:root {
  --ink: #1f1730;
  --paper: #fff8e8;
  --panel: #fff1c7;
  --night: #1d122e;
  --night-soft: #26183c;
  --footer-ink: #f5edff;
  --footer-muted: rgba(245, 237, 255, 0.72);
  --read: #c1447a;
  --world: #2f8f83;
  --language: #4b63c7;
  --artefacts: #d17a22;
  --line: rgba(31, 23, 48, 0.18);
}

* { box-sizing: border-box; }

html {
  background: var(--night);
}

body {
  margin: 0;
  background-color: var(--night);
  background-image:
    radial-gradient(circle at 8% 10%, rgba(255, 213, 94, 0.34), transparent 17rem),
    radial-gradient(circle at 92% 8%, rgba(113, 218, 203, 0.24), transparent 18rem),
    radial-gradient(circle at 50% 92%, rgba(193, 68, 122, 0.18), transparent 24rem),
    radial-gradient(circle, rgba(255, 248, 232, 0.08) 1px, transparent 1px);
  background-size: auto, auto, auto, 28px 28px;
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: white;
  transform: translateY(-200%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 248, 232, 0.94);
  backdrop-filter: blur(10px);
}

.site-nav {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  font-size: 0.93rem;
}

.brand {
  font-weight: 900;
  text-decoration: none;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.7rem;
  justify-content: flex-end;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  font-weight: 700;
}

.site-main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.55rem 1rem 3rem;
}

.hero, .page-section, .story-page, .panel {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 248, 232, 0.44);
  border-radius: 1.35rem;
  padding: clamp(1.2rem, 2.35vw, 2rem);
  box-shadow: 0 1rem 3rem rgba(9, 5, 18, 0.28);
}

.hero-illustrated {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 0.65fr);
  gap: 1.25rem;
  align-items: stretch;
}

.hero h1, .page-section h1, .story-content h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3.45vw, 3.05rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero p, .lede {
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  max-width: 46rem;
}

.hero-art {
  min-height: 18rem;
  border-radius: 1.2rem;
  background: linear-gradient(160deg, #45c6b3, #6c56d9 52%, #f0a23c);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 232, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.hero-art p {
  position: absolute;
  left: 1rem;
  bottom: 0.8rem;
  margin: 0;
  color: white;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sun-orb {
  position: absolute;
  right: 2rem;
  top: 2rem;
  width: 4.6rem;
  height: 4.6rem;
  border-radius: 999px;
  background: #ffe577;
  box-shadow: 0 0 2.5rem rgba(255, 229, 119, 0.75);
}

.bridge-arc {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 48%;
  height: 5rem;
  border-top: 0.65rem solid rgba(255, 255, 255, 0.82);
  border-radius: 100% 100% 0 0;
}

.mist-band {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 20%;
  height: 4.2rem;
  background: rgba(255, 255, 255, 0.34);
  transform: rotate(-4deg);
}

.map-line {
  position: absolute;
  height: 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}

.line-one { left: 12%; top: 25%; width: 52%; transform: rotate(-12deg); }
.line-two { left: 28%; top: 72%; width: 58%; transform: rotate(9deg); }

.star {
  position: absolute;
  color: white;
  font-size: 1.7rem;
}

.star-one { left: 18%; top: 16%; }
.star-two { right: 22%; bottom: 22%; }

.figure-dot {
  position: absolute;
  left: 47%;
  top: 53%;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 1.05rem 0 -0.2rem var(--ink);
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #6d3b91;
  font-size: 0.9rem;
}

.door-grid, .story-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}

.story-list {
  padding: 0;
  list-style: none;
}

.story-list li {
  min-width: 0;
}

.door-card, .story-card {
  min-height: 12rem;
  border-radius: 1.2rem;
  padding: 0.9rem;
  text-decoration: none;
  border: 1px solid rgba(255, 248, 232, 0.24);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: white;
  box-shadow: 0 0.8rem 2rem rgba(9, 5, 18, 0.2);
}

.story-card {
  min-height: 100%;
  justify-content: flex-start;
  gap: 0.5rem;
}

.story-card-action {
  margin-top: auto;
  padding-top: 0.35rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.story-card-pending {
  background: rgba(255, 248, 232, 0.84);
  color: var(--ink);
  border: 1px dashed rgba(255, 248, 232, 0.5);
}

.story-card-pending strong,
.story-card-pending span,
.story-card-pending p {
  opacity: 0.78;
}

.symbol-circle {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.44);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  margin-bottom: auto;
}

.story-card-symbol {
  width: 3.25rem;
  height: 3.25rem;
  display: block;
  object-fit: contain;
  margin-bottom: 0.25rem;
  padding: 0.12rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 0.55rem 1.4rem rgba(31, 23, 48, 0.16);
}

.door-card span:not(.symbol-circle), .story-card span {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.door-card strong, .story-card strong {
  font-size: 1.12rem;
  line-height: 1.1;
}

.door-card p, .story-card p {
  margin-bottom: 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.read, .story-card { background: var(--read); }
.story-card-pending { background: rgba(255, 248, 232, 0.84); }
.world { background: var(--world); }
.language { background: var(--language); }
.artefacts { background: var(--artefacts); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.2rem 0.3rem 0.2rem 0;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.9rem;
}

.button.secondary { background: #6d3b91; }

.link-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.link-list a {
  padding: 0.85rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.visual-callout {
  display: grid;
  grid-template-columns: minmax(6rem, 0.35fr) minmax(0, 1fr);
  gap: clamp(0.85rem, 2vw, 1.35rem);
  align-items: center;
  margin: 1rem 0;
  padding: clamp(1rem, 2.2vw, 1.45rem);
  border: 1px solid rgba(31, 23, 48, 0.14);
  border-radius: 1.2rem;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.42), transparent 8rem),
    rgba(255, 241, 199, 0.82);
  box-shadow: 0 0.85rem 2rem rgba(9, 5, 18, 0.16);
}

.visual-callout-mark {
  min-height: 8rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, var(--language), var(--read));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.visual-callout-mark span {
  width: 4.4rem;
  height: 4.4rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 2.25rem;
  line-height: 1;
}

.visual-callout-copy h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.visual-callout-copy p:not(.eyebrow) {
  margin: 0.55rem 0 0;
  max-width: 46rem;
}

.visual-callout-link {
  display: inline-flex;
  margin-top: 0.8rem;
  font-weight: 900;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
}

.visual-callout-read .visual-callout-mark { background: linear-gradient(145deg, #ed74a8, var(--read)); }
.visual-callout-world .visual-callout-mark { background: linear-gradient(145deg, #77d6bd, var(--world)); }
.visual-callout-language .visual-callout-mark { background: linear-gradient(145deg, #8a94ee, var(--language)); }
.visual-callout-artefacts .visual-callout-mark { background: linear-gradient(145deg, #f2b35f, var(--artefacts)); }
.visual-callout-memory .visual-callout-mark { background: linear-gradient(145deg, #6c56d9, #c1447a); }

.lexicon-list {
  display: grid;
  gap: 1.15rem;
  margin-top: 1.5rem;
}

.lexicon-entry {
  padding: clamp(1rem, 3vw, 1.35rem);
  background: rgba(255, 241, 199, 0.82);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
}

.lexicon-entry-header {
  display: grid;
  gap: 0.25rem;
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid rgba(31, 23, 48, 0.16);
}

.lexicon-entry-header h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.08;
}

.lexicon-entry-header p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.lexicon-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.lexicon-fields div {
  min-width: 0;
  padding: 0.75rem;
  background: rgba(255, 248, 232, 0.74);
  border: 1px solid rgba(31, 23, 48, 0.11);
  border-radius: 0.9rem;
}

.lexicon-fields .wide-field {
  grid-column: span 3;
}

.lexicon-fields dt {
  margin-bottom: 0.2rem;
  color: #6d3b91;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.lexicon-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.story-header-compact {
  margin-bottom: 1rem;
}

.story-header-compact .eyebrow,
.story-header-compact .story-count {
  margin: 0;
}

.story-hero-image {
  margin: 1rem 0 0;
  max-width: 46rem;
}

.story-hero-image img {
  display: block;
  width: 100%;
  max-height: 34rem;
  object-fit: cover;
  border-radius: 1.1rem;
  border: 1px solid rgba(31, 23, 48, 0.16);
  box-shadow: 0 0.85rem 2rem rgba(9, 5, 18, 0.16);
}

.story-content {
  max-width: 46rem;
  margin-top: 1rem;
}

.story-content p, .story-content li { font-size: 1.07rem; }
.story-content h2 { margin-top: 2.5rem; font-size: clamp(1.45rem, 2.2vw, 1.8rem); }
.story-content > h1 + p,
.story-content > h1 + p + p {
  color: #442c5f;
}
.story-count { font-weight: 800; color: #6d3b91; }

.site-footer {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.35rem 1rem;
  border-top: 1px solid rgba(245, 237, 255, 0.2);
  color: var(--footer-ink);
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  font-size: 0.92rem;
}

.footer-mark { margin: 0; }
.footer-note { margin: 0.2rem 0 0; color: var(--footer-muted); font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.45rem 0.75rem; }
.footer-links a { color: var(--footer-ink); text-decoration: none; }

@media (max-width: 1020px) {
  .door-grid, .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero-illustrated { grid-template-columns: 1fr; }
  .hero-art { min-height: 15rem; }
  .lexicon-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lexicon-fields .wide-field { grid-column: span 2; }
}

@media (max-width: 860px) {
  .site-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 0.6rem 1rem;
  }

  .nav-links a {
    white-space: nowrap;
  }

  .door-grid, .story-grid { grid-template-columns: 1fr; }
  .door-card, .story-card { min-height: 9.5rem; }
  .story-card-symbol { width: 3rem; height: 3rem; }
  .site-footer { flex-direction: column; }
}

@media (max-width: 700px) {
  .visual-callout {
    grid-template-columns: 1fr;
  }

  .visual-callout-mark {
    min-height: 6.5rem;
  }
}

@media (max-width: 520px) {
  .site-main {
    padding: 1rem 0.7rem 2.5rem;
  }

  .site-nav {
    padding: 0.7rem;
  }

  .brand {
    font-size: 1rem;
  }

  .nav-links {
    gap: 0.4rem 0.7rem;
    font-size: 0.92rem;
  }

  .hero, .page-section, .story-page, .panel {
    border-radius: 1rem;
    padding: 1.1rem;
  }

  .hero h1, .page-section h1, .story-content h1 {
    font-size: clamp(1.85rem, 9vw, 2.45rem);
    line-height: 1.04;
    letter-spacing: -0.035em;
  }

  .hero p, .lede,
  .page-section p,
  .story-header p {
    font-size: 1rem;
    line-height: 1.55;
  }

  .eyebrow {
    margin-bottom: 0.55rem;
    font-size: 0.78rem;
    letter-spacing: 0.13em;
  }

  .link-list {
    gap: 0.55rem;
    margin-top: 1rem;
  }

  .link-list a {
    padding: 0.75rem 0.85rem;
    border-radius: 0.85rem;
    font-size: 0.95rem;
  }

  .hero-art {
    min-height: 13rem;
  }

  .door-card, .story-card {
    min-height: 8.75rem;
  }

  .story-hero-image img {
    max-height: 22rem;
    border-radius: 0.9rem;
  }

  .visual-callout {
    padding: 0.9rem;
    border-radius: 1rem;
  }

  .visual-callout-mark {
    min-height: 5.75rem;
    border-radius: 0.85rem;
  }

  .visual-callout-mark span {
    width: 3.6rem;
    height: 3.6rem;
    font-size: 1.9rem;
  }

  .lexicon-fields,
  .lexicon-fields .wide-field {
    grid-template-columns: 1fr;
    grid-column: span 1;
  }

  .button {
    width: 100%;
    margin-right: 0;
  }
}
