
:root {
  --ink: #1c1814;
  --muted: #5e564c;
  --paper: #f4efe4;
  --card: #fbf7f1;
  --line: #e2d5c4;
  --brass: #a68456;
  --header: #1e2a24;
  --free: #1d6b45;
  --cream: #f6f1e7;
}
* { box-sizing: border-box; }
html { font-size: 18px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Segoe UI", sans-serif; line-height: 1.45; }
img, svg { max-width: 100%; }
.shell { width: 100%; max-width: 768px; margin: 0 auto; background: var(--paper); min-height: 100vh; }
.bar {
  width: 100dvw; margin-left: calc(50% - 50dvw);
  background: var(--header); color: var(--cream);
  position: sticky; top: 0; z-index: 5;
}
.bar-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  width: 100%; max-width: 768px; margin: 0 auto;
  gap: 0.6rem 1rem; padding: 0.85rem 1.15rem;
}
.brand img { height: 3.4rem; width: auto; display: block; }
.brand { color: var(--cream); text-decoration: none; font-family: Georgia, serif; font-size: 1.15rem; letter-spacing: 0.01em; }
.brand span { color: var(--brass); font-style: italic; }
nav { display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem; }
nav a { color: #efe6d6; text-decoration: none; font-size: 0.86rem; }
nav a.on, nav a:hover { color: #fff; border-bottom: 2px solid var(--brass); }
.hero { margin: 0; }
.hero img, .band img { width: 100%; height: 22rem; object-fit: cover; display: block; }
.hero figcaption, .band figcaption {
  margin: 0; padding: 0.75rem 1.15rem; background: #fffaf3;
  border-left: 4px solid var(--brass); font-family: Georgia, serif; font-size: 1.05rem;
}
.map-hero { padding: 0.9rem 1rem 0.2rem; }
.stage { position: relative; border-radius: 18px; overflow: hidden; line-height: 0; box-shadow: 0 10px 24px rgba(40, 28, 16, 0.12); }
.world { width: 100%; height: auto; display: block; }
.explorer {
  position: absolute; left: 1.5%; bottom: 0; height: 68%; width: auto; max-width: none;
  pointer-events: none; filter: drop-shadow(0 10px 8px rgba(20, 30, 40, 0.28));
}
.map-note { margin: 0.55rem 0 0; color: var(--muted); font-size: 0.9rem; }
.places { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.places a {
  color: var(--ink); text-decoration: none; background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.28rem 0.7rem; font-size: 0.86rem;
}
.places a.here { background: #e5f2ea; border-color: var(--free); color: var(--free); font-weight: 700; }
.lede { font-family: Georgia, serif; font-size: clamp(1.35rem, 4vw, 1.7rem); line-height: 1.25; margin: 0.85rem 0 0.2rem; }
.front { padding: 0.4rem 1rem 0.4rem; }
.lead {
  display: block; color: inherit; text-decoration: none;
  background: var(--card); border-radius: 16px; overflow: hidden;
  box-shadow: 0 1px 0 var(--line), 0 10px 24px rgba(40, 28, 16, 0.06);
}
.lead:hover { outline: 2px solid var(--brass); }
.lead img { width: 100%; height: 16rem; object-fit: cover; display: block; }
.lead-text { padding: 0.85rem 1rem 1rem; }
.dateline { margin: 0 0 0.25rem; font-family: Georgia, serif; font-style: italic; color: #8a6233; font-size: 0.95rem; }
.lead h2 { margin: 0 0 0.3rem; font-family: Georgia, serif; font-size: clamp(1.35rem, 4vw, 1.7rem); line-height: 1.15; }
.rail { list-style: none; margin: 0; padding: 0; }
.rail li {
  display: grid; grid-template-columns: 7.2rem 1fr; gap: 0.8rem;
  align-items: center; padding: 0.75rem 0; border-top: 1px solid var(--line);
}
.rail img { width: 100%; height: 5rem; object-fit: cover; border-radius: 10px; display: block; }
.rail h3 { margin: 0; font-family: Georgia, serif; font-size: 1.08rem; }
.intro { padding: 1.2rem 1.15rem 0.2rem; }
.intro p { margin: 0 0 0.8rem; }
h2.section { margin: 1.2rem 0 0.7rem; font-family: Georgia, serif; font-size: 1.25rem; }
.lesson-row h2.section { margin: 0.35rem 0 0.3rem; }
.lesson-note { margin: 0 0 0.45rem; color: var(--muted); font-size: 0.92rem; }
.see-lessons { margin: 0.15rem 0 0.8rem; }
.see-lessons a { color: #7a4e2d; font-weight: 700; display: inline-flex; align-items: center; min-height: 2.75rem; }
#stories-heading { margin: 0.9rem 0 0.25rem; }
.pbody, .copy, .story { padding: 0.9rem 1rem 1rem; }
h1, h3, .lede, .story p { font-family: Georgia, serif; }
h1 { font-size: clamp(1.45rem, 5vw, 1.8rem); line-height: 1.15; margin: 0.2rem 0 0.45rem; }
h3 { margin: 0 0 0.3rem; font-size: 1.15rem; }
.meta { margin: 0; color: var(--muted); font-size: 0.92rem; }
.badge { color: var(--free); font-weight: 700; }
.badge + .badge { margin-left: 0.45rem; }
.locks, .credit, .source, footer { color: var(--muted); }
.locks { margin: 0.7rem 0 0; font-size: 0.9rem; }
.credit, .source { margin: 0.45rem 0 0; font-size: 0.85rem; }
.story { padding-top: 0.4rem; }
.story p { font-size: 1.05rem; line-height: 1.6; margin: 0 0 0.95rem; }
.back { margin: 0.8rem 1.15rem 0; font-size: 0.9rem; }
.back a, .copy a { color: #7a4e2d; }
.locked { margin: 0 1.15rem; padding: 0.85rem 0; border-top: 1px solid var(--line); }
.locked h2 { font-family: Georgia, serif; font-size: 1.05rem; margin: 0; }
.locked p { margin: 0.2rem 0 0; color: var(--muted); }
.copy { padding: 1.1rem 1.15rem 0.4rem; }
.copy h1 { margin-top: 0; }
.age-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.45rem;
  margin: 0 0 0.85rem;
}
.age-switch button {
  font: inherit;
  font-family: Georgia, serif;
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.35rem 0.1rem;
  min-height: 2.75rem;
  cursor: pointer;
}
.age-switch button[aria-pressed="true"] {
  font-weight: 700;
  border-bottom-color: var(--free);
}
.age-gap { color: var(--muted); }
.story .sources { margin: 0.2rem 0 0.9rem; padding-left: 1.2rem; }
.story .sources li { margin: 0.35rem 0; }
.lesson-text { white-space: pre-wrap; margin: 0.45rem 0 0; line-height: 1.55; }
footer {
  width: 100dvw; margin-left: calc(50% - 50dvw);
  background: var(--header); color: var(--cream);
}
.footer-inner {
  width: 100%; max-width: 768px; margin: 0 auto;
  padding: 1.1rem 1rem 2rem; font-size: 0.95rem;
}
footer p { margin: 0 0 0.55rem; }
footer p:last-child { margin-bottom: 0; }
footer a { color: #efe6d6; }
footer a:hover { color: #fff; }
footer .footer-title { font-family: Georgia, serif; font-weight: 700; }
.band img { height: 12rem; }
@media (max-width: 640px) {
  html { font-size: 16px; }
  .bar-inner, .map-hero, .front, .footer-inner, .copy, .story, .back { padding-left: 0.8rem; padding-right: 0.8rem; }
  .bar-inner { flex-wrap: nowrap; align-items: center; gap: 0.45rem; padding-top: 0.45rem; padding-bottom: 0.45rem; }
  .brand { flex: 0 0 auto; }
  .brand img { height: 2.5rem; }
  nav { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; gap: 0.15rem 0.65rem; padding: 0.15rem 0.1rem 0.25rem; }
  nav a { white-space: nowrap; padding: 0.45rem 0.05rem; }
  .lead img { height: 11rem; }
  .rail li { grid-template-columns: 4.8rem 1fr; gap: 0.6rem; }
  .rail img { height: 4rem; }
  .explorer { height: 48%; }
  .hero img { height: 14rem; }
  .story { margin-left: 0.8rem; margin-right: 0.8rem; }
}

.rail a.rowlink { display: contents; color: inherit; text-decoration: none; }
.rail li:hover { outline: 2px solid var(--brass); }

.cards { list-style: none; margin: 0; padding: 0; }
.cards li { border-top: 1px solid var(--line); }
.cards a { display: block; padding: 0.75rem 0; color: inherit; text-decoration: none; }
.cards a:hover { outline: 2px solid var(--brass); }
.cards h3 { margin: 0; font-family: Georgia, serif; font-size: 1.08rem; }
.cards .meta { margin: 0.2rem 0 0; }

.hero figcaption.credit { font-size: 0.85rem; color: var(--muted); }
.cards img { width: 100%; height: 9rem; object-fit: cover; display: block; border-radius: 10px; margin: 0.15rem 0 0.55rem; }

.shelf-label { margin: 0.95rem 0 0; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pills, .bands, .shelves { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.pills button, .bands button, .shelves button, .shelves a {
  font: inherit; cursor: pointer; background: var(--card);
  border: 2px solid var(--line); border-radius: 999px; padding: 0.28rem 0.7rem; font-size: 0.86rem;
}
.shelves a { text-decoration: none; display: inline-flex; align-items: center; }
.bands button, .shelves button, .shelves a { color: var(--ink); }
.pills button.on, .bands button.on, .shelves button.on {
  background: #fff;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px currentColor;
}
.pick { margin: 0.4rem 0 0.8rem; color: var(--muted); }
.cards li[hidden] { display: none !important; }
.nophoto, .empty-hero { background: #fffaf3; border: 1px dashed var(--line); }
.nophoto { height: 9rem; border-radius: 10px; margin: 0.15rem 0 0.55rem; }
.empty-hero { height: 8rem; margin: 0.8rem 1rem 0; border-radius: 12px; }
.story {
  background: #fffaf3;
  margin: 0.6rem 1rem 1rem;
  padding: 0.95rem 1rem 1rem;
  border-radius: 14px;
}


.load-more {
  display: block;
  margin: 0.9rem auto 1rem;
  padding: 0.55rem 1.2rem;
  color: var(--cream);
  background: var(--header);
  border: 0;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}
.load-more:hover { background: #2b3b32; }
.load-more:focus-visible { outline: 3px solid #1c1814; outline-offset: 3px; }

html { overflow-x: clip; }
h1, h2, h3, p, a { overflow-wrap: break-word; }
.story a, .source a, .copy a { overflow-wrap: anywhere; }
h2.shelf-label {
  font-family: "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.95rem 0 0;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: 0.6rem;
  top: 0.5rem;
  z-index: 6;
  background: #fffaf3;
  color: #1c1814;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #1c1814;
  outline-offset: 2px;
}
.bar a:focus-visible, footer a:focus-visible { outline-color: #f6f1e7; }
.pills button, .bands button, .shelves button, .shelves a, .load-more { min-height: 2.75rem; }
.pin { cursor: pointer; }
.pin:focus { outline: none; }
/* Drawn size stays at the markup radius. The first circle is only the tap target. */
.pin circle:nth-of-type(1) { r: 130; pointer-events: none; }
.pin circle:nth-of-type(2) { r: 26; stroke: #1c1814; stroke-width: 8; }
.pin circle[fill="#a68456"] { fill: #7a5e38; }
.pin circle[fill="#c46b2c"] { fill: #8f4c16; }
.pin:focus-visible circle:nth-of-type(2),
.pin[data-ready="true"] circle:nth-of-type(2) { stroke: #143d28; stroke-width: 16; }
@media (max-width: 640px) {
  .pin circle:nth-of-type(1) { r: 170; }
}
#content, #stories, .cards a, .back { scroll-margin-top: 4.5rem; }
#win-form input[type="text"],
#win-form select {
  font: inherit;
  font-size: 1rem;
  width: 100%;
  max-width: 28rem;
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
#win-form button[type="submit"] {
  font: inherit;
  margin-top: 0.4rem;
  padding: 0.55rem 1.2rem;
  min-height: 2.75rem;
  color: var(--cream);
  background: var(--header);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
#win-form fieldset {
  margin: 0.85rem 0;
  padding: 0.55rem 0.8rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}
#win-form legend { font-family: Georgia, serif; padding: 0 0.2rem; }
#win-form label { display: inline-block; margin: 0.28rem 0; }
#win-form input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: #1d6b45;
  vertical-align: -0.15rem;
}
.account-form input[type="email"],
.account-form input[type="text"],
.account-form select,
.account-form textarea {
  font: inherit;
  font-size: 1rem;
  width: 100%;
  max-width: 28rem;
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
#contact-form label { display: block; }
#contact-form textarea { max-width: 100%; min-height: 8rem; resize: vertical; }
#contact-form .hint { color: var(--muted); font-size: 0.85rem; }
#turnstile-slot { margin: 0.8rem 0 0.2rem; min-height: 0; }
.offscreen {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.account-form button,
#sign-out,
#use-different,
#manage-subscription,
.currency-switch button,
.plan button {
  font: inherit;
  margin-top: 0.4rem;
  padding: 0.55rem 1.2rem;
  min-height: 2.75rem;
  border-radius: 999px;
  cursor: pointer;
}
.account-form button,
#sign-out,
#manage-subscription,
.plan button {
  color: var(--cream);
  background: var(--header);
  border: 0;
}
.currency-switch { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 0.8rem; }
.currency-switch button {
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
}
.currency-switch button[aria-pressed="true"] {
  color: var(--cream);
  background: var(--header);
  border-color: var(--header);
}
.plan {
  margin: 0.7rem 0;
  padding: 0.85rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.plan h3 { margin: 0; font-family: Georgia, serif; font-size: 1.15rem; }
.plan .plan-price { margin: 0.35rem 0; font-family: Georgia, serif; }
.plan button { margin-right: 0.55rem; }
#use-different {
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
}
.draft-banner {
  background: #fff3cd;
  border: 1px solid #e2c56b;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
}
.lesson-parts .lesson-open { margin-top: 0.35rem; }
.lesson-open ol { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.lesson-open li { margin: 0.25rem 0; }
.lesson-open .coming,
.lesson-open .answer { margin: 0.35rem 0 0; }
.lesson-open fieldset {
  margin: 0.7rem 0 0;
  padding: 0.55rem 0.8rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.lesson-open legend { font-family: Georgia, serif; padding: 0 0.2rem; }
.lesson-open label { display: block; margin: 0.28rem 0; }
.lesson-open input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: #1d6b45;
  vertical-align: -0.15rem;
}
.lesson-open button {
  font: inherit;
  margin-top: 0.35rem;
  padding: 0;
  background: transparent;
  border: 0;
  color: #7a4e2d;
  text-decoration: underline;
  cursor: pointer;
}
.audio-slot { margin-top: 0.45rem; }
.audio-slot audio { width: 100%; }
