:root {
  --moss: #2B4233; --moss-deep: #1E2E24; --night: #13201A;
  --vellum: #EFE6CF; --vellum-dim: #C9C2AD; --copper: #C98A3F; --river: #9FC2CF;
  --water:#9FC2CF; --fire:#E08A4B; --grove:#8FBF6E; --earth:#C2A074; --wind:#DDD6C2; --light:#F3E6B8; --dark:#8C7AB8;
  --measure: 64ch;
}
* { box-sizing: border-box; }
html { background: var(--moss); color: var(--vellum); font-family: "Fraunces", Georgia, serif; font-optical-sizing: auto; }
body { margin: 0; font-size: 18px; line-height: 1.65; }
a { color: var(--copper); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--vellum); }
:focus-visible { outline: 2px solid var(--river); outline-offset: 3px; }
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 24px; }

header.site { position: absolute; inset: 0 0 auto; padding: 24px 0 0; z-index: 2; }
header.site .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 1100px; }
.brand { font-weight: 600; font-size: 1.05rem; color: var(--vellum); text-decoration: none; }
.brand small { color: var(--vellum-dim); font-weight: 400; margin-left: .5em; }
nav a { margin-left: 18px; font-size: .95rem; }

/* ---------- hero scene */
.hero { position: relative; min-height: 70vh; max-height: 760px; display: grid; align-items: end; overflow: hidden;
  background: linear-gradient(180deg, var(--night) 0%, #1B2E24 55%, var(--moss) 100%); }
.hero .scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .copy { position: relative; z-index: 1; padding: 110px 24px 56px; max-width: 1100px; margin: 0 auto; width: 100%; }
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); line-height: .98; font-weight: 700; letter-spacing: -.025em; margin: 0 0 22px; max-width: 14ch;
  text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.entry { font-style: italic; font-size: 1.2rem; line-height: 1.55; margin: 0 0 18px; max-width: 54ch; }
.entry .initial { float: left; font-style: normal; font-weight: 700; font-size: 4.2rem; line-height: .8; padding: 10px 10px 0 0; color: var(--copper); }
.hero p.plain { color: var(--vellum-dim); margin: 0 0 26px; max-width: 54ch; }
.cta { display: inline-block; background: var(--copper); color: var(--night); font-weight: 600; padding: 12px 20px; border-radius: 4px; text-decoration: none; }
.cta:hover { background: var(--vellum); color: var(--night); }
.cta + .cta { background: transparent; color: var(--vellum); border: 1px solid rgba(239,230,207,.45); margin-left: 10px; }

.mote { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--river); opacity: 0; filter: blur(.5px); box-shadow: 0 0 10px 3px rgba(159,194,207,.55); }
@media (prefers-reduced-motion: no-preference) {
  .mote { animation: rise 11s linear infinite; }
  @keyframes rise { 0% { transform: translateY(0) translateX(0); opacity: 0; } 10% { opacity: .9; } 90% { opacity: .5; } 100% { transform: translateY(-78vh) translateX(var(--drift, 20px)); opacity: 0; } }
  .lantern { animation: flicker 3.2s ease-in-out infinite; }
  @keyframes flicker { 0%,100% { opacity: .85; } 50% { opacity: 1; } }
}

/* ---------- sections */
.rule { border: 0; height: 0; margin: 48px 0; position: relative; border-top: 1px solid rgba(201,138,63,.45); }
.rule::after { content: ""; position: absolute; left: 50%; top: -5px; width: 9px; height: 9px; transform: translateX(-50%) rotate(45deg); background: var(--moss); border: 1px solid var(--copper); }
h2 { font-size: 1.65rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 14px; }
section p { margin: 0 0 16px; }
.two { display: grid; gap: 32px; }
@media (min-width: 760px) { .two { grid-template-columns: 1fr 1fr; } }

/* ---------- chain toy */
.chain { background: var(--moss-deep); border-radius: 8px; padding: 22px 22px 18px; }
.chain .elements { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.el { font: inherit; font-size: .95rem; font-weight: 600; color: var(--night); border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; background: var(--c); }
.el:hover { filter: brightness(1.12); }
.el.breathbtn { background: transparent; color: var(--river); border: 1px dashed var(--river); }
.strip { display: flex; flex-wrap: wrap; gap: 26px 8px; align-items: center; min-height: 46px; margin-bottom: 14px; }
.link { padding: 6px 12px; border-radius: 4px; background: var(--c); color: var(--night); font-weight: 600; font-size: .95rem; position: relative; }
.link::after { content: attr(data-note); position: absolute; left: 0; top: 100%; font-size: .72rem; font-weight: 400; color: var(--vellum-dim); white-space: nowrap; }
.link.broke { opacity: .45; text-decoration: line-through; }
.strip .plus { color: var(--copper); font-size: 1.1rem; }
.readout { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--vellum-dim); font-size: .95rem; margin-top: 18px; }
.readout strong { color: var(--vellum); font-size: 1.3rem; }
.readout button { font: inherit; font-size: .9rem; background: none; border: 1px solid rgba(239,230,207,.35); color: var(--vellum-dim); border-radius: 4px; padding: 5px 10px; cursor: pointer; }

/* ---------- legend page */
.page { background: var(--vellum); color: #2A2A22; border-radius: 4px; padding: 28px 30px; box-shadow: 0 20px 50px rgba(0,0,0,.35); position: relative; max-width: 46ch; margin: 0 auto; }
.page::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(42,42,34,.25); pointer-events: none; }
.page h3 { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.page .sub { color: #6A6657; margin: 2px 0 14px; font-style: italic; }
.page ol { margin: 0; padding-left: 1.2em; }
.page li { margin: 0 0 8px; }
.page li::marker { color: #9A6A2C; }
.page .relic { margin-top: 16px; border-top: 1px solid rgba(42,42,34,.3); padding-top: 10px; color: #4A4538; }

dl.elements { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; }
dl.elements dt { font-weight: 600; }
dl.elements dd { margin: 0; color: var(--vellum-dim); }
dl.elements dt.breath { color: var(--river); }

.stores { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.stores span { border: 1px solid rgba(239,230,207,.35); padding: 10px 16px; border-radius: 4px; color: var(--vellum-dim); font-size: .95rem; }

footer.site { background: var(--night); margin-top: 72px; padding: 36px 0 44px; font-size: .92rem; color: var(--vellum-dim); }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; }
footer.site a { color: var(--vellum-dim); }

/* legal pages */
.legal { padding-top: 100px; }
.legal h1 { font-size: 2.2rem; max-width: none; text-shadow: none; }
.legal h2 { font-size: 1.25rem; margin-top: 32px; }
.legal table { border-collapse: collapse; width: 100%; margin: 12px 0 24px; }
.legal th, .legal td { text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(239,230,207,.18); }
.note { color: var(--vellum-dim); font-style: italic; }
body.plain header.site { position: static; padding-top: 24px; }
body.plain .legal { padding-top: 24px; }
