﻿@font-face {
  font-family: "DM Sans";
  src: url("assets/fonts/dm-sans.woff2") format("woff2");
  font-weight: 400 750;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f4efe6;
  --surface: #fffaf1;
  --band: #eae1d3;
  --inset: #f8f0e1;
  --art-mat: #e2d8c8;
  --ink: #29241e;
  --muted: #63594c;
  --prose: #4f4539;
  --accent: #745323;
  --accent-edge: #ac894a;
  --primary: #382d23;
  --primary-hover: #5c4933;
  --primary-text: #fffaf1;
  --gold-light: #e9c77e;
  --edge: #d9cdb8;
  --line: #e7dece;
  --control-edge: #927c5b;
  --control-text: #554023;
  --control-bg: #fcf5e8;
  --control-hover: #efe0c5;
  --disabled-edge: #d4c9b6;
  --disabled-bg: #f3ede1;
  --disabled-text: #6d6254;
  --selected: #765421;
  --selected-hover: #654619;
  --selected-text: #fff8e8;
  --selected-ring: #9a722e;
  --badge: #eee4d1;
  --badge-text: #624619;
  --q-badge: #e0eced;
  --q-text: #215561;
  --v-badge: #f1e0e7;
  --v-text: #782e52;
  --build-bg: #332a22;
  --build-text: #fff6e6;
  --build-active: #5b4732;
  --focus-ring: #286b7e;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --build-offset: 119px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #181511;
  --surface: #241e18;
  --band: #211b15;
  --inset: #2e251c;
  --art-mat: #130f0c;
  --ink: #f7ecdd;
  --muted: #c5b6a3;
  --prose: #ded0bf;
  --accent: #e5bc81;
  --accent-edge: #a77f49;
  --primary: #e6bd82;
  --primary-hover: #f6d09b;
  --primary-text: #2c2116;
  --edge: #574838;
  --line: #473a2d;
  --control-edge: #887258;
  --control-text: #ebd6b8;
  --control-bg: #30271d;
  --control-hover: #413326;
  --disabled-edge: #574838;
  --disabled-bg: #2a241e;
  --disabled-text: #b5a490;
  --selected: #e2b778;
  --selected-hover: #efc891;
  --selected-text: #2c2116;
  --selected-ring: #e5b66f;
  --badge: #3e3020;
  --badge-text: #f1ce9b;
  --q-badge: #23383d;
  --q-text: #b2e0eb;
  --v-badge: #432f3a;
  --v-text: #f2bdcf;
  --build-bg: #2a2119;
  --build-active: #60462e;
  --focus-ring: #9bd6e4;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
}
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
h1, h2, h3, h4 { font: 400 1.9rem/1.06 var(--serif); overflow-wrap: anywhere; }
h2 { font-size: clamp(2.6rem, 5vw, 4.65rem); }
h3 { font-size: 2.1rem; }
a { color: inherit; text-underline-offset: 0.23em; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 4px; }
.page-width { width: min(1120px, calc(100% - 96px)); margin-inline: auto; }

.sr-only, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus { position: fixed; z-index: 10; top: 10px; left: 10px; background: var(--surface); padding: 0.6rem; }

.site-header { border-bottom: 1px solid var(--edge); }
.header-inner {
  width: min(1200px, calc(100% - 96px));
  min-height: 73px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.53rem;
  color: var(--ink);
  font: 400 2rem/1 var(--serif);
  text-decoration: none;
}
.wordmark span { color: var(--accent); font: 1.05rem/1 var(--sans); }
.site-actions, .hero-actions { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.button, .text-button {
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 680;
  text-decoration: none;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 44px;
  padding: 0.55rem 0.95rem;
  text-align: center;
  line-height: 1.26;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.button-outline { border-color: var(--control-edge); color: var(--ink); background: transparent; }
.button-outline:hover:not(:disabled) { background: var(--control-hover); border-color: var(--accent); }
.button-outline:disabled { color: var(--disabled-text); border-color: var(--disabled-edge); }
.button-primary { border-color: var(--primary); background: var(--primary); color: var(--primary-text); }
.button-primary:hover { border-color: var(--primary-hover); background: var(--primary-hover); }
.theme-toggle { min-width: 44px; padding: 0; }
.theme-toggle span { font: 1.22rem/1 system-ui, sans-serif; }
.theme-toggle[aria-pressed="true"] .moon, .theme-toggle[aria-pressed="false"] .sun, .export-label-short, .original-label-short { display: none; }
.text-button {
  min-height: 44px;
  padding: 0.3rem 0.25rem;
  background: none;
  color: var(--ink);
}
.text-button:hover { text-decoration: underline; text-underline-offset: 0.28em; }

.hero {
  display: grid;
  grid-template-columns: 1.07fr 0.93fr;
  align-items: center;
  gap: clamp(2.5rem, 8vw, 7.25rem);
  padding-block: 2.75rem 3.2rem;
}
.hero-copy { padding-bottom: 0.15rem; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.eyebrow span { font-size: 0.98rem; line-height: 1; }
.hero h1 { margin: 0.07em 0 0.06em -0.012em; font-size: clamp(6rem, 13.5vw, 12.7rem); line-height: 0.83; letter-spacing: -0.045em; }
.hero-quote { margin-top: 1.55rem; font: italic 400 clamp(1.8rem, 3.2vw, 3.12rem)/1.02 var(--serif); color: var(--accent); }
.hero-description { max-width: 32ch; margin-top: 1.02rem; color: var(--muted); font-size: 1rem; }
.hero-actions { margin-top: 1.55rem; gap: 0.8rem 1.3rem; }
.hero-actions .button { padding-inline: 1.15rem; }
.hero-portrait { position: relative; padding: 9px; width: min(100%, 306px); justify-self: center; }
.hero-portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent-edge);
  border-radius: 4px;
  pointer-events: none;
}
.portrait-frame { box-shadow: 0 14px 32px #0002; }
.portrait-frame img { width: 100%; height: auto; }
.portrait-star {
  position: absolute;
  bottom: -13px;
  left: 50%;
  color: var(--accent);
  transform: translateX(-50%);
  background: var(--paper);
  padding-inline: 0.5rem;
  font-size: 1.2rem;
  line-height: 1.2;
}

.chapter-band { background: var(--band); border-block: 1px solid var(--edge); }
.threshold { padding-block: 2.6rem 2.9rem; scroll-margin-top: 0.8rem; }
.threshold h2 { margin-bottom: 1.2rem; }
.path-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.path-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 44% minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 7px;
  position: relative;
}
.path-art { display: grid; place-items: center; background: var(--art-mat); border-radius: 6px 0 0 6px; }
.path-art img { width: 100%; height: auto; }
.path-text { padding: 1rem 1.15rem; display: grid; align-content: center; gap: 0.48rem; }
.path-text h3 { font-size: 2.2rem; }
.path-text p { color: var(--muted); font-size: 0.88rem; }
.path-text .button { justify-self: start; margin-top: 0.25rem; }
.heaven-ending { margin-top: 1.3rem; border-left: 3px solid var(--accent-edge); background: var(--surface); padding: 1.3rem; }
.heaven-ending p { max-width: 75ch; }
.heaven-ending .button { margin-top: 0.8rem; }

.build-bar {
  --focus-ring: var(--gold-light);
  position: sticky;
  top: 0;
  z-index: 5;
  color: var(--build-text);
  background: var(--build-bg);
  box-shadow: 0 4px 14px #2d251927;
}
.build-bar-inner { display: grid; grid-template-columns: minmax(0, 1fr); }
.balances { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.4rem; padding-block: 0.66rem 0.58rem; }
.balance { display: inline-flex; align-items: baseline; gap: 0.45rem; white-space: nowrap; font-size: 0.87rem; }
.balance-name { color: #e2d6c5; }
.balance-symbol { color: var(--gold-light); }
.balance-symbol.q { color: #acdeed; }
.balance-symbol.v { color: #f1b2cb; }
.balance strong { font-variant-numeric: tabular-nums; }
.balance strong.negative { color: #ffac9f; }
.chapters {
  display: flex;
  align-items: center;
  gap: 0.15rem 0.22rem;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: #8d7d64 transparent;
  border-top: 1px solid #5c4b3b;
  padding-block: 0.22rem 0.25rem;
}
.chapters a {
  color: #f0e2cd;
  font-size: 0.8rem;
  font-weight: 610;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  padding: 0.63rem 0.7rem;
  border-radius: 3px;
}
.chapters a:hover, .chapters a[aria-current="location"] { color: var(--build-text); background: var(--build-active); }
.chapters a:focus-visible { outline-offset: -3px; }
.chapter-picker { display: none; }

.chapter { padding-block: 3rem; scroll-margin-top: var(--build-offset); border-bottom: 1px solid var(--edge); }
.chapter-heading { margin-bottom: 1.35rem; }
.chapter-heading .eyebrow { margin-bottom: 0.55rem; }
.chapter-heading > p:not(.eyebrow) { max-width: 72ch; color: var(--muted); margin-top: 0.55rem; }
.chapter details.lore { max-width: 77ch; margin-bottom: 1.25rem; }
.lore summary { color: var(--accent); font-weight: 660; }
.lore > div { margin-top: 0.7rem; }
.prose { color: var(--prose); overflow-wrap: anywhere; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 0.72rem; }
.prose ul { margin-bottom: 0; padding-left: 1.3rem; }
summary { cursor: pointer; min-height: 35px; padding-block: 0.33rem; }
summary:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.subchapter + .subchapter { margin-top: 2.15rem; }
.subchapter > h3 { margin: 0 0 0.55rem; font-size: 2.65rem; }
.note { margin-block: 0.8rem 1.2rem; color: var(--muted); font-size: 0.91rem; }
.build-status, .exchange, .wing-custom {
  border: 1px solid var(--edge);
  border-radius: 5px;
  background: var(--inset);
  padding: 0.85rem 1.1rem;
}
.build-status { margin-top: 1.1rem; font-size: 0.91rem; }
.exchange { margin-block: 0 1.1rem; }
.exchange h3 { margin-bottom: 0.35rem; }
.exchange form, .wing-custom { display: flex; align-items: end; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.8rem; }
.exchange .note { margin-bottom: 0; }
.field { display: grid; gap: 0.25rem; min-width: 0; }
.field label, .wing-custom label { font-size: 0.85rem; font-weight: 670; }
input, select, textarea {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--control-edge);
  border-radius: 4px;
  padding: 0.48rem 0.58rem;
  min-height: 44px;
  max-width: 100%;
}
input[type="number"] { width: 5rem; }
textarea { width: 100%; resize: vertical; }
textarea::placeholder { color: var(--muted); opacity: 1; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; align-items: start; }
.choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 3px 10px #5643210a;
  transition: box-shadow 160ms ease, border-color 160ms ease;
}
.choice-card:hover { border-color: var(--control-edge); }
.choice-card.is-selected, .path-card.is-selected {
  border-color: var(--selected-ring);
  box-shadow: 0 0 0 2px var(--selected-ring), 0 4px 12px #0002;
}
.card-art {
  width: 100%;
  aspect-ratio: var(--art-ratio, 1);
  max-height: var(--art-height, 360px);
  background: var(--art-mat);
  border-radius: 6px 6px 0 0;
}
.card-art img { width: 100%; height: 100%; object-fit: contain; }
#worlds { --art-ratio: 3 / 2; }
.halos { --art-ratio: 3 / 4; }
#welcomers { --art-ratio: 2 / 3; --art-height: 390px; }
.card-body { min-width: 0; padding: 0.95rem 1rem 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 0.55rem; margin-bottom: 0.55rem; }
.card-head h3, .card-head h4 { font-size: 1.85rem; }
.price {
  flex: none;
  background: var(--badge);
  color: var(--badge-text);
  border-radius: 3px;
  padding: 0.22rem 0.42rem;
  font-size: 0.76rem;
  font-weight: 740;
  white-space: nowrap;
}
.price.v { background: var(--v-badge); color: var(--v-text); }
.price.q { background: var(--q-badge); color: var(--q-text); }
.card-summary { color: var(--muted); font-size: 0.91rem; }
.card-body .prose { font-size: 0.9rem; }
.card-body details { margin-top: 0.45rem; }
.card-body summary { color: var(--accent); font-size: 0.85rem; font-weight: 670; }
.card-body details > .prose { margin-bottom: 0.35rem; }
.card-body:has(.card-description[open]) > .card-summary { display: none; }
.card-controls { display: grid; gap: 0.5rem; margin-top: 0.65rem; }
.select-button {
  display: flex;
  width: 100%;
  border-color: var(--control-edge);
  color: var(--control-text);
  background: var(--control-bg);
}
.select-button:hover:not(:disabled) { border-color: var(--accent); background: var(--control-hover); }
.select-button[aria-pressed="true"] { border-color: var(--selected); background: var(--selected); color: var(--selected-text); }
.select-button[aria-pressed="true"]:hover { background: var(--selected-hover); }
.select-button:disabled { border-color: var(--disabled-edge); background: var(--disabled-bg); color: var(--disabled-text); }
.constraint { color: var(--muted); font-size: 0.79rem; }
.constraint:empty { display: none; }
.action-row { display: flex; align-items: center; gap: 0.45rem; }
.action-row .button { flex: 1; }
.action-row .remove { flex: 0 0 auto; }
.tiers { display: grid; gap: 0.45rem; }
.tier { min-width: 0; border-top: 1px solid var(--line); padding-top: 0.4rem; }
.tier .button { margin-top: 0.35rem; }
.tier summary { padding-bottom: 0.12rem; }
.vows-intro {
  float: right;
  margin: 0 0 1rem 1.3rem;
  width: min(22%, 145px);
}
#vows .card-grid { clear: both; }

.review-panel { display: grid; grid-template-columns: 1.07fr 0.93fr; gap: 1.6rem; border: 1px solid var(--edge); border-radius: 7px; background: var(--surface); padding: clamp(1rem, 3vw, 1.65rem); }
#review-status, .review-notes p { margin: 0.5rem 0 0.85rem; color: var(--muted); font-size: 0.9rem; }
#review-choices div { display: grid; grid-template-columns: minmax(0, 7rem) minmax(0, 1fr); gap: 0.65rem; padding-block: 0.38rem; border-top: 1px solid var(--line); font-size: 0.86rem; }
#review-choices dt { font-weight: 700; }
#review-choices dd { overflow-wrap: anywhere; }
.review-notes label { display: block; margin-bottom: 0.45rem; font-weight: 700; }
.review-notes .text-button { margin-left: 0.5rem; }
.earth-ending { max-width: 72ch; margin: 1.45rem auto 0; text-align: center; font: italic 400 1.55rem/1.25 var(--serif); color: var(--accent); }
.site-footer { border-top: 1px solid var(--edge); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1.25rem; }
.footer-inner p { color: var(--muted); font-size: 0.87rem; }

dialog {
  width: min(650px, calc(100% - 1.75rem));
  max-height: min(87vh, 860px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--control-edge);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 14px 64px #28201857;
}
dialog::backdrop { background: #241b13af; }
.dialog-head { position: sticky; top: 0; z-index: 1; background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.85rem 1.15rem; border-bottom: 1px solid var(--edge); }
.dialog-head h2 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
.dialog-body { padding: 1.05rem 1.2rem 1.3rem; }
.original-dialog { width: min(980px, calc(100% - 1.75rem)); overflow: hidden; }
.original-dialog[open] { display: flex; flex-direction: column; }
.original-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.3rem 0.65rem; padding: 0.55rem 1rem; }
.original-controls a { font-size: 0.85rem; }
.page-tabs { display: flex; gap: 0.4rem; }
.page-tabs button { min-width: 42px; min-height: 42px; background: var(--surface); color: var(--ink); border: 1px solid var(--edge); border-radius: 4px; }
.page-tabs button[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); }
.original-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; background: var(--art-mat); }
.original-scroll img { width: 100%; }

@media (max-width: 850px) {
  .page-width, .header-inner { width: calc(100% - 56px); }
  .hero { gap: 2.1rem; padding-block: 2.75rem 3.3rem; }
  .wide-break { display: none; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .path-text { padding-inline: 0.78rem; }
  .chapter { padding-block: 2.45rem; }
}
@media (max-width: 620px) {
  :root { --build-offset: 115px; }
  .page-width, .header-inner { width: calc(100% - 36px); }
  .header-inner { min-height: 62px; gap: 0.5rem; }
  .site-actions { gap: 0.15rem 0.4rem; justify-content: end; }
  .site-actions .button, .site-actions .text-button { font-size: 0.74rem; }
  .site-actions .button { padding-inline: 0.4rem; gap: 0.25rem; }
  .wordmark { font-size: 1.7rem; gap: 0.3rem; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 1.35rem; padding-block: 1.65rem 2.55rem; }
  .hero h1 { font-size: clamp(5.65rem, 22vw, 8rem); }
  .hero-quote { margin-top: 0.9rem; font-size: 2.1rem; }
  .hero-description { margin-top: 0.55rem; }
  .hero-actions { margin-top: 0.86rem; }
  .hero-portrait { width: min(68%, 224px); padding: 6px; }
  .portrait-star { bottom: -10px; font-size: 0.96rem; }
  .threshold { padding-block: 1.5rem 1.85rem; }
  .path-grid, .review-panel { grid-template-columns: minmax(0, 1fr); }
  .path-card { grid-template-columns: minmax(0, 1fr); }
  .path-art { border-radius: 6px 6px 0 0; }
  .path-text h3 { font-size: 1.9rem; }
  .balances { gap: 0.25rem 0.62rem; padding-block: 0.48rem 0.45rem; }
  .balance { gap: 0.25rem; font-size: 0.72rem; }
  .balance-symbol { display: none; }
  .chapters { display: none; }
  .chapter-picker {
    display: flex;
    align-items: center;
    gap: 0.66rem;
    padding-block: 0.2rem 0.5rem;
    color: #e2d6c5;
    font-size: 0.77rem;
  }
  .chapter-picker select {
    flex: 1;
    min-width: 0;
    min-height: 39px;
    background: #4d3d2e;
    color: var(--build-text);
    border-color: #a38e71;
    font-size: 0.85rem;
  }
  .chapter-picker select:focus-visible { outline-offset: 2px; }
  .card-grid { gap: 0.85rem; grid-template-columns: minmax(0, 1fr); }
  .chapter { padding-block: 1.85rem; }
  .footer-inner { flex-wrap: wrap; gap: 0.35rem 0.65rem; }
  .footer-inner p { order: 3; width: 100%; }
}
@media (max-width: 460px) {
  .export-label { display: none; }
  .export-label-short { display: inline; }
}
@media (max-width: 355px) {
  .page-width, .header-inner { width: calc(100% - 24px); }
  .original-label { display: none; }
  .original-label-short { display: inline; }
  .hero-actions { gap: 0.25rem 0.45rem; }
  .hero-actions .button { padding-inline: 0.7rem; }
  .balance { font-size: 0.68rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
