/* =====================================================================
   A4AI home sections. Loads after /sub/_assets/site.css.
   2026-11 design refresh: dark film hero, four capabilities, two tracks,
   physical AI lab, IR deck viewer, contact band.
   Motion rule: opacity only. Nothing slides, shakes or pins.
   ===================================================================== */

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-rows: 1fr auto;
  min-height: clamp(620px, 100svh, 960px);
  background: var(--night); color: #fff;
}
.has-hero .hero { margin-top: calc(var(--header-h) * -1); padding-top: var(--header-h); }
.hero:focus { outline: none; }
/* The film carries letterbox bands and burned-in subtitles. Show only its middle 70 %. */
.hero__video {
  position: absolute; left: 50%; top: 50%; z-index: -2;
  width: 100%; height: 142.857143%; transform: translate(-50%, -50%);
  object-fit: cover; object-position: 58% 50%;
  opacity: .9;
}
.hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(8,17,29,.92) 0%, rgba(8,17,29,.74) 38%, rgba(8,17,29,.28) 72%, rgba(8,17,29,.18) 100%),
    linear-gradient(180deg, rgba(8,17,29,.55) 0%, rgba(8,17,29,0) 26%, rgba(8,17,29,0) 62%, rgba(8,17,29,.86) 100%);
}
.hero__inner { align-self: center; padding-block: clamp(56px, 9vh, 120px) clamp(40px, 6vh, 72px); }
.hero__eyebrow { margin: 0 0 22px; font-size: 15px; font-weight: 650; letter-spacing: .01em; color: #9ccaf2; }
.hero__title { margin: 0; color: #fff; text-wrap: balance; }
.hero__title-top {
  display: block; margin-bottom: 8px;
  font-size: clamp(24px, 3.1vw, 42px); font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; color: #e2eaf3;
}
.hero__title-main {
  display: block;
  font-size: clamp(54px, 9vw, 128px); font-weight: 800; line-height: 1.02; letter-spacing: -0.05em;
}
.hero__lead {
  margin: 28px 0 0; max-width: 31em;
  font-size: clamp(17px, 1.45vw, 20px); line-height: 1.75; color: #cbd6e2;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.hero__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding-block: 20px 28px; border-top: 1px solid rgba(255,255,255,.16);
  font-size: 14.5px; color: #b9c5d2;
}
.hero__tracks { margin: 0; font-weight: 600; color: #dfe7f0; }
.hero__foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.hero__more { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: #dfe7f0; text-decoration: none; }
.hero__more:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.hero__more svg { width: 16px; height: 16px; }
.hero__video-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px 0 12px;
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.28); border-radius: 999px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.hero__video-btn:hover { background: rgba(255,255,255,.16); }
.hero__video-btn:disabled { opacity: .6; cursor: default; }
.hero__video-btn svg { width: 18px; height: 18px; }
.hero__video-btn .icon-pause { display: none; }
.hero__video-btn.is-playing .icon-play { display: none; }
.hero__video-btn.is-playing .icon-pause { display: block; }

/* ---------- four capabilities ---------- */
.caps__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 1.8vw, 24px);
  counter-reset: cap;
}
.cap { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cap__media { position: relative; margin: 0; aspect-ratio: 16 / 9; background: var(--mist); overflow: hidden; }
.cap__media video, .cap__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Terrain card: one chip names the part of the loop on screen (climb, then descent shock absorption). */
.cap__phase { position: absolute; left: 12px; top: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(8, 18, 30, .74); color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.3; letter-spacing: .01em; transition: opacity .22s ease; pointer-events: none; }
.cap__phase--b, .cap__media[data-phase="b"] .cap__phase--a { opacity: 0; }
.cap__media[data-phase="b"] .cap__phase--b { opacity: 1; }
/* Split view card: second chip names the right half. */
.cap__phase--end { left: auto; right: 12px; }
@media (prefers-reduced-motion: reduce) { .cap__phase { transition: none; } }
/* Voice card: the two IR waveform loops on white, labels sit above each line. */
.cap__media--voice { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; padding: 10px 14px 8px; background: #fff; border-bottom: 1px solid var(--line); }
.cap__wave { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); margin: 0; min-height: 0; }
.cap__wave video { object-fit: contain; }
.cap__wave figcaption { font-size: 12px; font-weight: 700; line-height: 1.4; letter-spacing: .01em; color: var(--muted); }
.cap__wave--clean figcaption { color: var(--blue-ink); }
.cap__body { display: flex; flex-direction: column; flex: 1; padding: 24px 24px 26px; }
.cap__verb { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; font-size: clamp(26px, 2.3vw, 32px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; color: var(--blue-ink); }
.cap__no { font-size: 14px; font-weight: 700; letter-spacing: .02em; color: var(--muted); font-variant-numeric: tabular-nums; }
.cap h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.45; }
.cap__body > p:not(.cap__verb):not(.cap__fig) { margin: 0; font-size: 15.5px; line-height: 1.75; color: var(--text); }
.cap__fig { margin-top: auto !important; padding-top: 20px; }
.cap__fig strong { display: block; margin-top: 18px; font-size: clamp(28px, 2.4vw, 34px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.cap__fig span { display: block; min-height: 3.1em; margin-top: 4px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.reveal-ready .caps__list > .cap:nth-child(2) { transition-delay: 70ms; }
.reveal-ready .caps__list > .cap:nth-child(3) { transition-delay: 140ms; }
.reveal-ready .caps__list > .cap:nth-child(4) { transition-delay: 210ms; }
.caps__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin-top: 24px; }
.caps__note { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--muted); }
.caps__motion[hidden] { display: none; }
.caps__motion {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px;
  border: 0; background: none; font: inherit; font-size: 14px; font-weight: 650; color: var(--muted); cursor: pointer;
}
.caps__motion:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.caps__motion:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 2px; }
.caps__motion-icon { position: relative; width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.caps__motion.is-paused .caps__motion-icon { width: 0; height: 0; border: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }

/* ---------- two tracks: shorter photo band on the home page ---------- */
#services .track-media { aspect-ratio: 5 / 2; }

/* ---------- attach: one UGV, equipment on top, in front and behind (catalog p7) ----------
   One stage plays the attaching clip once and holds the attached frame. Swatch colours follow the render:
   top modules sand, front implements pink, rear trailers green. */
.attach { background: #fff; }
.attach__layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.attach__stage { margin: 0; min-width: 0; }
.attach__screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #e9e6e2; }
.attach__video { display: block; width: 100%; height: 100%; object-fit: cover; }
.attach__chip { position: absolute; left: 14px; top: 14px; padding: 4px 11px; border-radius: 999px; background: rgba(15,27,43,.78); color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.4; }
.attach__caption { display: flex; align-items: baseline; gap: 12px; margin-top: 14px; }
.attach__caption strong { font-size: clamp(20px, 1.8vw, 24px); font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.attach__group { font-size: 14px; font-weight: 700; color: var(--muted); }
.attach__picker { display: grid; gap: 22px; min-width: 0; }
.attach__set { --swatch: #e7cf9f; }
.attach__set--front { --swatch: #f2b3c2; }
.attach__set--rear { --swatch: #b6dfbd; }
.attach__label { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; font-weight: 750; color: var(--ink); }
.attach__swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(15,27,43,.18); }
.attach__items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.attach__items button {
  min-height: 44px; padding: 8px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  font: inherit; font-size: 15px; font-weight: 650; line-height: 1.35; color: var(--text); cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
@media (hover: hover) and (pointer: fine) {
  .attach__items button:hover { border-color: var(--line-strong); background: var(--mist); }
}
.attach__items button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.attach__items button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.attach__auto { justify-self: start; }
.attach__note { margin: 22px 0 0; font-size: 14px; line-height: 1.7; color: var(--muted); }
@media (max-width: 1000px) {
  .attach__layout { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .attach__items button { transition: none; }
}

/* ---------- physical AI lab ---------- */
.lab { position: relative; overflow: hidden; }
.lab__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.lab__copy .sec-lead { margin-top: 18px; }
.lab__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 32px 0 0; border-top: 1px solid rgba(255,255,255,.16); }
.lab__facts div { padding: 18px 0 4px; }
.lab__facts div + div { padding-left: 20px; border-left: 1px solid rgba(255,255,255,.16); }
.lab__facts dt { font-size: 13.5px; color: var(--on-dark-muted); }
.lab__facts dd { margin: 4px 0 0; font-size: clamp(26px, 2.4vw, 34px); font-weight: 800; letter-spacing: -0.03em; color: #fff; font-variant-numeric: tabular-nums; }
.lab__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.lab__photos { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 0; }
.lab__photo { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius); background: var(--night-2); }
.lab__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lab__photo--wide { grid-column: span 6; aspect-ratio: 2 / 1; }
.lab__photo--third { grid-column: span 2; aspect-ratio: 4 / 3; }
.lab__photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px;
  background: linear-gradient(180deg, rgba(10,21,34,0), rgba(10,21,34,.78));
  font-size: 13px; line-height: 1.45; color: #e6edf4;
}

/* ---------- IR deck viewer ---------- */
.ir-viewer { max-width: 920px; margin: 0 auto; }
.ir-stage {
  position: relative; margin: 0; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--night); border-radius: var(--radius);
  box-shadow: 0 30px 60px -36px rgba(10,21,34,.55);
}
.ir-stage img { display: block; width: 100%; height: 100%; object-fit: contain; transition: opacity .14s ease; }
.ir-stage.changing img { opacity: .25; }
.ir-badge {
  position: absolute; right: 12px; top: 12px; padding: 4px 10px; border-radius: 999px;
  background: rgba(10,21,34,.72); color: #fff; font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.ir-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  margin-top: 18px;
}
.ir-pager { display: flex; align-items: center; gap: 6px; }
.ir-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; min-height: 44px; padding: 0 14px;
  background: #fff; color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius);
  font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.ir-btn:hover:not(:disabled) { border-color: var(--ink); }
.ir-btn:disabled { color: var(--faint); border-color: var(--line); cursor: default; }
.ir-btn svg { width: 18px; height: 18px; flex: none; }
.ir-btn--icon { padding: 0; width: 44px; }
.ir-count { min-width: 76px; text-align: center; font-size: 15px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.ir-count .num { color: var(--ink); }
.ir-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.ir-hint { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }
kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; margin: 0 1px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px;
  background: #fff; font: inherit; font-size: 12px; font-weight: 650; line-height: 1.5; text-align: center; color: var(--ink);
}
.ir-fs-open, .ir-fs-open body { overflow: hidden; }
.ir-fs-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; grid-template-rows: 64px minmax(0, 1fr) 56px;
  align-items: center; justify-items: center;
  background: rgba(6,12,20,.96); color: #fff;
}
.ir-fs-overlay img { grid-column: 2; grid-row: 2; max-width: 100%; max-height: 100%; object-fit: contain; }
.ir-fs-close {
  grid-column: 3; grid-row: 1; min-height: 44px; padding: 0 14px;
  background: none; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: var(--radius);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; justify-self: end; margin-right: 16px;
}
.ir-fs-nav {
  width: 48px; height: 48px; display: grid; place-items: center;
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; cursor: pointer;
}
.ir-fs-nav svg { width: 22px; height: 22px; }
.ir-fs-prev { grid-column: 1; grid-row: 2; }
.ir-fs-next { grid-column: 3; grid-row: 2; }
.ir-fs-nav:disabled { opacity: .35; cursor: default; }
.ir-fs-info { grid-column: 2; grid-row: 3; margin: 0; font-size: 14px; color: #c7d2de; font-variant-numeric: tabular-nums; }

/* ---------- contact band ---------- */
.contact { position: relative; overflow: hidden; background: var(--blue); color: #fff; }

.contact__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; padding-block: clamp(56px, 7vw, 88px); }
.contact h2 { margin: 0; color: #fff; font-size: clamp(28px, 3.2vw, 42px); letter-spacing: -0.03em; }
.contact p { margin: 10px 0 0; color: #d6e6f5; font-size: 17px; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- notice popup (footer button) ---------- */
.a4ai-popup-overlay {
  position: fixed; inset: 0; z-index: 210;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; padding: 20px;
  background: rgba(6,12,20,.6); opacity: 0; transition: opacity .2s ease; overflow-y: auto;
}
.a4ai-popup-overlay.active { opacity: 1; }
.a4ai-popup-card {
  position: relative; width: min(420px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: #fff; color: var(--text); border-radius: 6px; box-shadow: 0 30px 70px -30px rgba(0,0,0,.6);
}
.a4ai-popup-media { display: block; width: 100%; height: auto; }
.a4ai-popup-text { padding: 26px 26px 8px; }
.a4ai-popup-text h3 { margin: 0 0 10px; font-size: 20px; }
.a4ai-popup-text p { margin: 0 0 10px; font-size: 15.5px; line-height: 1.75; white-space: pre-line; }
.a4ai-popup-text a { color: var(--blue-ink); font-weight: 650; }
.a4ai-popup-close {
  position: absolute; right: 8px; top: 8px; z-index: 1; width: 40px; height: 40px;
  background: rgba(255,255,255,.92); color: var(--ink); border: 0; border-radius: 50%; font-size: 24px; line-height: 1; cursor: pointer;
}
.a4ai-popup-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 16px 26px; border-top: 1px solid var(--line); }
.a4ai-popup-hide { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.a4ai-popup-dismiss {
  min-height: 40px; padding: 0 16px; background: var(--ink); color: #fff; border: 0; border-radius: var(--radius);
  font: inherit; font-size: 14px; font-weight: 650; cursor: pointer;
}

/* ---------- responsive ---------- */
/* Controls that need home.js stay hidden without it. The PDF link still works. */
html:not(.js) :is(#heroVideoToggle, .ir-pager, .ir-tools .ir-btn, .ir-hint, [data-footer-notice]) { display: none; }

@media (max-width: 1100px) {
  .caps__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .lab__grid { grid-template-columns: 1fr; }
  .lab__photos { max-width: 720px; }
}
@media (max-width: 768px) {
  .hero { min-height: clamp(560px, 92svh, 760px); }
  .hero__shade {
    background:
      linear-gradient(180deg, rgba(8,17,29,.6) 0%, rgba(8,17,29,.42) 30%, rgba(8,17,29,.78) 70%, rgba(8,17,29,.94) 100%);
  }
  .hero__video { object-position: 62% 50%; }
  .hero__inner { align-self: end; }
  .hero__actions .btn { flex: 1 1 150px; }
  .hero__foot { font-size: 14px; }
  .caps__list { grid-template-columns: 1fr; }
  .lab__photo--third { grid-column: span 3; }
  .lab__photo--third:last-child { grid-column: span 6; aspect-ratio: 2 / 1; }
  #services .track-media { aspect-ratio: 2 / 1; }
  .ir-bar { justify-content: center; }
  .ir-tools { justify-content: center; }
  .ir-hint { text-align: center; }
  /* Small screens: the page uses the full width; arrows and page number sit below it. */
  .ir-fs-overlay { grid-template-columns: 56px minmax(0, 1fr) 56px; grid-template-rows: 64px minmax(0, 1fr) 72px; }
  .ir-fs-overlay img { grid-column: 1 / -1; grid-row: 2; }
  .ir-fs-prev, .ir-fs-next { grid-row: 3; }
  .ir-fs-nav { width: 44px; height: 44px; }
  .ir-fs-close { margin-right: 8px; }
}
@media (max-width: 420px) {
  .ir-tools .ir-btn { flex: 1 1 calc(50% - 8px); }
  .lab__facts dd { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .ir-stage img, .a4ai-popup-overlay { transition: none; }
}
.contact .btn--outline-light { background-color: var(--blue); }
.contact .btn--outline-light:hover { background-color: #0b5c9e; }
