:root, :root[data-theme="dark"] {
  --bg: #0a0e14; --surface: #121923; --surface2: #18212d; --line: #243041;
  --ink: #e8edf4; --ink2: #aab6c6; --muted: #7d8aa0;
  --accent: #4fd1c5; --accent-ink: #04201d; --accent2: #f6b73c;
  --b0: #173540; --b1: #1a4d5a; --b2: #1b6d77; --b3: #1f929a; --b4: #3cb9bb; --b5: #8de6df;
  --on2: #ffffff; --on3: #04201d; --on4: #04201d; --on5: #04201d;
  --nodata: #1c2633; --dim: #151d28; --stroke: #0a0e14;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px rgba(0,0,0,.35);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f6fa; --surface: #ffffff; --surface2: #f0f3f8; --line: #e1e7ef;
  --ink: #0f1722; --ink2: #3c4859; --muted: #66748a;
  --accent: #0f9d8f; --accent-ink: #ffffff; --accent2: #c2870a;
  --b0: #dbf3f0; --b1: #a9e1db; --b2: #6fcbc4; --b3: #37aeab; --b4: #16847f; --b5: #0b5c5c;
  --on2: #0f1722; --on3: #0f1722; --on4: #ffffff; --on5: #ffffff;
  --nodata: #e6ebf2; --dim: #eef1f6; --stroke: #ffffff;
  --shadow: 0 1px 2px rgba(15,23,34,.06), 0 10px 28px rgba(15,23,34,.08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface2); padding: 1px 6px; border-radius: 5px; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---- Top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 50; height: 60px; display: flex; align-items: center; gap: 18px;
  padding: 0 clamp(16px, 3vw, 32px); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { width: 22px; height: 22px; border-radius: 7px; background: conic-gradient(from 210deg, var(--accent), var(--accent2), var(--accent)); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent); }
.topnav { display: flex; gap: 4px; margin-right: auto; }
.topnav a { padding: 7px 12px; border-radius: 9px; color: var(--ink2); font-weight: 600; font-size: 14px; }
.topnav a:hover { background: var(--surface2); color: var(--ink); }
.topnav a[aria-current="page"] { background: var(--surface2); color: var(--accent); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink2);
}
.icon-btn:hover { color: var(--ink); border-color: var(--muted); }
.palette { position: relative; }
.pal-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 208px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.pal-pop[hidden] { display: none; }
.pal-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 4px 8px 6px; }
.pal-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px;
  background: none; color: var(--ink2); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-align: left;
}
.pal-item i { width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
.pal-item:hover { background: var(--surface2); color: var(--ink); }
.pal-custom-sw { background: conic-gradient(#f44, #fc4, #4d6, #4cf, #84f, #f4a, #f44); }
.pal-custom { display: grid; gap: 8px; padding: 8px 10px 4px; margin-top: 4px; border-top: 1px solid var(--line); }
.pal-custom[hidden] { display: none; }
.pal-custom label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.pal-custom input[type="color"] { width: 38px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: none; cursor: pointer; }
.pal-reset { justify-self: start; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface2); color: var(--ink2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.pal-reset:hover { color: var(--ink); border-color: var(--muted); }
.pal-item.on { color: var(--accent); background: var(--surface2); }
.pal-item.on i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--accent); }
:root[data-theme="dark"] .i-sun, :root[data-theme="light"] .i-moon { display: none; }

/* ---- Home ---- */
.container { max-width: 1120px; margin: 0 auto; padding: clamp(28px, 6vw, 72px) clamp(16px, 3vw, 32px) 40px; }
.hero { max-width: 760px; margin-bottom: clamp(28px, 5vw, 56px); }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
.hero h1 { font-size: clamp(30px, 5.2vw, 52px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; }
.lede { margin-top: 18px; color: var(--ink2); font-size: clamp(16px, 2vw, 19px); max-width: 60ch; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card-link { display: block; border-radius: 20px; }
.pcard {
  height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.card-link:hover .pcard { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.pcard-media {
  position: relative; aspect-ratio: 16 / 7.5; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 140% at 20% 0%, color-mix(in srgb, var(--accent) 16%, var(--surface2)), var(--surface2));
  border-bottom: 1px solid var(--line);
}
.thumb-map { width: 92%; height: auto; }
.thumb-map path { stroke: var(--surface2); stroke-width: .6; transition: opacity .2s; }
.t0 { fill: var(--b0) } .t1 { fill: var(--b1) } .t2 { fill: var(--b2) } .t3 { fill: var(--b3) } .t4 { fill: var(--b4) } .t5 { fill: var(--b5) }
.badge {
  position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
}
.pcard-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcard h2 { font-size: 19px; letter-spacing: -.01em; }
.pcard p { color: var(--ink2); font-size: 14px; }
.tags { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 12px; font-weight: 600; color: var(--ink2); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); }
.pcard-src { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--muted); }
.pcard-empty { align-self: start; border-style: dashed; box-shadow: none; background: transparent; justify-content: center; opacity: .75; }
.footer { max-width: 1120px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 32px) 40px; display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.footer a:hover { color: var(--accent); }
@media (max-width: 560px) { .topnav a { padding: 7px 9px; } .brand-name { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.thumb-map g.t1 path { fill: var(--b1) } .thumb-map g.t2 path { fill: var(--b2) } .thumb-map g.t3 path { fill: var(--b3) } .thumb-map g.t4 path { fill: var(--b4) } .thumb-map g.t5 path { fill: var(--b5) }
