/* ============================================================
   Apertool AI — Components: nav, buttons, cards, form, footer
   Glassmorphic, premium, minimal.
   ============================================================ */

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font: inherit; font-weight: 600; font-size: var(--fs-body);
  padding: 0.8em 1.5em; border-radius: var(--radius-pill);
  border: 1px solid transparent; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent-strong); color: #fff; box-shadow: var(--shadow-accent); }
.btn--primary:hover { transform: translateY(-2px); }
.btn--ghost { background: var(--glass); color: var(--ink-2); border-color: var(--border-2); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn--lg { padding: 0.95em 1.9em; }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

/* ---- Navigation (sticky, glassy) ---- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); min-height: 68px; }
.nav__brand { display: inline-flex; align-items: center; gap: var(--space-3); font-weight: 700; color: var(--ink-2); }
.nav__brand img { height: 30px; width: auto; }
.nav__links { display: flex; align-items: center; gap: var(--space-6); }
.nav__links a { color: var(--ink-2); font-weight: 500; font-size: var(--fs-small); }
.nav__links a:hover { color: var(--accent-ink); text-decoration: none; }
/* Keep the primary CTA button text white (override the nav link color). */
.nav__links a.btn--primary,
.nav__links a.btn--primary:hover { color: #fff; }
.nav__cta { margin-left: var(--space-2); }
@media (max-width: 720px) {
  .nav__links a:not(.btn) { display: none; }
}

/* ---- Cards / tiles (glass) ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.tile {
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.tile:hover { box-shadow: var(--shadow-md); border-color: var(--border-2); }
.tile__icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: var(--space-4);
  background: var(--accent-wash); color: var(--accent-ink);
}
.tile h3 { margin-bottom: var(--space-2); }
@media (prefers-reduced-motion: reduce) { .tile:hover { transform: none; } }

.grid { display: grid; gap: var(--space-5); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

/* ---- Form ---- */
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); box-shadow: var(--shadow-md); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 600px) { .form__row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.field label { font-weight: 600; font-size: var(--fs-small); color: var(--ink-2); }
.field .req { color: var(--accent-ink); }
.field input, .field textarea {
  font: inherit; color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 0.75em 0.9em;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus {
  outline: none; background: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--error); }
.field__error { font-size: var(--fs-small); color: var(--error); min-height: 1.1em; }
.form__status { margin-top: var(--space-3); font-size: var(--fs-small); }
.form__status[data-state="error"] { color: var(--error); }
.form__status[data-state="success"] { color: var(--success); }
.form__note { font-size: var(--fs-small); color: var(--muted); margin-top: var(--space-3); }

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); padding-block: var(--space-7); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-5); }
.footer__brand { display: inline-flex; align-items: center; gap: var(--space-3); font-weight: 600; color: var(--ink-2); }
.footer__brand img { height: 26px; width: auto; }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--space-5); font-size: var(--fs-small); }
.footer__links a { color: var(--muted); }
.footer__links a:hover { color: var(--accent-ink); }
.footer__legal { width: 100%; font-size: var(--fs-small); color: var(--muted); border-top: 1px solid var(--border); padding-top: var(--space-4); }

/* ============================================================
   Diagrams (responsive HTML + CSS; legible without JS or motion)
   ============================================================ */

/* Shared node pill */
.dnode {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--glass); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4); box-shadow: var(--shadow-sm);
  font-weight: 500; color: var(--ink-2); font-size: var(--fs-small);
}
.dnode__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }

/* ---- Knowledge Layer (sources → core → consumers) ---- */
.kl { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: var(--space-4); }
.kl__col { display: grid; gap: var(--space-3); }
.kl__flow { position: relative; height: 3px; min-width: 48px; border-radius: 2px; background: var(--border-2); overflow: hidden; }
.kl__core {
  display: grid; place-items: center; text-align: center;
  width: clamp(120px, 9vw, 168px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, var(--accent-wash), var(--surface) 70%);
  border: 1.5px solid var(--accent); box-shadow: var(--shadow-accent);
  padding: var(--space-4);
}
.kl__core .node-core { font-weight: 700; color: var(--accent-ink); font-size: var(--fs-small); line-height: 1.2; }
.kl__core small { display: block; color: var(--muted); font-size: 0.72rem; margin-top: 4px; }
.kl__wrap { display: contents; }

@media (max-width: 820px) {
  .kl { grid-template-columns: 1fr; justify-items: center; gap: var(--space-4); }
  .kl__col { width: 100%; max-width: 420px; }
  .kl__flow { width: 3px; height: 28px; min-width: 0; }
}

/* ---- Knowledge Layer: radial constellation ---- */
.kl-radial {
  position: relative; width: 100%; max-width: 1000px; margin-inline: auto;
  height: clamp(560px, 62vw, 660px);
}
.kl-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; overflow: visible; }
.kl-lines line { stroke: var(--accent); opacity: 0.32; stroke-width: 1.5; }

.kl-hub {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: clamp(124px, 14vw, 172px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--glass-strong); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border: 1.5px solid var(--accent); box-shadow: var(--shadow-accent);
}
.kl-hub img { width: 56%; height: auto; }
.kl-hub__glow {
  position: absolute; inset: -36%; border-radius: 50%; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, var(--accent-wash) 0%, rgba(47,143,135,0.18) 38%, transparent 70%);
}
.kl-hub__label {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; z-index: 1;
  font-size: var(--fs-small); font-weight: 600; letter-spacing: var(--tracking-tight); color: var(--accent-ink);
  background: var(--glass-strong); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 5px 15px; box-shadow: var(--shadow-sm);
}

.kl-src {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); z-index: 1;
  display: flex; align-items: center; gap: var(--space-3); width: max-content; max-width: 200px;
  background: var(--glass-strong); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4); box-shadow: var(--shadow-md);
  font-size: var(--fs-small); font-weight: 600; color: var(--ink-2); line-height: 1.2;
  transition: box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.kl-src:hover { box-shadow: var(--shadow-lg); border-color: var(--accent); }
.kl-src--key { border-color: var(--accent); background: linear-gradient(var(--glass-strong), var(--glass-strong)) padding-box, var(--accent-wash); }
.kl-src__icon {
  width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--accent-wash); color: var(--accent-ink);
}
.kl-src__icon svg { width: 19px; height: 19px; }

@media (max-width: 820px) {
  /* Reflow constellation into hub-on-top + 2-col card grid */
  .kl-radial { height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
  .kl-lines { display: none; }
  .kl-hub { position: static; transform: none; grid-column: 1 / -1; justify-self: center; margin-bottom: var(--space-8); }
  .kl-src { position: static; transform: none; max-width: none; width: auto; }
}
@media (max-width: 460px) {
  .kl-radial { grid-template-columns: 1fr; }
}

/* ============================================================
   Intelligence Engine — simple 4-step flow + side text
   ============================================================ */
.ie-simple { display: grid; grid-template-columns: 1fr 0.95fr; gap: var(--space-8); align-items: center; }
.ie-simple__text h2 { margin-bottom: var(--space-4); }

.ie-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-6); }
.ie-step {
  position: relative; display: flex; align-items: center; gap: var(--space-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5); box-shadow: var(--shadow-sm);
}
.ie-step__num {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  background: var(--accent-wash); color: var(--accent-ink); font-weight: 700;
  display: grid; place-items: center;
}
.ie-step__label { font-weight: 600; color: var(--ink-2); font-size: var(--fs-h3); }
.ie-step--last { border-color: var(--accent); background: var(--accent-wash); }
/* vertical connector + downward arrow between steps */
.ie-step:not(:last-child)::after {
  content: ""; position: absolute; left: calc(var(--space-5) + 19px); top: 100%;
  width: 2px; height: var(--space-6); background: linear-gradient(var(--accent), var(--accent-soft));
}
.ie-step:not(:last-child)::before {
  content: ""; position: absolute; left: calc(var(--space-5) + 19px); top: calc(100% + var(--space-6) - 6px);
  transform: translateX(-50%); z-index: 1;
  border-top: 7px solid var(--accent); border-left: 5px solid transparent; border-right: 5px solid transparent;
}

@media (max-width: 820px) {
  .ie-simple { grid-template-columns: 1fr; gap: var(--space-6); }
}

/* ============================================================
   Business Impact / ROI metrics
   ============================================================ */
.impact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.impact-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--space-6) var(--space-5); box-shadow: var(--shadow-sm); text-align: center;
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.impact-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.impact-card__dir {
  display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-small); font-weight: 600;
  color: var(--accent-ink); background: var(--accent-wash); border-radius: var(--radius-pill);
  padding: 3px 10px; margin-bottom: var(--space-3);
}
.impact-card__value {
  font-size: clamp(2.4rem, 1.7rem + 2.2vw, 3.2rem); font-weight: 700; line-height: 1;
  color: var(--accent-strong); letter-spacing: var(--tracking-tight);
}
.impact-card__value .u { font-size: 0.5em; font-weight: 600; color: var(--muted); }
.impact-card__label { font-weight: 600; color: var(--ink-2); margin-top: var(--space-3); }
.impact-card__sub { font-size: var(--fs-small); color: var(--muted); margin-top: var(--space-2); }
.impact-note { text-align: center; font-size: var(--fs-small); color: var(--muted); margin-top: var(--space-6); max-width: 70ch; margin-inline: auto; }
@media (prefers-reduced-motion: reduce) { .impact-card:hover { transform: none; } }
@media (max-width: 900px) { .impact-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .impact-grid { grid-template-columns: 1fr; } }

/* ---- Linear flow chains (Intelligence Engine) ---- */
.chain { display: flex; align-items: stretch; gap: var(--space-3); flex-wrap: wrap; justify-content: center; }
.chain__step {
  flex: 1 1 180px; min-width: 160px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-4); box-shadow: var(--shadow-sm);
}
.chain__step--core { border-color: var(--accent); box-shadow: var(--shadow-accent); background: radial-gradient(circle at 50% 0%, var(--accent-wash), var(--surface) 70%); }
.chain__step h3 { font-size: var(--fs-body); margin-bottom: var(--space-1); }
.chain__step p { font-size: var(--fs-small); }
.chain__arrow { display: flex; align-items: center; color: var(--accent); flex: 0 0 auto; font-size: 1.4rem; }
@media (max-width: 760px) {
  .chain { flex-direction: column; align-items: stretch; }
  .chain__arrow { justify-content: center; transform: rotate(90deg); }
}

/* ---- Vision trajectory (stepper) ---- */
.trajectory { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-4); list-style: none; margin: 0; padding: 0; }
.trajectory::before {
  content: ""; position: absolute; top: 14px; left: 8%; right: 8%; height: 2px;
  background: linear-gradient(90deg, var(--accent) 35%, var(--coral) 100%);
}
.tstep { position: relative; text-align: center; }
.tstep__dot {
  width: 30px; height: 30px; border-radius: 50%; margin: 0 auto var(--space-3);
  background: var(--surface); border: 2px solid var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 0.8rem; position: relative; z-index: 1;
}
.tstep h3 { font-size: var(--fs-small); margin-bottom: 2px; }
.tstep p { font-size: 0.8rem; }
.tstep--future .tstep__dot { border-style: dashed; color: var(--coral-ink); border-color: var(--coral); background: var(--coral-wash); }
@media (max-width: 760px) {
  .trajectory { grid-template-columns: 1fr; gap: var(--space-5); }
  .trajectory::before { top: 0; bottom: 0; left: 14px; right: auto; width: 2px; height: auto; background: linear-gradient(180deg, var(--accent) 35%, var(--coral) 100%); }
  .tstep { text-align: left; display: grid; grid-template-columns: 30px 1fr; gap: var(--space-4); align-items: start; }
  .tstep__dot { margin: 0; }
}

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 2rem + 8vw, 7rem); }
.hero__inner { position: relative; z-index: 1; max-width: 880px; }
.hero h1 { font-size: var(--fs-display); line-height: var(--lh-tight); color: var(--ink-2); margin-bottom: var(--space-5); }
.hero .lead { max-width: 60ch; margin-bottom: var(--space-6); }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.hero__meta { margin-top: var(--space-6); font-size: var(--fs-small); color: var(--muted); }

/* ---- Video hero (dark treatment, white text for legibility) ---- */
.hero--video {
  min-height: min(82vh, 760px);
  display: flex; align-items: center;
  /* poster as fallback before/without video */
  background: #0a1417 center/cover no-repeat;
  background-image: url("../media/hero-poster.jpg");
}
.hero__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; pointer-events: none;
}
.hero__scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, rgba(8,16,20,0.88) 0%, rgba(8,16,20,0.62) 44%, rgba(8,16,20,0.22) 100%),
    linear-gradient(0deg, rgba(8,16,20,0.55) 0%, rgba(8,16,20,0) 42%);
}
.hero--video .hero__inner { z-index: 2; }
.hero--video h1 { color: #fff; }
.hero--video .lead { color: rgba(255,255,255,0.86); }
.hero--video .eyebrow { color: var(--accent-soft); }
.hero--video .hero__meta { color: rgba(255,255,255,0.72); }
.hero--video .gradient-text {
  background: none;
  -webkit-text-fill-color: #fff;
  color: #fff;
}
.hero--video .btn--ghost {
  background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.55); color: #fff;
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
}
.hero--video .btn--ghost:hover { border-color: #fff; color: #fff; }

/* ---- Industries grid ---- */
.industries-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.ind-card {
  position: relative; border-radius: var(--radius-md);
  background: var(--surface);           /* white mat — lighter than the wash section behind it */
  padding: 7px;                          /* the frame that shows around the image */
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.ind-card img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 9px; }
/* gradient overlay confined to the image (inset by the mat padding) */
.ind-card::after {
  content: ""; position: absolute; inset: 7px; z-index: 1; border-radius: 9px; pointer-events: none;
  background: linear-gradient(0deg, rgba(8,16,20,0.82) 0%, rgba(8,16,20,0.30) 42%, rgba(8,16,20,0) 68%);
}
.ind-card__label {
  position: absolute; left: var(--space-5); right: var(--space-5); bottom: var(--space-5); z-index: 2;
  color: #fff; font-weight: 600; font-size: var(--fs-body); line-height: 1.25; letter-spacing: var(--tracking-tight);
}
.ind-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) {
  .ind-card:hover { transform: none; }
}
@media (max-width: 900px) { .industries-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .industries-grid { grid-template-columns: 1fr; } }

/* ---- Generic page (gdpr/legal/thank-you) prose ---- */
.prose { max-width: var(--maxw-narrow); margin-inline: auto; }
.prose h2 { margin-top: var(--space-7); margin-bottom: var(--space-3); }
.prose h3 { margin-top: var(--space-5); margin-bottom: var(--space-2); }
.prose p, .prose li { color: var(--muted); }
.prose ul { margin-left: var(--space-5); margin-bottom: var(--space-4); }
.prose li { margin-bottom: var(--space-2); }
.prose p { margin-bottom: var(--space-4); }
