/* ================= World is Your Wingfoil ================= */
:root {
  --bg: #04070f;
  --ink: #eaf4ff;
  --ink-dim: #8fa6bf;
  --cyan: #3fd8ff;
  --cyan-soft: rgba(63, 216, 255, .14);
  --coral: #ff7a59;
  --gold: #ffd166;
  --glass: rgba(10, 18, 32, .72);
  --glass-brd: rgba(122, 180, 255, .16);
  --display: 'Space Grotesk', system-ui, sans-serif;
  --text: 'Inter', system-ui, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: var(--bg); }
body { font-family: var(--text); color: var(--ink); }
canvas#globe { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
canvas#globe:active { cursor: grabbing; }
.hidden { opacity: 0 !important; pointer-events: none !important; }
.ui { transition: opacity .6s ease; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 60%, #0a1526 0%, #04070f 70%);
  transition: opacity .8s ease;
}
.loader-inner { text-align: center; width: min(420px, 80vw); }
.loader-wing {
  width: 64px; height: 34px; margin: 0 auto 26px; position: relative;
  animation: sway 2.2s ease-in-out infinite;
}
.loader-wing::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 100% 100% 8% 8% / 160% 160% 30% 30%;
  border: 3px solid var(--cyan); border-bottom-color: transparent;
  filter: drop-shadow(0 0 12px rgba(63, 216, 255, .8));
}
@keyframes sway { 0%,100% { transform: rotate(-9deg) translateY(0);} 50% { transform: rotate(9deg) translateY(-6px);} }
.loader-title {
  font-family: var(--display); font-weight: 700; letter-spacing: .35em;
  font-size: 13px; color: var(--ink-dim); margin-bottom: 20px;
}
.loader-bar { height: 2px; background: rgba(122,180,255,.15); border-radius: 2px; overflow: hidden; }
.loader-bar-fill { height: 100%; width: 0%; background: var(--cyan); transition: width .3s ease; box-shadow: 0 0 10px var(--cyan); }
.loader-status { margin-top: 14px; font-size: 12px; color: var(--ink-dim); letter-spacing: .08em; }

/* ---------- intro ---------- */
#intro {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 120%, rgba(4,7,15,0) 0%, rgba(4,7,15,.55) 75%);
  transition: opacity .9s ease;
}
.intro-title { font-family: var(--display); line-height: .95; }
.intro-title span { display: block; font-size: clamp(18px, 2.6vw, 30px); font-weight: 500; letter-spacing: .5em; color: var(--ink-dim); }
.intro-title em {
  display: block; font-style: normal; font-weight: 700;
  font-size: clamp(56px, 10vw, 128px); letter-spacing: .02em;
  background: linear-gradient(92deg, #eaf4ff 10%, var(--cyan) 55%, #7dffc8 95%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 30px rgba(63,216,255,.35));
}
.intro-sub { max-width: 560px; margin: 22px 0 30px; color: var(--ink-dim); font-size: 15px; line-height: 1.65; }
#intro-cta {
  font-family: var(--display); font-size: 15px; font-weight: 500; letter-spacing: .12em;
  padding: 16px 42px; border-radius: 0; color: #04121c;
  background: linear-gradient(90deg, var(--cyan), #7dffc8);
  box-shadow: 0 0 30px rgba(63,216,255,.45); transition: transform .2s, box-shadow .2s;
}
#intro-cta:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 0 44px rgba(63,216,255,.7); }
.intro-hint { margin-top: 26px; font-size: 12px; letter-spacing: .14em; color: var(--ink-dim); }

/* ---------- top bar ---------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  background: linear-gradient(180deg, rgba(4,7,15,.8), rgba(4,7,15,0));
}
.brand { font-family: var(--display); font-weight: 500; font-size: 13px; letter-spacing: .3em; color: var(--ink-dim); }
.brand em { font-style: normal; font-weight: 700; color: var(--ink); }
.topnav { display: flex; gap: 6px; }
.nav-btn {
  font-family: var(--display); font-size: 13px; letter-spacing: .08em; color: var(--ink-dim);
  padding: 8px 16px; border-radius: 999px; border: 1px solid transparent; transition: all .2s;
}
.nav-btn:hover { color: var(--ink); }
.nav-btn.active { color: var(--cyan); border-color: var(--glass-brd); background: var(--cyan-soft); }

/* ---------- left rail ---------- */
#rail {
  position: fixed; left: 18px; top: 74px; bottom: 120px; z-index: 25; width: 228px;
  background: var(--glass); border: 1px solid var(--glass-brd); border-radius: 18px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 18px 16px; overflow-y: auto; scrollbar-width: thin;
}
.rail-section { margin-bottom: 18px; }
.rail-label {
  font-family: var(--display); font-size: 10px; font-weight: 500; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-dim); margin-bottom: 9px;
}
#continent-nav { display: flex; flex-direction: column; gap: 3px; }
.cont-btn {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; border-radius: 9px; font-size: 13px; color: var(--ink);
  transition: background .15s;
}
.cont-btn:hover { background: var(--cyan-soft); }
.cont-btn .n { color: var(--ink-dim); font-size: 11px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11.5px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--glass-brd); color: var(--ink-dim); transition: all .15s;
}
.chip:hover { color: var(--ink); }
.chip.active { background: var(--cyan-soft); border-color: rgba(63,216,255,.5); color: var(--cyan); }
.month-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.month-cell {
  font-size: 10.5px; text-align: center; padding: 6px 0; border-radius: 7px;
  border: 1px solid var(--glass-brd); color: var(--ink-dim); transition: all .15s;
}
.month-cell:hover { color: var(--ink); }
.month-cell.active { background: var(--cyan-soft); border-color: rgba(63,216,255,.5); color: var(--cyan); }
.rail-count { font-size: 11.5px; color: var(--ink-dim); letter-spacing: .05em; padding-top: 4px; }

/* ---------- tooltip ---------- */
#tooltip {
  position: fixed; z-index: 35; pointer-events: none; transform: translate(-50%, -130%);
  background: var(--glass); border: 1px solid var(--glass-brd); border-radius: 10px;
  padding: 8px 13px; backdrop-filter: blur(10px); white-space: nowrap;
  transition: opacity .15s;
}
#tooltip .t-name { font-family: var(--display); font-weight: 500; font-size: 13.5px; }
#tooltip .t-meta { font-size: 11px; color: var(--ink-dim); margin-top: 1px; }
#tooltip .t-meta b { color: var(--cyan); font-weight: 600; }

/* ---------- detail panel ---------- */
#panel {
  position: fixed; top: 74px; right: 18px; bottom: 18px; z-index: 28; width: min(400px, calc(100vw - 36px));
  background: var(--glass); border: 1px solid var(--glass-brd); border-radius: 20px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  overflow: hidden; display: flex; flex-direction: column;
  transform: translateX(0); transition: opacity .45s ease, transform .45s cubic-bezier(.2,.9,.25,1);
}
#panel.hidden { transform: translateX(40px); }
#panel-close, #modal-close {
  position: absolute; top: 10px; right: 12px; z-index: 3; font-size: 26px; line-height: 1;
  color: var(--ink-dim); width: 36px; height: 36px; border-radius: 50%;
  background: rgba(4,7,15,.5); transition: all .15s;
}
#panel-close:hover, #modal-close:hover { color: var(--ink); background: rgba(4,7,15,.8); }
#panel-content { overflow-y: auto; scrollbar-width: thin; }

.p-hero { position: relative; height: 190px; background: #0a1526; }
.p-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,18,32,.1) 40%, rgba(10,18,32,.92) 100%);
}
.p-hero .p-attr {
  position: absolute; top: 8px; left: 12px; z-index: 2; font-size: 9.5px;
  color: rgba(234,244,255,.6); text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.p-hero .p-attr a { color: rgba(234,244,255,.7); }
.p-head { position: relative; z-index: 2; padding: 0 20px; margin-top: -44px; }
.p-continent { font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--cyan); font-family: var(--display); }
.p-name { font-family: var(--display); font-weight: 700; font-size: 27px; line-height: 1.05; margin: 4px 0 2px; }
.p-country { font-size: 13px; color: var(--ink-dim); }
.p-body { padding: 16px 20px 24px; }

.p-wisdom {
  font-family: var(--display); font-size: 14.5px; font-weight: 400; font-style: italic;
  line-height: 1.55; color: #bfe9ff; margin: 14px 0 4px; padding-left: 14px;
  border-left: 2px solid rgba(63,216,255,.45);
}
.p-wisdom cite { display: block; margin-top: 6px; font-size: 10.5px; font-style: normal; letter-spacing: .12em; color: var(--ink-dim); }
.p-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 14px 0; }
.stat {
  background: rgba(63,216,255,.06); border: 1px solid var(--glass-brd);
  border-radius: 12px; padding: 10px 12px;
}
.stat .s-label { font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-dim); }
.stat .s-value { font-family: var(--display); font-size: 17px; font-weight: 500; margin-top: 3px; }
.stat .s-value small { font-size: 11px; color: var(--ink-dim); }
.wind-pips { letter-spacing: 2px; font-size: 14px; }
.wind-pips .on { color: var(--cyan); } .wind-pips .off { color: rgba(143,166,191,.3); }

.p-months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin: 6px 0 2px; }
.pm {
  height: 30px; border-radius: 6px; display: grid; place-items: end center;
  font-size: 8.5px; color: var(--ink-dim); padding-bottom: 3px;
  background: rgba(122,180,255,.07); position: relative; overflow: hidden;
}
.pm.on { background: linear-gradient(180deg, rgba(63,216,255,.55), rgba(63,216,255,.18)); color: #dff6ff; }
.pm.now::after { content: ""; position: absolute; top: 3px; left: 50%; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); transform: translateX(-50%); }
.p-monthcap { font-size: 10px; color: var(--ink-dim); margin-bottom: 12px; }

.p-desc { font-size: 13.5px; line-height: 1.68; color: #c9d9ea; margin: 12px 0; }
.p-h { font-family: var(--display); font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-dim); margin: 16px 0 8px; }
.p-list { list-style: none; }
.p-list li { font-size: 13px; line-height: 1.55; padding-left: 18px; position: relative; margin-bottom: 5px; color: #c9d9ea; }
.p-list li::before { content: "◦"; position: absolute; left: 2px; color: var(--cyan); }
.p-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.p-tag {
  font-size: 11.5px; padding: 5px 11px; border-radius: 999px;
  background: rgba(122,180,255,.08); border: 1px solid var(--glass-brd); color: #c9d9ea;
}
.p-tag.gold { color: var(--gold); border-color: rgba(255,209,102,.35); background: rgba(255,209,102,.07); }
.p-hazard { font-size: 12.5px; line-height: 1.6; color: #e8b9a8; }
.p-foot { margin-top: 16px; font-size: 11px; color: var(--ink-dim); }

/* ---------- bottom strip ---------- */
#strip {
  position: fixed; left: 264px; right: 200px; bottom: 14px; z-index: 24;
  display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px;
  scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}
#strip::-webkit-scrollbar { display: none; }
.strip-card {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start;
  padding: 9px 14px; border-radius: 12px; background: var(--glass);
  border: 1px solid var(--glass-brd); backdrop-filter: blur(10px);
  transition: all .18s; text-align: left;
}
.strip-card:hover { border-color: rgba(63,216,255,.55); transform: translateY(-2px); }
.strip-card.sel { border-color: var(--cyan); background: var(--cyan-soft); }
.strip-card .sc-name { font-family: var(--display); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.strip-card .sc-meta { font-size: 10px; color: var(--ink-dim); white-space: nowrap; }
.strip-card .sc-meta b { color: var(--cyan); font-weight: 600; }

/* ---------- wind legend & credit ---------- */
#wind-legend {
  position: fixed; right: 20px; bottom: 96px; z-index: 20;
  display: flex; flex-direction: column; gap: 5px; align-items: flex-end;
  font-size: 10.5px; color: var(--ink-dim);
}
#wind-legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; box-shadow: 0 0 6px currentColor; }
#credit {
  position: fixed; right: 20px; bottom: 18px; z-index: 26; font-size: 10px;
  color: rgba(143,166,191,.6); max-width: 200px; text-align: right; line-height: 1.5;
}
#credit a { color: rgba(143,166,191,.9); }

/* ---------- modal (tour / about / credits) ---------- */
#modal {
  position: fixed; inset: 0; z-index: 45; display: grid; place-items: center;
  background: rgba(2,4,10,.6); backdrop-filter: blur(6px); transition: opacity .4s;
}
#modal-box {
  position: relative; width: min(760px, calc(100vw - 40px)); max-height: min(82vh, 900px);
  overflow-y: auto; scrollbar-width: thin;
  background: var(--glass); border: 1px solid var(--glass-brd); border-radius: 22px;
  backdrop-filter: blur(20px); padding: 34px 38px;
}
.m-title { font-family: var(--display); font-weight: 700; font-size: 30px; margin-bottom: 4px; }
.m-sub { color: var(--ink-dim); font-size: 13.5px; margin-bottom: 22px; line-height: 1.6; }
.m-h { font-family: var(--display); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); margin: 24px 0 10px; }
.champ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 9px; }
.champ {
  background: rgba(255,209,102,.05); border: 1px solid rgba(255,209,102,.22);
  border-radius: 12px; padding: 11px 13px;
}
.champ .c-name { font-family: var(--display); font-weight: 500; font-size: 14.5px; color: var(--gold); }
.champ .c-meta { font-size: 11px; color: var(--ink-dim); margin-top: 2px; line-height: 1.45; }
.event-row {
  display: flex; gap: 14px; align-items: baseline; padding: 10px 2px;
  border-bottom: 1px solid rgba(122,180,255,.08); cursor: pointer; border-radius: 8px;
}
.event-row:hover { background: rgba(63,216,255,.05); }
.event-row .e-when { flex: 0 0 74px; font-family: var(--display); font-size: 12px; color: var(--cyan); }
.event-row .e-name { font-size: 13.5px; font-weight: 600; }
.event-row .e-where { font-size: 11.5px; color: var(--ink-dim); }
.event-row .e-disc { margin-left: auto; font-size: 10px; color: var(--gold); white-space: nowrap; }
.fact-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.fact-cols p, #modal .prose p { font-size: 13.5px; line-height: 1.7; color: #c9d9ea; margin-bottom: 10px; }
.star-list li { font-size: 12.5px; line-height: 1.6; color: #c9d9ea; margin-bottom: 7px; list-style: none; padding-left: 16px; position: relative; }
.star-list li::before { content: "★"; position: absolute; left: 0; top: 1px; font-size: 9px; color: var(--gold); }
.credit-list { font-size: 11.5px; color: var(--ink-dim); line-height: 1.8; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 10px; }
.gallery figure { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 3/2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery figcaption {
  position: absolute; inset: auto 0 0 0; padding: 14px 8px 5px; font-size: 9px;
  color: rgba(234,244,255,.75); background: linear-gradient(180deg, transparent, rgba(4,7,15,.85));
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  #rail { display: none; }
  #strip { left: 14px; }
  #wind-legend { display: none; }
  #panel { top: auto; right: 10px; left: 10px; bottom: 10px; width: auto; max-height: 62vh; }
}
