/* NDK Hub: "zero gravity" theme */
:root {
  --bg: #f6f6fb;
  --ink: #0f1226;
  --muted: #5a607a;
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #ffffff;
  --line: rgba(15, 18, 38, 0.09);
  --shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 18px 40px -18px rgba(40, 50, 120, 0.28);
  --shadow-hover: 0 1px 0 rgba(255,255,255,.9) inset, 0 30px 60px -20px rgba(60, 70, 180, 0.4);
  --b1: #4f7cff; --b2: #a66bff; --b3: #ff7ab8; --b4: #ffb547;
  --radius: 28px;
  --display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #090b19;
  --ink: #f2f3ff;
  --muted: #9ba2c4;
  --card: rgba(24, 28, 56, 0.62);
  --card-solid: #151937;
  --line: rgba(255, 255, 255, 0.09);
  --shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 20px 44px -20px rgba(0, 0, 0, 0.7);
  --shadow-hover: 0 1px 0 rgba(255,255,255,.1) inset, 0 32px 64px -22px rgba(90, 100, 255, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--body); -webkit-font-smoothing: antialiased;
  overflow-x: hidden; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--b1); outline-offset: 3px; border-radius: 12px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 999px; z-index: 100; }
.skip:focus { left: 12px; }

/* ---------- background ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; width: 58vmax; height: 58vmax; border-radius: 50%; filter: blur(70px); opacity: .5; }
.aurora i:nth-child(1) { background: radial-gradient(circle, var(--b1), transparent 65%); left: -18vmax; top: -22vmax; animation: drift1 26s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: radial-gradient(circle, var(--b3), transparent 65%); right: -20vmax; top: 8vmax; opacity: .38; animation: drift2 32s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { background: radial-gradient(circle, var(--b2), transparent 65%); left: 20vmax; bottom: -34vmax; opacity: .36; animation: drift3 38s ease-in-out infinite alternate; }
:root[data-theme="dark"] .aurora i { opacity: .34; }
:root[data-theme="dark"] .aurora i:nth-child(2), :root[data-theme="dark"] .aurora i:nth-child(3) { opacity: .24; }
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-12vmax, 14vmax) scale(.92); } }
@keyframes drift3 { to { transform: translate(10vmax, -10vmax) scale(1.08); } }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
main, .foot, .nav { position: relative; z-index: 2; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 14px; z-index: 50; margin: 14px auto 0; width: min(1120px, calc(100% - 32px));
  display: flex; align-items: center; gap: 16px; padding: 10px 12px 10px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; font: 800 1.15rem var(--display); letter-spacing: -.02em; }
.brand-mark { position: relative; width: 28px; height: 28px; }
.brand-mark i { position: absolute; width: 11px; height: 11px; border-radius: 50%; animation: bob 4s ease-in-out infinite alternate; }
.brand-mark i:nth-child(1) { left: 0; top: 14px; background: var(--b1); }
.brand-mark i:nth-child(2) { left: 14px; top: 2px; background: var(--b2); animation-delay: -1s; }
.brand-mark i:nth-child(3) { left: 16px; top: 16px; width: 8px; height: 8px; background: var(--b4); animation-delay: -2s; }
.brand-mark i:nth-child(4) { left: 3px; top: 1px; width: 6px; height: 6px; background: var(--b3); animation-delay: -3s; }
@keyframes bob { from { transform: translateY(2px); } to { transform: translateY(-3px); } }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a { padding: 8px 14px; border-radius: 999px; font-weight: 500; color: var(--muted); transition: .2s; }
.nav-links a:hover { background: var(--line); color: var(--ink); }
.nav-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pill-btn, .icon-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 999px; transition: .2s;
}
.icon-btn { width: 40px; padding: 0; justify-content: center; }
.pill-btn:hover, .icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pill-btn svg, .icon-btn svg { width: 18px; height: 18px; }
kbd { font: 500 .72rem var(--body); padding: 2px 7px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }

/* ---------- hero ---------- */
.hero { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: clamp(56px, 10vw, 120px) 0 40px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 7px 16px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-weight: 500; font-size: .9rem;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: #25d39a; box-shadow: 0 0 0 0 rgba(37,211,154,.6); animation: ping 2.4s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(37,211,154,0); } 100% { box-shadow: 0 0 0 0 rgba(37,211,154,0); } }
h1 {
  margin: 0 auto; max-width: 14ch; font: 800 clamp(2.7rem, 8.4vw, 6.4rem)/.98 var(--display);
  letter-spacing: -.045em; text-wrap: balance;
}
h1 span { display: inline-block; }
.grad {
  background: linear-gradient(100deg, var(--b1), var(--b2) 35%, var(--b3) 65%, var(--b4)); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 9s ease-in-out infinite alternate;
  padding: 0 .06em .08em;
}
@keyframes shimmer { to { background-position: 100% 0; } }
.lede { max-width: 56ch; margin: 26px auto 0; color: var(--muted); font-size: clamp(1.02rem, 2.2vw, 1.22rem); }
.hero-cta { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; height: 52px; padding: 0 28px; border-radius: 999px; font-weight: 700; transition: .25s;
}
.btn.primary { color: #fff; background: linear-gradient(120deg, var(--b1), var(--b2)); box-shadow: 0 16px 34px -14px rgba(79,124,255,.8); }
.btn.primary:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 22px 40px -14px rgba(120,100,255,.9); }
.popular { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.popular a {
  padding: 9px 15px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  font-size: .92rem; font-weight: 500; transition: .2s;
}
.popular a:hover { transform: translateY(-3px); border-color: var(--b1); }

/* ---------- live orbs ---------- */
.live {
  width: min(1120px, calc(100% - 32px)); margin: 28px auto 0; display: grid; gap: 20px;
  grid-template-columns: 1.25fr 1fr 0.8fr; align-items: stretch;
}
.orb {
  position: relative; padding: 26px 28px; border-radius: 36px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  animation: bob2 var(--d, 8s) ease-in-out infinite alternate;
}
.orb-time { --d: 7.5s; }
.orb-weather { --d: 9s; }
.orb-visit { --d: 8.2s; }
.orb:nth-child(2) { animation-delay: -2.5s; }
.orb:nth-child(3) { animation-delay: -4.5s; margin-top: -6px; }
.orb:hover, .orb:focus-within { animation-play-state: paused; }
@keyframes bob2 { from { transform: translateY(-5px); } to { transform: translateY(7px); } }
.orb-label { margin: 0; color: var(--muted); font-weight: 500; font-size: .92rem; }
.orb-time { background: linear-gradient(150deg, rgba(79,124,255,.16), rgba(166,107,255,.12)), var(--card); }
.clock { margin: 6px 0 0; font: 800 clamp(2.8rem, 6vw, 4.4rem)/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.clock small { font-size: .42em; letter-spacing: 0; color: var(--muted); font-weight: 700; margin-left: 6px; }
.date { margin: 12px 0 0; font-weight: 700; }
.tz { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }

.wx-top { display: flex; justify-content: space-between; }
.place { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--card-solid); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; max-width: 100%; }
.place span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place svg { width: 16px; height: 16px; flex: none; color: var(--b3); }
.place:hover { border-color: var(--b1); }
.wx-main { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.wx-icon { width: 64px; height: 64px; flex: none; }
.wx-icon svg { width: 100%; height: 100%; stroke-width: 1.5; }
.temp { margin: 0; font: 800 clamp(2.6rem, 5vw, 3.8rem)/1 var(--display); letter-spacing: -.04em; }
.temp sup { font-size: .38em; vertical-align: top; position: relative; top: .35em; margin-left: 2px; color: var(--muted); }
.wx-desc { margin: 8px 0 0; font-weight: 700; }
.wx-stats { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wx-stats li { padding: 10px 10px; border-radius: 16px; background: var(--line); display: grid; gap: 2px; }
.wx-stats span { font-size: .72rem; color: var(--muted); }
.wx-stats b { font-size: .9rem; white-space: nowrap; }

.place-pop {
  position: absolute; z-index: 20; left: 14px; right: 14px; top: 62px; padding: 14px; border-radius: 22px;
  background: var(--card-solid); border: 1px solid var(--line); box-shadow: 0 30px 60px -20px rgba(20,20,80,.5);
}
.place-pop[hidden] { display: none; }
.place-pop input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit;
}
.locate { margin-top: 10px; width: 100%; height: 42px; border-radius: 14px; border: 1px dashed var(--b1); background: transparent; color: var(--b1); font-weight: 700; }
.locate:hover { background: rgba(79,124,255,.1); }
.place-results { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; max-height: 190px; overflow: auto; }
.place-results button { width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 12px; background: transparent; }
.place-results button:hover, .place-results button:focus-visible { background: var(--line); }
.place-results small { color: var(--muted); display: block; }
.place-msg { margin: 8px 2px 0; font-size: .84rem; color: var(--muted); min-height: 1.1em; }

.orb-visit { display: flex; flex-direction: column; background: linear-gradient(160deg, rgba(255,122,184,.16), rgba(255,181,71,.12)), var(--card); }
.visit-num { margin: 10px 0 0; font: 800 clamp(2.4rem, 5vw, 3.4rem)/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.visit-note { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
.spark { margin-top: auto; padding-top: 22px; display: flex; align-items: flex-end; gap: 6px; height: 76px; }
.spark i { flex: 1; border-radius: 8px 8px 4px 4px; background: linear-gradient(var(--b3), var(--b4)); opacity: .85; animation: grow 3.6s ease-in-out infinite alternate; transform-origin: bottom; }
.spark i:nth-child(1) { height: 30%; animation-delay: -.2s; } .spark i:nth-child(2) { height: 48%; animation-delay: -.9s; }
.spark i:nth-child(3) { height: 38%; animation-delay: -1.4s; } .spark i:nth-child(4) { height: 66%; animation-delay: -.5s; }
.spark i:nth-child(5) { height: 55%; animation-delay: -2s; } .spark i:nth-child(6) { height: 82%; animation-delay: -1s; }
.spark i:nth-child(7) { height: 100%; animation-delay: -1.7s; }
@keyframes grow { from { transform: scaleY(.72); } to { transform: scaleY(1); } }

/* ---------- finder ---------- */
.finder { width: min(1120px, calc(100% - 32px)); margin: 90px auto 0; }
.finder-bar {
  display: grid; gap: 12px; padding: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 30px; box-shadow: var(--shadow);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.search { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 18px; border-radius: 20px; background: var(--card-solid); border: 1px solid var(--line); }
.search:focus-within { border-color: var(--b1); box-shadow: 0 0 0 4px rgba(79,124,255,.16); }
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.02rem; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line); font-weight: 500; color: var(--muted); transition: .2s;
}
.chip b { font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--ink); }
.chip:hover { color: var(--ink); border-color: var(--b1); }
.chip[aria-selected="true"] { color: #fff; border-color: transparent; background: linear-gradient(120deg, var(--b1), var(--b2)); }
.chip[aria-selected="true"] b { background: rgba(255,255,255,.25); color: #fff; }

.grid-wrap { margin-top: 36px; display: grid; gap: 56px; }
.group-head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 20px; flex-wrap: wrap; }
.group-head h2 { margin: 0; font: 800 clamp(1.7rem, 4vw, 2.4rem)/1 var(--display); letter-spacing: -.035em; }
.group-head span { color: var(--muted); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
.cards li { animation: bob2 var(--d, 8s) ease-in-out infinite alternate; animation-delay: var(--delay, 0s); }
.card {
  --rx: 0deg; --ry: 0deg; position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%; min-height: 190px; padding: 22px;
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .18s ease-out, box-shadow .3s, border-color .3s;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0; transition: opacity .3s; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--h1) 20%, transparent), transparent 60%);
}
a.card:hover { box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--h1) 50%, var(--line)); }
a.card:hover::before { opacity: 1; }
.cards li:hover { animation-play-state: paused; }
.ico { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--h1), var(--h2)); box-shadow: 0 12px 22px -10px var(--h1); }
.ico svg { width: 26px; height: 26px; stroke-width: 1.9; }
.card h3 { margin: 6px 0 0; font: 700 1.2rem/1.2 var(--display); letter-spacing: -.02em; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 8px; }
.tag { font-size: .78rem; color: var(--muted); }
.go { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--card-solid); transition: .25s; }
.go svg { width: 16px; height: 16px; }
a.card:hover .go { background: linear-gradient(140deg, var(--h1), var(--h2)); color: #fff; border-color: transparent; transform: rotate(45deg); }
.badge { position: absolute; top: 18px; right: 18px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; color: #fff; background: linear-gradient(120deg, var(--b3), var(--b4)); }
.badge.soon { background: var(--line); color: var(--muted); }
.card.is-soon { opacity: .75; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 1.1rem; }
mark { background: color-mix(in srgb, var(--b4) 45%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }

/* ---------- footer ---------- */
.foot { width: min(1120px, calc(100% - 32px)); margin: 110px auto 36px; padding: 24px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; color: var(--muted); font-size: .92rem; }
.foot p { margin: 0; }
.foot nav { display: flex; gap: 18px; }
.foot nav a:hover { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .live { grid-template-columns: 1fr 1fr; }
  .orb-time { grid-column: 1 / -1; }
  .orb:nth-child(2), .orb:nth-child(3) { margin-top: 0; }
}
@media (max-width: 620px) {
  .hide-sm, .nav-links { display: none; }
  .nav { padding-left: 14px; }
  .live { grid-template-columns: 1fr; }
  .orb { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
/* ---------- Site Maintenance Banner & Tool Status Modal ---------- */
.site-maint-banner {
  width: min(1120px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 14px 20px;
  border-radius: 22px;
  background: linear-gradient(120deg, rgba(255, 122, 184, 0.16), rgba(255, 181, 71, 0.18)), var(--card);
  border: 1px solid rgba(255, 181, 71, 0.48);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  position: relative;
  z-index: 5;
}
.site-maint-pill {
  padding: 4px 11px;
  border-radius: 999px;
  font: 800 0.72rem var(--body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1f1600;
  background: linear-gradient(120deg, var(--b3), var(--b4));
}
.site-maint-text {
  margin: 0;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink);
}
.badge.maint {
  background: linear-gradient(120deg, #f59e0b, #fbbf24);
  color: #1f1600;
}
.badge.disabled {
  background: linear-gradient(120deg, #e11d48, #fb7185);
  color: #ffffff;
}
.card.is-blocked {
  opacity: 0.84;
}
.ndk-hub-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(9, 11, 25, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.ndk-hub-modal-card {
  width: 100%;
  max-width: 460px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 26px;
  box-shadow: var(--shadow-hover);
  color: var(--ink);
}
.ndk-hub-modal-card h3 {
  margin: 10px 0 8px;
  font: 800 1.45rem/1.15 var(--display);
  letter-spacing: -0.025em;
}
.ndk-hub-modal-msg {
  margin: 12px 0 20px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink);
}
