/* Cinematic layer: page transitions, signal-field hero, static marquee, pinned story, footer. */

/* ---------- Page transitions (cross-document View Transitions, Chromium/Safari) ---------- */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: vt-out 320ms cubic-bezier(.4, 0, .2, 1) both; }
::view-transition-new(root) { animation: vt-in 560ms cubic-bezier(.2, .72, .15, 1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-14px); filter: blur(3px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }

.motion-preference[hidden] { display: none; }
.motion-preference { padding: .2rem 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.motion-preference:hover { color: var(--accent-light); }

/* ---------- Hero character split ---------- */
.hero-wordmark { overflow: hidden; padding-bottom: .1em; }
.hc { display: inline-block; will-change: transform; }

/* ---------- Footer wordmark fills on scroll ---------- */
.site-footer .footer-wordmark { --fill: 100%; letter-spacing: -.055em; padding-bottom: .08em; color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(90deg, var(--accent-light) var(--fill), rgba(239, 239, 226, .13) var(--fill)); }

/* ---------- Home: header over dark hero ---------- */
.is-home .site-header { background: rgba(18, 20, 16, .88); color: var(--paper); border-bottom-color: rgba(239, 239, 226, .13); }
.is-home .brand-mark { border-right-color: rgba(239, 239, 226, .4); }
.is-home .header-contact { border-bottom-color: var(--paper); }
.is-home .menu-toggle span { background: var(--paper); }
.is-home .desktop-nav a:hover, .is-home .header-contact:hover { color: var(--accent-light); }
.is-home .mobile-nav { color: var(--paper); }

/* ---------- Hero: signal field ---------- */
.parent-hero .hero-field { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s ease .2s; }
.parent-hero .hero-field.is-live { opacity: 1; }
.parent-hero::after { z-index: -1; }
.hero-hud { position: absolute; z-index: 1; right: var(--gutter); top: 7.2rem; display: grid; gap: .25rem; text-align: right; font: var(--text-meta)/1.5 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: rgba(239, 239, 226, .5); }
.hero-hud b { font-weight: 400; color: var(--accent-light); }
.parent-hero .hero-wordmark { font-size: clamp(3.6rem, 17.6vw, 17rem); letter-spacing: -.065em; margin-left: -.05em; }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; background: var(--accent); color: #fff; border-block: 1px solid rgba(0, 0, 0, .25); }
.marquee__track { display: flex; width: max-content; align-items: center; gap: 2.2rem; padding-block: 1.1rem; padding-right: 2.2rem; will-change: transform; }
.marquee__track span { font-weight: 700; font-size: clamp(1.2rem, 2.4vw, 2.2rem); letter-spacing: -.04em; white-space: nowrap; }
.marquee__track i { width: .55rem; height: .55rem; border: 1px solid #fff; transform: rotate(45deg); flex: none; }

/* ---------- Dither ---------- */
.dither-canvas { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
.reality-break > img { filter: none; }

/* ---------- Unit cards: hover as designed interaction ---------- */
.parent-unit { position: relative; top: 0; transition: background-color 500ms var(--ease), top 380ms var(--ease); }
.parent-unit::before { content: ""; position: absolute; inset: -2px 0 auto; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 550ms var(--ease); pointer-events: none; }
.parent-unit:hover, .parent-unit:focus-within { background-color: rgba(255, 255, 255, .27); top: -9px; }
.parent-unit:hover::before, .parent-unit:focus-within::before { transform: scaleX(1); }
.parent-unit h3 { transition: color 360ms var(--ease), translate 500ms var(--ease); }
.parent-unit:hover h3, .parent-unit:focus-within h3 { color: var(--accent); translate: 10px 0; }
.parent-unit .text-link span { transition: transform 400ms var(--ease); display: inline-block; }
.parent-unit:hover .text-link span { transform: translate(6px, -6px); }
.unit-surface--research .unit-surface__mark { transition: transform 900ms var(--ease), letter-spacing 900ms var(--ease); }
.parent-unit:hover .unit-surface__mark { transform: scale(1.06); letter-spacing: -.05em; }
.research-row, .journal-row { position: relative; top: 0; transition: padding-inline 400ms var(--ease), background 400ms var(--ease), top 380ms var(--ease); }
.research-row:hover, .research-row:focus-visible,
.journal-row:hover, .journal-row:focus-visible { top: -6px; }
.product-feature, .industry-feature, .related-grid a { position: relative; top: 0; transition: top 380ms var(--ease); }
.product-feature:hover, .product-feature:focus-within,
.industry-feature:hover, .industry-feature:focus-within,
.related-grid a:hover, .related-grid a:focus-visible { top: -9px; }
.unit-surface, .product-media-frame { transition: transform 800ms var(--ease); }
.parent-unit:hover .unit-surface, .parent-unit:focus-within .unit-surface,
.product-feature:hover .product-media-frame, .product-feature:focus-within .product-media-frame { transform: scale(1.045); }

/* ---------- Hover and focus motion ---------- */
.text-link span[aria-hidden="true"],
.header-contact span[aria-hidden="true"],
.industry-action span,
.journal-read span,
.row-arrow {
  display: inline-block;
  transition: transform 320ms var(--ease), color 220ms var(--ease);
}
.text-link:hover span[aria-hidden="true"],
.text-link:focus-visible span[aria-hidden="true"],
.header-contact:hover span[aria-hidden="true"],
.header-contact:focus-visible span[aria-hidden="true"],
.industry-feature:hover .industry-action span,
.industry-feature:focus-within .industry-action span,
.research-row:hover .row-arrow,
.research-row:focus-visible .row-arrow,
.journal-row:hover .journal-read span,
.journal-row:focus-visible .journal-read span { transform: translate(5px, -3px); }
.button-light { transition: transform 260ms var(--ease), background 220ms var(--ease), color 220ms var(--ease), box-shadow 260ms var(--ease); }
.button-light:hover, .button-light:focus-visible { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(21, 23, 19, .16); }
.systems-menu__trigger > span { display: inline-block; transition: transform 260ms var(--ease); }
.systems-menu__trigger[aria-expanded="true"] > span { transform: rotate(180deg) translateY(-1px); }
.mobile-nav-system-toggle__icon { display: inline-block; transition: transform 260ms var(--ease); }
.mobile-nav-system-toggle[aria-expanded="true"] .mobile-nav-system-toggle__icon { transform: rotate(45deg); }
.product-feature:hover .product-feature__status,
.product-feature:focus-within .product-feature__status { color: var(--accent); }
.principle-grid > div, .capability-list > div, .contact-options > div { position: relative; top: 0; transition: border-color 300ms var(--ease), padding-inline 300ms var(--ease), top 380ms var(--ease); }
.principle-grid > div:hover, .principle-grid > div:focus-within,
.capability-list > div:hover, .capability-list > div:focus-within,
.contact-options > div:hover, .contact-options > div:focus-within { border-color: var(--accent); padding-inline: .45rem; top: -7px; }

/* ---------- Organization menu popup ---------- */
.systems-panel-enter-active, .systems-panel-leave-active {
  transition: opacity 340ms var(--ease), translate 420ms var(--ease), scale 420ms var(--ease), clip-path 420ms var(--ease);
  transform-origin: top center;
}
.systems-panel-enter-from, .systems-panel-leave-to { opacity: 0; translate: 0 -20px; scale: .94; clip-path: inset(0 0 100% 0); }
.systems-panel-enter-to, .systems-panel-leave-from { opacity: 1; translate: 0 0; scale: 1; clip-path: inset(0); }
.systems-menu__panel.is-open .systems-menu__group,
.systems-menu__panel.is-open .systems-menu__all { animation: popup-content-in 420ms var(--ease) both; }
.systems-menu__panel.is-open .systems-menu__group:nth-child(2) { animation-delay: 55ms; }
.systems-menu__panel.is-open .systems-menu__all { animation-delay: 110ms; }

/* ---------- Mobile navigation and nested popup ---------- */
.mobile-nav-enter-active, .mobile-nav-leave-active {
  transition: opacity 320ms var(--ease), translate 420ms var(--ease), clip-path 420ms var(--ease);
  transform-origin: top center;
}
.mobile-nav-enter-from, .mobile-nav-leave-to { opacity: .4; translate: 0 -18px; clip-path: inset(0 0 100% 0); }
.mobile-nav-enter-to, .mobile-nav-leave-from { opacity: 1; translate: 0 0; clip-path: inset(0); }
.mobile-nav.is-open .mobile-nav-top,
.mobile-nav.is-open .mobile-nav-links > *,
.mobile-nav.is-open .mobile-nav-foot { animation: popup-content-in 420ms var(--ease) both; }
.mobile-nav.is-open .mobile-nav-links > :nth-child(2) { animation-delay: 35ms; }
.mobile-nav.is-open .mobile-nav-links > :nth-child(3) { animation-delay: 70ms; }
.mobile-nav.is-open .mobile-nav-links > :nth-child(4) { animation-delay: 105ms; }
.mobile-nav.is-open .mobile-nav-links > :nth-child(5) { animation-delay: 140ms; }
.mobile-nav.is-open .mobile-nav-links > :nth-child(6) { animation-delay: 175ms; }
.mobile-nav.is-open .mobile-nav-links > :nth-child(7) { animation-delay: 210ms; }
.mobile-nav.is-open .mobile-nav-foot { animation-delay: 230ms; }
.mobile-submenu-enter-active, .mobile-submenu-leave-active { transition: opacity 280ms var(--ease), translate 330ms var(--ease), clip-path 330ms var(--ease); }
.mobile-submenu-enter-from, .mobile-submenu-leave-to { opacity: 0; translate: 0 -12px; clip-path: inset(0 0 100% 0); }
.mobile-submenu-enter-to, .mobile-submenu-leave-from { opacity: 1; translate: 0 0; clip-path: inset(0); }
.mobile-nav-system-links.is-expanded a { animation: popup-content-in 320ms var(--ease) both; }
.mobile-nav-system-links.is-expanded a:nth-child(2) { animation-delay: 35ms; }
.mobile-nav-system-links.is-expanded a:nth-child(3) { animation-delay: 70ms; }
.mobile-nav-system-links.is-expanded a:nth-child(4) { animation-delay: 105ms; }
.mobile-nav-system-links.is-expanded a:nth-child(5) { animation-delay: 140ms; }
@keyframes popup-content-in { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }

/* ---------- Sticky trajectory story: picture stays, copy scrolls past ---------- */
.story-rail { display: none; }
.parent-trajectory:not(.is-sticky) .trajectory-media { display: none; }
.parent-trajectory:not(.is-sticky) .parent-trajectory__layout { grid-template-columns: 1fr; }
.parent-trajectory:not(.is-sticky) .trajectory-stage__media { display: block; margin-top: 1.5rem; overflow: hidden; }
.trajectory-stage__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.trajectory-stage__media figcaption { margin-top: .6rem; font: var(--text-meta)/1.4 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--paper-3); }

.parent-trajectory.is-sticky .parent-trajectory__layout { position: relative; align-items: start; padding-left: 3.5rem; }
.is-sticky .story-rail { position: absolute; left: 0; top: 0; bottom: 0; display: block; width: 2.4rem; font: var(--text-meta)/1.3 var(--font-mono); color: var(--accent-light); }
.is-sticky .story-rail > span { position: sticky; top: 6.5rem; display: block; writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .08em; }
.story-rail__track { position: absolute; left: .35rem; top: 7.5rem; bottom: 0; width: 1px; background: var(--line-dark); }
.story-rail__track i { position: absolute; inset: 0; background: var(--accent-light); transform: scaleY(0); transform-origin: top; }
.is-sticky .trajectory-media { position: sticky; top: 6.5rem; }
.is-sticky .trajectory-media__stack { aspect-ratio: auto; height: min(74svh, 48rem); background: #0f110e; }
.is-sticky .trajectory-media__stack img { opacity: 1; transition: none; clip-path: inset(100% 0 0 0); transform: scale(1.22); z-index: 1; }
.is-sticky .trajectory-media__stack img.is-below { clip-path: inset(0); transform: scale(1.04); z-index: 2; transition: transform 1.6s var(--ease); }
.is-sticky .trajectory-media__stack img.is-active { clip-path: inset(0); transform: scale(1); z-index: 3; transition: clip-path 1.15s var(--ease), transform 1.8s var(--ease); }
.is-sticky .parent-trajectory__stages { border-top: 0; }
.is-sticky .trajectory-stage { min-height: 92svh; display: grid; align-content: center; opacity: .22; transform: translateX(26px); filter: blur(2px); transition: opacity 600ms var(--ease), transform 800ms var(--ease), filter 600ms var(--ease); }
.is-sticky .trajectory-stage.is-active { opacity: 1; transform: none; filter: none; }
.is-sticky .trajectory-stage__media { display: none; }
.is-sticky .trajectory-stage > span { color: var(--accent-light); }

@media (max-width: 700px) {
  .parent-hero .hero-wordmark { font-size: 14vw; letter-spacing: -.06em; margin-left: -.04em; }
  .hero-hud { display: none; }
}
@media all {
  html.motion-off .parent-hero .hero-field { display: none; }
  html.motion-off::view-transition-old(root), html.motion-off::view-transition-new(root) { animation: none; }
}

/* Product screenshots are shown whole, never cropped. */
.is-sticky .trajectory-media__stack img[data-capability-visual="software"] { object-fit: contain; object-position: center; background: #f0f4f1; height: auto; aspect-ratio: 1440 / 1000; inset: 50% 0 auto 0; margin-top: calc(-0.5 * 100% * 1000 / 1440 / 1); }
.trajectory-stage[data-capability-step="software"] .trajectory-stage__media img { object-fit: contain; aspect-ratio: 1440 / 1000; background: #f0f4f1; }
.is-sticky .trajectory-media__stack { background: #0f110e radial-gradient(rgba(239,239,226,.1) 1px, transparent 1.2px) 0 0 / 14px 14px; }
