/*
  NF Coming Soon
  Night sky in brand blues; content sits low and left so the open sky
  above belongs to the planes. Slant (13°) is taken from the NF logo.
*/

@font-face {
  font-family: 'Saira';
  src: url('../fonts/saira-800-italic-latin.woff2') format('woff2');
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}
/* Static Inter weights rather than the variable font: same size (48 KB),
   and no reliance on font-variation support. */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallbacks, so the swap to the web fonts doesn't shift the
   layout on slow connections. Values measured from the font files against
   Arial and Arial Bold with fontkit. */
@font-face {
  font-family: 'Saira Fallback';
  src: local('Arial Bold Italic'), local('Arial-BoldItalicMT');
  font-weight: 800;
  font-style: italic;
  size-adjust: 101.31%;
  ascent-override: 112.04%;
  descent-override: 43.33%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial'), local('ArialMT');
  font-weight: 400;
  size-adjust: 106.58%;
  ascent-override: 90.9%;
  descent-override: 22.63%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial Bold'), local('Arial-BoldMT');
  font-weight: 600;
  size-adjust: 101.86%;
  ascent-override: 95.11%;
  descent-override: 23.68%;
  line-gap-override: 0%;
}

:root {
  color-scheme: dark;

  --night: #061230;
  --night-hi: #0a1d4a;
  --deck: #0a1c44;
  --sky: #89d0ea;
  --field: #268242;
  --field-lit: #4cc47a;
  --ink: #eaf3fa;
  --mist: #9db3cf;
  --line: rgb(137 208 234 / 0.18);
  --line-strong: rgb(137 208 234 / 0.42);

  --display: 'Saira', 'Saira Fallback', 'Arial Narrow', sans-serif;
  --body: 'Inter', 'Inter Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --slant: 13deg;
  --pad-x: clamp(16px, 4.5vw, 64px);
  --pad-l: max(var(--pad-x), env(safe-area-inset-left, 0px));
  --pad-r: max(var(--pad-x), env(safe-area-inset-right, 0px));
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Reserve the scrollbar's space so a scrollbar appearing mid-load (classic
     desktop scrollbars) doesn't narrow the page and shift the layout. */
  scrollbar-gutter: stable;
  background: var(--night);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  /* A column where nothing depends on content that arrives later: the footer
     is pushed down by its own margin, so a slowly streamed page never shifts. */
  display: flex;
  flex-direction: column;
  background: var(--night);
  color: var(--ink);
  font: 400 1rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
h1, h2, p, dl, dd { margin: 0; }

a { color: var(--sky); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--sky); color: var(--night); }

/* ── Sky (decorative layer; planes are added here) ─────────────────── */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(75% 60% at 88% 0%, rgb(137 208 234 / 0.16), transparent 70%),
    radial-gradient(55% 45% at 0% 100%, rgb(38 130 66 / 0.18), transparent 70%),
    linear-gradient(180deg, var(--night-hi) 0%, var(--night) 65%);
}

.site-header,
.site-main,
.site-footer {
  position: relative;
  z-index: 1;
  padding-left: var(--pad-l);
  padding-right: var(--pad-r);
}

/* ── Planes (see assets/js/planes.js for the style guide) ─────────── */

.plane { display: block; overflow: visible; }
.plane .m, .plane .s, .plane .w { stroke-width: 2.4; stroke-linejoin: round; }
.plane .m { fill: var(--c1); stroke: var(--c1); }
.plane .s { fill: var(--c2); stroke: var(--c2); }
.plane .w { fill: #f4f8fc; stroke: #f4f8fc; }
.plane .a { fill: var(--c3); }
.plane .k { fill: #1c3263; }
.plane .ln { fill: none; stroke: var(--c2); stroke-width: 1.6; stroke-linecap: round; }
.plane .arm { stroke: var(--c2); stroke-width: 2.4; stroke-linecap: round; }
.plane .disc { fill: rgb(234 243 250 / 0.13); }
.plane .blade { stroke: rgb(234 243 250 / 0.85); stroke-width: 1.4; stroke-linecap: round; }
.plane .blade-stop { stroke: #5a74a3; stroke-width: 1.6; stroke-linecap: round; }
.plane .bladef { fill: rgb(234 243 250 / 0.8); }
.plane .hub { fill: var(--c2); }
.plane .nav-r { fill: #ff6b6b; }
.plane .nav-g { fill: #63f29a; }
.plane .glow-r { fill: rgb(255 107 107 / 0.3); }
.plane .glow-g { fill: rgb(99 242 154 / 0.3); }
.plane .strobe { fill: #fff; animation: nfcs-strobe 1.5s steps(1, end) infinite; }
.plane .beacon { fill: #ff4d4d; animation: nfcs-strobe 1.1s steps(1, end) infinite; }
.plane .trail { fill: url(#nfcs-trail); }

.plane .pe, .plane .ro, .plane .tele { transform-box: fill-box; transform-origin: center; }
.plane .pe { animation: nfcs-prop 0.08s linear infinite alternate; }
.plane .ro { animation: nfcs-rotor 0.32s linear infinite; }
/* Elly: span 4.5 ↔ 6.5 m, the canard follows */
.plane .tele { animation: 13s ease-in-out infinite alternate; }
.plane .tele-l { animation-name: nfcs-tele-l; }
.plane .tele-r { animation-name: nfcs-tele-r; }
.plane .tele-cl { animation-name: nfcs-tele-cl; }
.plane .tele-cr { animation-name: nfcs-tele-cr; }

@keyframes nfcs-prop { to { transform: scaleY(0.15); } }
@keyframes nfcs-rotor { to { transform: rotate(360deg); } }
@keyframes nfcs-strobe { 0% { opacity: 1; } 10% { opacity: 0; } }
@keyframes nfcs-tele-l { 0%, 15% { transform: none; } 85%, 100% { transform: translateY(15px); } }
@keyframes nfcs-tele-r { 0%, 15% { transform: none; } 85%, 100% { transform: translateY(-15px); } }
@keyframes nfcs-tele-cl { 0%, 15% { transform: none; } 85%, 100% { transform: translateY(3.5px); } }
@keyframes nfcs-tele-cr { 0%, 15% { transform: none; } 85%, 100% { transform: translateY(-3.5px); } }

/* Random per-plane offset so props and strobes don't run in sync */
.plane .pe, .plane .ro, .plane .tele, .plane .strobe, .plane .beacon { animation-delay: var(--nfcs-delay, 0s); }

.nfcs-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.sky-layer { position: absolute; inset: 0; }
.sky-layer--far { opacity: 0.42; }
.sky-layer--mid { opacity: 0.8; }
.sky-layer--near { opacity: 0.95; }
.sky-layer .plane {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 50% 50%;
  will-change: transform;
}

.cloud {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  background:
    radial-gradient(closest-side, rgb(234 243 250 / 0.05), transparent),
    radial-gradient(40% 60% at 30% 55%, rgb(234 243 250 / 0.035), transparent 70%);
}

.sky.is-paused .plane * { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .plane * { animation: none !important; }
}

/* ── Header ───────────────────────────────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: max(clamp(16px, 3vw, 40px), env(safe-area-inset-top, 0px));
}

.logo { width: clamp(150px, 20vw, 260px); height: auto; }

.lang {
  display: flex;
  gap: 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
}
.lang a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  color: var(--mist);
  text-decoration: none;
}
.lang a:hover { color: var(--ink); }
.lang a[aria-current='true'] { color: var(--ink); }
.lang a[aria-current='true']::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 1.1rem;
  height: 3px;
  background: var(--sky);
  transform: translateX(-50%) skewX(calc(-1 * var(--slant)));
}

/* ── Main ─────────────────────────────────────────────────────────── */

.site-main {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  padding-top: clamp(6rem, 22vh, 16rem);
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

/* Soft night halo under the message keeps text legible over passing planes */
.site-main::before {
  content: '';
  position: absolute;
  inset: auto auto 0 0;
  width: min(100%, 64rem);
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(70% 60% at 20% 78%, rgb(6 18 48 / 0.82), rgb(6 18 48 / 0.5) 55%, transparent 80%);
}

@media (min-width: 960px) {
  .site-main {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    align-items: end;
  }
}

.intro { max-width: 44rem; }

.intro h1 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(2.6rem, 1.3rem + 5.2vw, 5.75rem);
  line-height: 0.94;
  letter-spacing: -0.012em;
  /* em, not ch: ch follows the loaded font, so the line breaks would jump on font swap */
  max-width: 7.92em;
  text-wrap: balance;
}

.intro p {
  margin-top: clamp(1rem, 2vw, 1.5rem);
  max-width: 22.7em;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.5;
  color: color-mix(in srgb, var(--ink) 86%, var(--mist));
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 0;
  padding: 0;
  list-style: none;
}
.actions li { display: flex; }

/* Parallelogram buttons: the shape of the bars in the NF logo */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-edge: var(--line-strong);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.7rem 1.45rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--btn-fg);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 3px;
  background: var(--btn-bg);
  box-shadow: inset 0 0 0 1.5px var(--btn-edge);
  transform: skewX(calc(-1 * var(--slant)));
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { color: var(--btn-fg); --btn-edge: var(--sky); }
.btn svg { flex: none; width: 1.15em; height: 1.15em; }

.btn--primary { --btn-bg: var(--sky); --btn-fg: var(--night); --btn-edge: transparent; }
.btn--primary:hover { --btn-bg: var(--ink); --btn-edge: transparent; }

/* ── NFC 2027 teaser ──────────────────────────────────────────────── */

.nfc {
  position: relative;
  max-width: 26rem;
  padding: 1.4rem 1.5rem 1.5rem 1.9rem;
  background: rgb(10 28 68 / 0.93);
  border: 1px solid var(--line);
  border-radius: 4px;
}
/* One slanted green stroke, like the N in the logo. A fixed-offset polygon,
   so the lean stays the same whatever the panel's height. */
.nfc::before {
  content: '';
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 0.4rem;
  width: 13px;
  background: var(--field-lit);
  clip-path: polygon(8px 0, 13px 0, 5px 100%, 0 100%);
}

.nfc h2 {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 2rem;
  line-height: 0.8;
  color: var(--field-lit);
}
.nfc h2 img { width: 132px; height: auto; }

.nfc p {
  margin-top: 1rem;
  color: color-mix(in srgb, var(--ink) 86%, var(--mist));
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1rem;
  margin-top: 1rem;
  font-size: 0.9375rem;
}
.facts dt { color: var(--mist); }
.facts dd { font-weight: 600; }

.docs { display: grid; gap: 0.15rem; margin: 0.75rem 0 0; padding: 0; list-style: none; }
.docs a { display: inline-flex; align-items: center; min-height: 32px; font-weight: 600; }

/* ── Footer ───────────────────────────────────────────────────────── */

.site-footer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--mist);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--mist);
}
.site-footer a:hover { color: var(--ink); }
.site-footer .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.25rem; }

.pause {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--mist);
  cursor: pointer;
}
.pause:hover { color: var(--ink); }
/* Hidden until JS shows it, but its space is kept so the footer doesn't shift.
   With reduced motion it never appears, so no space is kept. */
.pause[hidden] { display: inline-flex; visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .pause[hidden] { display: none; }
}
.pause svg { width: 1rem; height: 1rem; }
.pause .icon-play,
.pause[data-state='paused'] .icon-pause { display: none; }
.pause[data-state='paused'] .icon-play { display: block; }

/* ── Small screens ────────────────────────────────────────────────── */

@media (max-width: 479px) {
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd + dt { margin-top: 0.5rem; }
}

@media (max-width: 380px) {
  .btn { padding-inline: 1.15rem; font-size: 0.9375rem; }
  .nfc { padding-right: 1.15rem; }
}
