/* Corporate While Black — shared styles. Palette from the cut-paper cover system. */
:root {
  --ink: #0d0f14;
  --ink-2: #151925;
  --indigo: #182648;
  --oxblood: #681626;
  --forest: #123a2c;
  --cream: #f4ecdb;
  --copper: #c46e34;
  --gold: #e2b042;
  --muted: #a8a29e;
}

html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

.display { font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.text-gold { color: var(--gold); }
.text-copper { color: var(--copper); }
.text-cream { color: var(--cream); }
.text-soft { color: #cfc6b4; }
.bg-ink-2 { background: var(--ink-2); }

/* Glass nav */
.glass {
  background: rgba(13, 15, 20, .72);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(244, 236, 219, .08);
}
.nav-link { color: #d6cdbb; font-size: .875rem; transition: color .2s; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--cream); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: 999px;
  font-weight: 700; padding: .8rem 1.4rem; transition: transform .15s ease, background .2s, box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn-gold { background: var(--gold); color: #1a1407; box-shadow: 0 8px 30px rgba(226, 176, 66, .25); }
.btn-gold:hover { background: #f0c25a; }
.btn-ghost { border: 1px solid rgba(244, 236, 219, .25); color: var(--cream); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: .45rem .95rem; font-size: .85rem; }

/* Cards */
.card { background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  border: 1px solid rgba(244, 236, 219, .08); border-radius: 1.5rem; }
.card-hover { transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .3s; }
.card-hover:hover { transform: translateY(-4px); border-color: rgba(226, 176, 66, .35); }

/* Reveal on scroll */
/* Hidden only when JS has started (html.js), so a failed script never leaves a blank page. */
html.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
html.js .reveal.in { opacity: 1; transform: none; }
html.js .reveal[data-delay="1"] { transition-delay: .08s; }
html.js .reveal[data-delay="2"] { transition-delay: .16s; }
html.js .reveal[data-delay="3"] { transition-delay: .24s; }

/* Pattern strip (spine pattern from the cover system) */
.pattern-strip { height: 4px; background: repeating-linear-gradient(90deg, var(--indigo) 0 28px, var(--oxblood) 28px 56px, var(--forest) 56px 84px, var(--gold) 84px 96px); }

/* Concentric rings motif */
.rings { background-image:
  radial-gradient(circle at 50% 50%, transparent 0 38%, rgba(196,110,52,.18) 38.3% 38.7%, transparent 39% 48%,
  rgba(196,110,52,.14) 48.3% 48.7%, transparent 49% 58%, rgba(196,110,52,.10) 58.3% 58.7%, transparent 59%); }

/* Map */
.map-shell { position: relative; height: min(86vh, 860px); min-height: 560px; border-radius: 2rem; overflow: hidden;
  border: 1px solid rgba(244, 236, 219, .08); background: #0b0d12; }
#love-map { position: absolute; inset: 0; }
#love-map:not(.tiles-native) .leaflet-tile-pane { filter: invert(100%) hue-rotate(185deg) brightness(78%) contrast(95%) saturate(60%); }
.leaflet-container { background: #0b0d12; font-family: inherit; }
.leaflet-control-attribution { background: rgba(13,15,20,.6) !important; color: #8a837a !important; }
.leaflet-control-attribution a { color: #b8ad99 !important; }
.leaflet-control-zoom a { background: rgba(21,25,37,.9) !important; color: var(--cream) !important; border-color: rgba(244,236,219,.1) !important; }

.map-panel { position: absolute; z-index: 500; top: 1rem; left: 1rem; bottom: 1rem; width: min(380px, calc(100% - 2rem));
  display: flex; flex-direction: column; border-radius: 1.5rem; overflow: hidden; }
@media (max-width: 767px) {
  .map-panel { top: auto; height: 46%; left: .75rem; right: .75rem; bottom: .75rem; width: auto; }
}
.chip { border: 1px solid rgba(244,236,219,.18); border-radius: 999px; padding: .35rem .8rem; font-size: .8rem; font-weight: 600;
  color: #d6cdbb; transition: all .2s; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.chip.locked { color: #8a837a; }
.story-item { border-radius: 1rem; padding: .85rem .9rem; cursor: pointer; transition: background .2s; border: 1px solid transparent; }
.story-item:hover, .story-item.active { background: rgba(244,236,219,.06); border-color: rgba(226,176,66,.25); }

.pin { position: relative; width: 18px; height: 18px; }
.pin span { position: absolute; inset: 0; border-radius: 999px; border: 2px solid var(--cream); }
.pin.joy span { background: var(--gold); }
.pin.survival span { background: var(--copper); }
.pin::after { content: ""; position: absolute; inset: -8px; border-radius: 999px; border: 2px solid currentColor; opacity: 0;
  animation: pulse 2.4s ease-out infinite; }
.pin.joy { color: var(--gold); }
.pin.survival { color: var(--copper); }
.pin.active span { transform: scale(1.35); box-shadow: 0 0 0 6px rgba(226,176,66,.25); }
@keyframes pulse { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }

.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #151925; color: var(--cream); border: 1px solid rgba(244,236,219,.12); }
.leaflet-popup-content { margin: 14px 16px; font-size: .85rem; line-height: 1.45; }

/* Book covers */
.cover { border-radius: .6rem; box-shadow: 0 30px 60px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(244,236,219,.06);
  transition: transform .5s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }

/* Prompt blocks */
.prompt { position: relative; background: #0f1219; border: 1px solid rgba(244,236,219,.1); border-radius: 1rem;
  padding: 1rem 1rem 1rem 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; line-height: 1.6;
  white-space: pre-wrap; color: #e7dfcf; }
.copy-btn { position: absolute; top: .6rem; right: .6rem; }

/* Lesson body typography */
.lesson h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin: 2.2rem 0 .7rem; color: var(--cream); }
.lesson h3 { font-size: 1.1rem; font-weight: 700; margin: 1.6rem 0 .5rem; color: var(--gold); }
.lesson p, .lesson li { color: #d9d0bf; line-height: 1.7; }
.lesson ul { list-style: disc; padding-left: 1.3rem; margin: .5rem 0 1rem; }
.lesson ol { list-style: decimal; padding-left: 1.3rem; margin: .5rem 0 1rem; }
.lesson li { margin: .3rem 0; }
.lesson .note { border-left: 3px solid var(--copper); padding: .6rem 1rem; background: rgba(196,110,52,.08); border-radius: 0 .75rem .75rem 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .pin::after { animation: none; }
  .card-hover:hover { transform: none; }
}
