/* ============================================================================
   BlackSea Software

   Structure, rhythm and motion follow the Atlantic.vc reference: a midnight
   observatory. Full-viewport display type at a single weight, monospaced
   micro-labels at extreme tracking, hairline wireframe borders, stepped
   surfaces instead of shadows, and a particle field as the only texture.

   The palette is NOT Atlantic's. Electric cobalt and signal orange are
   deliberately absent. Every colour below comes from brand/BRANDBOOK.md §4
   (dark mode), so the site matches the mark, the app icons and the social
   card without a second system to maintain.
   ========================================================================= */

:root {
  /* Surfaces — BRANDBOOK dark mode, stepped for depth without shadows. */
  --void: #070c0f;          /* deepest canvas, one step below --paper */
  --paper: #0b1114;         /* page background */
  --paper-warm: #0f1619;    /* recessed surfaces, cards */
  --panel: #121b1f;         /* the most common elevated panel */

  /* Ink */
  --ink: #eef2f2;           /* primary text */
  --ink-soft: #a8b6bb;      /* body copy */
  --ink-faint: #6d7f86;     /* labels, metadata */
  --rule: #212c31;          /* hairline borders */

  /* The single accent. Atlantic illuminates words in electric cobalt; we
     illuminate them in sea, which is the mark's own colour. */
  --sea: #7fc9d3;
  --sea-deep: #10454f;

  /* Type. General Sans and IBM Plex Mono are the substitutes the reference
     itself names for Monument and Mono. */
  --display: 'General Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Scale, lifted from the reference's measured values. */
  --text-display: clamp(2.75rem, 7.4vw, 6rem);   /* 96px ceiling */
  --text-heading: clamp(2rem, 4.6vw, 4rem);      /* 64px ceiling */
  --text-heading-sm: clamp(1.25rem, 2vw, 1.5rem);
  --text-body: 1rem;
  --text-caption: 0.625rem;                      /* 10px mono labels */

  --tracking-display: -0.03em;
  --tracking-heading: -0.01em;
  --tracking-caption: 0.16em;

  /* Spacing, 4px base. */
  --s-4: 4px;   --s-8: 8px;   --s-12: 12px; --s-16: 16px;
  --s-20: 20px; --s-24: 24px; --s-32: 32px; --s-48: 48px;
  --s-80: 80px; --s-100: 100px; --s-148: 148px; --s-200: 200px;

  --page: 1400px;
  --gutter: clamp(20px, 4vw, 50px);
  --section-gap: clamp(72px, 10vw, 148px);

  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;

  --dur: 0.4s;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── Reset ─────────────────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: var(--text-body);
  line-height: 1.5;
  font-feature-settings: "ss01" on, "ss02" on;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--sea); color: var(--paper); }

:focus-visible {
  outline: 1px solid var(--sea);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: var(--s-8);
  padding: var(--s-8) var(--s-16);
  background: var(--panel);
  border: 1px solid var(--sea);
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip:focus { left: var(--s-16); }

/* ── Shared primitives ─────────────────────────────────────────────────── */

.shell {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* The signature micro-label: mono, uppercase, 0.16em tracking, preceded by a
   small square in accent. Atlantic uses these as section serial numbers. */
.label {
  display: inline-flex;
  align-items: center;
  gap: var(--s-12);
  font-family: var(--mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1;
}

.label::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--sea);
  flex: none;
}

.label-rule {
  display: flex;
  align-items: center;
  gap: var(--s-16);
  padding-bottom: var(--s-16);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--s-32);
}

h1, h2, h3 {
  font-weight: 400;                 /* single-weight philosophy */
  margin: 0;
}

h1 {
  font-size: var(--text-display);
  line-height: 1;
  letter-spacing: var(--tracking-display);
}

h2 {
  font-size: var(--text-heading);
  line-height: 1.06;
  letter-spacing: var(--tracking-heading);
}

h3 {
  font-size: var(--text-heading-sm);
  line-height: 1.24;
  letter-spacing: var(--tracking-heading);
}

/* One word per headline is illuminated. Never a whole sentence. */
.lit { color: var(--sea); }

p { margin: 0; }

.prose {
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.7;
  max-width: 62ch;
}

.prose-muted { color: var(--ink-faint); }

/* ── Navigation ────────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--s-32);
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  color: var(--ink);
  flex: none;
}

.brand svg { height: 26px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-32);
  margin-left: var(--s-24);
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: var(--tracking-caption);
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color var(--dur) var(--ease);
  position: relative;
  padding-block: var(--s-4);
}

.nav-links a:hover { color: var(--ink); }

/* Active state marks with the accent, matching the reference's active nav. */
.nav-links a.is-active { color: var(--ink); }

.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--sea);
}

.nav-cta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sea);
  border: 1px solid var(--sea);
  border-radius: var(--radius-sm);
  padding: var(--s-12) var(--s-20);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--sea);
  color: var(--paper);
}

/* ── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 72px;
  overflow: hidden;
  background: var(--void);
}

#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* Keeps the display type legible over the densest part of the field. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    120% 80% at 30% 55%,
    color-mix(in srgb, var(--void) 78%, transparent) 0%,
    transparent 62%
  );
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-label { margin-bottom: var(--s-32); }

.hero h1 { max-width: 16ch; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-32);
  margin-top: var(--s-48);
  padding-top: var(--s-24);
  border-top: 1px solid var(--rule);
  max-width: 720px;
}

.hero-meta div { min-width: 140px; }

.hero-meta dt {
  font-family: var(--mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: var(--s-8);
}

.hero-meta dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* Scroll indicator: square wireframe frame with a chevron, as in the
   reference, centred above the fold edge. */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: var(--s-32);
  transform: translateX(-50%);
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--ink-faint);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.scroll-cue:hover {
  color: var(--sea);
  border-color: var(--sea);
}

/* ── Sections ──────────────────────────────────────────────────────────── */

.section {
  padding-block: var(--section-gap);
  position: relative;
}

.section-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-32);
  margin-bottom: var(--s-80);
}

.section-head h2 { max-width: 20ch; }

/* Spacing variants. These exist as classes rather than style="" attributes
   because the CSP sets style-src 'self' with no unsafe-inline: an inline
   style attribute is dropped in production while working locally. */
.section-head-spaced { margin-top: var(--s-80); }
.label-rule-spaced { margin-top: var(--s-48); }
.registry-note { margin-top: var(--s-32); }

/* The sparkle: a six-point asterisk marking each editorial transition. */
.sparkle {
  flex: none;
  width: 44px;
  height: 44px;
  color: var(--sea);
  margin-top: var(--s-8);
}

/* ── Word scaffolding (THEY / HAVE / BECOME / INEVITABLE) ──────────────── */

.scaffold {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-16);
  padding-block: var(--s-48);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.scaffold span {
  display: block;
  font-family: var(--mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Progressive indent instead of alternating alignment: the four labels must
   read left-to-right as one sentence. Right-aligning every second cell
   reorders them visually into nonsense. */
.scaffold span:nth-child(2) { justify-self: start; }
.scaffold span:nth-child(3) { justify-self: center; }
.scaffold span:nth-child(4) { justify-self: end; }

/* ── Cards ─────────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: var(--s-16);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  position: relative;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s-32);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.card:hover {
  border-color: color-mix(in srgb, var(--sea) 45%, var(--rule));
  background: var(--panel);
}

/* --ink-faint measures 4.38:1 on --paper-warm, below AA for 10px text.
   Cards get the brighter body ink for their labels; the token is unchanged
   everywhere else, where it sits on --paper at 4.55:1. */
.card .label {
  margin-bottom: var(--s-24);
  color: var(--ink-soft);
}

.card h3 { margin-bottom: var(--s-12); }

.card p {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* Corner dots: the reference marks its wireframe frames this way. */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--sea);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.card::before { top: -2px; left: -2px; }
.card::after  { bottom: -2px; right: -2px; }
.card:hover::before,
.card:hover::after { opacity: 1; }

/* ── Split: framed visual beside prose ─────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 100px);
  align-items: center;
}

.frame {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--void);
  /* Not `overflow: hidden`: the corner dots sit outside the border box by
     design and would be clipped away. The canvas clips itself instead. */
}

.frame canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: calc(var(--radius-lg) - 1px);
  overflow: hidden;
}

/* Blue corner dots on the viewport frame. */
.frame-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--sea);
  z-index: 2;
}
.frame-dot.tl { top: -3px; left: -3px; }
.frame-dot.tr { top: -3px; right: -3px; }
.frame-dot.bl { bottom: -3px; left: -3px; }
.frame-dot.br { bottom: -3px; right: -3px; }

.split-body > * + * { margin-top: var(--s-24); }

/* ── Products ──────────────────────────────────────────────────────────── */

.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-32);
  align-items: start;
  padding-block: var(--s-48);
  border-top: 1px solid var(--rule);
}

.product:last-of-type { border-bottom: 1px solid var(--rule); }

.product h3 { margin-bottom: var(--s-16); }

.product p {
  color: var(--ink-soft);
  max-width: 56ch;
  line-height: 1.7;
}

.product-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-8);
  margin-top: var(--s-20);
}

.tag {
  font-family: var(--mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 6px var(--s-12);
}

.product-link {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sea);
  border-bottom: 1px solid color-mix(in srgb, var(--sea) 40%, transparent);
  padding-bottom: 3px;
  white-space: nowrap;
  transition: border-color var(--dur) var(--ease);
}

.product-link:hover { border-color: var(--sea); }

.product-soon {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ── Registry ──────────────────────────────────────────────────────────── */

.registry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.registry div {
  background: var(--paper-warm);
  padding: var(--s-24) var(--s-32);
}

.registry dt {
  font-family: var(--mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: var(--s-12);
}

.registry dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.registry a { border-bottom: 1px solid var(--rule); padding-bottom: 2px; }
.registry a:hover { border-color: var(--sea); color: var(--sea); }

.pending { color: var(--ink-faint); font-style: italic; }

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

.footer {
  border-top: 1px solid var(--rule);
  background: var(--void);
  padding-block: var(--s-48);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-24);
  align-items: center;
  justify-content: space-between;
}

.footer-mark { display: flex; align-items: center; color: var(--ink-faint); }
.footer-mark svg { height: 22px; width: auto; }

.footer small {
  font-family: var(--mono);
  font-size: var(--text-caption);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.8;
}

/* ── Motion ────────────────────────────────────────────────────────────── */

/* Hero words resolve out of blur, mirroring the reference's per-word
   blur(30px)/scale(1.3) entrance. Only applied when scripting is available:
   without JS the html.js class never lands and everything renders plainly. */
html.js .word {
  display: inline-block;
  opacity: 0;
  filter: blur(24px);
  transform: translateY(0.18em) scale(1.16);
  transition:
    opacity 0.9s var(--ease),
    filter 0.9s var(--ease),
    transform 0.9s var(--ease);
  will-change: opacity, filter, transform;
}

html.js .hero.is-in .word {
  opacity: 1;
  filter: blur(0);
  transform: none;
}

html.js .hero.is-in .word { will-change: auto; }

/* Scroll reveals: ±10px counter-motion, as measured on the reference. */
html.js [data-rise] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

html.js [data-fall] {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

html.js [data-rise].is-in,
html.js [data-fall].is-in {
  opacity: 1;
  transform: none;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .scaffold { grid-template-columns: repeat(2, 1fr); row-gap: var(--s-24); }
  .section-head { flex-direction: column; gap: var(--s-24); margin-bottom: var(--s-48); }
  .sparkle { width: 36px; height: 36px; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-inner { height: 64px; }
  .hero { padding-top: 64px; }
  .product { grid-template-columns: 1fr; gap: var(--s-20); }
  .hero-meta { gap: var(--s-20); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  html.js .word,
  html.js [data-rise],
  html.js [data-fall] {
    opacity: 1;
    filter: none;
    transform: none;
    transition: none;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
