/* =========================================================================
   Worldly — interactive atlas
   Dark ("night") by default with a full light ("day") theme.
   ========================================================================= */

:root {
  --bg: #060913;
  --bg-2: #0a1020;
  --panel: rgba(19, 27, 48, 0.62);
  --panel-solid: #131b30;
  --panel-2: rgba(28, 38, 66, 0.55);
  --line: rgba(140, 175, 235, 0.16);
  --line-strong: rgba(150, 190, 255, 0.32);
  --text: #e8eefc;
  --text-dim: #a3b0cd;
  --text-faint: #6f7d9c;

  --teal: #4fe3c1;
  --blue: #5aa9ff;
  --violet: #b47cff;
  --amber: #ffc857;
  --rose: #ff7a92;

  --accent-grad: linear-gradient(115deg, var(--teal), var(--blue) 52%, var(--violet));
  --ocean: #0b1930;
  --land: #24557f;
  --land-hi: #45a0d8;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 22px 60px -28px rgba(0, 0, 0, 0.9);
  --shadow-lift: 0 30px 70px -26px rgba(0, 0, 0, 0.95);

  --ring: 0 0 0 2px rgba(90, 169, 255, 0.55);
  --maxw: 1440px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="day"] {
  --bg: #eef3fb;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --panel-2: rgba(238, 244, 255, 0.85);
  --line: rgba(24, 52, 96, 0.14);
  --line-strong: rgba(24, 52, 96, 0.26);
  --text: #10203c;
  --text-dim: #46587a;
  --text-faint: #7286a8;

  --teal: #0aa088;
  --blue: #2f6fe0;
  --violet: #7a4bd8;
  --amber: #c98a06;
  --rose: #d94566;

  --ocean: #cfe1f5;
  --land: #8fb4d8;
  --land-hi: #2f6fe0;
  --shadow: 0 20px 50px -30px rgba(20, 45, 90, 0.55);
  --shadow-lift: 0 28px 60px -26px rgba(20, 45, 90, 0.6);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

a { color: inherit; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.15;
  letter-spacing: -0.022em;
  font-weight: 700;
}

p { margin: 0 0 1em; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 12px 18px;
  background: var(--panel-solid);
  border-radius: 0 0 12px 0;
}
.skip:focus { left: 0; }

/* ---------------------------------------------------------------- backdrop */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(90, 169, 255, 0.16), transparent 60%),
    radial-gradient(900px 600px at 8% 8%, rgba(79, 227, 193, 0.12), transparent 62%),
    linear-gradient(180deg, var(--bg), var(--bg-2) 45%, var(--bg));
}

.sky__stars { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.75; }
[data-theme="day"] .sky__stars { opacity: 0.16; }

.sky__aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  mix-blend-mode: screen;
  animation: drift 34s var(--ease) infinite alternate;
}
[data-theme="day"] .sky__aurora { opacity: 0.32; mix-blend-mode: multiply; filter: blur(110px); }

.sky__aurora--a { width: 46vw; height: 46vw; left: -8vw; top: -10vw; background: radial-gradient(circle, var(--teal), transparent 68%); }
.sky__aurora--b { width: 52vw; height: 52vw; right: -12vw; top: 4vw; background: radial-gradient(circle, var(--violet), transparent 68%); animation-delay: -11s; animation-duration: 42s; }
.sky__aurora--c { width: 40vw; height: 40vw; left: 34vw; bottom: -16vw; background: radial-gradient(circle, var(--blue), transparent 68%); animation-delay: -22s; animation-duration: 50s; }

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(4vw, 5vh, 0) scale(1.14); }
  100% { transform: translate3d(-5vw, -3vh, 0) scale(0.94); }
}

.sky__grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px clamp(14px, 3vw, 34px);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; flex-shrink: 0; }
.brand__globe { display: grid; place-items: center; animation: spin-globe 26s linear infinite; }
@keyframes spin-globe { to { transform: rotate(360deg); } }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__text strong {
  font-size: 1.16rem;
  letter-spacing: -0.03em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand__text small { font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); }

.nav { display: flex; gap: 3px; margin-left: auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 11px;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s, background 0.25s, transform 0.25s var(--ease);
}
.nav__icon { font-size: 0.95em; opacity: 0.85; }
.nav__link:hover { color: var(--text); background: var(--panel-2); transform: translateY(-1px); }
.nav__link.is-active { color: var(--text); background: var(--panel); }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-grad);
}

.topbar__right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav + .topbar__right { margin-left: 12px; }

.utc-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  font-variant-numeric: tabular-nums;
  font-size: 0.86rem;
}
.utc-badge__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--teal) 70%, transparent);
  animation: ping 2s ease-out infinite;
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--teal) 60%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.utc-badge__time { font-weight: 650; letter-spacing: 0.02em; }
.utc-badge__label { font-size: 0.68rem; letter-spacing: 0.14em; color: var(--text-faint); }

.ghost-btn {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s;
}
.ghost-btn:hover { transform: translateY(-2px) rotate(-12deg); border-color: var(--line-strong); }

/* ----------------------------------------------------------------- layout */

.wrap { width: min(var(--maxw), 100% - clamp(24px, 5vw, 72px)); margin-inline: auto; }

section { padding-block: clamp(38px, 5vw, 70px); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--text-dim); max-width: 62ch; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.grad-text { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ------------------------------------------------------------------ cards */

.card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.35s, box-shadow 0.4s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.22), transparent 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.7;
  pointer-events: none;
}
.card:hover { transform: translateY(-5px); border-color: var(--line-strong); box-shadow: var(--shadow-lift); }

.card--link { text-decoration: none; display: block; }

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }

/* ------------------------------------------------------------------- hero */

.hero { padding-top: clamp(26px, 4vw, 54px); }

.hero__grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
@media (max-width: 1080px) { .hero__grid { grid-template-columns: 1fr; } }

.hero__intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(22px, 4vw, 56px); align-items: end; }
@media (max-width: 980px) { .hero__intro { grid-template-columns: 1fr; align-items: start; } }

.explore__stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 18px; align-items: start; margin-top: 14px; }
@media (max-width: 1080px) { .explore__stage { grid-template-columns: 1fr; } }

.hero__title { font-size: clamp(2.1rem, 5vw, 3.5rem); letter-spacing: -0.04em; margin-bottom: 14px; }
.hero__lede { color: var(--text-dim); font-size: 1.03rem; max-width: 46ch; }

.hero__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 22px; }

.stat {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.stat__value { display: block; font-size: 1.42rem; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.28s var(--ease), box-shadow 0.28s, border-color 0.28s, background 0.28s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--blue); }
.btn--primary { border-color: transparent; background: var(--accent-grad); color: #04101f; font-weight: 700; }
.btn--primary:hover { box-shadow: 0 16px 40px -16px var(--blue); }
.btn--sm { padding: 8px 14px; font-size: 0.84rem; }

/* -------------------------------------------------------------- map stage */

.mapstage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ocean);
  overflow: hidden;
  box-shadow: var(--shadow);
  touch-action: none;
}
.mapstage--mini { border-radius: var(--radius-sm); }

.worldmap { display: block; width: 100%; height: auto; cursor: grab; }

/* Sea gradient stops live in CSS so the map follows the theme. */
.wm-sea-1 { stop-color: #18345c; }
.wm-sea-2 { stop-color: #0b1932; }
.wm-sea-3 { stop-color: #050a19; }
[data-theme="day"] .wm-sea-1 { stop-color: #dceafa; }
[data-theme="day"] .wm-sea-2 { stop-color: #c2daf2; }
[data-theme="day"] .wm-sea-3 { stop-color: #aac9e8; }
[data-theme="day"] .wm-country { stroke: rgba(20, 55, 100, 0.35); }
[data-theme="day"] .wm-graticule line, [data-theme="day"] .wm-graticule path { stroke: rgba(20, 60, 110, 0.16); }
.mapstage.is-panning .worldmap { cursor: grabbing; }

.wm-camera { transition: transform 0.85s var(--ease); }
.mapstage.is-panning .wm-camera,
.mapstage.is-zooming .wm-camera { transition: none; }

.wm-country {
  fill: var(--land);
  stroke: rgba(160, 215, 255, 0.34);
  stroke-width: 0.35;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill 0.45s var(--ease), opacity 0.4s, filter 0.3s;
  opacity: 0;
  animation: land-in 0.5s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 4ms + 120ms);
  outline: none;
}
@keyframes land-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.mapstage--mini .wm-country { animation-delay: calc(var(--i, 0) * 2ms); }

.wm-country:hover,
.wm-country:focus-visible { fill: var(--land-hi); filter: drop-shadow(0 0 6px rgba(120, 200, 255, 0.65)); cursor: pointer; }

/* Beats the inline fill that the colour modes write onto each path. */
.wm-country.is-selected { fill: var(--teal) !important; stroke: #fff; stroke-width: 0.7; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--teal) 70%, transparent)); }
.wm-country.is-dimmed { opacity: 0.22; }

.wm-graticule line, .wm-graticule path { stroke: rgba(140, 190, 255, 0.14); stroke-width: 0.4; fill: none; vector-effect: non-scaling-stroke; }
.wm-graticule .wm-equator { stroke: rgba(255, 200, 87, 0.36); stroke-dasharray: 5 4; }

.wm-night__shade { fill: rgba(2, 6, 20, 0.5); pointer-events: none; transition: d 1s linear; }
[data-theme="day"] .wm-night__shade { fill: rgba(12, 22, 48, 0.34); }
.wm-night__sun { fill: #ffd66b; filter: drop-shadow(0 0 12px rgba(255, 214, 107, 0.9)); }

.wm-marker { cursor: pointer; transition: opacity 0.35s; }
.wm-marker circle { transition: r 0.3s var(--ease), fill-opacity 0.3s; }
.wm-marker:hover circle { fill-opacity: 1; }

.wm-marker--capital circle { fill: var(--amber); }
.wm-marker--mountain path { fill: #e8f4ff; }
/* Travel pins carry their own per-category fill, set inline when built. */

.wm-pulse circle {
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  animation: pulse-out 1.8s var(--ease) infinite;
}
@keyframes pulse-out {
  0%   { r: 2; opacity: 0.9; }
  100% { r: 26; opacity: 0; }
}

.wm-arcs path {
  fill: none;
  stroke: url(#arcGrad);
  stroke: var(--teal);
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 4 4;
  animation: dash 1.6s linear infinite;
  opacity: 0.75;
}
@keyframes dash { to { stroke-dashoffset: -16; } }

.wm-tooltip {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  pointer-events: none;
  transform: translate(-50%, -125%);
  transition: opacity 0.16s;
  white-space: nowrap;
}
.wm-tooltip[hidden] { display: none; }
.wm-tooltip__flag { font-size: 1.4rem; line-height: 1; }
.wm-tooltip__body { display: flex; flex-direction: column; line-height: 1.25; }
.wm-tooltip__body small { color: var(--text-faint); font-size: 0.76rem; }

.wm-controls { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 7px; z-index: 5; }
.wm-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: color-mix(in srgb, var(--panel-solid) 82%, transparent);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s;
}
.wm-btn:hover { transform: scale(1.1); background: var(--panel-solid); }

.wm-scale {
  position: absolute;
  left: 14px; bottom: 14px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-solid) 78%, transparent);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  pointer-events: none;
}

/* ----------------------------------------------------------- map toolbar */

.maptools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }

.chipset { display: flex; flex-wrap: wrap; gap: 7px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-dim);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.chip.is-on { color: #04101f; background: var(--accent-grad); border-color: transparent; font-weight: 650; }
.chip__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ------------------------------------------------------------ search box */

.searchbox { position: relative; flex: 1 1 260px; min-width: 220px; }

.searchbox input {
  width: 100%;
  padding: 11px 16px 11px 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.searchbox input:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.searchbox::before {
  content: "⌕";
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-52%);
  font-size: 1.15rem;
  color: var(--text-faint);
  pointer-events: none;
}

.suggest {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  left: 0; right: 0;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-solid) 96%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lift);
}
.suggest[hidden] { display: none; }

.suggest__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.suggest__item:hover, .suggest__item.is-active { background: var(--panel-2); }
.suggest__item small { margin-left: auto; color: var(--text-faint); font-size: 0.76rem; }

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ------------------------------------------------------------- side panel */

.detail {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  min-height: 420px;
}

.detail__flag { font-size: 3.2rem; line-height: 1; animation: pop 0.45s var(--ease); }
@keyframes pop { from { transform: scale(0.6) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }

.detail__name { font-size: 1.55rem; margin: 0; }
.detail__sub { color: var(--text-dim); font-size: 0.9rem; margin: 0; }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; font-size: 0.9rem; }
.kv dt { color: var(--text-faint); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.empty-state { display: grid; place-items: center; gap: 10px; flex: 1; text-align: center; color: var(--text-faint); }
.empty-state__icon { font-size: 2.6rem; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* ---------------------------------------------------------------- meters */

.meter { height: 7px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.meter__fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent-grad);
  width: 0;
  transition: width 1.1s var(--ease);
}

/* --------------------------------------------------------------- clocks */

.clockwall { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }

.clock { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.clock__face { width: 132px; height: 132px; }
.clock__digital { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.clock__city { font-weight: 650; }
.clock__meta { font-size: 0.76rem; color: var(--text-faint); }
.clock__remove {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s, color 0.25s;
}
.card:hover .clock__remove { opacity: 1; }
.clock__remove:hover { color: var(--rose); }

.clock-face-bg { fill: none; stroke: var(--line-strong); stroke-width: 2; }
.clock-tick { stroke: var(--text-faint); stroke-width: 1.4; stroke-linecap: round; }
.clock-tick--major { stroke: var(--text-dim); stroke-width: 2.4; }
.clock-hand { stroke-linecap: round; transform-origin: 50px 50px; transition: transform 0.28s var(--ease); }
.clock-hand--h { stroke: var(--text); stroke-width: 4.2; }
.clock-hand--m { stroke: var(--text); stroke-width: 2.8; }
.clock-hand--s { stroke: var(--rose); stroke-width: 1.4; }
.clock-pin { fill: var(--teal); }
.clock-daynight { transition: fill 0.6s var(--ease); }

.bigtime {
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.timer-ring { transform: rotate(-90deg); transform-origin: center; }
.timer-ring__track { fill: none; stroke: var(--panel-2); stroke-width: 9; }
.timer-ring__fill {
  fill: none;
  stroke: url(#timerGrad);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s linear;
}
.timer.is-alarming { animation: shake 0.6s var(--ease) 4; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

.numinput {
  width: 82px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 650;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.numinput:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }

.lap-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.lap {
  display: flex; justify-content: space-between;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--panel-2);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  animation: slide-in 0.35s var(--ease);
}
@keyframes slide-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- converter */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }

.field select, .field input[type="datetime-local"], .field input[type="text"], .field input[type="number"] {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 0.94rem;
}
.field select:focus, .field input:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.field select option { background: var(--panel-solid); color: var(--text); }

.swap-btn {
  align-self: center;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  font-size: 1.15rem;
  cursor: pointer;
  transition: transform 0.4s var(--ease);
}
.swap-btn:hover { transform: rotate(180deg) scale(1.08); }

.daybar {
  position: relative;
  height: 46px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(90deg,
    #0b1b3a 0%, #14315e 18%, #f0a35e 26%, #7ec8ff 34%,
    #a9dcff 50%, #7ec8ff 66%, #f0784a 74%, #14315e 82%, #0b1b3a 100%);
}
.daybar__marker {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 3px;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
  transition: left 0.6s var(--ease);
}
.daybar__label {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 2px 8px;
  border-radius: 7px;
  background: rgba(4, 10, 22, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
  transition: left 0.6s var(--ease);
}

/* --------------------------------------------------------------- listings */

.table-card { padding: 0; overflow: hidden; }

.rowlist { display: flex; flex-direction: column; }

.row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background 0.25s, transform 0.25s var(--ease);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--panel-2); transform: translateX(4px); }
.row__rank { color: var(--text-faint); font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.row__title { font-weight: 640; display: flex; align-items: center; gap: 9px; min-width: 0; }
.row__title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__sub { color: var(--text-dim); font-size: 0.87rem; }
.row__num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 620; }
@media (max-width: 760px) {
  .row { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .row__sub:nth-of-type(2) { display: none; }
}

/* ------------------------------------------------------------- mountains */

.peak-chart { width: 100%; height: auto; overflow: visible; }
.peak-bar { transition: opacity 0.3s, transform 0.6s var(--ease); cursor: pointer; transform-origin: bottom; }
.peak-bar:hover { opacity: 0.85; }
.peak-label { font-size: 7px; fill: var(--text-faint); }
.snowline { stroke: rgba(255, 255, 255, 0.28); stroke-dasharray: 4 4; stroke-width: 0.8; }

.mountain-card__peak { font-size: 1.9rem; font-weight: 780; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  border: 1px solid var(--line-strong);
}
.badge--8k { background: color-mix(in srgb, var(--rose) 22%, transparent); border-color: color-mix(in srgb, var(--rose) 50%, transparent); }
.badge--seven { background: color-mix(in srgb, var(--amber) 22%, transparent); border-color: color-mix(in srgb, var(--amber) 50%, transparent); }

/* ---------------------------------------------------------------- travel */

.place-card { display: flex; flex-direction: column; gap: 10px; min-height: 100%; }
.place-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.place-card__cat {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #04101f;
}
.place-card__blurb { color: var(--text-dim); font-size: 0.9rem; margin: 0; }
.place-card__foot { margin-top: auto; display: flex; justify-content: space-between; gap: 10px; font-size: 0.8rem; color: var(--text-faint); padding-top: 8px; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------- continent */

.continent-card { position: relative; padding: 0; overflow: hidden; text-decoration: none; display: block; }
.continent-card__glow {
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 200px;
  filter: blur(52px);
  opacity: 0.5;
  transition: opacity 0.5s, transform 0.7s var(--ease);
}
.continent-card:hover .continent-card__glow { opacity: 0.85; transform: translateY(14px) scale(1.1); }
.continent-card__body { position: relative; padding: 22px; }
.continent-card__name { font-size: 1.45rem; margin-bottom: 4px; }
.continent-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.continent-card__stats b { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.continent-card__stats span { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-faint); }

/* ------------------------------------------------------------------ misc */

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  z-index: 200;
  padding: 12px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-solid) 95%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lift);
  font-size: 0.9rem;
  transform: translate(-50%, 130%);
  transition: transform 0.5s var(--ease);
}
.toast.is-up { transform: translate(-50%, 0); }

.footer { margin-top: 40px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); }
.footer__inner { width: min(var(--maxw), 100% - clamp(24px, 5vw, 72px)); margin-inline: auto; padding: 34px 0 46px; }
.footer__brand { font-size: 0.95rem; }
.footer__meta { color: var(--text-faint); font-size: 0.84rem; max-width: 74ch; }
.footer__links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; }
.footer__links a { color: var(--text-dim); font-size: 0.86rem; text-decoration: none; }
.footer__links a:hover { color: var(--text); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  /* Brand and clock stay on the first row; the nav drops to its own scroller. */
  .topbar { flex-wrap: wrap; gap: 10px 14px; padding-bottom: 6px; }
  .nav { order: 3; flex: 1 0 100%; margin-left: 0; padding-bottom: 4px; }
  .nav + .topbar__right { margin-left: auto; }
  .nav__link { padding: 8px 11px; font-size: 0.85rem; }
}

@media (max-width: 620px) {
  .brand__text small { display: none; }
  .hero__stats { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 30px minmax(0, 1fr) auto; padding: 12px 14px; }
  .row__sub { display: none; }
  .detail { position: static; min-height: 0; }
  .bigtime { font-size: clamp(2.2rem, 13vw, 3.4rem); }
  .clock__face { width: 112px; height: 112px; }
  section { padding-block: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .wm-country { opacity: 1; }
}
