@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-Extraleicht.otf") format("opentype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-ExtraleichtKursiv.otf") format("opentype");
  font-weight: 200;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-Leicht.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-LeichtKursiv.otf") format("opentype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-Buch.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-BuchKursiv.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-Kraftig.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-KraftigKursiv.otf") format("opentype");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-Halbfett.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-HalbfettKursiv.otf") format("opentype");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-Dreiviertelfett.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-DreiviertelfettKursiv.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-Fett.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-FettKursiv.otf") format("opentype");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-Extrafett.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne";
  src: url("../assets/fonts/TestSohne-ExtrafettKursiv.otf") format("opentype");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-Extraleicht.otf") format("opentype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-ExtraleichtKursiv.otf") format("opentype");
  font-weight: 200;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-Leicht.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-LeichtKursiv.otf") format("opentype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-Buch.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-BuchKursiv.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-Kraftig.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-KraftigKursiv.otf") format("opentype");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-Halbfett.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-HalbfettKursiv.otf") format("opentype");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-Dreiviertelfett.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-DreiviertelfettKursiv.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-Fett.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-FettKursiv.otf") format("opentype");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-Extrafett.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sohne Mono";
  src: url("../assets/fonts/TestSohneMono-ExtrafettKursiv.otf") format("opentype");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

/* =====================================================================
   un.Abrax — clean single-theme stylesheet (rebuild)
   Palette: graphite #444445 ground / #EDEDED ink. No conflicting :root.
   ===================================================================== */

:root {
  --bg:        #444445;
  /* The brand has exactly two colours. Every tint below is ink over graphite
     at some alpha -- never a third hue. */
  --bg-deep:   #444445;
  --panel:     rgba(237,237,237,0.045);
  --panel-2:   rgba(237,237,237,0.085);
  --field:     rgba(237,237,237,0.03);
  --ink:       #ededed;
  --text:      rgba(237,237,237,0.82);
  --muted:     rgba(237,237,237,0.58);
  --dim:       rgba(237,237,237,0.40);
  --line:      rgba(237,237,237,0.16);
  --line-2:    rgba(237,237,237,0.30);

  /* One type scale for the sheet. Section sizes were all ad hoc -- 0.6, 0.62,
     0.64, 0.66, 0.7, 0.72, 0.78, 0.8 -- which read as drift rather than
     hierarchy. Use these; do not add a new size. */
  --t-label:  0.64rem;   /* mono labels, captions, flags */
  --t-meta:   0.75rem;   /* data lines, chips, mono body */
  --t-body:   0.92rem;   /* Korean body copy */
  --t-read:   1.06rem;   /* the overall reading, set larger on purpose */
  --t-title:  clamp(1.05rem, 1.5vw, 1.28rem);   /* panel headings */
  --t-figure: clamp(2.6rem, 5vw, 3.6rem);       /* the one big number */
  --glow:      rgba(237,237,237,0.10);
  --mono: "Sohne Mono", "SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace;
  --sans: "Sohne", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--ink); font-weight: 500; letter-spacing: -0.024em; margin: 0 0 0.6em; }
p { margin: 0 0 1em; }
a { color: var(--text); text-decoration: none; }
code, pre { font-family: var(--mono); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.1em;
}
.ko-small, .ko-translation { color: var(--muted); font-size: 0.86rem; line-height: 1.7; }
/* drawn, not typed: the bullet character is outside the trial font's 68 glyphs */
.blink {
  display: inline-block; width: 0.42em; height: 0.42em;
  border-radius: 50%; background: var(--ink);
  animation: blink 1.2s steps(2,start) infinite;
}
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0.15; } }

/* Fine drifting grain, drawn on a fixed canvas so the texture carries across
   every section instead of stopping at the hero. Sits behind main (z-index 2)
   and above the body ground. */
.grain-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
/* A second, static grain that sits ABOVE the content. The animated field behind
   cannot dither the form's soft washes, because those washes are painted on top
   of it -- and a blur running from a low alpha down to zero bands into visible
   rings without something breaking up the steps. This is that something. */
.grain-overlay {
  position: fixed; inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- corner logo (nav removed for a design-led, poster feel) ---------- */
.corner-logo {
  position: fixed; top: clamp(18px, 3vw, 30px); left: clamp(18px, 3vw, 34px);
  z-index: 60; display: inline-flex; opacity: 0.9;
  transition: opacity 0.5s ease, transform 0.5s ease;
  mix-blend-mode: difference;
}
.corner-logo:hover { opacity: 1; }
.corner-logo-img { height: clamp(16px, 1.8vw, 22px); width: auto; display: block; }

/* hide the corner logo during the pinned intro — the big intro logo carries the moment */
body.is-hero-sequence .corner-logo {
  opacity: 0; transform: translateY(-12px); pointer-events: none;
}

/* ---------- view switching ---------- */
.view { display: none; }
.view.is-active { display: block; }
/* hard guarantee: any view that is not active is fully removed, so camera/analysis
   sections can never leak onto the home scroll or behind the result */
.view:not(.is-active) { display: none !important; }
main { position: relative; z-index: 2; }

/* ---------- bottom logo marquee (conveyor-belt lettering) ---------- */
.logo-marquee {
  position: relative; z-index: 2; overflow: hidden; width: 100%;
  background: transparent; padding: clamp(28px, 5vw, 64px) 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.logo-marquee-track { display: flex; width: max-content; animation: logoMarquee 34s linear infinite; }
.logo-marquee:hover .logo-marquee-track { animation-play-state: paused; }
.logo-marquee-group { display: flex; align-items: center; gap: clamp(56px, 8vw, 120px); padding-right: clamp(56px, 8vw, 120px); flex: none; }
.logo-marquee-group img { height: clamp(64px, 9vw, 140px); width: auto; display: block; opacity: 0.5; }
@keyframes logoMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .logo-marquee-track { animation: none; } }

/* ---------- footer ---------- */
.footer {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  padding: 30px clamp(20px, 4vw, 48px);
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--dim);
}

/* =====================================================================
   HOME — one continuous scroll sequence, drawn on a single canvas
   ===================================================================== */

/* The tall track that scrubs the sequence. Its height is the running time of
   the whole choreography, so lengthening it slows every phase evenly. */
.seq-track {
  position: relative;
  height: 900vh;
  background: var(--bg);
}
.seq-sticky {
  position: sticky; top: 0;
  height: 100vh;
  overflow: hidden;
}
.seq-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  pointer-events: none;
}
/* the canvas carries no text, so the page still needs a real heading */
.seq-sr {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.intro-scrollhint {
  position: absolute; left: 50%; bottom: 6vh;
  transform: translateX(-50%);
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem; letter-spacing: 0.42em; text-indent: 0.42em;
  color: var(--muted);
  animation: introHintPulse 1.9s ease-in-out infinite;
}
@keyframes introHintPulse { 0%,100% { opacity: 0.28; } 50% { opacity: 0.82; } }

/* main landing reached after the logo resolves */
.main-landing {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(80px, 12vh, 160px) clamp(24px, 6vw, 80px);
}
.hero-statement { width: min(940px, 92vw); }
.hero-statement h1 {
  font-size: clamp(2.2rem, 5.4vw, 4.2rem);
  line-height: 1.04;
  font-weight: 500;
  margin: 0 0 0.5em;
}
.hero-statement .lead {
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  color: var(--ink); font-weight: 400; margin: 0 0 1.4em;
}
.hero-statement .scroll-note {
  font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.04em;
  color: var(--muted); margin: 0;
}

/* ---------- story sections ---------- */
.story-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(90px, 16vh, 200px) clamp(24px, 6vw, 80px);
}
.story-section.split-reverse .story-copy { order: 2; }
.story-section.story-solo {
  grid-template-columns: 1fr;
  max-width: 820px;
  padding-top: clamp(110px, 18vh, 220px);
  padding-bottom: clamp(110px, 18vh, 220px);
}
.story-section.story-solo .story-copy h2 { font-size: clamp(1.7rem, 3.6vw, 2.9rem); }
.story-section.story-solo .story-copy p { font-size: 1.06rem; max-width: 62ch; }
.story-copy h2 {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.16; margin: 0 0 0.7em;
}
.story-copy p { color: var(--text); font-size: 1rem; }
.story-copy .ko-small { margin-top: 1em; }

/* scroll reveal for panels */
.panel-scroll { opacity: 0; transform: translateY(28px); transition: opacity 0.9s ease, transform 0.9s ease; }
.panel-scroll.is-inview { opacity: 1; transform: none; }
.brand-hero.panel-scroll, .main-landing.panel-scroll { opacity: 1; transform: none; }
/* story sections are already revealed by the checkerboard veil — a second
   slide-up on top of it reads as noise, so they only ever sit still. */
.story-section.panel-scroll { opacity: 1; transform: none; }

/* decode / block-cursor text reveal
   The scrambling text keeps its own typeface, size and weight so nothing
   reflows while it resolves — only the glyphs themselves change. */
.is-decoding {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-variant-ligatures: none;
  word-break: normal;
}

.decode-line { display: block; }
.decode-glyphs { white-space: pre-wrap; }
.decode-cursor {
  display: inline-block;
  width: 0.42em;
  height: 0.96em;
  margin-left: 0.16em;
  vertical-align: -0.1em;
  background: var(--ink);
  transform-origin: left center;
  animation:
    cursorUnfold 0.62s cubic-bezier(0.22, 1, 0.36, 1) both,
    cursorBlink 1.15s steps(2, start) 0.62s infinite;
}
/* thin tall bar that stretches in, then unfolds into a solid block */
@keyframes cursorUnfold {
  0%   { transform: scaleX(0.12) scaleY(1.5); opacity: 0; }
  26%  { transform: scaleX(0.12) scaleY(1.5); opacity: 1; }
  100% { transform: scaleX(1) scaleY(1); opacity: 1; }
}
@keyframes cursorBlink {
  0%, 56%   { opacity: 1; }
  60%, 100% { opacity: 0.2; }
}
/* once a line has fully resolved its cursor folds away again */
.decode-line.is-locked .decode-cursor {
  animation: cursorFold 0.34s cubic-bezier(0.4, 0, 0.9, 0.4) both;
}
@keyframes cursorFold {
  from { transform: scaleX(1) scaleY(1); opacity: 1; }
  to   { transform: scaleX(0.12) scaleY(1.4); opacity: 0; }
}

/* checkerboard transition veil */
.checker-veil {
  position: absolute;
  inset: 0;
  display: grid;
  z-index: 3;
  pointer-events: none;
}
.checker-veil .ck {
  background: var(--bg);
  opacity: 1;
  transition: opacity 0.5s cubic-bezier(0.33, 0, 0.2, 1);
  will-change: opacity;
}
.checker-veil.is-clear { pointer-events: none; }
.checker-veil.is-clear .ck { opacity: 0; }

/* layer-stack / appendix-map decorative lists */
/* Hairline-ruled index rather than filled cards — the boxed, rounded panels
   read as generic UI chrome against an otherwise poster-like page. */
.layer-stack, .appendix-map {
  display: grid; gap: 0;
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.08em;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
}
.appendix-map { grid-template-columns: 1fr; }
.layer-stack span, .appendix-map div {
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.layer-stack span:first-child, .appendix-map div:first-child { color: var(--ink); }

/* =====================================================================
   INPUT FORM
   ===================================================================== */
/* The form is the one place the visitor acts, so it sits alone in the middle of
   the column at full width rather than beside a block of copy.
   Nothing here is drawn with a stroke: every region is described by a soft
   feathered wash of ink over graphite, which is all the palette allows. */
.input-section {
  display: block;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(90px, 16vh, 200px) clamp(20px, 5vw, 40px) clamp(120px, 20vh, 240px);
  text-align: center;
}
.input-intro { margin: 0 auto clamp(38px, 6vh, 68px); max-width: 34ch; }
.input-intro h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.14; margin: 0 0 0.7em;
}
.input-intro .ko-small { margin: 0; }

.codex-card {
  position: relative;
  background: none;
  border: 0;
  border-radius: 0;
  padding: clamp(26px, 4vw, 44px);
  display: grid;
  gap: clamp(20px, 3vw, 30px);
  text-align: left;
}
/* the feathered field that stands in for a card outline */
.codex-card::before {
  content: '';
  position: absolute; inset: 2% 1%;
  border-radius: 48px;
  background: rgba(237,237,237,0.035);
  filter: blur(58px);
  pointer-events: none;
  z-index: -1;
}

.field { display: grid; gap: 10px; border: 0; margin: 0; padding: 0; }
.field > span, .field legend {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); padding: 0;
}
.field-well { position: relative; display: block; }
.field-well::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 16px;
  background: rgba(237,237,237,0.095);
  filter: blur(9px);
  pointer-events: none;
  transition: background 0.25s ease;
}
.field-well:focus-within::before { background: rgba(237,237,237,0.15); }
.field input[type="text"] {
  position: relative;
  width: 100%;
  border: 0;
  background: none;
  border-radius: 12px;
  padding: 17px 20px;
  color: var(--ink);
  font-family: var(--sans); font-size: 1.12rem;
}
.field input::placeholder { color: var(--dim); }
.field input[type="text"]:focus { outline: none; }

/* ---------- on-screen keypad ---------- */
.keypad { display: grid; gap: 7px; justify-items: center; }
.keypad-row { display: flex; gap: 7px; justify-content: center; flex-wrap: nowrap; }
.key {
  flex: 0 0 auto;
  min-width: 2.15em;
  padding: 10px 0;
  border: 0; border-radius: 8px;
  background: rgba(237,237,237,0.055);
  color: var(--text);
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.key:hover { background: rgba(237,237,237,0.13); color: var(--ink); }
.key:active { background: rgba(237,237,237,0.22); }
.key.key-wide { min-width: 5.4em; }

/* ---------- gender ---------- */
.gender-field { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.gender-field legend { flex: 1 0 100%; margin-bottom: 6px; text-align: left; }
.gender-field label {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border: 0; border-radius: 10px;
  background: rgba(237,237,237,0.045);
  color: var(--text); font-size: 0.94rem; cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.gender-field input[type="radio"] { accent-color: var(--ink); }
.gender-field label:has(input:checked) { background: rgba(237,237,237,0.14); color: var(--ink); }

/* ---------- date steppers ---------- */
.steppers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stepper {
  position: relative;
  display: grid; justify-items: center; gap: 4px;
  padding: 12px 6px;
  user-select: none;
}
.stepper::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 16px;
  background: rgba(237,237,237,0.08);
  filter: blur(9px);
  pointer-events: none;
  transition: background 0.25s ease;
}
.stepper:focus-within { outline: none; }
.stepper:focus-within::before { background: rgba(237,237,237,0.14); }
.stepper > * { position: relative; }
.step-value {
  font-family: var(--mono); font-size: 1.5rem; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.step-label {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--dim);
}
.step-btn {
  border: 0; background: none; padding: 5px 14px; cursor: pointer;
  display: grid; place-items: center; opacity: 0.55;
  transition: opacity 0.16s ease;
}
.step-btn:hover { opacity: 1; }
/* arrows are drawn, not typed: the trial font has no triangle glyphs */
.step-btn::before {
  content: ''; width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid var(--ink);
}
.step-btn.is-down::before { border-bottom: 0; border-top: 6px solid var(--ink); }

.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 17px 22px;
  background: var(--ink); color: var(--bg);
  border: none; border-radius: 10px;
  font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 500; cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
}
.primary-btn:hover { opacity: 0.86; }
.primary-btn:active { transform: translateY(1px); }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 8px;
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.12em;
  text-transform: uppercase; cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.ghost-btn:hover { background: rgba(237,237,237,0.08); border-color: var(--ink); }

/* =====================================================================
   CAMERA RITE
   ===================================================================== */
/* clean editorial camera page — big media left, text column right */
.camera-rite.is-active { min-height: 100vh; display: grid; place-items: center; padding: clamp(70px,10vh,110px) clamp(20px,5vw,64px) 50px; }
.camera-editorial {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(22px, 4vw, 64px);
  width: min(1340px, 94vw); height: min(86vh, 880px); align-items: stretch;
}
.camera-frame {
  position: relative; height: 100%; width: 100%;
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background: var(--bg-deep);
}
.camera-frame video, .camera-frame #riteCanvas {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.camera-frame video { filter: grayscale(1) contrast(1.06) brightness(0.86); opacity: 0.72; }
.camera-layer { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; }
.camera-layer.layer-a { background: radial-gradient(circle at 30% 30%, rgba(237,237,237,0.06), transparent 60%); }
.camera-layer.layer-b { background: radial-gradient(circle at 70% 70%, rgba(237,237,237,0.05), transparent 60%); }
.rite-scanline { position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(rgba(237,237,237,0.04) 0 1px, transparent 1px 4px); }
.hand-focus { position: absolute; width: 80px; height: 80px; pointer-events: none; transform: translate(-50%,-50%); }
.focus-ring { position: absolute; inset: 0; border: 1px solid var(--line-2); border-radius: 50%; }
.focus-dot { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; background: var(--ink); border-radius: 50%; transform: translate(-50%,-50%); }
.hand-code-burst { position: absolute; font-family: var(--mono); font-size: 0.7rem; color: var(--ink); pointer-events: none; }
.camera-frame-label {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 4;
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-weight: 400; font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  color: var(--ink); letter-spacing: -0.01em;
}
.frame-badge {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line-2); font-family: var(--mono); font-size: 0.66rem; color: var(--ink);
}

.camera-aside { display: flex; flex-direction: column; justify-content: space-between; height: 100%; min-width: 0; }
.camera-headline {
  font-family: var(--sans); font-weight: 300; color: var(--ink); margin: 0;
  font-size: clamp(1.9rem, 4.2vw, 3.5rem); line-height: 1.0; letter-spacing: -0.025em;
}
.camera-menu-label { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 12px; }
.rite-meta { display: grid; gap: 5px; margin: 0 0 18px; font-family: var(--mono); font-size: 0.74rem; color: var(--text); }
.rite-status-line { display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 0.76rem; color: var(--muted); margin-bottom: 8px; }
.rite-status-line strong { color: var(--ink); }
.rite-progress { height: 3px; background: rgba(237,237,237,0.12); border-radius: 3px; overflow: hidden; }
.rite-progress span { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.3s ease; }
.rite-description { color: var(--muted); font-size: 0.84rem; line-height: 1.45; margin: 16px 0 18px; max-width: 38ch; }
.rite-skip { margin-top: 2px; }
.camera-aside-foot { display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em; color: var(--dim);
  border-top: 1px solid var(--line); padding-top: 16px; }

/* =====================================================================
   ANALYSIS LANDING
   ===================================================================== */
.analysis.is-active { min-height: 100vh; display: grid; place-items: center; padding: 100px clamp(20px,5vw,60px) 70px; }
.analysis-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px,4vw,60px);
  align-items: stretch; max-width: 1280px; width: 100%;
}
.analysis-copy h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); line-height: 1.1; }
.analysis-copy .analysis-description { color: var(--text); }
.analysis-progress-block { margin: 28px 0; }
.analysis-sequence { display: grid; gap: 10px; }
.analysis-step {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 0.82rem; color: var(--dim);
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.analysis-step span { color: var(--muted); }
.analysis-step.is-active { color: var(--ink); border-color: var(--line-2); background: rgba(237,237,237,0.05); }
.analysis-step.is-active span { color: var(--ink); }

.analysis-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px 26px; display: flex; flex-direction: column;
}
.terminal-header {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px;
}
.analysis-code {
  flex: 1; margin: 0; font-family: var(--mono); font-size: 0.8rem; line-height: 1.9;
  color: var(--text); white-space: pre-wrap; min-height: 220px;
}
.analysis-gridline {
  height: 1px; margin: 16px 0; opacity: 0.16;
  background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 12px);
}
.analysis-metrics { display: grid; gap: 8px; font-family: var(--mono); font-size: 0.76rem; }
.analysis-metrics > div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.analysis-metrics code { color: var(--ink); }

/* =====================================================================
   RESULT / REPORT
   ===================================================================== */
.result { max-width: none; margin: 0; padding: 0; }
/* Anything added straight under .result must be listed here or it runs to the
   window edges: the section itself carries no padding. */
.result > .result-header,
.result > .chart-header,
.result > .report-meta-line,
.result > .report-grid,
.result > .certificate,
.result > .report-footer-tags {
  /* A hard 1280 cap left a wide screen mostly empty and squeezed the twelve
     columns into tiles too narrow to hold anything. */
  max-width: min(1120px, 92vw); margin-left: auto; margin-right: auto;
  padding-left: clamp(20px, 4vw, 56px); padding-right: clamp(20px, 4vw, 56px);
}
.result > .result-header { padding-top: clamp(56px, 9vh, 110px); }
.result > .report-footer-tags { padding-bottom: 90px; }

/* ---- full-screen poster (abx.skin colour motif fills the empty space) ---- */
.result-poster {
  position: relative; min-height: 100vh; width: 100%;
  display: grid; place-items: center; overflow: hidden;
  padding: clamp(28px, 5vh, 64px) clamp(24px, 6vw, 90px);
  border-bottom: 1px solid var(--line);
}
.poster-sheet {
  position: relative; width: 100%; max-width: 1240px; height: min(86vh, 1040px);
  background: var(--bg);
  isolation: isolate; /* give the video's mix-blend-mode a real backdrop to lighten against */
  animation: posterRise 1s cubic-bezier(.16,.84,.34,1) both;
}
@keyframes posterRise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }

.poster-headline {
  position: absolute; top: 0; left: 0; z-index: 3; margin: 0; max-width: 14ch;
  font-family: var(--sans); font-weight: 300; color: var(--ink);
  font-size: clamp(2.1rem, 5.6vw, 5.4rem); line-height: 0.98; letter-spacing: -0.018em;
}
/* the element motion video sits in the open lower-right space of the sheet.
   the clip background matches the page field, so mix-blend-mode:lighten
   dissolves the video rectangle and only the floating form remains. */
.poster-skin {
  position: absolute; z-index: 2; right: 2%; bottom: 8%;
  height: clamp(400px, 82vh, 940px); width: auto; pointer-events: none;
  object-fit: contain;
  /* The skin PNGs carry their own alpha, so there is no rectangle to hide.
     The old motion clips were opaque video with a near-background fill, which
     is why this used to need mix-blend-mode: lighten and a four-edge mask. */
}
@keyframes skinFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.poster-element-mark {
  position: absolute; z-index: 1; right: 4%; top: 30%; margin: 0;
  font-family: var(--sans); font-weight: 200; color: var(--ink);
  font-size: clamp(3rem, 10vw, 9rem); line-height: 1; letter-spacing: 0.02em;
  opacity: 0.07; text-transform: uppercase; pointer-events: none;
}
.poster-foot { position: absolute; left: 0; bottom: 0; z-index: 3; max-width: 46ch; }
.poster-keywords { display: flex; flex-wrap: wrap; gap: clamp(14px, 2vw, 30px); margin-bottom: 22px; }
.poster-keywords span {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--text);
}
.poster-logo { height: clamp(26px, 3vw, 40px); width: auto; display: block; margin-bottom: 14px; }
.poster-desc { font-family: var(--sans); font-weight: 500; font-size: clamp(0.86rem, 1.2vw, 1rem); line-height: 1.3; color: var(--text); margin: 0 0 10px; max-width: 34ch; }
.poster-tag { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em; color: var(--muted); margin: 0; }
.poster-scrollhint {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 4;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.3em; color: var(--muted);
  animation: scrollHintPulse 2.4s ease-in-out infinite;
}
@keyframes scrollHintPulse { 0%,100% { opacity: 0.3; transform: translate(-50%, 0); } 50% { opacity: 0.8; transform: translate(-50%, 6px); } }

/* ---- scroll reveal for report panels ---- */
#result .result-header,
#result .report-meta-line,
#result .panel,
#result .report-footer-tags {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.16,.84,.34,1);
}
#result .is-revealed { opacity: 1; transform: translateY(0); }

.result-header {
  display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: flex-end;
  padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px;
}
.result-header h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin: 0; }
.result-subtitle { color: var(--muted); margin: 0.4em 0 0; }
.result-actions { display: flex; gap: 12px; }

.report-meta-line {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px;
  margin-bottom: 28px; align-items: start;
}
.mono-title { font-family: var(--mono); font-size: var(--t-meta); letter-spacing: 0.06em; color: var(--ink); margin-bottom: 10px; }
.report-intro-en { color: var(--text); margin: 0 0 0.5em; }
.report-filelist { display: flex; flex-wrap: wrap; gap: 8px; align-content: start; }
.report-filelist span {
  font-family: var(--mono); font-size: var(--t-meta); padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: rgba(237,237,237,0.04);
}

.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px 24px; min-width: 0;
}
.panel-label {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 16px;
}
.ratio-panel, .interpretation-panel, .dataset-panel { grid-column: span 1; }
.disclaimer-panel { grid-column: 1 / -1; }
.panel p { color: var(--text); }
.reading-en, .reading-text { color: var(--text); }
.ko-translation { color: var(--muted); }
.small-caps { font-variant: small-caps; letter-spacing: 0.08em; color: var(--muted); font-family: var(--mono); font-size: 0.74rem; }

/* identity & data tables */
.identity-table, .dataset-table { display: grid; gap: 8px; }
.identity-row, .dataset-row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.82rem;
}
.dataset-row { grid-template-columns: 1fr auto auto; }
.identity-row span, .dataset-row span { color: var(--muted); }
.identity-row code, .dataset-row code { color: var(--ink); }
.dataset-row strong { color: var(--text); }

.data-line {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
}
.data-line code { color: var(--ink); }

/* element motif — image only, no frame */
.layer-display { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 14px; }
.layer-motif {
  flex: none; width: 96px; height: 120px; object-fit: contain; object-position: center;
  display: block; opacity: 0.95;
}
.layer-display h3 { font-size: 1rem; margin: 0.2em 0 0.4em; }

/* zodiac */
.zodiac-block { display: flex; gap: 18px; align-items: flex-start; }
.zodiac-sign {
  flex: none; font-family: var(--mono); font-weight: 600; letter-spacing: 0.08em;
  color: var(--ink); font-size: 1.1rem; padding: 14px 16px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-deep);
}

/* material — image only, no frame */
.material-display { display: flex; gap: 22px; align-items: flex-start; }
.matter-image { flex: none; width: 120px; height: 150px; object-fit: contain; object-position: center; display: block; opacity: 0.95; }
.matter-copy h3 { font-size: 1rem; }

/* token chips */
.token-cloud { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.token-cloud span {
  font-family: var(--mono); font-size: 0.72rem; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: rgba(237,237,237,0.04);
}

/* radar + ratio */
#radarChart { width: 100%; max-width: 360px; height: auto; margin: 0 auto; display: block; }
.code-ratio { font-family: var(--mono); font-size: 0.84rem; color: var(--ink); text-align: center; margin-top: 12px; letter-spacing: 0.05em; }
.ratio-bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 36px 1fr 44px; gap: 10px; align-items: center; font-family: var(--mono); font-size: 0.78rem; }
.bar-label { color: var(--muted); }
.bar-track { height: 8px; background: rgba(237,237,237,0.10); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width 1.1s cubic-bezier(.16,.84,.34,1); }
.bar-value { color: var(--ink); text-align: right; }
.reading-block.compact-reading { margin-top: 16px; }

/* disposition */
.trait-row { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.trait-row:first-of-type { border-top: 0; }
.trait-key { font-family: var(--mono); font-size: var(--t-meta); letter-spacing: 0.12em; color: var(--ink); }

.disclaimer-panel p { font-size: 0.86rem; color: var(--muted); }

.report-footer-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.report-footer-tags span {
  font-family: var(--mono); font-size: var(--t-meta); padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: rgba(237,237,237,0.04);
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
  .meta-nav { display: none; }
  .story-section, .input-section, .analysis-layout, .report-meta-line { grid-template-columns: 1fr; }
  .story-section.split-reverse .story-copy { order: 0; }
  .report-grid { grid-template-columns: 1fr; }
  .brand-hero { height: 380vh; }
  .intro-code { font-size: clamp(0.66rem, 3.2vw, 0.95rem); width: 88vw; }
  .intro-logo-text { --logo-w: 96vw; }
  .layer-display, .material-display { flex-direction: column; align-items: flex-start; }

  /* camera editorial -> stack media over text */
  .camera-editorial { grid-template-columns: 1fr; height: auto; gap: 22px; }
  .camera-frame { height: 56vh; }
  .camera-aside { gap: 26px; }
  .camera-aside-top, .camera-aside-mid { margin: 0; }

  /* poster -> let the sheet breathe, motif sits lower */
  .poster-sheet { height: auto; min-height: 86vh; }
  .poster-headline { position: static; max-width: 100%; margin-bottom: 4vh; }
  .poster-skin { position: static; display: block; margin: 2vh auto 12vh; height: clamp(220px, 40vh, 380px); }
  .poster-element-mark { display: none; }
  .poster-foot { position: static; max-width: 100%; }
}

/* =====================================================================
   PRINT — clean light report
   ===================================================================== */
/* =====================================================================
   PRINT = LABEL STICKER
   The sheet is not what gets printed. Printing emits only abx.read, the last
   layer: a small adhesive label for a label printer. Everything else is
   dropped, and the page box is set to the stock rather than to paper.
   ===================================================================== */
.abx-label { display: none; }

/* Stock is 62 x 40mm. The @page margin is what the printer honours, but the
   content also needs its own inset or descenders and the QR ride the edge. */
@page { size: 62mm 40mm; margin: 3mm; }

@media print {
  html, body {
    background: #fff !important;
    color: #444445 !important;
    width: auto; height: auto; margin: 0; padding: 0;
  }
  /* nothing from the screen sheet reaches the printer */
  body > *, main, main > * { display: none !important; }
  .grain-canvas, .grain-overlay, .corner-logo, .attract-trigger { display: none !important; }

  .abx-label {
    display: flex !important;
    align-items: flex-start;
    gap: 2.5mm;
    box-sizing: border-box;
    /* inside the 56 x 34mm the page margin leaves */
    width: 56mm; height: 34mm;
    padding: 1.5mm;
    overflow: hidden;
    position: static;
    width: 100%;
    font-family: var(--mono);
    color: #444445;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .label-body { flex: 1 1 auto; min-width: 0; }
  /* Scanning this brings the sheet back up: the payload carries the three
     inputs, so the report is regenerated rather than looked up. */
  .label-qr {
    flex: none;
    width: 15mm; height: 15mm;
    display: grid;
    grid-template-columns: repeat(var(--qr-size, 21), 1fr);
    grid-template-rows: repeat(var(--qr-size, 21), 1fr);
  }
  .label-qr span { background: none; }
  .label-qr span.is-on { background: #444445; }
  .label-top {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 6pt; letter-spacing: 0.12em; text-transform: uppercase;
  }
  .label-name {
    /* 13pt only fit about twelve characters before wrapping, and a second
       line pushed the column past the stock. This leaves room for two. */
    font-size: 11.5pt; line-height: 1.05; margin-top: 1mm;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.01em;
  }
  .label-dob { font-size: 8pt; margin-top: 0.5mm; letter-spacing: 0.06em; }
  .label-type {
    font-size: 9.5pt; margin-top: 1mm;
    letter-spacing: 0.16em; text-transform: uppercase;
  }
  .label-code { font-size: 7pt; margin-top: 0.5mm; letter-spacing: 0.06em; }
  .label-barcode {
    display: flex; align-items: flex-end; height: 4.5mm; margin-top: 1mm;
  }
  .label-barcode span { display: block; height: 100%; background: #444445; }
  .label-barcode span.is-gap { background: none; }
  .label-id { font-size: 5.5pt; margin-top: 0.8mm; letter-spacing: 0.08em; }
}


/* ---------- attract-sequence trigger ----------
   A dot in the bottom-right corner: quiet enough that a visitor reads it as
   punctuation rather than a control, but solid enough to actually find.
   At 0.10 alpha it resolved to (85,85,86) against a (68,68,69) ground -- a
   17-step difference on an 11px dot, with grain drawn over the top of it. That
   is not subtle, it is invisible. */
.attract-trigger {
  position: fixed;
  right: clamp(12px, 1.4vw, 20px);
  bottom: clamp(12px, 1.4vw, 20px);
  z-index: 70;
  width: 13px; height: 13px;
  padding: 0; margin: 0; border: 0; border-radius: 50%;
  background: rgba(237,237,237,0.34);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}
.attract-trigger:hover { background: rgba(237,237,237,0.85); transform: scale(1.3); }
.attract-trigger:focus-visible { outline: 1px solid rgba(237,237,237,0.6); outline-offset: 3px; }
.attract-trigger.is-playing { background: rgba(237,237,237,1); }


/* =====================================================================
   UNIFIED SURFACE LANGUAGE
   The form was rebuilt with no strokes at all -- every region described by a
   soft feathered wash -- while the camera, analysis and result views were still
   drawn with 1px outlines and filled cards. This section brings them onto the
   same footing: nothing here is drawn with a border.
   ===================================================================== */

/* ---- the result poster wants a clean ground ----
   The poster sheet paints solid --bg, so the fixed grain behind it stops dead
   at the sheet's edge and reads as a seam. Both grain layers step aside for the
   whole result view rather than trying to match it. */
body:has(#result.is-active) .grain-canvas,
body:has(#result.is-active) .grain-overlay {
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* ---- feathered surfaces, in place of filled and outlined cards ---- */
.analysis-panel, .panel {
  position: relative;
  background: none;
  border: 0;
  border-radius: 0;
}
.analysis-panel::before, .panel::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 20px;
  background: rgba(237,237,237,0.05);
  filter: blur(16px);
  pointer-events: none;
}
.analysis-panel > *, .panel > * { position: relative; }

/* the camera image dissolves into the page instead of sitting in a frame */
.camera-frame {
  border: 0;
  background: none;
  border-radius: 0;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-composite: intersect;
}

/* ---- chips and pills: same weight as the form's keypad keys ---- */
.token-cloud span,
.report-filelist span,
.report-footer-tags span,
.analysis-step,
.zodiac-sign,
.frame-badge,
.gender-field label,
.key {
  border: 0;
  background: rgba(237,237,237,0.055);
  border-radius: 8px;
}
.analysis-step.is-active,
.zodiac-sign { background: rgba(237,237,237,0.11); }
.ghost-btn { border: 0; background: rgba(237,237,237,0.08); }
.ghost-btn:hover { background: rgba(237,237,237,0.16); }

/* ---- rules that fade out at their ends, rather than hairlines ---- */
.identity-row, .dataset-row, .result-header, .terminal-header {
  border-bottom: 0;
  background-image: linear-gradient(90deg,
    transparent, rgba(237,237,237,0.13) 10%, rgba(237,237,237,0.13) 90%, transparent);
  background-size: 100% 1px;
  background-position: bottom;
  background-repeat: no-repeat;
}
.data-line, .trait-row, .report-footer {
  border-top: 0;
  background-image: linear-gradient(90deg,
    transparent, rgba(237,237,237,0.13) 10%, rgba(237,237,237,0.13) 90%, transparent);
  background-size: 100% 1px;
  background-position: top;
  background-repeat: no-repeat;
}
.trait-row:first-of-type { background-image: none; }


/* =====================================================================
   DIAGNOSTIC SHEET
   Reference ranges, the contradiction index, the specimen plate and the
   certificate. Same rule as everything else: no strokes, only feathered
   washes of ink over graphite.
   ===================================================================== */

/* ---- (1) reference ranges on the ratio bars ---- */
.bar-row { grid-template-columns: 34px 1fr 60px 40px; }
.bar-track { position: relative; overflow: visible; }
/* the population band, drawn onto the track so the row reads as a lab result */
.bar-ref {
  position: absolute; top: -3px; bottom: -3px;
  background: rgba(237,237,237,0.11);
  border-radius: 3px;
  pointer-events: none;
}
.bar-fill { position: relative; }
.bar-value { font-variant-numeric: tabular-nums; }
.bar-flag {
  font-size: var(--t-label); letter-spacing: 0.1em; text-align: right;
  color: var(--dim);
}
.bar-flag.is-low, .bar-flag.is-high { color: var(--ink); }

/* ---- (2) contradiction index ---- */
.ci-readout { display: flex; align-items: flex-end; gap: clamp(16px, 3vw, 30px); }
.ci-figure { display: flex; align-items: baseline; gap: 8px; flex: none; }
.ci-value {
  font-family: var(--mono); font-size: var(--t-figure);
  line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums;
}
.ci-scale { font-family: var(--mono); font-size: var(--t-label); color: var(--dim); letter-spacing: 0.1em; }
.ci-meta { flex: 1 1 auto; min-width: 0; }
.ci-meter {
  display: block; height: 6px; border-radius: 4px;
  background: rgba(237,237,237,0.10); overflow: hidden; margin-bottom: 12px;
}
.ci-meter-fill {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, rgba(237,237,237,0.25), rgba(237,237,237,0.85));
  transition: width 1.4s cubic-bezier(.16,.84,.34,1);
}

/* ---- (3) specimen plate ---- */
.plate-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
  overflow: hidden;
}
.plate-specimen {
  max-width: 58%; max-height: 82%;
  object-fit: contain;
  opacity: 0.9;
}
/* a single pass across the specimen, the way a scan reads a plate */
.plate-scan {
  position: absolute; left: 0; right: 0; height: 26%;
  top: -30%;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(237,237,237,0) 0%, rgba(237,237,237,0.16) 45%,
    rgba(237,237,237,0.16) 55%, rgba(237,237,237,0) 100%);
  opacity: 0;
}
.plate-panel.is-scanning .plate-scan { animation: plateScan 2.1s cubic-bezier(.4,0,.2,1) 0.25s both; }
@keyframes plateScan {
  0%   { top: -30%; opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { top: 104%; opacity: 0; }
}
.plate-notes { position: absolute; inset: 0; pointer-events: none; }
.plate-note {
  position: absolute; display: flex; align-items: center; gap: 8px;
  transform: translateY(-50%);
  font-family: var(--mono); font-size: var(--t-label); letter-spacing: 0.12em;
  color: var(--muted); text-transform: uppercase;
}
.plate-note.is-right { left: 52%; right: 3%; }
.plate-note.is-left { right: 52%; left: 3%; flex-direction: row-reverse; }
/* the leader uses the same fading rule as every other divider on the sheet */
.plate-lead {
  flex: 1 1 auto; height: 1px;
  background: linear-gradient(90deg,
    rgba(237,237,237,0.32), rgba(237,237,237,0.06));
}
.plate-note.is-left .plate-lead {
  background: linear-gradient(270deg, rgba(237,237,237,0.32), rgba(237,237,237,0.06));
}
.plate-label { flex: none; white-space: nowrap; }

/* ---- (5) certificate ---- */
.certificate {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: clamp(20px, 4vw, 48px);
  margin-top: 34px; padding-top: 26px;
  background-image: linear-gradient(90deg,
    transparent, rgba(237,237,237,0.13) 10%, rgba(237,237,237,0.13) 90%, transparent);
  background-size: 100% 1px;
  background-position: top;
  background-repeat: no-repeat;
}
.cert-block { flex: 1 1 240px; min-width: 0; }
.cert-barcode {
  flex: 1 1 200px;
  display: flex; align-items: flex-end; height: 46px; gap: 0;
  opacity: 0.85;
}
.cert-barcode span { display: block; height: 100%; background: var(--ink); }
.cert-barcode span.is-gap { background: none; }
.cert-stamp { flex: none; width: 110px; height: 110px; opacity: 0.72; }
.cert-stamp svg { width: 100%; height: 100%; overflow: visible; }
.cert-stamp circle { fill: none; stroke: rgba(237,237,237,0.5); stroke-width: 1; }
.cert-stamp text {
  fill: var(--ink); font-family: var(--mono);
  font-size: 9px; letter-spacing: 0.16em; text-anchor: middle;
}
.cert-stamp .cert-stamp-core { font-size: 20px; letter-spacing: 0; }

@media (max-width: 900px) {
  .ci-readout { flex-direction: column; align-items: stretch; gap: 16px; }
  .certificate { gap: 22px; }
  .plate-note { font-size: 0.6rem; }
}


/* ---- chart masthead: the sheet reads as a record, not an article ---- */
.chart-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 2px 26px;
  margin: 0 0 28px;
  padding: 16px 0;
  background-image:
    linear-gradient(90deg, transparent, rgba(237,237,237,0.13) 8%, rgba(237,237,237,0.13) 92%, transparent),
    linear-gradient(90deg, transparent, rgba(237,237,237,0.13) 8%, rgba(237,237,237,0.13) 92%, transparent);
  background-size: 100% 1px, 100% 1px;
  background-position: top, bottom;
  background-repeat: no-repeat;
}
.chart-field {
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--mono); font-size: var(--t-meta); padding: 5px 0;
}
.chart-field.is-wide { grid-column: 1 / -1; }
.chart-field span {
  flex: none; min-width: 74px;
  font-size: var(--t-label); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dim);
}
.chart-field code { color: var(--ink); letter-spacing: 0.04em; }

/* ---- the index shows its working ---- */
.ci-parts { margin-top: 18px; }
.ci-note {
  font-family: var(--mono); font-size: var(--t-meta); line-height: 1.75;
  color: var(--muted); margin: 14px 0 0; max-width: 68ch;
}
.ci-note.ko-translation { font-family: var(--sans); font-size: var(--t-body); }


/* =====================================================================
   FACE SCAN
   The middle step is held to the opening sequence's tone: centred, mono,
   feathered, no strokes. The camera image dissolves into the page rather
   than sitting in a frame, and the reticle is drawn, never a glyph.
   ===================================================================== */
.camera-rite.is-active { display: grid; place-items: center; min-height: 100vh; }
.scan-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: clamp(26px, 4vh, 46px);
  width: min(760px, 90vw);
  padding: clamp(40px, 8vh, 90px) 0;
  text-align: center;
}
.scan-frame {
  position: relative;
  width: min(430px, 74vw);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  /* same cross-feather the opening uses, so the image has no edge */
  /* Asymmetric on purpose: the top edge is a clean feather, the bottom half
     dissolves progressively so the image sinks into the page instead of
     stopping at a line. */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 9%, #000 46%,
      rgba(0,0,0,0.55) 72%, rgba(0,0,0,0.18) 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 9%, #000 46%,
      rgba(0,0,0,0.55) 72%, rgba(0,0,0,0.18) 88%, transparent 100%);
  mask-composite: intersect;
}
.scan-frame video, .scan-frame canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transform: scaleX(-1);
}
.scan-frame video { filter: grayscale(1) contrast(1.05) brightness(0.8); opacity: 0.66; }

/* an oval sat where a face goes, drawn with a soft ring rather than a border */
.scan-reticle {
  position: absolute; left: 50%; top: 46%;
  width: 54%; aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(237,237,237,0.28), 0 0 34px rgba(237,237,237,0.10) inset;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(.16,.84,.34,1);
  pointer-events: none;
}
/* states the tracker actually sets */
.scan-reticle.is-detected {
  box-shadow: 0 0 0 1px rgba(237,237,237,0.62), 0 0 46px rgba(237,237,237,0.14) inset;
}
.scan-reticle.is-open { transform: translate(-50%, -50%) scale(1.04); }
.scan-reticle.is-closed { transform: translate(-50%, -50%) scale(0.97); }

/* one band travelling down the frame, on a loop while the scan runs */
.scan-sweep {
  position: absolute; left: 0; right: 0; height: 22%;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(237,237,237,0) 0%, rgba(237,237,237,0.16) 50%, rgba(237,237,237,0) 100%);
  animation: scanSweep 3.4s cubic-bezier(.5,0,.5,1) infinite;
}
@keyframes scanSweep {
  0% { top: -24%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { top: 102%; opacity: 0; }
}
.scan-burst { position: absolute; inset: 0; pointer-events: none; }

.scan-readout { width: min(430px, 74vw); display: grid; gap: 14px; }
.scan-title {
  font-size: clamp(1.15rem, 2.4vw, 1.7rem); line-height: 1.22; margin: 0;
  color: var(--ink);
}
.scan-note { font-size: 0.78rem; color: var(--dim); margin: 0; }
.scan-readout .rite-meta { justify-items: center; text-align: center; }
.scan-readout .rite-status-line { justify-content: center; gap: 12px; }
.scan-readout .rite-progress { margin: 0 auto; width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .scan-sweep { animation: none; opacity: 0.5; top: 40%; }
}


/* =====================================================================
   SCAN RIG
   A measuring instrument rather than an outline: rings, crosshair, corner
   brackets and a rotating radar wipe.
   ===================================================================== */
.scan-rig {
  position: absolute; left: 50%; top: 46%;
  width: 62%; aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.scan-rig > * { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.scan-ring { border-radius: 50%; box-shadow: 0 0 0 1px rgba(237,237,237,0.16); }
.scan-ring.r1 { width: 100%; height: 100%; }
.scan-ring.r2 { width: 74%; height: 74%; box-shadow: 0 0 0 1px rgba(237,237,237,0.10); }
.scan-ring.r3 { width: 46%; height: 46%; box-shadow: 0 0 0 1px rgba(237,237,237,0.22); }
.scan-cross { background: rgba(237,237,237,0.18); }
.scan-cross.v { width: 1px; height: 104%; }
.scan-cross.h { width: 104%; height: 1px; }
/* corner brackets, drawn with borders on a transparent box */
.scan-corner { width: 14px; height: 14px; }
.scan-corner.tl { transform: translate(-50%, -50%) translate(-31%, -31%) scale(1); border-left: 1px solid rgba(237,237,237,0.5); border-top: 1px solid rgba(237,237,237,0.5); }
.scan-corner.tr { transform: translate(-50%, -50%) translate(31%, -31%); border-right: 1px solid rgba(237,237,237,0.5); border-top: 1px solid rgba(237,237,237,0.5); }
.scan-corner.bl { transform: translate(-50%, -50%) translate(-31%, 31%); border-left: 1px solid rgba(237,237,237,0.5); border-bottom: 1px solid rgba(237,237,237,0.5); }
.scan-corner.br { transform: translate(-50%, -50%) translate(31%, 31%); border-right: 1px solid rgba(237,237,237,0.5); border-bottom: 1px solid rgba(237,237,237,0.5); }
/* the sweep hand */
.scan-radar {
  width: 100%; height: 100%; border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(237,237,237,0.20) 0deg, rgba(237,237,237,0) 46deg, rgba(237,237,237,0) 360deg);
  animation: scanRadar 3.6s linear infinite;
}
@keyframes scanRadar { to { transform: translate(-50%, -50%) rotate(360deg); } }
.scan-reticle { width: 54%; height: 68%; }

/* measurement ticks down the right edge of the frame */
.scan-ticks {
  position: absolute; right: 8%; top: 16%; bottom: 16%;
  width: 18px; pointer-events: none;
  display: flex; flex-direction: column; justify-content: space-between;
}
.scan-ticks span { display: block; height: 1px; background: rgba(237,237,237,0.28); }
.scan-ticks span.is-major { background: rgba(237,237,237,0.6); }

@media (prefers-reduced-motion: reduce) { .scan-radar { animation: none; } }


/* =====================================================================
   POINTER BLOOM
   A soft lens that follows the cursor and lifts the grain under it. The
   texture is already there; this only changes how much of it you can see,
   which is why it costs a transform and nothing else.
   ===================================================================== */
.pointer-bloom {
  position: fixed;
  left: 0; top: 0;
  width: 46vmax; height: 46vmax;
  margin: -23vmax 0 0 -23vmax;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(closest-side,
    rgba(237,237,237,0.075), rgba(237,237,237,0.03) 46%, rgba(237,237,237,0) 78%);
  filter: blur(28px);
  transition: opacity 0.7s ease;
  will-change: transform;
}
.pointer-bloom.is-live { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .pointer-bloom { display: none; } }


/* =====================================================================
   SHEET LAYOUT
   Cards on an open grid rather than a dense two-column block: a few pieces
   run the full width and carry the reading, the rest sit as tiles. The
   graphics and the motion do the work; the prose sits under them.
   ===================================================================== */
/* One column at every width. The multi-column arrangement only held together
   below 900px, where it collapsed to this anyway -- so this is the layout the
   sheet was actually designed around. Margins either side are fine. */
.report-grid {
  grid-template-columns: 1fr;
  gap: clamp(18px, 2.4vw, 34px);
  align-items: start;
}

.panel { padding: clamp(24px, 2.6vw, 40px); }
.panel-label {
  font-size: var(--t-label); letter-spacing: 0.22em;
  margin-bottom: clamp(16px, 2vw, 26px);
}

/* the overall reading is the one place the sheet speaks plainly, so it is set
   larger than the clinical copy around it */
.overview-text {
  font-size: var(--t-read);
  line-height: 1.72; margin: 0; max-width: 74ch;
  color: var(--ink);
}
.overview-text.is-en {
  margin-top: 1.1em;
  font-family: var(--mono); font-size: var(--t-meta); line-height: 1.9;
  color: var(--muted); max-width: 92ch;
}

/* ---- the ABX.GENE specimen ---- */
.gene-plate {
  position: relative; margin: 0 0 22px;
  aspect-ratio: 1 / 1; width: 100%;
  border-radius: 22px; overflow: hidden;
}
.gene-plate-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0.8;
  filter: grayscale(0.35) contrast(1.06) brightness(0.92);
}
/* a specimen grid over the section, the way a graticule sits in an eyepiece */
.gene-plate-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(237,237,237,0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237,237,237,0.09) 1px, transparent 1px);
  background-size: 11% 11%;
  mix-blend-mode: overlay;
}
.gene-plate-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between;
  padding: 12px 14px;
  font-family: var(--mono); font-size: var(--t-label); letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink);
  background: linear-gradient(180deg, rgba(68,68,69,0), rgba(68,68,69,0.72));
}

/* The panels already have a reveal: #result .panel starts at opacity 0 and the
   IntersectionObserver adds .is-revealed as each scrolls in -- and that same
   observer is what fires animateRadar and animateBars. An extra rule here that
   showed every panel as soon as the sheet opened outranked .is-revealed, so the
   graphs ran while nobody was looking at them. Do not add one. */




/* =====================================================================
   ABX.FRAME - the skeleton
   The element hanja drawn as an X-ray of internal structure: an outline with
   no fill, lit from within, with a scan band crossing it. Scale is carried by
   the stroke -- a large frame is heavy, a small one is fine.
   ===================================================================== */
.frame-xray {
  position: relative;
  flex: none;
  width: clamp(120px, 13vw, 190px);
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background: radial-gradient(closest-side,
    rgba(237,237,237,0.07), rgba(237,237,237,0.02) 62%, rgba(237,237,237,0) 100%);
}
.frame-hanja {
  font-size: clamp(64px, 8vw, 112px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(237,237,237,0.55);
  text-shadow: 0 0 26px rgba(237,237,237,0.22);
  transition: -webkit-text-stroke-width 0.6s ease;
}
/* large scale: a heavier skeleton, and a faint fill so it reads as dense bone */
.frame-xray.is-large .frame-hanja {
  -webkit-text-stroke-width: 2.4px;
  color: rgba(237,237,237,0.08);
  text-shadow: 0 0 34px rgba(237,237,237,0.3);
}
/* the exposure band */
.frame-scan {
  position: absolute; left: 0; right: 0; height: 34%;
  background: linear-gradient(180deg,
    rgba(237,237,237,0) 0%, rgba(237,237,237,0.13) 50%, rgba(237,237,237,0) 100%);
  animation: frameScan 4.6s cubic-bezier(.5,0,.5,1) infinite;
  pointer-events: none;
}
@keyframes frameScan { 0% { top: -36%; } 100% { top: 104%; } }
.frame-scale {
  position: absolute; left: 0; right: 0; bottom: 10px;
  text-align: center;
  font-family: var(--mono); font-size: var(--t-label);
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
@media (prefers-reduced-motion: reduce) { .frame-scan { animation: none; top: 33%; } }


/* panel headings and body copy sit on the same scale as everything else */
.panel h3, .layer-display h3 { font-size: var(--t-title); line-height: 1.24; }
.panel .reading-en, .panel .panel-body { font-size: var(--t-meta); line-height: 1.85; }
.panel .ko-translation, .panel p { font-size: var(--t-body); line-height: 1.78; }
.panel .small-caps { font-size: var(--t-label); letter-spacing: 0.16em; }


/* the scan readout sits under the reticle, fixed. It used to be positioned at
   the motion centroid, which read as hand tracking rather than a face scan. */
.scan-burst {
  position: absolute; left: 50%; bottom: 12%;
  transform: translateX(-50%);
  width: 84%; text-align: center;
  font-family: var(--mono); font-size: var(--t-label);
  letter-spacing: 0.08em; color: var(--ink);
  text-shadow: 0 0 18px rgba(68,68,69,0.9);
  pointer-events: none;
}


/* =====================================================================
   GLASS CONTROLS
   Frosted rather than filled: the grain and whatever sits behind stays
   visible through them. No stroke -- the edge is an inset highlight, which
   keeps it inside the two-colour palette.
   ===================================================================== */
.ghost-btn,
.key,
.gender-field label,
.stepper,
.attract-trigger {
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  background: rgba(237,237,237,0.07);
  box-shadow:
    inset 0 1px 0 rgba(237,237,237,0.16),
    inset 0 -1px 0 rgba(68,68,69,0.22);
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}
.ghost-btn:hover,
.key:hover,
.gender-field label:hover {
  background: rgba(237,237,237,0.14);
  box-shadow:
    inset 0 1px 0 rgba(237,237,237,0.3),
    inset 0 -1px 0 rgba(68,68,69,0.26);
}
.ghost-btn:active, .key:active { transform: translateY(1px); }
.gender-field label:has(input:checked) {
  background: rgba(237,237,237,0.2);
  box-shadow:
    inset 0 1px 0 rgba(237,237,237,0.42),
    inset 0 -1px 0 rgba(68,68,69,0.28);
}
/* the submit stays solid ink -- it is the one control that must not recede */
.primary-btn {
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28);
}
/* backdrop-filter needs something behind it to be worth anything */
.stepper::before { background: rgba(237,237,237,0.045); }
