/* ---------- Tokens ---------- */
@property --bg { syntax: "<color>"; inherits: true; initial-value: #0E1B2E; }
@property --fg { syntax: "<color>"; inherits: true; initial-value: #EEF3FB; }
@property --fg-muted { syntax: "<color>"; inherits: true; initial-value: #9FB1CB; }
@property --line { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,.1); }

:root {
  /* Frontier platform palette: same values as the client portal (app/globals.css) and the portal demo */
  --navy-900: #0E1B2E;
  --navy-800: #14243D;
  --navy-700: #1B2E4F;
  --navy-600: #243C66;
  --primary-800: #2A4166;
  --primary-700: #48638F;
  --primary-600: #6C89B7;
  --primary-500: #97B4E0;
  --primary-400: #C2DAFF;
  --primary-200: #E6F0FF;
  /* Page roles mapped onto the palette */
  --night: var(--navy-900);
  --navy: var(--navy-800);
  --signal: var(--primary-700);
  --signal-ink: var(--primary-800);
  --signal-soft: var(--primary-400);
  --dawn: #F3B97E;
  --mist: #EDF1F6;
  --paper: #F6F8FB;
  --ink: var(--navy-800);
  --slate: #56657A;
  --ok: #1F9D6B;
  --watch: #C98A2E;
  --focus: #2A4166; /* focus ring on light surfaces; dark surfaces override below */

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1200px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --scene-dur: .9s;

  --bg: var(--night);
  --fg: #EEF3FB;
  --fg-muted: #9FB1CB;
  --line: rgba(255,255,255,.1);
  transition: --bg var(--scene-dur) var(--ease-io), --fg var(--scene-dur) var(--ease-io),
              --fg-muted var(--scene-dur) var(--ease-io), --line var(--scene-dur) var(--ease-io);
}
html[data-scene="light"] { --bg: var(--paper); --fg: var(--ink); --fg-muted: var(--slate); --line: rgba(20,36,61,.1); }
html[data-scene="mist"]  { --bg: var(--mist);  --fg: var(--ink); --fg-muted: var(--slate); --line: rgba(20,36,61,.12); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "tnum";
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.05; font-weight: 400; letter-spacing: -.03em; max-width: 18ch; text-wrap: balance; }
h3 { font-size: 19px; line-height: 1.3; font-weight: 500; letter-spacing: -.01em; }
.lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--fg-muted); max-width: 52ch; margin-top: 20px; }
.wrap { width: 100%; max-width: calc(var(--maxw) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
section { position: relative; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
/* Dark and blue surfaces get a light ring so focus stays visible (3:1 or better) */
.hero, .statement, .industries, .engine, .close, .footer, .prod-feature,
html[data-scene="dark"] .nav, html[data-scene="blue"] .nav, html[data-scene="dark"] .mobile-menu, html[data-scene="blue"] .mobile-menu { --focus: #C2DAFF; }
.frame { --focus: #2A4166; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 500 16px/1 var(--font); letter-spacing: -.005em; cursor: pointer; border: 1px solid transparent;
  transition: transform .25s var(--ease-out), background-color .25s, color .25s, border-color .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); transition-duration: .08s; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 15px; }
.btn-primary { background: var(--signal); color: #fff; }
.btn-primary:hover { background: var(--signal-ink); box-shadow: 0 8px 24px -10px rgba(108,137,183,.7); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { box-shadow: 0 10px 30px -12px rgba(151,180,224,.6); }
.btn-ghost { color: var(--fg); border-color: var(--line); background: transparent; }
.btn-ghost:hover { border-color: currentColor; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Nav ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; transition: background-color .4s, backdrop-filter .4s, border-color .4s; border-bottom: 1px solid transparent; }
.nav.is-scrolled { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 32px; height: 68px; }
.nav-logo { position: relative; width: 150px; height: 28px; flex: none; }
.nav-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: left center; transition: opacity var(--scene-dur) var(--ease-io); }
.logo-on-light { opacity: 0; }
html[data-scene="light"] .logo-on-light, html[data-scene="mist"] .logo-on-light { opacity: 1; }
html[data-scene="light"] .logo-on-dark, html[data-scene="mist"] .logo-on-dark { opacity: 0; }
.nav-links { display: flex; gap: 28px; font-size: 15px; color: var(--fg-muted); }
.nav-links a, .link-quiet { position: relative; transition: color .2s; }
.nav-links a::after, .link-quiet::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; opacity: 0; transition: transform .3s var(--ease-out), opacity .2s; }
.nav-links a:hover, .link-quiet:hover { color: var(--fg); }
.nav-links a:hover::after, .link-quiet:hover::after { transform: scaleX(1); opacity: 1; }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 20px; font-size: 15px; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: transparent; color: var(--fg); cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: currentColor; transition: transform .3s var(--ease-out); }
.nav-toggle span:first-child { top: 18px; } .nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.mobile-menu { position: fixed; inset: 68px 0 0; background: var(--bg); padding: 24px var(--gutter); display: flex; flex-direction: column; gap: 4px; }
.mobile-menu[hidden] { display: none; }
.mobile-menu a:not(.btn) { font-size: 24px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mobile-menu .btn { margin-top: 20px; width: 100%; }

@media (max-width: 900px) {
  .nav-links, .nav-actions .link-quiet { display: none; }
  .nav-actions { gap: 8px; }
  .nav-actions .btn { min-height: 36px; padding: 0 14px; font-size: 14px; }
  .nav-toggle { display: block; }
}

/* ---------- Scroll transitions ---------- */
[data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
[data-split] .wi { display: inline-block; transform: translateY(105%); transition: transform 1s var(--ease-out); transition-delay: calc(var(--i) * 45ms); }
[data-split].is-in .wi { transform: none; }

[data-reveal] { opacity: 0; transform: translateY(28px); filter: blur(6px); transition: opacity .9s var(--ease-out), transform 1s var(--ease-out), filter .9s var(--ease-out); transition-delay: var(--d, 0s); }
[data-reveal].is-in { opacity: 1; transform: none; filter: none; }

.no-js [data-reveal] { opacity: 1; transform: none; filter: none; }
.no-js [data-split] .wi { transform: none; }

@media (prefers-reduced-motion: reduce) {
  :root { --scene-dur: .01s; }
  html { scroll-behavior: auto; }
  /* Turn transitions off outright. Forcing a tiny duration instead would make every property
     transition (the default transition-property is "all"), so layout reads would lag a frame. */
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  [data-reveal], [data-split] .wi, [data-curtain], [data-depth] { opacity: 1 !important; transform: none !important; filter: none !important; clip-path: none !important; }
  .statement { height: auto; padding: 120px 0; } .statement .wrap { position: static; height: auto; }
  .hero-frame { transform: translateY(calc(-50% + 34px + (1 - var(--b)) * var(--start, 44vh))) !important; }
  .hero-copy { filter: none !important; transform: none !important; }
  .hero .horizon { transform: translate(-50%, 0) !important; }
}

/* Looping animations rest while their section is off screen (set by js/main.js) */
[data-offscreen] *, [data-offscreen] *::before, [data-offscreen] *::after { animation-play-state: paused !important; }
/* "Pause animations" in the footer stops every looping animation on the page */
html.is-paused *, html.is-paused *::before, html.is-paused *::after { animation-play-state: paused !important; }
