/* SINERGIA: two voices that end up as one.
   Human voice  = serif + amber (the fire on the cover): Aiden, narration, the author's letter.
   Machine voice = monospace + cyan: the AI, data, navigation.
   The real cover is the only image; everything else is typography. */

:root {
  --bg: #07090c;
  --surface: #0f1318;
  --text: #ebe6dc;
  --muted: #a29d93;
  --machine: #45e3dc;
  --human: #e8a04a;
  --line: rgba(235, 230, 220, 0.12);   /* a tint of --text, not a new colour */

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Type scale: nothing outside these sizes. */
  --t-xs: 0.875rem;   /* 14 */
  --t-sm: 1.0625rem;  /* 17 */
  --t-md: 1.25rem;    /* 20 */
  --t-lg: 1.75rem;    /* 28 */
  --t-xl: 2.5rem;     /* 40 */
  --t-xxl: 4rem;      /* 64 */
  --t-display: 7rem;  /* 112, the title and the 02:47 only */

  --radius: 6px;
  --wrap: 1120px;
  --gutter: 24px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--t-sm)/1.65 var(--serif); text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--machine); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--machine); outline-offset: 3px; border-radius: 2px; }
strong { font-weight: 600; }
p { margin: 0 0 1.1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--machine); color: var(--bg); padding: 10px 14px; font-family: var(--mono); z-index: 20; }
.skip:focus { left: 8px; }

/* ---------- the two voices ---------- */
.mono, .label, .site-nav, .site-footer, .price, .meta, .btn, .faq summary, .who { font-family: var(--mono); }
.label { display: block; font-size: var(--t-xs); color: var(--muted); letter-spacing: 0.04em; margin-bottom: 14px; }
.machine { color: var(--machine); font-family: var(--mono); font-weight: 500; }
.human { color: var(--human); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(7, 9, 12, 0.92); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { font-family: var(--mono); font-weight: 500; font-size: var(--t-sm); color: var(--text); text-decoration: none; letter-spacing: 0.12em; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav { display: flex; gap: 4px; font-size: var(--t-xs); }
.site-nav a { color: var(--text); text-decoration: none; padding: 12px 10px; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav a:hover { color: var(--machine); }
.site-nav .lang { color: var(--muted); }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 22px; border-radius: var(--radius);
       font-size: var(--t-xs); font-weight: 500; text-decoration: none; transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); }
.btn-primary { background: var(--machine); color: var(--bg); }
.btn-primary:hover { background: var(--text); }
.btn-quiet { color: var(--text); border: 1px solid var(--line); }
.btn-quiet:hover { border-color: var(--machine); color: var(--machine); }
.text-link { font-family: var(--mono); font-size: var(--t-xs); min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 96px; overflow: hidden; position: relative; isolation: isolate; }
/* Chapter 1, 2:47 a.m.: neon signs blinking through metal blinds ("Azul. Rojo. Azul otra vez.").
   Two slatted lights take turns: cyan (the machine) and amber (the human). Low alpha so the text always wins. */
.hero::before, .hero::after { content: ""; position: absolute; inset: -10% -5% -10% 30%; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(to bottom, var(--slat) 0 7px, transparent 7px 24px);
  transform: skewY(-7deg);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 45%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 70% 45%, #000 0%, transparent 75%); }
.hero::before { --slat: rgba(69, 227, 220, 0.22); animation: neon-a 9s steps(1, end) infinite; }
.hero::after  { --slat: rgba(232, 160, 74, 0.20); animation: neon-b 9s steps(1, end) infinite; }
@keyframes neon-a { 0% { opacity: 1; } 40% { opacity: 0.25; } 42% { opacity: 1; } 45% { opacity: 0; } 92% { opacity: 1; } }
@keyframes neon-b { 0% { opacity: 0; } 45% { opacity: 1; } 84% { opacity: 0.3; } 86% { opacity: 1; } 90% { opacity: 0; } }
.hero .wrap { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: center; }
.hero h1 { font-size: var(--t-display); font-weight: 600; line-height: 0.92; letter-spacing: -0.03em; margin: 0 0 36px; }
.voice-line { font-size: var(--t-md); line-height: 1.5; margin: 0 0 28px; min-height: 3.2em; }
.who { display: block; font-size: var(--t-xs); color: var(--muted); font-weight: 400; margin-bottom: 6px; }
.typing::after { content: "_"; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.premise { font-size: var(--t-md); max-width: 32em; margin-bottom: 36px; }

/* The cover as a real object: a paperback with spine and page block. The page block depth follows the page count. */
.book3d { --w: 340px; --depth: 26px; display: block; width: var(--w); justify-self: center; perspective: 1800px; text-decoration: none; }
/* The pieces are <span>s inside a link; inline boxes ignore 3D transforms, so they must be blocks. */
.book3d .obj, .book3d .front, .book3d .pages, .book3d picture { display: block; }
/* At rest almost facing the reader; with a mouse it follows the pointer (site.js sets --ry/--rx). */
.book3d .obj { position: relative; transform-style: preserve-3d; transform: rotateY(var(--ry, -16deg)) rotateX(var(--rx, 4deg)); transition: transform .5s var(--ease); }
.book3d.tracking .obj { transition: transform .12s linear; }
.book3d:focus-visible .obj { transform: rotateY(-6deg) rotateX(2deg); }
.book3d .front { position: relative; z-index: 2; border-radius: 2px 4px 4px 2px; overflow: hidden; transform: translateZ(calc(var(--depth) / 2)); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55); }
.book3d .front img { width: 100%; }
/* Only the faces turned to the reader are painted (a back-facing face showed mirrored). */
.book3d .pages, .book3d .front { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.book3d .pages { position: absolute; top: 3px; right: 0; width: var(--depth); height: calc(100% - 6px);
  background: repeating-linear-gradient(90deg, #d9d2c3 0 1px, #efe9dc 1px 3px);
  transform: rotateY(90deg) translateZ(calc(var(--w) - var(--depth) / 2)); transform-origin: left center; left: calc(var(--depth) / -2); }
.book3d .caption { display: block; text-align: center; margin-top: 28px; font-family: var(--mono); font-size: var(--t-xs); color: var(--muted); }

/* ---------- sections ---------- */
.section { padding: 112px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: var(--t-xl); font-weight: 600; line-height: 1.15; margin: 0 0 28px; letter-spacing: -0.01em; }

/* ---------- 02:47, the first conversation ---------- */
.scene { padding: 120px 0; border-top: 1px solid var(--line); }
.scene .clock { font-family: var(--mono); font-weight: 500; font-size: var(--t-display); line-height: 1; color: var(--text); letter-spacing: -0.04em; margin: 0; }
.scene .clock small { font-size: var(--t-lg); color: var(--muted); letter-spacing: 0; margin-left: 12px; }
.scene .setting { max-width: 34em; font-size: var(--t-md); color: var(--muted); margin: 24px 0 72px; }
.transcript { list-style: none; margin: 0; padding: 0; max-width: 46em; }
.transcript li { display: grid; grid-template-columns: 96px 1fr; gap: 24px; padding: 18px 0; border-top: 1px solid var(--line); }
.transcript .who { margin: 4px 0 0; }
.transcript .ia .who { color: var(--machine); }
.transcript .aiden .who { color: var(--human); }
.transcript .ia p { font-family: var(--mono); color: var(--machine); font-size: var(--t-sm); line-height: 1.6; margin: 0; }
.transcript .aiden p { font-family: var(--serif); color: var(--text); font-size: var(--t-md); line-height: 1.5; margin: 0; }
.transcript .omit { color: var(--muted); }
/* Hidden only when the script runs, so crawlers and no-JS readers always get every line. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.shown { opacity: 1; transform: none; }

.acronym { margin: 96px 0 0; }
.acronym .letters { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--mono); font-weight: 500; font-size: var(--t-xxl); line-height: 1; color: var(--muted); margin: 0 0 20px; }
.acronym .letters span { transition: color .4s var(--ease); }
.acronym .letters span.on { color: var(--machine); }
.acronym .expansion { font-family: var(--mono); font-size: var(--t-sm); color: var(--text); max-width: 40em; margin: 0 0 12px; }
.acronym .gloss { font-size: var(--t-md); max-width: 36em; }
.scene .actions { margin-top: 56px; }
.meta { font-size: var(--t-xs); color: var(--muted); }

/* ---------- the voices (characters) ---------- */
.voices { list-style: none; margin: 0; padding: 0; }
.voices li { display: grid; grid-template-columns: 280px 1fr; gap: 32px; padding: 32px 0; border-top: 1px solid var(--line); align-items: baseline; }
.voices .name { margin: 0; font-size: var(--t-xl); line-height: 1.1; font-weight: 600; }
.voices .name.serif { font-family: var(--serif); color: var(--human); }
.voices .name.code { font-family: var(--mono); font-weight: 500; color: var(--machine); letter-spacing: -0.02em; }
.voices .name.cold { font-family: var(--mono); font-weight: 500; color: var(--muted); letter-spacing: 0.08em; }
.voices .role { display: block; font-family: var(--mono); font-size: var(--t-xs); color: var(--muted); margin-top: 8px; font-weight: 400; letter-spacing: 0; }
.voices p { font-size: var(--t-md); max-width: 34em; margin: 0; }

/* ---------- buy ---------- */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.option { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; display: flex; flex-direction: column; }
.option h3 { font-family: var(--mono); font-size: var(--t-xs); font-weight: 500; color: var(--muted); margin: 0 0 6px; letter-spacing: 0.04em; }
.option .store { font-size: var(--t-md); font-weight: 600; margin: 0 0 20px; }
.price { font-size: var(--t-lg); font-weight: 500; color: var(--text); margin: 0 0 6px; }
.option .detail { font-size: var(--t-xs); font-family: var(--mono); color: var(--muted); margin: 0 0 24px; flex: 1; }
.option .btn { width: 100%; }
.note { font-size: var(--t-xs); font-family: var(--mono); color: var(--muted); margin-top: 20px; max-width: 62em; }

/* ---------- author ---------- */
.pull { font-size: var(--t-xl); line-height: 1.25; font-weight: 400; color: var(--human); max-width: 22em; margin: 0 0 48px; }
.letter { max-width: 38em; font-size: var(--t-md); }
.signature { font-family: var(--mono); font-size: var(--t-xs); color: var(--muted); margin-top: 28px; }

/* ---------- faq ---------- */
.faq { max-width: 46em; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 18px 0; font-size: var(--t-xs); font-weight: 500; min-height: 44px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--machine); }
.faq details[open] summary::after { content: "-"; }
.faq details p { margin: 0 0 20px; }

/* ---------- closing: the two voices become one sentence ---------- */
.closing { padding: 128px 0; border-top: 1px solid var(--line); }
.closing p { margin: 0; font-size: var(--t-xxl); line-height: 1.12; letter-spacing: -0.02em; max-width: 14em; }
.closing .h { font-family: var(--serif); color: var(--human); }
.closing .t { font-family: var(--serif); color: var(--text); }
.closing .m { font-family: var(--mono); color: var(--machine); font-weight: 500; letter-spacing: -0.04em; }
.closing .src { display: block; margin-top: 28px; font-family: var(--mono); font-size: var(--t-xs); color: var(--muted); letter-spacing: 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 56px; font-size: var(--t-xs); color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; align-items: center; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer a { color: var(--text); display: inline-flex; min-height: 44px; align-items: center; }
.site-footer p { margin: 0; }

/* ---------- reader (free chapters) ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--machine); transform-origin: 0 50%; transform: scaleX(0); z-index: 30; }
.reader-intro { padding: 72px 0 32px; }
.reader-intro h1 { font-size: var(--t-xl); font-weight: 600; margin: 0 0 16px; line-height: 1.15; }
.reader-intro p { max-width: 38em; font-size: var(--t-md); }
.toc { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.book { max-width: 40em; margin: 0 auto; padding: 0 var(--gutter) 40px; font-size: 1.1875rem; line-height: 1.75; }
.chapter-page { padding: 72px 0 24px; border-top: 1px solid var(--line); }
.chapter-header { margin-bottom: 40px; }
.chapter-number-display { font-family: var(--mono); font-size: var(--t-xs); color: var(--muted); letter-spacing: 0.04em; }
.chapter-title-display { font-size: var(--t-xl); font-weight: 600; line-height: 1.15; margin: 8px 0 20px; }
.chapter-epigraph { font-family: var(--mono); font-size: var(--t-xs); color: var(--machine); }
.dialogue { margin: 0 0 1.1em; padding-left: 1.2em; }
.section-separator { height: 1px; width: 64px; background: var(--line); margin: 48px auto; }
.future-fragment, .flashback { margin: 48px 0; padding: 28px 24px; background: var(--surface); border-radius: var(--radius); }
.future-fragment header div, .flashback header div { font-family: var(--mono); font-size: var(--t-xs); color: var(--human); letter-spacing: 0.04em; }
.continue { max-width: 40em; margin: 24px auto 0; padding: 48px var(--gutter) 72px; border-top: 1px solid var(--line); }
.continue h2 { font-size: var(--t-lg); font-weight: 600; margin: 0 0 12px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { padding: 40px 0 72px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 56px; }
  .book3d { --w: 240px; --depth: 19px; justify-self: start; margin-left: 24px; }
  .voices li { grid-template-columns: 1fr; gap: 12px; }
  .options { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .hero h1 { font-size: var(--t-xxl); }
  .scene .clock { font-size: var(--t-xxl); }
  .scene .clock small { font-size: var(--t-md); }
  .section, .scene, .closing { padding: 72px 0; }
  .section h2, .chapter-title-display, .reader-intro h1, .pull { font-size: var(--t-lg); }
  .transcript li { grid-template-columns: 1fr; gap: 6px; }
  .acronym .letters { font-size: var(--t-xl); }
  .closing p { font-size: var(--t-xl); }
  .book { font-size: var(--t-sm); }
  .site-nav a { padding: 12px 8px; }
  .site-nav .nav-extra { display: none; }
}

/* Motion only marks state (a line arriving, a letter decoded). People who ask for less get the final state. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .hero::after { opacity: 0; }
  .progress { display: none; }
}
