/* Bansun: shared design system.
   Dark green night, one neon-lime accent, glass, glow and particles.
   Typeface: Google Sans (OFL), self-hosted on purpose: no third-party font CDN ever sees our visitors. */

@font-face { font-family: 'Google Sans'; src: url('/fonts/GoogleSans.woff') format('woff'); font-weight: 400 600; font-style: normal; font-display: swap; }

:root {
  --bg: #020704;
  --bg-2: #04110a;
  --bg-3: #072213;
  --panel: rgba(10, 24, 14, 0.58);
  --panel-strong: rgba(12, 30, 17, 0.82);
  --line: rgba(170, 255, 180, 0.09);
  --line-strong: rgba(170, 255, 180, 0.18);
  --text: #eef5ef;
  --text-2: #b9c6bc;
  --muted: #7d8b81;
  --muted-2: #536058;
  --accent: #3cf628; /* brand green, from the logo */
  --accent-2: #46e05c;
  --accent-deep: #0f5f24;
  --accent-ink: #062b0f;
  --warn: #ffcf4a;
  --danger: #ff6b5a;
  --glow: rgba(60, 246, 40, 0.5);
  --glow-soft: rgba(70, 224, 92, 0.18);

  --font-display: 'Google Sans', 'Product Sans', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --font-body: 'Google Sans', 'Product Sans', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'DejaVu Sans Mono', monospace;

  --frame-inset: 12px;
  --radius-frame: 26px;
  --radius-card: 20px;
  --radius-sm: 12px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- atmosphere ---------- */

.atmosphere {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(46, 160, 70, 0.35), transparent 60%),
    radial-gradient(60% 40% at 50% 110%, rgba(70, 224, 92, 0.12), transparent 70%),
    var(--bg);
  transition: background 1.2s var(--ease-out);
}
.atmosphere[data-mood='night'] {
  background: radial-gradient(80% 60% at 50% 50%, rgba(20, 70, 32, 0.25), transparent 70%), var(--bg);
}
.grain {
  position: fixed; inset: -50%; z-index: 60; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(3) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 33% { transform: translate(-3%, 2%); } 66% { transform: translate(2%, -3%); } }
.vignette { position: fixed; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.65) 100%); }
.stage-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

/* The rounded "window" frame around the whole experience. */
.frame {
  position: fixed; inset: var(--frame-inset); z-index: 50; pointer-events: none;
  border-radius: var(--radius-frame);
  border: 1px solid var(--line);
  box-shadow: 0 0 0 calc(var(--frame-inset) + 2px) var(--bg), inset 0 0 80px rgba(0, 0, 0, 0.35);
}

/* ---------- top bar ---------- */

.topbar {
  position: fixed; z-index: 55; top: calc(var(--frame-inset) + 18px); left: calc(var(--frame-inset) + 26px); right: calc(var(--frame-inset) + 22px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 400; letter-spacing: 0.08em; font-size: 14px; }
.brand svg { width: 27px; height: 23px; color: var(--accent); filter: drop-shadow(0 0 8px var(--glow)); }
.brand b { font-weight: 400; color: var(--accent); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- buttons ---------- */

.pill {
  --pad: 5px;
  display: inline-flex; align-items: center; gap: 12px;
  padding: var(--pad) var(--pad) var(--pad) 18px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(8, 20, 11, 0.6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 13.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: border-color 0.4s var(--ease-out), background 0.4s var(--ease-out), transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.pill:hover { border-color: rgba(141, 255, 74, 0.45); box-shadow: 0 0 24px -6px var(--glow); }
.pill:active { transform: scale(0.97); }
.pill .dot {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #c5ff9b, var(--accent) 45%, var(--accent-2));
  color: var(--accent-ink); box-shadow: 0 0 18px -2px var(--glow);
  transition: transform 0.5s var(--ease-out);
}
.pill .dot svg { width: 14px; height: 14px; }
.pill:hover .dot { transform: rotate(45deg); }
.pill.light { background: #f3f7f2; color: #08140b; border-color: transparent; }
.pill.light:hover { box-shadow: 0 0 34px -6px var(--glow); }
.pill.plain { padding: 9px 16px; }
.pill[disabled], .pill.is-busy { opacity: 0.55; pointer-events: none; }
.pill.small { font-size: 12.5px; padding: 7px 13px; }
.pill.active { border-color: rgba(141, 255, 74, 0.55); color: var(--accent); }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(8, 20, 11, 0.6);
  display: grid; place-items: center; cursor: pointer; transition: border-color 0.3s, color 0.3s;
}
.icon-btn:hover { border-color: rgba(141, 255, 74, 0.5); color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }


/* ---------- chips & inline icons ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.03); color: var(--text-2);
  padding: 5px 11px; border-radius: 999px; font-size: 12px; line-height: 1.4; cursor: pointer; transition: all 0.3s var(--ease-out);
}
button.chip:hover, label.chip:hover, a.chip:hover { color: var(--accent); border-color: rgba(141, 255, 74, 0.4); }
button.chip:disabled { opacity: 0.5; pointer-events: none; }
.chip svg, .badge svg, .pill > svg, .note svg { width: 14px; height: 14px; flex: none; }

/* ---------- floating bottom navigation ---------- */

.dock {
  position: fixed; z-index: 55; left: 50%; bottom: calc(var(--frame-inset) + 22px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 5px;
  border-radius: 14px; border: 1px solid var(--line-strong);
  background: rgba(12, 22, 14, 0.62); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  max-width: calc(100vw - 2 * var(--frame-inset) - 24px); overflow-x: auto; scrollbar-width: none;
}
.dock::-webkit-scrollbar { display: none; }
.dock a, .dock button {
  position: relative; border: 0; background: none; cursor: pointer;
  padding: 8px 13px; border-radius: 10px; font-size: 13px; color: var(--text-2); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px; transition: color 0.3s, background 0.3s;
}
.dock a:hover, .dock button:hover { color: var(--text); }
.dock .is-active { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.dock .is-active::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--glow); }
.dock .plus { color: var(--accent); font-size: 15px; line-height: 1; }

.scroll-hint {
  position: fixed; z-index: 55; left: calc(var(--frame-inset) + 30px); bottom: calc(var(--frame-inset) + 30px);
  display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2);
  transition: opacity 0.6s;
}
.scroll-hint svg { width: 12px; height: 12px; animation: bob 2s var(--ease-in-out) infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* ---------- type ---------- */

.label {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}
.label::before { content: '['; opacity: 0.7; }
.label::after { content: ']'; opacity: 0.7; }
.index { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); letter-spacing: 0.1em; }
.index::before { content: '[ '; color: var(--muted); }
.index::after { content: ' ]'; color: var(--muted); }

.display {
  font-family: var(--font-display); font-weight: 400; letter-spacing: -0.035em; line-height: 0.94;
  font-size: clamp(44px, 8.2vw, 124px); margin: 0;
}
.h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.03em; line-height: 1.02; font-size: clamp(34px, 5vw, 70px); margin: 0; }
.h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.025em; line-height: 1.12; font-size: clamp(20px, 2vw, 27px); margin: 0; }
.dim { color: var(--muted); }
.small { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.inline-icon {
  display: inline-grid; place-items: center; vertical-align: middle;
  width: 0.62em; height: 0.62em; margin: 0 0.08em 0.12em; color: var(--accent);
  filter: drop-shadow(0 0 8px var(--glow));
}
.inline-icon svg { width: 100%; height: 100%; }

/* ---------- glass ---------- */

.glass {
  background: linear-gradient(160deg, rgba(20, 44, 26, 0.55), rgba(6, 16, 9, 0.62));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  backdrop-filter: blur(16px) saturate(1.15); -webkit-backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.corner-brackets { position: relative; }
.corner-brackets::before, .corner-brackets::after {
  content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid var(--accent); filter: drop-shadow(0 0 6px var(--glow));
}
.corner-brackets::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.corner-brackets::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

/* ---------- motion: reveal ---------- */

.reveal { opacity: 0; transform: translateY(26px); filter: blur(10px); transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out), filter 1.1s var(--ease-out); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; filter: none; }
.words .w { display: inline-block; opacity: 0; transform: translateY(0.45em); filter: blur(8px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out), filter 0.9s var(--ease-out); transition-delay: calc(var(--i) * 45ms + var(--d, 0s)); }
.words.is-in .w { opacity: 1; transform: none; filter: none; }

.toast {
  position: fixed; z-index: 80; left: 50%; top: calc(var(--frame-inset) + 74px); transform: translate(-50%, -12px);
  padding: 10px 16px; border-radius: 12px; font-size: 13.5px; opacity: 0; pointer-events: none;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast[data-kind='warn'] { border-color: rgba(255, 207, 74, 0.45); color: #ffe6a3; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  :root { --frame-inset: 0px; --radius-frame: 0px; }
  .frame { display: none; }
  .topbar { top: 14px; left: 16px; right: 14px; }
  .scroll-hint { display: none; }
  .dock { bottom: 14px; }
  .grain { opacity: 0.04; }
}

@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, .words .w { opacity: 1; transform: none; filter: none; }
}

/* ---------- scroll polish: hidden scrollbars, scroll-active blur, responsive safety ---------- */
html, body, .rail, .dock, .md-table, .md pre, .table-wrap { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar, *::-webkit-scrollbar { width: 0; height: 0; display: none; }
html { overflow-x: hidden; }
.topbar::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none; inset: -18px -26px -14px;
  background: linear-gradient(to bottom, rgba(2, 7, 4, 0.7), transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent);
  opacity: 0; transition: opacity 0.4s var(--ease-out);
}
.is-scrolled .topbar::before { opacity: 0.55; }
.is-scrolling .topbar::before { opacity: 1; }
.stage-canvas, .atmosphere { transition: filter 0.4s var(--ease-out), opacity 0.4s; }
.is-scrolling .atmosphere { filter: blur(3px); }
.is-scrolling .stage-canvas { filter: blur(3px); }
button, .pill, .chip, .icon-btn, select, .input { touch-action: manipulation; }
@media (pointer: coarse) {
  .chip, .seg button, .copy-btn, .dock a, .dock button, .rail button { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .copy-btn { min-width: 44px; }
  .pill.small, .pill.plain { min-height: 44px; }
  .input { min-height: 44px; font-size: 16px; }
}
@media (max-width: 760px) {
  .topbar { gap: 8px; }
  .brand { font-size: 13px; }
  .toast { max-width: calc(100vw - 24px); top: 64px; }
  .dock { padding-bottom: calc(5px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .is-scrolling .atmosphere, .is-scrolling .stage-canvas { filter: none; }
  .topbar::before { transition: none; }
}
