/* ══════════════════════════════════════════════════════════════════════════
   Zahra · Home · the railway gateway
   Dusk plum sky, garden green hills, gold rails. The scene itself is drawn
   by js/home.js; this file sizes it, animates it and styles the welcome.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --sky: #1b0f2e;
  --ground: #0e2317;
  --cream: #f0e8d8;
  --muted: #cdbfe0;
  --gold: #c8a84a;
  --gold-light: #e0cc80;
  --rose-soft: #e89ab0;
  --f-display: 'Cormorant Garamond', Georgia, serif;
  --f-body: 'EB Garamond', Georgia, serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; height: 100%; }
body {
  height: 100%; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  overflow: hidden;                     /* the scene always fits the screen */
  color: var(--cream);
  font-family: var(--f-body);
  /* sky above, ground below, so the edges around the map blend in */
  background: linear-gradient(var(--sky) 0 50%, var(--ground) 50% 100%);
}
a { color: inherit; }

/* ── Welcome ────────────────────────────────────────────────────────────── */
.welcome {
  position: relative; z-index: 2;
  padding: calc(env(safe-area-inset-top) + clamp(1rem, 3vh, 2rem)) clamp(1.25rem, 4vw, 3.5rem) 0;
  pointer-events: none;
  animation: rise 0.7s var(--ease-out) both;
}
.brand { font-size: 1.5rem; color: var(--rose-soft); line-height: 1.2; }
h1 { font-family: var(--f-display); font-weight: 600; font-size: clamp(2rem, 3vw + 1.25rem, 4rem); line-height: 1.05; letter-spacing: -0.015em; text-wrap: balance; }
.sub { font-family: var(--f-display); font-style: italic; font-size: clamp(1.125rem, 0.8vw + 1rem, 1.5rem); color: var(--muted); margin-top: 0.25rem; }

/* ── The map ────────────────────────────────────────────────────────────── */
main { position: relative; flex: 1; min-height: 0; }
.map { display: none; width: 100%; height: 100%; overflow: visible; }
.map-tall { display: block; }
.plain { display: flex; flex-wrap: wrap; gap: 1rem; padding: 2rem clamp(1.25rem, 4vw, 3.5rem); font-size: 1.25rem; }
.ready .plain { display: none; }

/* Wide screens: the welcome sits over the empty sky at the top left */
@media (min-width: 760px) and (min-aspect-ratio: 11/10) {
  .map-wide { display: block; }
  .map-tall { display: none; }
  .welcome { position: absolute; top: 0; left: 0; max-width: 34rem; }
}

.map text { font-family: var(--f-display); font-weight: 600; fill: var(--cream); }
.map .name { font-size: 25px; }
.map .name.soon { fill: #c9b3e6; font-style: italic; font-weight: 500; }
.map .sign { font-size: 21px; fill: var(--gold-light); letter-spacing: 0.02em; }

.place { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.place .ring { opacity: 0; }
.place:focus-visible .ring { opacity: 1; }
.place .lift { transition: transform 0.3s var(--ease-out); }
.place .win { transition: fill 0.3s var(--ease-out); }
.place:hover .lift, .place:focus-visible .lift, .place.chosen .lift { transform: translateY(-5px); }
.place:hover .win, .place.chosen .win { fill: #fff0b8; }
.place:hover .name, .place.chosen .name { fill: var(--gold-light); }
.riding .place { cursor: default; }

/* ── Little animations ──────────────────────────────────────────────────── */
.star { animation: twinkle 4s ease-in-out infinite; }
.star.s1 { animation-delay: 1.3s; }
.star.s2 { animation-delay: 2.6s; }
.engine { animation: chug 1.6s ease-in-out infinite; }
.riding .engine { animation-duration: 0.28s; }
.puff { opacity: 0; transform-box: fill-box; transform-origin: center; animation: puff 2.4s ease-out infinite; }
.puff.p2 { animation-delay: 0.8s; }
.puff.p3 { animation-delay: 1.6s; }
.riding .puff { animation-duration: 0.9s; }
.riding .puff.p2 { animation-delay: 0.3s; }
.riding .puff.p3 { animation-delay: 0.6s; }

@keyframes twinkle { 50% { opacity: 0.25; } }
@keyframes chug { 50% { transform: translateY(-1.5px); } }
@keyframes puff { 0% { opacity: 0; transform: translate(0, 0) scale(0.6); } 20% { opacity: 0.85; } 100% { opacity: 0; transform: translate(-10px, -34px) scale(1.7); } }
@keyframes rise { from { transform: translateY(10px); } }   /* never hides the welcome */

/* ── The "nothing here yet" note ────────────────────────────────────────── */
.note {
  position: fixed; z-index: 5;
  left: 50%; bottom: calc(env(safe-area-inset-bottom) + 1.25rem);
  width: min(26rem, calc(100vw - 2rem));
  transform: translate(-50%, 1rem);
  padding: 1rem 1.25rem;
  background: #2a1638; border: 1px solid var(--gold); border-radius: 14px;
  font-size: 1.125rem; line-height: 1.4;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s 0.3s;
}
.note.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out); }
.note-title { font-family: var(--f-display); font-weight: 600; font-size: 1.5rem; color: var(--gold-light); line-height: 1.2; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .puff { opacity: 0.7; }
  .puff.p2 { transform: translate(-5px, -12px); }
  .puff.p3 { transform: translate(-9px, -22px); }
}

.map-tall .name { font-size: 31px; }
