/* The World — night hill, lamplight. */

/* Crimson Pro — the face the atlas plates letter themselves in. Loaded once
   here and shared by every inlined plate, so the maps cost ~10 KB of font
   between them instead of carrying a copy each. Subset to Latin + the marks
   the plates use; SIL Open Font License, see fonts/CrimsonPro-LICENSE.txt */
@font-face {
  font-family: 'Crimson Pro';
  src: url('/static/fonts/crimson-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Crimson Pro';
  src: url('/static/fonts/crimson-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}

/* `hidden` has to win. Anything that sets its own `display` — .button,
   .token-box — otherwise outranks the attribute on specificity alone, and the
   handoff link sat on the settings page as an empty box because of it. */
[hidden] { display: none !important; }

:root {
  --ground: #141922;
  --panel: #1a2130;
  --line: #2a3346;
  --ink: #e9e4d8;
  --muted: #8d94a4;
  --lamp: #e3a44f;
  --lane: #8fb2cd;
  --error: #d97b6c;

  /* the atlas palette, so page and plate agree */
  --paper: #ece1c8;
  --paper-edge: #cbbb98;

  /* type scale (1.25) — one ladder, used everywhere */
  --t-xs: .78rem;
  --t-sm: .88rem;
  --t-base: 1rem;
  --t-md: 1.15rem;
  --t-lg: 1.45rem;
  --t-xl: 1.85rem;
  --t-2xl: 2.35rem;
  --t-3xl: 3rem;

  /* space scale — 4px root, so nothing is ever a nudge */
  --s-1: .25rem;
  --s-2: .5rem;
  --s-3: .75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;

  --radius: 10px;
  --radius-sm: 6px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  --shadow-lift: 0 1px 0 rgba(255,255,255,.04), 0 18px 40px -24px rgba(0,0,0,.75);
}

* { box-sizing: border-box; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: Charter, "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.65;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap { flex: 1; width: 100%; max-width: 46rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }

/* nav */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--s-4) var(--s-5); flex-wrap: wrap;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--line);
}
.nav a { color: var(--ink); text-decoration: none; }
.brand { font-weight: 600; letter-spacing: .02em; }
/* wraps rather than pushing the page sideways on a narrow phone */
.nav-links { display: flex; gap: var(--s-2) 1.4rem; align-items: center; flex-wrap: wrap;
  font-family: var(--sans); font-size: var(--t-sm); }
.nav-links a:hover { color: var(--lamp); }
.nav-links .cta { color: var(--lamp); border: 1px solid var(--lamp);
  border-radius: 2px; padding: .3rem .8rem; }

/* type */
.eyebrow {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--lamp);
}
h1 { font-size: 2.1rem; font-weight: 600; letter-spacing: -.01em;
  margin: .4rem 0 .8rem; text-wrap: balance; }
h2 { font-size: 1.25rem; font-weight: 600; margin: 2rem 0 .5rem; }
h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .4rem; }
p { margin: 0 0 1em; }
a { color: var(--lane); }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--error); }

/* hero */
.hero { padding: 2.5rem 0 1rem; }
.lede { font-size: 1.12rem; max-width: 38rem; }
.hero-actions { display: flex; gap: .8rem; margin-top: 1.6rem; }

/* ---- front page refresh ---- */
.wrap:has(.doors) { max-width: 60rem; }
.hero h1 { text-wrap: balance; }

.whatis { border-left: 2px solid var(--lamp); padding: .2rem 0 .2rem 1.1rem; margin: 2.4rem 0; }
.whatis p { margin: 0; font-size: 1.06rem; max-width: 44rem; color: var(--ink); }

.arrive { margin: 3rem 0 1rem; }
.arrive h2 { font-size: 1.4rem; margin: 0; }
.arrive-note { margin: .35rem 0 1.4rem; font-size: .9rem; }
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.door { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent, var(--lamp));
  border-radius: 3px; padding: 1.3rem 1.35rem; display: flex; flex-direction: column; gap: .55rem; }
.door-you { --accent: var(--lamp); }
.door-both { --accent: var(--lane); }
.door-agent { --accent: #8db96a; }
.door-tag { font-family: ui-sans-serif, system-ui, sans-serif; font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); }
.door h3 { margin: 0; font-size: 1.18rem; }
.door p { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.door p.door-note { flex: 0; font-size: .86rem; padding-left: .7rem;
  border-left: 1px solid var(--line); }
.door .button { align-self: flex-start; margin-top: .3rem; }

.enter { display: flex; flex-direction: column; gap: .5rem; margin-top: .4rem; }
.enter input { font-family: ui-sans-serif, system-ui, sans-serif; font-size: .9rem; padding: .55rem .7rem;
  background: var(--ground); border: 1px solid var(--line); border-radius: 3px; color: var(--ink); }
.enter .button { align-self: stretch; text-align: center; margin-top: .1rem; }
.enter-msg { margin: .1rem 0 0; font-size: .85rem; color: var(--lamp); }

.built { margin: 3rem 0 1rem; border-top: 1px solid var(--line); padding-top: 1.8rem; }
.built h2 { font-size: 1.4rem; margin: 0 0 1.2rem; }
.built-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.1rem 1.6rem; }
.feat h3 { margin: 0 0 .35rem; font-size: 1.05rem; color: var(--lamp); }
.feat p { margin: 0; color: var(--muted); font-size: .95rem; }

/* buttons + forms */
.button {
  display: inline-block; font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: .88rem; padding: .55rem 1.1rem; border-radius: 2px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  text-decoration: none; cursor: pointer;
}
.button:hover { border-color: var(--lamp); }
.button.primary { background: var(--lamp); border-color: var(--lamp); color: #1a1408; font-weight: 600; }
.button.primary:hover { filter: brightness(1.08); }
.button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--lane); outline-offset: 2px;
}
form label { display: block; margin: 0 0 1rem;
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: .85rem; color: var(--muted); }
input, select {
  display: block; width: 100%; margin-top: .35rem; padding: .6rem .7rem;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 2px; font-size: 1rem; font-family: inherit;
}

/* front-page steps strip */
.steps-strip { border: 1px solid var(--line); border-radius: 2px;
  background: var(--panel); padding: 1.4rem 1.5rem; margin: 2.2rem 0 0; }
.steps-strip h2 { margin: 0 0 1rem; font-size: 1.15rem; }
.plain-steps { margin: 0; padding: 0; list-style: none;
  counter-reset: step; display: flex; flex-direction: column; gap: .9rem; }
.plain-steps li { counter-increment: step; position: relative;
  padding-left: 2.3rem; }
.plain-steps li::before { content: counter(step); position: absolute;
  left: 0; top: .15rem; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--lamp); color: #1a1408; display: flex; align-items: center;
  justify-content: center; font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: .8rem; font-weight: 600; }
.steps-strip .muted { margin: 1.1rem 0 0; font-size: .9rem; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem; margin: 2.5rem 0; }
.card { background: var(--panel); border: 1px solid var(--line);
  border-radius: 2px; padding: 1.2rem 1.3rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }

/* verbs panel */
/* --- front page: the hero, with a plate of the world beside the argument --- */
.wrap:has(.hero-split) { max-width: 72rem; }
.hero-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-7); align-items: center; padding: var(--s-6) 0 var(--s-4); }
.hero-copy .lede { max-width: 34rem; }
.hero-plate { margin: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.plate-mount { display: block; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #0d1117; box-shadow: var(--shadow-lift);
  transition: border-color .25s, transform .25s; }
.plate-mount:hover, .plate-mount:focus-visible { border-color: var(--lamp); transform: translateY(-2px); }
.plate-slot { aspect-ratio: 1742 / 1616; }
.plate-slot svg { display: block; width: 100%; height: 100%; }
.plate-slot:empty { background:
  linear-gradient(105deg, transparent 40%, rgba(236,225,200,.05) 50%, transparent 60%) var(--paper-edge);
  opacity: .06; }
.hero-plate figcaption { font-family: var(--sans); font-size: var(--t-xs);
  color: var(--muted); line-height: 1.5; text-wrap: pretty; }

/* --- the four lands --- */
.lands { margin: var(--s-7) 0 var(--s-5); }
.lands h2 { font-size: var(--t-lg); margin: 0; }
.landgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--s-4); margin-top: var(--s-4); }
.land { background: var(--panel); border: 1px solid var(--line);
  border-top: 3px solid var(--accent, var(--lamp)); border-radius: var(--radius-sm);
  padding: var(--s-4) var(--s-4) var(--s-5); }
.land-hill { --accent: var(--lamp); }
.land-snow { --accent: #8fd3f0; }
.land-forest { --accent: #8db96a; }
.land-city { --accent: #ff5cae; }
.land h3 { margin: 0; font-size: var(--t-md); }
.land-meta { margin: var(--s-1) 0 var(--s-3); font-family: var(--mono);
  font-size: var(--t-xs); color: var(--accent, var(--lamp)); letter-spacing: .02em; }
.land p:last-child { margin: 0; color: var(--muted); font-size: var(--t-sm); }
.lands-foot { margin: var(--s-4) 0 0; font-style: italic; }

/* --- the verbs, in three columns --- */
.verbset { margin: var(--s-7) 0 var(--s-5); border-top: 1px solid var(--line);
  padding-top: var(--s-6); }
.verbset h2 { font-size: var(--t-lg); margin: 0; }
.verbset .intro { margin: var(--s-2) 0 var(--s-5); color: var(--muted);
  font-size: var(--t-sm); max-width: 42rem; }
.verbgroups { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--s-5) var(--s-6); }
.verbgroup h3 { margin: 0 0 var(--s-3); font-size: var(--t-sm); font-family: var(--sans);
  letter-spacing: .13em; text-transform: uppercase; color: var(--lamp); font-weight: 600; }
.verbgroup-note { margin: -.55rem 0 var(--s-3); font-size: var(--t-xs);
  color: var(--muted); font-style: italic; }
.verbgroup dl { margin: 0; display: grid; grid-template-columns: minmax(0, auto) 1fr;
  gap: var(--s-2) var(--s-3); align-items: baseline; }
.verbgroup dt { font-family: var(--mono); font-size: var(--t-sm); color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  padding: .1rem .45rem; white-space: nowrap; }
.verbgroup dd { margin: 0; color: var(--muted); font-size: var(--t-sm); line-height: 1.5; }
.verbset .whisper { margin: var(--s-5) 0 0; font-size: var(--t-sm); color: var(--muted);
  border-left: 2px solid var(--line); padding-left: var(--s-4); max-width: 44rem; }
.verbset .whisper strong { color: var(--ink); font-weight: 600; }

@media (max-width: 62rem) {
  .hero-split { grid-template-columns: 1fr; gap: var(--s-5); }
  .hero-plate { order: -1; }
}

.featured { border-top: 1px solid var(--line); padding-top: 1.6rem; margin-top: 1rem; }
.disclosure { border: 1px dashed var(--line); border-radius: 2px;
  padding: .9rem 1.15rem; margin: 2.2rem 0 0; color: var(--muted); font-size: .95rem; }
.disclosure p { margin: 0; }

/* prose pages */
.prose-page.narrow { max-width: 34rem; }
.prose-page h2 { margin-top: 2.2rem; }
.backlink { margin-top: 2.4rem; }

/* connect doors */
.door { border: 1px solid var(--line); border-radius: 2px; background: var(--panel);
  padding: 1.2rem 1.3rem; margin: 1.2rem 0; }
.door h3 { margin-top: 0; }
.tag { font-family: ui-sans-serif, system-ui, sans-serif; font-size: .65rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--lamp);
  border: 1px solid var(--lamp); border-radius: 2px; padding: .1rem .4rem;
  vertical-align: middle; margin-left: .4rem; }
.door details { margin: .8rem 0 0; }
.door summary { cursor: pointer; color: var(--lane);
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: .88rem; }
.door details ol, .door details p { color: var(--muted); font-size: .95rem; }

/* connect steps */
.step { border-top: 1px solid var(--line); padding: 1.6rem 0 .6rem; }
.step-n { display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; margin-right: .5rem; border-radius: 50%;
  background: var(--lamp); color: #1a1408;
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: .8rem; }
.token-box { display: block; background: var(--panel); border: 1px solid var(--lamp);
  border-radius: 2px; padding: .8rem 1rem; margin: 0 0 .8rem; word-break: break-all; }

/* transcript (play + adventure pages) */
.transcript { min-height: 12rem; }
.turn { display: flex; flex-direction: column; gap: .15rem; margin: 0 0 1.5rem; }
.who { font-family: ui-sans-serif, system-ui, sans-serif; font-size: .72rem;
  letter-spacing: .16em; text-transform: uppercase; }
.turn.sarah .who, .turn.resident .who { color: var(--lamp); }
.turn.wanderer .who, .turn.agent .who { color: var(--lane); }
.turn.visitor .who { color: #b58bd6; }
.turn.visitor .speech { border-left: 2px solid #b58bd6; padding-left: 1rem; }
.turn.sarah .speech, .turn.resident .speech {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 2px; padding: .9rem 1.15rem; }
.speech { white-space: pre-wrap; }
.world-line { color: var(--muted); font-style: italic; margin: 0 0 1.2rem; }
.world-prose { color: var(--muted); border-left: 2px solid var(--line);
  padding-left: 1rem; margin: 0 0 1.5rem; white-space: pre-wrap; font-size: .95rem; }
.visit-header { display: flex; align-items: baseline; gap: 1rem;
  border-top: 1px solid var(--line); padding-top: 1.4rem; margin: 2.6rem 0 1.4rem; }
.visit-count { font-family: ui-sans-serif, system-ui, sans-serif; font-size: .72rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--lamp); white-space: nowrap; }
.visit-when { font-family: ui-sans-serif, system-ui, sans-serif; font-size: .78rem;
  color: var(--muted); font-variant-numeric: tabular-nums; }

/* play page */
.play-header { display: flex; justify-content: space-between; align-items: start;
  gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.play-header h1 { margin: 0 0 .2rem; font-size: 1.5rem; }
.play-header p { margin: 0; }
.play-controls { display: flex; gap: .6rem; }
.nudge { display: flex; gap: .6rem; margin: 1.5rem 0 .8rem; }
.nudge input { margin: 0; flex: 1; }

/* settings */
.setting-row { display: flex; justify-content: space-between; gap: 1.5rem;
  align-items: center; border: 1px solid var(--line); border-radius: 2px;
  background: var(--panel); padding: 1rem 1.2rem; margin: 1.4rem 0; }
.setting-row p { margin: .2rem 0 0; }
.switch { position: relative; width: 3rem; height: 1.6rem; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--line);
  border-radius: 1rem; cursor: pointer; transition: background .15s; }
.slider::before { content: ""; position: absolute; width: 1.2rem; height: 1.2rem;
  left: .2rem; top: .2rem; background: var(--ink); border-radius: 50%;
  transition: transform .15s; }
.switch input:checked + .slider { background: var(--lamp); }
.switch input:checked + .slider::before { transform: translateX(1.4rem); }
.switch input:focus-visible + .slider { outline: 2px solid var(--lane); }

.footer { border-top: 1px solid var(--line); padding: 1.2rem 1.5rem;
  color: var(--muted); font-size: .82rem;
  font-family: ui-sans-serif, system-ui, sans-serif; }
.footer p { margin: 0; }

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

.askline { font-size: 1.15rem; color: var(--lamp); border-left: 2px solid var(--lamp);
  padding-left: .9rem; margin: .9rem 0; }
details summary { cursor: pointer; color: var(--muted); font-size: .9rem; margin-top: 1rem; }

/* "how do I get back in?" — the answer people need most, and the one that used
   to be a footnote inside a card nobody read */
.comeback { margin: 4rem 0 0; }
.comeback-lede { color: var(--muted); max-width: 46rem; margin: .4rem 0 1.6rem; }
.asks { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.ask { border: 1px solid var(--line); border-radius: 10px; padding: 1.2rem 1.3rem;
  background: var(--panel); }
.ask p { margin: 0; color: var(--muted); font-size: .95rem; }
.ask .ask-line { font-family: var(--serif, Georgia, serif); font-size: 1.28rem;
  line-height: 1.35; color: var(--lamp); margin: 0 0 .7rem; }
@media (max-width: 820px) { .asks { grid-template-columns: 1fr; } }

.after-connect { margin-top: 1rem; padding: .9rem 1rem; border-radius: 8px;
  background: rgba(232,184,75,.06); border: 1px solid var(--line);
  font-size: .92rem; line-height: 1.75; }
.after-connect em { color: var(--lamp); font-style: normal; }
