/*
 * eFatum landing — "Classified Editorial".
 * Hand-written CSS built from the design tokens in style/DESIGN.md.
 * Loaded as an external sheet: the CSP forbids inline <style> blocks.
 *
 * Conscious deviation from the design system: it mandates 0px radius, but
 * the landing applies the consistent rounding scale below (--radius-*) to
 * buttons, inputs, chips/stamps, panels and notices, keeping the palette,
 * hairlines and metadata typography intact.
 *
 * Structural hairlines use the design's warm archival outline tone
 * (outline-variant #5B403C at reduced alpha), matching the reference
 * composition; component borders (inputs, buttons) use the neutral
 * Hairline Border token #262A30 as specified per component.
 */

/* ---- Design tokens ------------------------------------------------------- */

:root {
  /* Color */
  --void: #0C0D0E;            /* Base Void: canvas background */
  --dossier: #141618;         /* Surface Dossier: panels */
  --elevation: #1C1F23;       /* Surface Elevation: inputs, hover */
  --hairline: #262A30;        /* Hairline Border: component borders */
  --signal: #D93829;          /* Signal Red: primary buttons ONLY (plus the
                                 error note's semantic border/text) */
  --ink: #EDEDED;             /* Ink Primary: titles and key text */
  --muted: #A0A5AB;           /* Ink Muted: secondary text */
  --ghost: #5A6068;           /* Ink Ghost: micro-coordinates, placeholders */
  --line-soft: rgba(91, 64, 60, 0.3);  /* warm hairline, 30% */
  --line-faint: rgba(91, 64, 60, 0.2); /* warm hairline, 20% */

  /* Rounding scale (conscious deviation: see the file header). */
  --radius-sm: 10px;    /* inputs */
  --radius-md: 12px;    /* notices */
  --radius-lg: 16px;    /* cards / panels */
  --radius-pill: 999px; /* buttons, chips / stamps */

  /* Typography families */
  --font-display: "Syne", sans-serif;
  --font-body: "Geist", sans-serif;
  --font-mono: "Space Mono", monospace;

  /* Spacing scale */
  --gutter: 1rem;
  --gutter-lg: 2rem;
  --margin: 1.5rem;
  --margin-lg: 3rem;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;

  /* Left structural rail: the thread position; content starts at 2x. */
  --rail: 1.5rem;
}

/* ---- Font faces (self-hosted, latin subset, zero third-party requests) ---- */

@font-face {
  font-family: "Syne";
  font-style: normal;
  font-weight: 600 700; /* variable axis */
  font-display: swap;
  src: url("/fonts/syne-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 600; /* variable axis */
  font-display: swap;
  src: url("/fonts/geist-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/space-mono-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/space-mono-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Reset & base --------------------------------------------------------- */

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.8125rem; /* 13px, body-md */
  line-height: 1.25rem;
  -webkit-font-smoothing: antialiased;
}

::selection {
  /* Neutral selection: the Signal Red accent is reserved for the primary
     buttons (owner's call); void text on ink keeps a 16.6:1 ratio. */
  background: var(--ink);
  color: var(--void);
}

img,
svg {
  display: block;
}

a {
  color: inherit;
}

/* Visible, sharp focus for keyboard users (design: 1px offset hairline).
   Ink outline: 16.6:1 on the page, 3.9:1 over the red button — both clear. */
:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

/* Visually hidden, still exposed to assistive technology. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- Typographic roles ---------------------------------------------------- */

.t-display-hero {
  font-family: var(--font-display);
  font-size: 2rem;        /* 32px, hero mobile */
  font-weight: 700;
  line-height: 2.375rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0;
}

.t-headline-lg {
  font-family: var(--font-display);
  font-size: 1.5rem;      /* 24px, headline-lg mobile */
  font-weight: 700;
  line-height: 1.875rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0;
}

.t-headline-md {
  font-family: var(--font-display);
  font-size: 1.375rem;    /* 22px */
  font-weight: 600;
  line-height: 1.75rem;
  letter-spacing: -0.01em;
  margin: 0;
}

.t-body-lg {
  font-family: var(--font-body);
  font-size: 0.9375rem;   /* 15px */
  font-weight: 400;
  line-height: 1.5rem;
  letter-spacing: -0.005em;
  margin: 0;
}

.t-body-md {
  font-family: var(--font-body);
  font-size: 0.8125rem;   /* 13px */
  font-weight: 400;
  line-height: 1.25rem;
  margin: 0;
}

.t-label-code {
  font-family: var(--font-mono);
  font-size: 0.6875rem;   /* 11px */
  font-weight: 400;
  line-height: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}

.t-label-stamp {
  font-family: var(--font-mono);
  font-size: 0.625rem;    /* 10px */
  font-weight: 700;
  line-height: 0.875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
}

.t-caption {
  font-family: var(--font-mono);
  font-size: 0.5625rem;   /* 9px */
  font-weight: 400;
  line-height: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

/* ---- Page scaffold: the vertical thread of evidence ------------------------ */

.page {
  position: relative;
  overflow-x: clip;
}

.thread {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--rail);
  width: 1px;
  background: var(--line-soft);
  pointer-events: none;
  z-index: 1;
}

/* Sections ride the rail: clear the thread, hug the right gutter. */
.rail {
  position: relative;
  padding-left: calc(var(--rail) * 2);
  padding-right: var(--gutter);
}

/* Flank node markers pinned on the thread. */
.node {
  position: absolute;
  left: var(--rail);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--void);
  border: 1px solid var(--ghost);
  border-radius: 2px; /* soften the registration marks without hiding them */
  z-index: 2;
}

.node--tick {
  top: 50%;
  transform: translate(-50%, -50%);
  width: 0.5rem;
  height: 0.5rem;
  border-color: var(--ghost);
}

.node--muted {
  top: 4rem;
  width: 0.75rem;
  height: 0.75rem;
  border-color: var(--ghost);
}

.node__core {
  width: 0.125rem;
  height: 0.125rem;
  background: var(--ghost);
}

/* Register numbers are decorative (aria-hidden): Ghost is the design's
   register-mark tone and is exempt from the 4.5:1 text threshold. */
.node__num {
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1;
  color: var(--ghost);
}

/* ---- Section 1: header sub-bar -------------------------------------------- */

.bar {
  border-bottom: 1px solid var(--line-faint);
  padding-top: var(--space-lg);
  padding-bottom: var(--space-md);
}

.bar__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.bar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.375rem;   /* headline-md */
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.stamp {
  /* Neutral telemetry tag (design system): muted on elevation is 6.7:1. */
  color: var(--muted);
  border: 1px solid var(--hairline);
  background: var(--elevation);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.625rem;
  width: fit-content;
}

.navlink {
  color: var(--muted);
  text-decoration: none;
  width: fit-content;
  transition: color 0.15s ease;
}

.navlink:hover {
  color: var(--ink);
}

/* ---- Section 2: hero -------------------------------------------------------- */

.hero {
  min-height: 82vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--margin-lg);
  padding-bottom: var(--margin-lg);
  overflow: hidden;
}

/* Faint celestial coordinate grid (hero and footer share the styling).
   Decorative texture: aria-hidden, exempt from the text-contrast rule. */
.celestial {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.035;
  color: var(--ink);
}

/* Hero star chart: a barely-there drift and twinkle so the backdrop feels
   alive without stealing attention. Both stop under reduced motion (see the
   reduced-motion block); the footer grid stays static. */
.hero .celestial {
  animation:
    star-drift 120s linear infinite alternate,
    star-twinkle 16s ease-in-out infinite alternate;
}

@keyframes star-drift {
  from {
    transform: scale(1.04) translate(0.4%, -0.3%);
  }
  to {
    transform: scale(1.04) translate(-0.4%, 0.3%);
  }
}

@keyframes star-twinkle {
  from {
    opacity: 0.03;
  }
  to {
    opacity: 0.05;
  }
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 56rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--muted);
  letter-spacing: 0.14em;
}

.pulse-dot {
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--muted);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .pulse-dot,
  .btn-primary.is-sending::after,
  .hero .celestial {
    animation: none;
  }
  .form-note--in {
    animation: none;
  }
}

.hero__sub {
  color: var(--muted);
  max-width: 42rem;
}

.hero__actions {
  padding-top: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
}

.hero__file {
  color: var(--muted); /* muted/void 7.8:1 — the 0.4-alpha tone failed 4.5:1 */
  letter-spacing: 0.14em;
}

/* ---- Buttons (primary / dispatch) ------------------------------------------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.875rem var(--space-lg);
  background: var(--signal);
  border: 1px solid var(--signal);
  border-radius: var(--radius-pill);
  /* White on Signal Red measures 4.5:1; the previous ink text was 3.9:1. */
  color: #FFFCFF;
  text-decoration: none;
  letter-spacing: 0.1em;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-primary:active {
  border-color: var(--void); /* design: 1px inset border of Base Void */
  transform: translateY(1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Sending state (toggled from app.js): minimal spinner, no shadow. */
.btn-primary.is-sending::after {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid rgba(237, 237, 237, 0.35);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

/* ---- Sections 3 & 4: split editorial layout --------------------------------- */

.split {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.split__rail {
  display: none;
  flex-direction: column;
  gap: var(--space-sm);
  padding-top: var(--space-xs);
  color: var(--muted);
}

.split__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.split__body {
  color: var(--muted);
  max-width: 48rem;
}

.fragments {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-soft);
}

.fragment {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--line-faint);
}

.fragment__label {
  color: var(--ink); /* was Signal Red: accent is button-only now */
  font-weight: 700;
}

.fragment__body {
  color: var(--muted); /* 7.8:1 on void */
}

/* Observation log: right rail pull-quote, as a dossier card. */
.observation {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-lg);
  background: var(--dossier);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  color: var(--muted); /* muted/dossier 7.3:1 */
}

.observation__quote {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.observation__quote blockquote {
  color: rgba(237, 237, 237, 0.9);
}

.observation__source {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  border-top: 1px solid var(--line-faint);
  padding-top: var(--space-xl);
}

/* ---- Section 5: whitelist ------------------------------------------------------ */

.whitelist {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

.whitelist__inner {
  max-width: 48rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.whitelist__body {
  color: var(--muted);
}

.whitelist__form {
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.whitelist__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.field {
  flex: 1;
}

.input {
  width: 100%;
  padding: 0.875rem var(--space-md);
  background: var(--void);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--ink);
  transition: border-color 0.15s ease;
}

.input::placeholder {
  /* Placeholder is meaningful text: muted (7.8:1), not Ghost (3.1:1). */
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.input:focus {
  outline: none;
  border-color: var(--ink); /* design: focus swaps the border, zero glow */
}

/* Honeypot: moved off-screen and unfocusable; not display:none so that
 * naive bots still render and fill it. Wrapper is aria-hidden. */
.honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note {
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
}

.form-note--ok {
  /* Neutral success note: no accent outside the buttons. */
  background: var(--dossier);
  border: 1px solid var(--hairline);
  color: var(--ink);
}

.form-note--error {
  /* THE one accent exception: a semantic error cue (a11y), red on purpose.
     Text #FFB4AB on dossier is 10.7:1; the border is a UI mark at 3.9:1. */
  background: var(--dossier);
  border: 1px solid var(--signal);
  color: #FFB4AB;
}

/* Reveal animation (class toggled from app.js): subtle fade + slide. */
.form-note--in {
  animation: note-in 0.22s ease-out;
}

@keyframes note-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.whitelist__microcopy {
  color: var(--muted); /* muted/void 7.8:1 */
}

/* ---- Section 6: contact ---------------------------------------------------------- */

/* The section reuses the .split grid; no telemetry rail is rendered — at
   desktop the single .split__main is explicitly placed in columns 5-12, the
   same slot as the thesis section's main column. */

.contact__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* The message field shares the input look; vertical resize only so the
   hairline grid stays intact. */
textarea.input {
  resize: vertical;
  min-height: 8rem;
}

/* ---- Section 7: privacy (unnumbered, centered like the footer) --------------------- */

.privacy {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
  /* Symmetric padding (not the .rail offset): the inner block must center on
     the viewport, while still clearing the decorative thread at every size. */
  padding-inline: calc(var(--rail) + var(--gutter));
  border-top: 1px solid var(--line-soft);
}

.privacy__inner {
  max-width: 48rem;
  margin-inline: auto; /* centers the block on the viewport */
  display: flex;
  flex-direction: column;
  align-items: center; /* centered stamp and headings, footer-style */
  text-align: center;
  gap: var(--space-lg);
}

.privacy__list {
  display: flex;
  flex-direction: column;
  width: 100%; /* hairlines span the full block width */
  border-top: 1px solid var(--line-soft);
}

.privacy__row {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--line-faint);
}

.privacy__row:last-child {
  border-bottom: 0;
}

.privacy__label {
  color: var(--ink); /* same hierarchy as the fragment labels */
}

.privacy__body {
  color: var(--muted); /* muted/void 7.8:1 */
}

/* ---- Section 8: footer ------------------------------------------------------------ */

.footer {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  padding: var(--space-xl) var(--gutter);
  text-align: center;
}

.footer__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.footer__inner .t-caption {
  color: var(--muted); /* muted/void 7.8:1 — the 0.5-alpha tone failed 4.5:1 */
}

.footer .celestial {
  opacity: 0.03;
}

.footer__inner .footer__file {
  color: var(--muted);
  letter-spacing: 0.14em;
}

.footer__links {
  display: flex;
  gap: var(--space-md);
}

/* ---- Breakpoints ------------------------------------------------------------------ */

@media (min-width: 640px) {
  .bar__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .whitelist__fields,
  .contact__fields {
    flex-direction: row;
    flex-wrap: wrap;
  }

  /* Fields keep a readable minimum width and wrap to the next line when the
     viewport cannot fit them all plus the button. */
  .whitelist__fields .field,
  .contact__fields .field {
    flex: 1 1 12rem;
  }
}

@media (min-width: 768px) {
  :root {
    --rail: 3rem;
  }

  .rail {
    padding-right: var(--gutter);
  }
}

@media (min-width: 1024px) {
  :root {
    --rail: 6rem;
  }

  .rail {
    padding-right: var(--gutter-lg);
  }

  .t-display-hero {
    font-size: 3rem;        /* 48px */
    line-height: 3.25rem;
    letter-spacing: -0.03em;
  }

  .t-headline-lg {
    font-size: 2rem;        /* 32px */
    line-height: 2.375rem;
    letter-spacing: -0.02em;
  }

  .split {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--gutter-lg);
    row-gap: var(--space-xl);
  }

  /* Why-eFatum: narrow telemetry rail (4) + narrative (8). */
  .split__rail {
    display: flex;
    grid-column: span 4;
    border-right: 1px solid var(--line-faint);
    padding-right: var(--space-lg);
  }

  .split__main {
    grid-column: span 8;
    padding-left: var(--space-xl);
  }

  /* The problem: inverted ratio, narrative (7) + observation (5). */
  .split__main--wide {
    grid-column: span 7;
    padding-left: 0;
  }

  /* Contact: the same horizontal slot as the thesis section's main column
     (columns 5-12, same column-gap and .split__main padding-left), capped at
     the readable measure. */
  .contact .split__main {
    grid-column: 5 / -1;
    max-width: 48rem;
  }

  .observation {
    grid-column: span 5;
  }
}

