/* Dark Current: darkroom under safelight.
   No external requests: fonts are self-hosted (EB Garamond, OFL; see /fonts/OFL.txt),
   grain is an inline SVG data URI, everything else is CSS. */

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/ebgaramond-roman.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/ebgaramond-italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #0B0809;
  --ink-2: #140E0F;
  --ink-3: #1E1516;
  --safe: #E8392A;
  --safe-glow: rgba(232, 57, 42, 0.32);
  --safe-line: rgba(232, 57, 42, 0.28);
  --paper: #ECE2D4;
  --text: #E4D8CA;
  --muted: #A3948A;
  --faint: #6E615A;
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 66ch;
  color-scheme: dark;
}

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

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--serif);
  font-size: clamp(1.125rem, 1.02rem + 0.35vw, 1.3rem);
  line-height: 1.55;
  font-variant-numeric: oldstyle-nums proportional-nums;
  color: var(--text);
  background:
    radial-gradient(120vmax 80vmax at 8% -10%, rgba(232, 57, 42, 0.16), transparent 55%),
    radial-gradient(60vmax 50vmax at 110% 30%, rgba(232, 57, 42, 0.06), transparent 60%),
    var(--ink);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Film grain: fractal noise, fixed over everything, never intercepts input. */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.11;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.85 0 0 0 0 0.8 0 0 0 1.1 -0.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  17%  { transform: translate(-3%, 2%); }
  33%  { transform: translate(2%, -4%); }
  50%  { transform: translate(-4%, -1%); }
  67%  { transform: translate(3%, 3%); }
  83%  { transform: translate(-1%, 4%); }
  100% { transform: translate(0, 0); }
}

::selection { background: var(--safe); color: var(--ink); }

a { color: var(--text); text-decoration-color: var(--safe); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: #fff; text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--safe); outline-offset: 4px; border-radius: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.grain-layer { mix-blend-mode: overlay; }

.skip {
  position: absolute; left: var(--gutter); top: -100px;
  font-family: var(--mono); font-size: 0.8rem;
  background: var(--safe); color: var(--ink); padding: 0.5em 0.8em; z-index: 60;
}
.skip:focus { top: 12px; }

.mono, .label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variant-numeric: normal;
}
.label { color: var(--safe); }

/* ---------- Header ---------- */

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 22px var(--gutter);
  max-width: 1240px; margin: 0 auto;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 0.7rem;
  text-decoration: none;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--text);
}
.lamp {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--safe);
  box-shadow: 0 0 6px 1px var(--safe), 0 0 22px 6px var(--safe-glow);
  animation: lamp 6s ease-in-out infinite;
}
@keyframes lamp { 0%, 100% { opacity: 1; } 47% { opacity: 1; } 49% { opacity: 0.55; } 51% { opacity: 1; } }
.site-nav { display: flex; gap: clamp(0.9rem, 3vw, 2rem); }
.site-nav a {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { box-shadow: 0 1px 0 var(--safe); }

/* ---------- Hero ---------- */

main { display: block; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  padding-top: clamp(1.5rem, 6vh, 5rem);
  padding-bottom: clamp(3rem, 10vh, 7rem);
}
.hero h1 {
  font-weight: 400; font-style: italic;
  font-size: clamp(2.7rem, 1.4rem + 5.4vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0.4em 0 0.35em;
  color: var(--paper);
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--safe); }
.hero .lede { max-width: 34ch; color: var(--text); margin: 0 0 2rem; font-size: 1.12em; }
.hero .lede strong { font-weight: 500; color: var(--paper); }

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; }

/* Placeholder until the App Store URL exists. Replace with Apple's official
   "Download on the App Store" badge artwork (Apple Marketing Resources) when live. */
.store-badge {
  display: inline-flex; align-items: center; gap: 0.75rem;
  padding: 0.62rem 1.15rem 0.62rem 0.95rem;
  border: 1px solid rgba(236, 226, 212, 0.55);
  border-radius: 10px;
  background: #000;
  color: #fff; text-decoration: none;
  line-height: 1.1;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.store-badge:hover { color: #fff; border-color: var(--safe); box-shadow: 0 0 0 4px rgba(232, 57, 42, 0.15); }
.store-badge svg { width: 22px; height: 22px; flex: none; }
.store-badge small { display: block; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: #cfc6bd; }
.store-badge span { font-family: var(--serif); font-size: 1.2rem; }
.price-note { color: var(--muted); font-size: 0.95rem; margin: 0; max-width: 30ch; }
.price-note b { color: var(--text); font-weight: 500; }

/* The print: an undeveloped frame that develops on hover or focus (tap on iPhone). */
.print {
  position: relative;
  margin: 0;
  justify-self: center;
  width: min(100%, 440px);
  transform: rotate(1.6deg);
}
.print-frame {
  display: block;
  position: relative;
  padding: 14px 14px 58px;
  background: #E9E0D2;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.9),
    0 0 80px -10px rgba(232, 57, 42, 0.35);
  cursor: crosshair;
  outline-offset: 8px;
}
/* Safelight wash over the paper itself. */
.print-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(160deg, rgba(232, 57, 42, 0.28), rgba(232, 57, 42, 0.12));
  mix-blend-mode: multiply;
}
.print-frame svg { display: block; width: 100%; height: auto; }
.scene {
  filter: brightness(0.5) contrast(0.82) saturate(0.6);
  transition: filter 2.6s cubic-bezier(.2,.7,.2,1);
  animation: develop-in 3.2s 0.5s cubic-bezier(.3,.6,.2,1) both;
}
.ghost { opacity: 0.05; transition: opacity 3.4s 0.4s cubic-bezier(.3,.6,.2,1); }
@keyframes develop-in { from { opacity: 0; } to { opacity: 1; } }

.print-frame:hover .scene, .print-frame:focus .scene {
  filter: brightness(1.32) contrast(1.18) saturate(0.9);
}
.print-frame:hover .ghost, .print-frame:focus .ghost { opacity: 0.92; }

.print-caption {
  position: absolute; left: 14px; right: 14px; bottom: 16px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #4a3a35;
}
.print-caption .state-on { display: none; color: #9b231a; }
.print-frame:hover .state-off, .print-frame:focus .state-off { display: none; }
.print-frame:hover .state-on, .print-frame:focus .state-on { display: inline; }
.tape {
  position: absolute; top: -14px; left: 50%; width: 110px; height: 28px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(236, 226, 212, 0.18);
  border-left: 1px dashed rgba(236, 226, 212, 0.2);
  border-right: 1px dashed rgba(236, 226, 212, 0.2);
  backdrop-filter: blur(1px);
}

/* Staggered entrance */
.rise { animation: rise 1s cubic-bezier(.2,.7,.2,1) both; }
.d1 { animation-delay: 0.1s; } .d2 { animation-delay: 0.25s; } .d3 { animation-delay: 0.45s; } .d4 { animation-delay: 0.65s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Film strip: how it plays ---------- */

.section { padding-block: clamp(3rem, 9vh, 6.5rem); }
.section-head { display: flex; align-items: baseline; gap: 1.2rem; margin-bottom: 2.2rem; }
.section-head h2 {
  margin: 0; font-weight: 400; font-style: italic;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.4rem); line-height: 1; color: var(--paper);
}
.rule { flex: 1; height: 1px; background: var(--safe-line); align-self: center; }

.strip {
  --hole: rgba(11, 8, 9, 1);
  position: relative;
  margin: 0; padding: 38px 0;
  list-style: none;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #1a0f0e;
  border-top: 1px solid rgba(232, 57, 42, 0.18);
  border-bottom: 1px solid rgba(232, 57, 42, 0.18);
  box-shadow: 0 0 60px -20px rgba(232, 57, 42, 0.4) inset;
}
/* Sprocket holes, top and bottom */
.strip::before, .strip::after {
  content: ""; position: absolute; left: 0; right: 0; height: 14px;
  background-image: linear-gradient(90deg, transparent 0 9px, var(--hole) 9px 23px, transparent 23px 32px);
  background-size: 32px 14px;
  border-radius: 2px;
  opacity: 0.95;
}
.strip::before { top: 12px; }
.strip::after { bottom: 12px; }

.frame {
  position: relative;
  margin: 0 7px;
  padding: clamp(1.4rem, 3vw, 2.2rem) clamp(1.1rem, 2.6vw, 2rem) clamp(1.6rem, 3vw, 2.4rem);
  background: linear-gradient(180deg, #0f0a0a, #0b0809);
  border: 1px solid rgba(232, 57, 42, 0.12);
  min-height: 100%;
}
.frame .edge {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.2em; color: rgba(232, 57, 42, 0.75);
  margin-bottom: 1.4rem;
}
.frame svg { width: 54px; height: 54px; color: var(--safe); margin-bottom: 1rem; }
.frame h3 { margin: 0 0 0.4rem; font-weight: 500; font-size: 1.55rem; color: var(--paper); line-height: 1.15; }
.frame p { margin: 0; color: var(--muted); font-size: 1.02rem; }

/* ---------- Statements ---------- */

.split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem); align-items: start;
}
.statement {
  margin: 0;
  font-style: italic; font-weight: 400;
  font-size: clamp(2.3rem, 1.2rem + 4vw, 4.6rem); line-height: 1;
  color: var(--paper);
  text-wrap: balance;
}
.statement span { color: var(--safe); font-style: normal; }
.facts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--safe-line); }
.facts li {
  display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 0.6rem;
  padding: 1rem 0; border-bottom: 1px solid rgba(232, 57, 42, 0.14);
}
.facts li::before {
  content: counter(fact, decimal-leading-zero);
  counter-increment: fact;
  grid-row: 1 / span 2;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--safe); padding-top: 0.45rem;
}
.facts { counter-reset: fact; }
.facts b, .facts span { grid-column: 2; }
.facts b { font-weight: 500; color: var(--paper); }
.facts span { color: var(--muted); }

.listen {
  position: relative;
  border: 1px solid rgba(232, 57, 42, 0.2);
  padding: clamp(1.6rem, 4vw, 3rem);
  background: radial-gradient(80% 120% at 0% 0%, rgba(232, 57, 42, 0.1), transparent 60%), var(--ink-2);
}
.listen p { margin: 0.6rem 0 0; max-width: 46ch; color: var(--muted); }
.listen h2 { margin: 0.4rem 0 0; font-weight: 400; font-style: italic; font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem); line-height: 1.05; color: var(--paper); }
.wave { display: block; width: 100%; height: 64px; margin-top: 1.6rem; color: var(--safe); }
.wave path { fill: none; stroke: currentColor; stroke-width: 1.4; }

.unlock {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center;
  border-top: 1px solid var(--safe-line); border-bottom: 1px solid var(--safe-line);
  padding: clamp(2rem, 5vw, 3.5rem) 0;
}
.price {
  font-style: italic; font-size: clamp(4rem, 2rem + 8vw, 8.5rem); line-height: 0.85; color: var(--safe);
  font-variant-numeric: lining-nums;
  text-shadow: 0 0 40px rgba(232, 57, 42, 0.35);
}
.price small { display: block; font-family: var(--mono); font-style: normal; font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); text-shadow: none; margin-top: 1rem; }
.unlock h2 { margin: 0 0 0.5rem; font-weight: 500; font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); color: var(--paper); }
.unlock p { margin: 0 0 0.6rem; color: var(--muted); max-width: 52ch; }
.unlock p b { color: var(--text); font-weight: 500; }

/* ---------- Documents (privacy, support) ---------- */

.doc { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(1.5rem, 5vh, 4rem) var(--gutter) 4rem; }
.doc-title {
  font-weight: 400; font-style: italic; color: var(--paper);
  font-size: clamp(2.6rem, 1.6rem + 4vw, 4.8rem); line-height: 1.04; margin: 0.6rem 0 1rem;
}
.doc .meta { color: var(--muted); font-size: 0.95rem; margin: 0 0 2.5rem; }
.doc .summary {
  border-left: 2px solid var(--safe);
  padding: 0.2rem 0 0.2rem 1.2rem;
  margin: 0 0 3rem;
  font-size: 1.15em; color: var(--paper);
}
.doc h2 {
  display: flex; align-items: baseline; gap: 0.9rem;
  margin: 3rem 0 0.8rem; font-weight: 500; font-size: clamp(1.45rem, 1.2rem + 0.8vw, 1.8rem); line-height: 1.2; color: var(--paper);
}
.doc h2 .label { flex: none; font-size: 0.66rem; }
.doc h3 { margin: 2rem 0 0.4rem; font-weight: 500; font-size: 1.2rem; color: var(--paper); }
.doc p, .doc li { color: var(--text); }
.doc ul { padding-left: 1.2rem; }
.doc li { margin: 0.35rem 0; }
.doc li::marker { color: var(--safe); }
.doc code { font-family: var(--mono); font-size: 0.78em; color: var(--paper); background: var(--ink-3); padding: 0.1em 0.35em; border-radius: 3px; overflow-wrap: anywhere; }
.doc table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.98rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.6rem 0.6rem 0.6rem 0; border-bottom: 1px solid rgba(232, 57, 42, 0.16); }
.doc th { font-family: var(--mono); font-weight: 400; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--safe); }
.table-scroll { overflow-x: auto; }
.doc td code { white-space: nowrap; overflow-wrap: normal; font-size: 0.72em; }

.faq details { border-bottom: 1px solid rgba(232, 57, 42, 0.16); }
.faq details:first-of-type { border-top: 1px solid rgba(232, 57, 42, 0.16); }
.faq summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  cursor: pointer; list-style: none;
  padding: 1.1rem 0; font-size: 1.22rem; font-weight: 500; color: var(--paper);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--safe); font-weight: 400; transition: transform 0.25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 0 1.2rem; }
.faq .answer > :first-child { margin-top: 0; }

.contact-card {
  margin-top: 3.5rem; padding: 1.8rem;
  border: 1px solid rgba(232, 57, 42, 0.24);
  background: radial-gradient(90% 140% at 100% 0%, rgba(232, 57, 42, 0.1), transparent 60%), var(--ink-2);
}
.contact-card p { margin: 0.4rem 0 0; }
.contact-card .email { font-size: clamp(1.3rem, 1rem + 1.4vw, 1.9rem); font-style: italic; overflow-wrap: anywhere; }

/* ---------- 404 ---------- */

.lost { min-height: 70vh; display: grid; place-content: center; text-align: center; padding: 2rem var(--gutter); }
.lost .num { font-style: italic; font-size: clamp(6rem, 3rem + 14vw, 13rem); line-height: 0.9; color: var(--safe); text-shadow: 0 0 60px rgba(232, 57, 42, 0.4); font-variant-numeric: lining-nums; }
.lost h1 { font-weight: 400; font-style: italic; font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.8rem); margin: 0.8rem 0 0.4rem; color: var(--paper); }
.lost p { color: var(--muted); margin: 0 0 1.6rem; }

/* ---------- Footer ---------- */

.site-footer {
  max-width: 1240px; margin: 2rem auto 0; padding: 2rem var(--gutter) 3rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem;
  border-top: 1px solid rgba(232, 57, 42, 0.14);
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* Single-class accents inside containers whose `x p` rules would otherwise win. */
.doc .label, .listen .label, .contact-card .label { color: var(--safe); }
.unlock .price { color: var(--safe); margin: 0; }
.unlock .price small { color: var(--muted); }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .print { width: min(88%, 380px); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .unlock { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  /* The strip turns vertical: sprockets run down both sides. */
  .strip { grid-template-columns: minmax(0, 1fr); padding: 0 38px; gap: 14px; }
  .strip::before, .strip::after {
    top: 0; bottom: 0; left: auto; right: auto; width: 14px; height: auto;
    background-image: linear-gradient(180deg, transparent 0 9px, var(--hole) 9px 23px, transparent 23px 32px);
    background-size: 14px 32px;
  }
  .strip::before { left: 12px; }
  .strip::after { right: 12px; }
  .frame { margin: 0; }
  .strip > li:first-child .frame { margin-top: 14px; }
  .strip > li:last-child .frame { margin-bottom: 14px; }
  .site-header { padding-top: 16px; padding-bottom: 16px; }
  .wordmark { letter-spacing: 0.2em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; color: #000; }
  body::after, .site-nav, .skip { display: none; }
  .doc p, .doc li, .doc-title, .doc h2, .doc h3 { color: #000; }
}
