/* Vanuki — one system, two themes.
   Dark is the void the game lives in. Light is the paper the log is written on.

   Contract: LIGHT IS THE DEFAULT. Absence of [data-theme] means light, not
   "whatever the OS says" — we deliberately do not honour prefers-color-scheme,
   because the log is paper. Dark is opt-in via the toggle, which persists.
   Nothing below this token block may hard-code a colour. */

:root {
  color-scheme: light;

  --bg:        #E7E6E1;
  --bg-inset:  #DEDDD7;
  --fg:        #12141A;
  --muted:     #4A4E58;
  --rule:      #C6C6C0;
  --green:     #146B45;
  --amber:     #A65A12;

  /* the pilot: a white suit reads on both themes; only the shading moves */
  --suit:       #F3F2EE;
  --suit-shade: #CBC9C2;
  --outline:    #0B0D14;

  /* code and game footage are always the void, quoted inside the page */
  --void:      #0A0C13;
  --void-fg:   #C9D4E4;
  --void-rule: #1E2434;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --serif: Georgia, "Iowan Old Style", Palatino, "Times New Roman", serif;

  --measure: 62ch;
  --gutter: 24px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #E7E6E1; --bg-inset: #DEDDD7; --fg: #12141A; --muted: #4A4E58;
  --rule: #C6C6C0; --green: #146B45; --amber: #A65A12;
  --suit-shade: #CBC9C2; --void: #0A0C13;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #05060E; --bg-inset: #0A0F1F; --fg: #EAF2FF; --muted: #8B93A7;
  --rule: #1E2434; --green: #5CF2A6; --amber: #E8A33D;
  --suit-shade: #8892A6; --void: #0A0F1F;
}

/* ---------------------------------------------------------------- base ---- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 18px/1.7 var(--serif);
}

::selection { background: var(--amber); color: var(--bg); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

.sheet { max-width: 760px; margin: 0 auto; padding: 22px var(--gutter) 120px; }
.sheet--wide { max-width: 860px; }

/* screentone: the halftone of a printed panel, not a gradient */
.tone {
  background-image: radial-gradient(var(--rule) 1px, transparent 1.1px);
  background-size: 7px 7px;
}

/* --------------------------------------------------------------- chrome --- */

.masthead {
  display: flex; align-items: center; gap: 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--rule);
  font: 500 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
}
.masthead a { color: var(--muted); text-decoration: none; }
.masthead a:hover { color: var(--fg); }
.masthead .here { color: var(--fg); }
.masthead .spacer { flex: 1; }

.ctl {
  appearance: none; background: none; border: 1px solid var(--rule);
  color: var(--muted); cursor: pointer;
  font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  padding: 7px 10px; border-radius: 3px;
}
.ctl:hover { color: var(--fg); border-color: var(--muted); }

.lang { display: inline-flex; border: 1px solid var(--rule); border-radius: 3px; overflow: hidden; }
.lang a {
  padding: 7px 9px; text-decoration: none; color: var(--muted);
  font: 500 10px/1 var(--mono); letter-spacing: .14em;
}
.lang a[aria-current="true"] { background: var(--fg); color: var(--bg); }

footer.foot {
  margin-top: 76px; padding-top: 20px; border-top: 1px solid var(--rule);
  font: 500 10px/2 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
}
footer.foot a { text-decoration: none; margin-right: 20px; }
footer.foot a:hover { color: var(--fg); }

/* ----------------------------------------------------------------- hero --- */

.hero { position: relative; padding: 64px 0 56px; }

/* speed lines: CSS, not an image. Behind the pilot, never over the type. */
.hero::before {
  content: ""; position: absolute; inset: -10% -40% auto -40%; height: 420px;
  background: repeating-conic-gradient(from 0deg at 50% 42%,
    var(--rule) 0deg .35deg, transparent .35deg 5deg);
  opacity: .5;
  -webkit-mask-image: radial-gradient(closest-side, #000 12%, transparent 74%);
          mask-image: radial-gradient(closest-side, #000 12%, transparent 74%);
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .hero::before { animation: drift 24s linear infinite; }
  @keyframes drift { to { transform: rotate(1turn); } }
}

.hero > * { position: relative; }

h1.wordmark {
  margin: 0;
  font: 500 clamp(32px, 9vw, 58px)/1 var(--mono);
  letter-spacing: .22em; text-transform: uppercase;
}
.dek { margin: 20px 0 0; max-width: 46ch; color: var(--muted); font-size: 19px; }

h2.section {
  margin: 56px 0 18px;
  font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------------------------------------------------------------- pilot --- */
/* Flat cel fills, one hard shadow, thick ink outline. No soft gradients.
   The visor is the ghost line: amber by default, green when you're on target. */

.pilot { display: block; width: 100%; height: auto; overflow: visible; }
.pilot .suit   { fill: var(--suit); stroke: var(--outline); stroke-width: 5; stroke-linejoin: round; }
.pilot .shade  { fill: var(--suit-shade); }
.pilot .visor  { fill: var(--signal, var(--amber)); stroke: var(--outline); stroke-width: 5;
                 stroke-linejoin: round; transition: fill .25s ease; }
.pilot .glint  { fill: var(--suit); opacity: .9; }
.pilot .ink    { fill: none; stroke: var(--outline); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.pilot .tether { fill: none; stroke: var(--signal, var(--amber)); stroke-width: 3.5;
                 stroke-dasharray: 2 10; stroke-linecap: round; transition: stroke .25s ease; }
.pilot .planet { fill: var(--bg-inset); stroke: var(--outline); stroke-width: 5; }

/* the whole point: the page's call-to-action flips the pilot's visor to green */
.hero:has(.cta:hover) { --signal: var(--green); }
.hero:has(.cta:focus-visible) { --signal: var(--green); }

.pilot .scarf { fill: var(--suit-shade); stroke: var(--outline); stroke-width: 5; stroke-linejoin: round; }

@media (prefers-reduced-motion: no-preference) {
  .pilot .scarf { transform-origin: 80px 112px; animation: flutter 3.6s ease-in-out infinite; }
  @keyframes flutter { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(4deg); } }
}

.hero-grid { display: grid; grid-template-columns: 1fr 210px; gap: 32px; align-items: center; }
@media (max-width: 620px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-grid .pilot-wrap { max-width: 180px; }
}

/* ---------------------------------------------------------------- cards --- */

.card {
  display: flex; gap: 18px; align-items: center;
  background: var(--bg-inset); border: 1px solid var(--rule); border-radius: 12px;
  padding: 20px; text-decoration: none; color: inherit;
  transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--green); transform: translateX(3px); }
.card h3 { margin: 0 0 4px; font: 500 15px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card + .card { margin-top: 14px; }

.cta {
  display: inline-block; margin-top: 26px; padding: 13px 22px;
  background: var(--fg); color: var(--bg); text-decoration: none; border-radius: 4px;
  font: 500 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
}
.cta:hover { background: var(--green); color: var(--void); }

.pitch { margin: 30px 0 0; max-width: var(--measure); }
.pitch strong { color: var(--green); font-weight: 400; }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 34px; }
.trio div { border-top: 2px solid var(--rule); padding-top: 14px; }
.trio h3 { margin: 0 0 6px; font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--green); }
.trio p { margin: 0; font-size: 15px; color: var(--muted); }
@media (max-width: 620px) { .trio { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ log --- */
/* The devlog index IS the ghost line. Each post is a planet on the trajectory;
   the segment is green if the decision held, amber if it was misread. */

.key { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-bottom: 38px;
       font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.key i { font-style: normal; display: inline-flex; align-items: center; gap: 7px; }
.key i::before { content: ""; width: 18px; height: 2px; background: currentColor; }
.key .g { color: var(--green); }
.key .a { color: var(--amber); }

.log { list-style: none; margin: 0; padding: 0; }
.entry { position: relative; padding: 0 0 44px 34px; border-left: 2px solid var(--seg, var(--rule)); }
.entry--green { --seg: var(--green); }
.entry--amber { --seg: var(--amber); }
.entry--pending { --seg: transparent; border-left: 2px dotted var(--rule); }

.entry::before {
  content: ""; position: absolute; left: -7px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--seg, var(--rule));
}
.entry--pending::before { border-style: dotted; }

.entry > a { display: block; text-decoration: none; transition: transform .18s ease; }
.entry > a:hover { transform: translateX(3px); }

.stamp { display: flex; align-items: center; gap: 14px;
         font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.stamp time { color: var(--muted); }
.stamp .verdict { color: var(--seg); }

.entry h2 { margin: 12px 0 8px; font: 400 26px/1.25 var(--serif); letter-spacing: -.01em; }
.entry > a:hover h2 { color: var(--seg); }
.entry p { margin: 0; color: var(--muted); font-size: 17px; max-width: 54ch; }
.entry--pending h2 { color: var(--muted); font-style: italic; }

@media (max-width: 540px) { .entry { padding-left: 26px; } }

/* ---------------------------------------------------------------- prose --- */

.prose { max-width: var(--measure); }
.prose h1 { font: 700 clamp(27px, 6vw, 38px)/1.2 var(--serif); margin: 0 0 30px; letter-spacing: -.015em; }
.prose h2 { font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase;
            color: var(--green); margin: 46px 0 14px; }
.prose p { color: var(--fg); }
.prose .lead { font-size: 20px; color: var(--muted); }
.prose time { display: block; color: var(--muted);
              font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; margin: 26px 0 12px; }

.prose blockquote {
  margin: 32px 0; padding: 6px 0 6px 22px;
  border-left: 3px solid var(--amber);
  font-size: 21px; font-style: italic;
}

.prose pre {
  background: var(--void); color: var(--void-fg);
  border: 1px solid var(--void-rule); border-radius: 10px;
  padding: 18px; overflow-x: auto; font: 14px/1.6 var(--mono);
}
.prose pre code { color: inherit; }
.prose code { font-family: var(--mono); color: var(--green); font-size: .88em; }
.prose p code { background: var(--bg-inset); padding: 1px 5px; border-radius: 4px; }

.prose ul { padding-left: 22px; color: var(--fg); }
.prose li { margin-bottom: 8px; }
.prose .meta { color: var(--muted); font-size: 15px; margin-bottom: 28px; }
.prose .note {
  border-left: 3px solid var(--green); background: var(--bg-inset);
  padding: 14px 18px; border-radius: 8px; color: var(--muted); font-size: 16px;
}

.verdict-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
}
.verdict-tag::before { content: ""; width: 18px; height: 2px; background: currentColor; }
.verdict-tag.a { color: var(--amber); }
.verdict-tag.g { color: var(--green); }

/* ------------------------------------------------------------ not found --- */

.lost { min-height: 72vh; display: grid; place-items: center; text-align: center; }
.lost h1 { font: 500 clamp(26px, 7vw, 40px)/1 var(--mono); letter-spacing: .2em;
           text-transform: uppercase; margin: 30px 0 12px; }
.lost p { color: var(--muted); margin: 0 0 30px; }
.lost .pilot-wrap { width: 150px; margin: 0 auto; }
