/* Landing page layout — Frostmaiden */

.page {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 56px;
}
@media (max-width: 720px) {
  .container { padding: 0 24px; }
}

/* ─── TOP BAR ─── */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  padding: 28px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 36px; height: 36px;
  border: 1px solid var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  background: rgba(232, 224, 207, 0.5);
}
.night .brand-mark { background: rgba(23, 30, 43, 0.5); }
.topnav {
  display: flex;
  gap: 28px;
  align-items: center;
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.75rem;
}
.topnav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
}
.topnav a:hover { color: var(--ink); border-bottom-color: var(--ink); }

#theme-btn {
  background: none;
  border: 1px solid var(--ink-faded);
  color: var(--ink-soft);
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.7rem;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s;
}
#theme-btn:hover { border-color: var(--ink); color: var(--ink); }

#lang-btn {
  background: none;
  border: 1px solid var(--ink-faded);
  color: var(--ink-soft);
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.7rem;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s;
}
#lang-btn:hover { border-color: var(--ink); color: var(--ink); }

/* ─── HERO ─── */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 120px 0 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
}

.hero-map-bg {
  position: absolute;
  inset: 0; z-index: 0;
  overflow: hidden;
}
.hero-map-bg img {
  position: absolute;
  inset: -5%;
  width: 110%; height: 110%;
  object-fit: cover;
  filter: blur(1px) contrast(0.92) brightness(1.05) saturate(0.7);
  opacity: 0.42;
  mix-blend-mode: multiply;
}
.night .hero-map-bg img {
  filter: blur(1.4px) contrast(0.9) brightness(0.45) saturate(0.6);
  opacity: 0.35;
  mix-blend-mode: screen;
}
.hero-map-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, transparent 0%, var(--vellum) 80%),
    linear-gradient(to bottom, transparent 60%, var(--vellum) 100%);
}

.hero-copy { position: relative; }
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.72rem;
  color: var(--ink-soft);
}
.hero-kicker .tick { width: 38px; height: 1px; background: var(--ink-faded); }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 7.5vw, 6.4rem);
  line-height: 0.92;
  margin: 0 0 24px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.hero-title em {
  font-style: italic;
  font-family: var(--font-display-italic);
  color: var(--frost-deep);
}
.night .hero-title em { color: var(--rime); }
.hero-sub {
  font-size: 1.2rem;
  max-width: 46ch;
  color: var(--ink-soft);
  margin: 0 0 36px;
  line-height: 1.5;
}
.hero-actions { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s, color 0.2s;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--ink); color: var(--vellum); }
.btn.primary:hover { background: var(--ink-soft); }
.btn.ghost { border-color: var(--ink-faded); color: var(--ink-soft); }
.btn.ghost:hover { border-color: var(--ink); color: var(--ink); }

.status-card {
  position: relative;
  padding: 36px 36px 32px;
  background: rgba(232, 224, 207, 0.6);
  border: 1px solid var(--vellum-edge);
  box-shadow: 0 24px 60px -20px rgba(20, 30, 50, 0.35), inset 0 0 60px rgba(143, 181, 201, 0.08);
  backdrop-filter: blur(2px);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: start;
}
.night .status-card {
  background: rgba(15, 21, 33, 0.75);
  border-color: rgba(140, 197, 223, 0.2);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6), inset 0 0 60px rgba(140, 197, 223, 0.06);
}
.status-head { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.status-day { font-family: var(--font-display); font-size: 4.5rem; line-height: 1; color: var(--ink); }
.status-day-label { font-family: var(--font-label); font-size: 0.7rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-faded); }
.status-body .label { margin-bottom: 12px; }
.status-quote {
  font-family: var(--font-display-italic);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.4;
  margin: 0 0 14px;
  color: var(--ink);
  position: relative;
  padding-left: 14px;
  border-left: 2px solid var(--wax);
}
.status-attr { font-family: var(--font-label); font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-faded); }
.status-open-questions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--ink-faded);
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}
.status-open-questions li {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
  padding-left: 18px;
  position: relative;
}
.status-open-questions li::before {
  content: "❄";
  position: absolute;
  left: 0; top: 0;
  color: var(--rime);
  font-size: 0.8em;
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.72rem;
  color: var(--ink-faded);
  z-index: 4;
}
.scroll-cue-line {
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, var(--ink-faded), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.4); transform-origin: top; opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ─── MAP SECTION ─── */
.section { position: relative; padding: 100px 0; }
.section-head-block {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.section-head-block h2 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  margin: 0.4em 0 0;
  line-height: 1;
}
.section-head-block p { margin: 0; color: var(--ink-soft); max-width: 44ch; font-size: 1.05rem; }

.map-frame {
  position: relative;
  background: var(--vellum-warm);
  border: 1px solid var(--ink-faded);
  padding: 20px;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.45), inset 0 0 90px rgba(143, 181, 201, 0.12);
}
.night .map-frame { border-color: rgba(140, 197, 223, 0.25); }
.map-frame-inner { position: relative; overflow: hidden; }
.map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 6000 / 4215;
  overflow: hidden;
  background: var(--vellum-warm);
}
.map-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.75) contrast(0.98);
}
.night .map-img { filter: saturate(0.5) contrast(0.85) brightness(0.65); }
.map-tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(199, 221, 232, 0.12) 100%),
    linear-gradient(to bottom, rgba(30, 45, 65, 0.04), transparent 30%);
}
.night .map-tint {
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(20, 30, 50, 0.4) 100%),
    linear-gradient(to bottom, rgba(10, 15, 25, 0.3), transparent 40%);
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 3;
}
.pin-dot {
  display: block;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--vellum);
  box-shadow: 0 0 0 1px var(--ink), 0 0 0 8px rgba(122, 178, 201, 0), 0 0 14px rgba(122, 178, 201, 0.6);
  transition: all 0.25s ease;
}
.map-pin:hover .pin-dot,
.map-pin.is-active .pin-dot {
  background: var(--rime);
  box-shadow: 0 0 0 1px var(--ink), 0 0 0 6px rgba(122, 178, 201, 0.18), 0 0 20px rgba(122, 178, 201, 0.9);
  transform: scale(1.2);
}
.pin-label {
  position: absolute;
  top: 120%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 0.68rem;
  color: var(--ink);
  white-space: nowrap;
  text-shadow: 0 0 4px var(--vellum), 0 0 8px var(--vellum);
  pointer-events: none;
  opacity: 0.8;
}

.map-tooltip {
  position: absolute;
  transform: translate(var(--flip-x, 0%), var(--flip-y, 0%)) translate(calc(18px + (var(--flip-x, 0%) * -0.2)), 18px);
  width: 280px;
  background: var(--vellum-warm);
  border: 1px solid var(--ink);
  padding: 18px 20px 16px;
  z-index: 5;
  box-shadow: 0 18px 38px -10px rgba(20, 30, 50, 0.4), 0 0 0 4px var(--vellum-warm), 0 0 0 5px var(--vellum-edge);
  animation: ttIn 0.18s ease-out;
}
@keyframes ttIn {
  from { opacity: 0; transform: translate(var(--flip-x, 0%), var(--flip-y, 0%)) translate(18px, 24px); }
}
.night .map-tooltip {
  background: #1b2332;
  border-color: rgba(140, 197, 223, 0.5);
  box-shadow: 0 18px 38px -10px rgba(0, 0, 0, 0.7), 0 0 0 4px #1b2332, 0 0 0 5px rgba(140, 197, 223, 0.3);
}
.tooltip-corner {
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--ink);
}
.tooltip-corner.tl { top: -4px; left: -4px; border-right: none; border-bottom: none; }
.tooltip-corner.tr { top: -4px; right: -4px; border-left: none; border-bottom: none; }
.tooltip-corner.bl { bottom: -4px; left: -4px; border-right: none; border-top: none; }
.tooltip-corner.br { bottom: -4px; right: -4px; border-left: none; border-top: none; }
.tt-label { font-family: var(--font-label); text-transform: uppercase; letter-spacing: 0.26em; font-size: 0.7rem; color: var(--ink-faded); margin-bottom: 6px; }
.tt-title { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 8px; line-height: 1.1; }
.tt-blurb { font-size: 0.9rem; line-height: 1.45; color: var(--ink-soft); margin: 0 0 14px; }
.tt-link { font-family: var(--font-label); text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.72rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.tt-link:hover { color: var(--frost-shadow); border-color: var(--rime); }
.night .tt-link:hover { color: var(--rime); border-color: var(--rime); }

.map-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 20px;
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faded);
}

/* ─── PARTY ─── */
.party-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 960px) { .party-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .party-grid { grid-template-columns: 1fr; } }

.char-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  background: var(--vellum-warm);
  border: 1px solid var(--vellum-edge);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 18px -8px rgba(20, 30, 50, 0.2);
}
.night .char-card { background: rgba(26, 35, 50, 0.85); border-color: rgba(140, 197, 223, 0.2); }
.char-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -14px rgba(20, 30, 50, 0.35); }
.char-portrait {
  position: relative;
  aspect-ratio: 3 / 3.4;
  overflow: hidden;
  background: var(--vellum-deep);
}
.char-portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(0.1) contrast(0.98);
}
.night .char-portrait img { filter: sepia(0.05) brightness(0.85) contrast(1) saturate(0.9); }
.char-frost {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 40% at 50% 0%, rgba(199, 221, 232, 0.55), transparent 60%),
    radial-gradient(ellipse 80% 30% at 50% 100%, rgba(199, 221, 232, 0.35), transparent 60%);
  mix-blend-mode: screen;
}
.char-meta { padding: 18px 22px 22px; }
.char-meta .label { margin-bottom: 4px; font-size: 0.68rem; }
.char-name { font-size: 1.5rem; margin-bottom: 8px; }
.char-blurb { font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 14px; line-height: 1.45; }
.char-more { font-family: var(--font-label); text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.7rem; color: var(--ink); }

/* ─── WIKI SECTION CARDS ─── */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 960px) { .sections-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .sections-grid { grid-template-columns: 1fr; } }

.section-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  padding: 28px 30px;
  background: var(--vellum-warm);
  border: 1px solid var(--vellum-edge);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 260px;
}
.night .section-card { background: rgba(26, 35, 50, 0.85); border-color: rgba(140, 197, 223, 0.2); }
.section-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(to right, transparent, var(--rime), transparent);
  opacity: 0.5;
}
.section-card:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -14px rgba(20, 30, 50, 0.3); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.section-count { font-family: var(--font-display); font-size: 2rem; color: var(--ink-faded); line-height: 1; }
.section-title { font-size: 1.8rem; line-height: 1.1; margin-bottom: 18px; }
.section-list {
  list-style: none;
  padding: 0;
  margin: 0 0 auto;
  border-top: 1px dashed var(--ink-faded);
  padding-top: 14px;
}
.section-list li { font-size: 0.95rem; color: var(--ink-soft); padding: 4px 0; border-bottom: 1px dotted rgba(74, 83, 112, 0.2); }
.section-list li:last-child { border-bottom: none; }
.section-list li.muted { color: var(--ink-faded); font-style: italic; }
.section-foot {
  margin-top: 18px;
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.7rem;
  color: var(--ink);
  border-top: 1px solid var(--ink-faded);
}

/* ─── MOBILE ─── */
@media (max-width: 720px) {
  /* Topbar — hide nav links, keep brand mark + theme toggle */
  .topbar { padding: 16px 24px; gap: 12px; }
  .brand span { display: none; }
  .topnav a { display: none; }

  /* Hero */
  .hero { padding: 88px 0 56px; min-height: unset; }
  .hero-inner { gap: 28px; }
  .hero-sub { font-size: 1.05rem; }
  .hero-map-cta { display: none; }

  /* Status card — stack day number + body vertically */
  .status-card { grid-template-columns: 1fr; padding: 22px 20px 20px; gap: 14px; }
  .status-head { flex-direction: row; align-items: baseline; gap: 14px; }
  .status-day { font-size: 3rem; }
  .status-open-questions li { font-size: 0.9rem; }

  /* Hide map on mobile */
  #karta { display: none; }

  /* Sections */
  .section { padding: 64px 0; }
  .section-head-block { gap: 16px; }

  /* Decorative elements not useful at small size */
  .floating-compass { display: none; }
  .scroll-cue { display: none; }
}

/* ─── FOOTER ─── */
.footer {
  padding: 60px 0 40px;
  border-top: 1px solid var(--vellum-edge);
  margin-top: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--ink-faded);
  flex-wrap: wrap;
}

/* ─── FLOATING COMPASS ─── */
.floating-compass {
  position: fixed;
  right: 28px; bottom: 28px;
  width: 72px; height: 72px;
  color: var(--ink-soft);
  opacity: 0.5;
  transition: opacity 0.3s, transform 0.6s ease-out;
  pointer-events: none;
  z-index: 10;
  transform: rotate(var(--compass-rot, 0deg));
}
.floating-compass svg { width: 100%; height: 100%; }

/* ─── FROST CREEP ─── */
.frost-creep {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  mix-blend-mode: screen;
  opacity: var(--scroll-frost, 0);
  background-image:
    radial-gradient(ellipse 40% 25% at 0% 0%, rgba(199, 221, 232, 0.95), transparent 65%),
    radial-gradient(ellipse 35% 22% at 100% 0%, rgba(199, 221, 232, 0.9), transparent 65%),
    radial-gradient(ellipse 40% 25% at 0% 100%, rgba(199, 221, 232, 0.85), transparent 65%),
    radial-gradient(ellipse 35% 22% at 100% 100%, rgba(199, 221, 232, 0.9), transparent 65%);
}
.night .frost-creep {
  background-image:
    radial-gradient(ellipse 40% 25% at 0% 0%, rgba(140, 197, 223, 0.55), transparent 65%),
    radial-gradient(ellipse 35% 22% at 100% 0%, rgba(140, 197, 223, 0.5), transparent 65%),
    radial-gradient(ellipse 40% 25% at 0% 100%, rgba(140, 197, 223, 0.5), transparent 65%),
    radial-gradient(ellipse 35% 22% at 100% 100%, rgba(140, 197, 223, 0.55), transparent 65%);
}
