/* ============================================================================
   Amber Watch — design.css  (v2)
   "deep night sea with amber glow"

   Strategy:
   - Single dark navy base color shared by page bg AND every card.
   - Glass effect (rgba alpha + backdrop-filter) so cards emerge from the same
     atmosphere instead of stacking solid panels on it.
   - One accent ramp (amber) with a teal whisper used ONLY for fala/map water.
   - Glow is reserved for L3 + active gauge segments. Nothing else glows.
   ============================================================================ */

:root {
  /* base */
  --ink-950: #04060c;
  --ink-900: #070b14;   /* page background */
  --ink-800: #0a0f1c;
  --ink-700: #0e1424;

  /* glass tokens — used by EVERY card */
  --glass-fill:   rgba(255, 255, 255, 0.012);
  --glass-fill-2: rgba(255, 255, 255, 0.028);   /* slight emphasis */
  --glass-stroke: rgba(255, 255, 255, 0.08);
  --glass-stroke-soft: rgba(255, 255, 255, 0.05);
  --glass-highlight: rgba(255, 255, 255, 0.06);

  /* accent */
  --amber-300: #fcd34d;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-glow:    rgba(245, 158, 11, 0.55);
  --amber-glow-2:  rgba(245, 158, 11, 0.18);
  --amber-tint:    rgba(245, 158, 11, 0.10);

  /* secondary (teal — sparingly: fala + map water) */
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;

  /* text */
  --ash-100: #e6ecf3;
  --ash-200: #c5cfdc;
  --ash-300: #94a3b8;
  --ash-400: #64748b;
  --ash-500: #475569;

  /* status */
  --ok:   #10b981;
  --warn: #fbbf24;
  --err:  #ef4444;

  /* tweakable */
  --accent: var(--amber-500);
  --alert-glow-intensity: 1;
}

/* ---------- Theme: graphite (toggle from Tweaks → Motyw) -------------------- */
[data-theme="graphite"] {
  --ink-950: #0a0a0c;
  --ink-900: #14141a;   /* page background — neutral graphite */
  --ink-800: #1c1c24;
  --ink-700: #23232c;
}
[data-theme="graphite"] .bg-glow {
  /* swap teal whisper for warmer neutral so it doesn't clash with cool navy
     undertones being gone */
  background:
    radial-gradient(ellipse 900px 700px at 12% 8%,  rgba(245, 158, 11, 0.06), transparent 65%),
    radial-gradient(ellipse 1100px 900px at 96% 96%, rgba(180, 180, 200, 0.030), transparent 65%),
    radial-gradient(ellipse 600px 500px at 50% 110%, rgba(245, 158, 11, 0.030), transparent 60%);
}

* { box-sizing: border-box; }

html, body {
  background: var(--ink-900);
  color: var(--ash-100);
  font-family: "Inter var", "Inter", ui-sans-serif, system-ui, -apple-system,
               "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01", "ss03";
  font-variant-numeric: tabular-nums;
  margin: 0;
  overflow-x: hidden;
}

/* ============================================================================
   BACKGROUND LAYERS (all fixed, behind everything)
   ============================================================================ */

#bg-particles {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  width: 100vw; height: 100vh;
  /* canvas is sized in JS — these are just the box dimensions */
}

.bg-glow {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 900px 700px at 12% 8%,  rgba(245, 158, 11, 0.05), transparent 65%),
    radial-gradient(ellipse 1100px 900px at 96% 96%, rgba(45, 212, 191, 0.035), transparent 65%),
    radial-gradient(ellipse 600px 500px at 50% 110%, rgba(245, 158, 11, 0.025), transparent 60%);
}

.bg-grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9  0 0 0 0 0.9  0 0 0 0 0.9  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
[data-bg="flat"]     .bg-grain,
[data-bg="flat"]     .bg-glow,
[data-bg="flat"]     #bg-particles { display: none; }
[data-bg="gradient"] .bg-grain { display: none; }

/* App root sits above the bg layers */
#app { position: relative; z-index: 10; }

/* ============================================================================
   GLASS CARDS — the heart of v2
   ============================================================================ */

.card {
  position: relative;
  background: var(--glass-fill);
  backdrop-filter: blur(5px) saturate(140%);
  -webkit-backdrop-filter: blur(5px) saturate(140%);
  border: 1px solid var(--glass-stroke);
  border-radius: 20px;
  /* Lit from top-left (the logo): warm amber halo outside on that side,
     deep shadow falling bottom-right. */
  box-shadow:
    0 1px 0 var(--glass-highlight) inset,                        /* rim light top */
     -3px  -3px 11px -3px rgba(245, 158, 11, 0.14),              /* amber halo TL (near) */
     -7px  -7px 18px -6px rgba(245, 158, 11, 0.10),              /* amber halo TL (far)  */
     22px  26px 48px -18px rgba(0, 0, 0, 0.62),                  /* dark shadow BR (far) */
     10px  14px 26px -10px rgba(0, 0, 0, 0.42),                  /* dark shadow BR (near)*/
      2px   3px  8px  -4px rgba(0, 0, 0, 0.35);                  /* contact shadow       */
  transition: transform 0.25s cubic-bezier(.2,.7,.3,1),
              border-color 0.25s, box-shadow 0.35s;
  overflow: hidden;
  isolation: isolate;
}

/* Subtle internal rim light from upper-left, suggesting "facet" */
.card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 55% at 0% 0%,
              rgba(255, 255, 255, 0.04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.card > * { position: relative; z-index: 1; }

.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 1px 0 var(--glass-highlight) inset,
     -4px  -4px 13px -3px rgba(245, 158, 11, 0.20),
     -8px  -8px 21px -6px rgba(245, 158, 11, 0.13),
     22px  26px 48px -18px rgba(0, 0, 0, 0.62),
     10px  14px 26px -10px rgba(0, 0, 0, 0.42),
      2px   3px  8px  -4px rgba(0, 0, 0, 0.35);
}

/* ---------- Level-driven L3 inner glow (the bursztyn-lit-from-within effect) */
.card[data-level="L3"] {
  border-color: rgba(245, 158, 11, 0.28);
}
.card[data-level="L3"]::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 -90px 110px rgba(245, 158, 11, 0.18),
    inset 0 -30px 50px  rgba(245, 158, 11, 0.10),
    inset 0  60px 90px -40px rgba(245, 158, 11, 0.04);
  pointer-events: none;
  opacity: calc(var(--alert-glow-intensity, 1) * 1);
  animation: amber-breathe 6s ease-in-out infinite;
  z-index: 0;
}
@keyframes amber-breathe {
  0%, 100% { opacity: calc(var(--alert-glow-intensity, 1) * 0.55); }
  50%      { opacity: calc(var(--alert-glow-intensity, 1) * 1.00); }
}

/* L2 — softer purple breath, much less intense */
.card[data-level="L2"]::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 -60px 80px rgba(167, 139, 250, 0.08);
  pointer-events: none;
  z-index: 0;
}

@media (prefers-reduced-motion: reduce) {
  .card[data-level="L3"]::after { animation: none; }
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

.label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash-400);
}

.mono { font-family: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
        font-feature-settings: "tnum", "zero"; }

.num-hero {
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #ffeebd 0%, var(--amber-400) 35%, var(--amber-600) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.num-metric { font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.unit { font-size: 12px; font-weight: 400; color: var(--ash-400); margin-left: 4px; }

/* ============================================================================
   ARC GAUGE — continuous, thin stroke + amber drop-shadow
   ============================================================================ */

.arc-gauge { display: block; }
.arc-gauge .arc-bg {
  stroke: rgba(255, 255, 255, 0.06);
  fill: none;
}
.arc-gauge .arc-fg {
  stroke: var(--accent);
  fill: none;
  filter: drop-shadow(0 0 4px var(--amber-glow));
  transition: stroke-dashoffset 0.8s cubic-bezier(.2,.7,.3,1);
}
.arc-gauge.no-glow .arc-fg { filter: none; }

/* ============================================================================
   SIDEBAR
   ============================================================================ */

.sidebar {
  position: relative;
  padding: 20px 12px;
  /* Glassmorphism — same fog as cards. No solid panel. */
  background: var(--glass-fill);
  backdrop-filter: blur(5px) saturate(140%);
  -webkit-backdrop-filter: blur(5px) saturate(140%);
  border-right: 1px solid var(--glass-stroke);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  display: block;
  width: 48px; height: 48px;
  margin: 2px 0 6px;
  background: var(--brand-logo, url("assets/logo-amber.png")) center/contain no-repeat;
  filter: var(--brand-halo, drop-shadow(0 0 12px rgba(245,158,11,0.40)) drop-shadow(0 0 28px rgba(245,158,11,0.20)));
  transition: filter 0.3s ease, background-image 0.3s ease;
}

.nav-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--ash-400);
  transition: all 0.18s;
  position: relative;
  text-decoration: none;
}
.nav-btn:hover {
  color: var(--ash-100);
  background: rgba(255, 255, 255, 0.05);
}
.nav-btn[aria-current="page"] {
  color: var(--amber-400);
  background: rgba(245, 158, 11, 0.10);
}
.nav-btn[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -12px; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 18px;
  background: var(--amber-400);
  border-radius: 1px;
  box-shadow: 0 0 8px var(--amber-glow);
}

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a1f15, #4a3520);
  border: 1px solid var(--glass-stroke);
  display: grid;
  place-items: center;
  color: var(--amber-300);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ============================================================================
   PHASE ICONS — abstract geometric (2026)
   ============================================================================ */

.phase-icon { display: block; }

/* BUILDING — rising sinusoid (oscilloscope) */
.phase-building .wave-line {
  stroke: var(--ash-300);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  opacity: 0.9;
}
.phase-building .wave-line.w-1 { animation: osc-flow 3.6s linear infinite; }
.phase-building .wave-line.w-2 { animation: osc-flow 3.6s linear infinite -1.2s; opacity: 0.65; }
.phase-building .wave-line.w-3 { animation: osc-flow 3.6s linear infinite -2.4s; opacity: 0.4; }
.phase-building .wave-line.peak { stroke: var(--amber-400); opacity: 1; }
@keyframes osc-flow {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -40; }
}

/* PEAK — geometric bolt with glow pulse */
.phase-peak .bolt {
  fill: var(--amber-500);
  stroke: var(--amber-300);
  stroke-width: 1;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px var(--amber-glow));
  animation: bolt-pulse 1.8s ease-in-out infinite;
  transform-origin: center center;
}
.phase-peak .frame {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
  fill: none;
}
@keyframes bolt-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px var(--amber-glow)); transform: scale(1); }
  50%      { filter: drop-shadow(0 0 16px var(--amber-glow)); transform: scale(1.04); }
}

/* POST_STORM (Okno) — amber rhombus, the bursztyn shape */
.phase-post .rhombus-outer {
  stroke: var(--amber-400);
  stroke-width: 1.4;
  fill: rgba(245, 158, 11, 0.06);
}
.phase-post .rhombus-inner {
  fill: url(#amber-grad);
  filter: drop-shadow(0 0 10px var(--amber-glow));
  animation: rhombus-breathe 4s ease-in-out infinite;
  transform-origin: center;
}
.phase-post .facet {
  stroke: rgba(255, 230, 180, 0.5);
  stroke-width: 0.8;
  fill: none;
}
@keyframes rhombus-breathe {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.03); }
}

/* QUIET — nearly-flat line */
.phase-quiet .flat-line {
  stroke: var(--ash-400);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  animation: flat-drift 6s ease-in-out infinite;
}
.phase-quiet .anchor {
  fill: var(--ash-400);
  opacity: 0.6;
}
@keyframes flat-drift {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1px); }
}

@media (prefers-reduced-motion: reduce) {
  .phase-icon * { animation: none !important; }
}

/* ============================================================================
   SPARKLINES — fill bottom half of card
   ============================================================================ */

.spark-frame {
  position: relative;
  margin-top: auto;
  height: 80px;
  margin-left: -20px;
  margin-right: -20px;
  margin-bottom: -20px;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  overflow: hidden;
}
.spark-frame canvas {
  position: absolute; inset: 0;
  width: 100% !important;
  height: 100% !important;
}

/* ============================================================================
   METRIC STRIP — borderless strips stacked inside a single wrapper card.
   Used as the right-column companion to the hero card. Three strips share
   one container, separated by hair-thin dividers, no individual borders.
   ============================================================================ */

.metric-stack {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.metric-stack > .metric-strip {
  flex: 1;
  min-height: 0;
}
.metric-stack > .metric-strip + .metric-strip {
  border-top: 1px solid var(--glass-stroke-soft);
}

.metric-strip {
  position: relative;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.metric-strip .strip-head {
  display: flex; align-items: center; justify-content: space-between;
}
.metric-strip .strip-main {
  display: flex; align-items: flex-end; gap: 10px;
  margin-top: 2px;
}
.metric-strip .strip-foot {
  font-size: 11px;
  color: var(--ash-400);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.metric-strip .strip-spark {
  position: absolute;
  right: 18px;
  bottom: 14px;
  width: 42%;
  height: 44px;
  pointer-events: none;
  opacity: 0.95;
}
.metric-strip .strip-spark canvas {
  position: absolute; inset: 0;
  width: 100% !important;
  height: 100% !important;
}

/* ============================================================================
   WIND DIRECTION PILL
   ============================================================================ */

.dir-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--amber-300);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.dir-pill .arrow {
  width: 12px; height: 12px;
  transition: transform 0.4s;
}

/* ============================================================================
   WINDOW FORECAST
   ============================================================================ */

.window-bar {
  position: relative;
  height: 36px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.15)),
    rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-stroke-soft);
  overflow: hidden;
}
.window-bar .span {
  position: absolute; top: 0; bottom: 0;
  background:
    linear-gradient(90deg,
      rgba(245, 158, 11, 0.0)   0%,
      rgba(245, 158, 11, 0.55) 12%,
      rgba(252, 211, 77, 0.7)  50%,
      rgba(245, 158, 11, 0.55) 88%,
      rgba(245, 158, 11, 0.0)  100%);
  border-left: 1px solid rgba(252, 211, 77, 0.8);
  border-right: 1px solid rgba(252, 211, 77, 0.8);
  box-shadow:
    inset 0 0 24px rgba(245, 158, 11, 0.25),
    0 0 14px rgba(245, 158, 11, 0.2);
}
.window-bar .tick {
  position: absolute; top: 25%; bottom: 25%;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
}
.window-bar .now {
  position: absolute; top: -2px; bottom: -2px;
  width: 2px;
  background: var(--amber-300);
  box-shadow: 0 0 8px var(--amber-glow);
}

/* ============================================================================
   MAP
   ============================================================================ */

.leaflet-container {
  background: var(--ink-950) !important;
  border-radius: 20px;
  font-family: inherit !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}
/* Hide leaflet default attribution + zoom (we add custom UI) */
.leaflet-control-attribution { display: none; }

/* Warm overlay on the dark map */
.map-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 65% 55%, rgba(20, 184, 166, 0.10), transparent 60%),
    radial-gradient(ellipse 35% 30% at 40% 40%, rgba(245, 158, 11, 0.10), transparent 65%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(0, 0, 0, 0.3), transparent 70%);
  border-radius: 20px;
  z-index: 401;
  mix-blend-mode: screen;
}

/* Map tile tint via CSS filter on the tiles themselves */
.leaflet-tile {
  filter: brightness(0.85) contrast(1.1) hue-rotate(-15deg) saturate(0.7);
}

/* ----- Pinezki ----- */

.amber-pin {
  background: transparent !important;
  border: none !important;
}

.pin-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pin-core {
  position: relative;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--amber-500);
  box-shadow:
    0 0 0 2px rgba(7, 11, 20, 0.8),
    0 0 14px rgba(245, 158, 11, 0.6);
  flex-shrink: 0;
}
.pin-core.l2 { background: #a78bfa; box-shadow: 0 0 0 2px rgba(7,11,20,0.8), 0 0 10px rgba(167, 139, 250, 0.4); }
.pin-core.l1 { background: #64748b; box-shadow: 0 0 0 2px rgba(7,11,20,0.8); }
.pin-core.l0 { background: rgba(255,255,255,0.25); box-shadow: 0 0 0 2px rgba(7,11,20,0.8); }

.pin-core.l3::before,
.pin-core.l3::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 1.5px solid var(--amber-400);
  box-sizing: border-box;
  animation: sonar 2.4s ease-out infinite;
  transform-origin: center center;
}
.pin-core.l3::after { animation-delay: 1.2s; }
@keyframes sonar {
  0%   { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(4.5); opacity: 0; }
}

.pin-label {
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-stroke);
  padding: 4px 8px 4px 9px;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 11px;
  color: var(--ash-100);
  line-height: 1.2;
  letter-spacing: 0.01em;
  pointer-events: none;
}
.pin-label .lvl {
  color: var(--amber-300);
  font-weight: 600;
  font-size: 10px;
  margin-left: 6px;
  letter-spacing: 0.08em;
}

/* Wind arrows over water */
.wind-arrow {
  background: transparent !important;
  border: none !important;
}
.wind-arrow svg {
  width: 24px; height: 24px;
  fill: none;
  stroke: rgba(252, 211, 77, 0.55);
  stroke-width: 1.4;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.3));
}

/* ============================================================================
   FRESHNESS DOT
   ============================================================================ */

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok   { background: var(--ok);   box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
.dot-warn { background: var(--warn); box-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }
.dot-err  { background: var(--err);  animation: blink 2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ============================================================================
   TINY UI BITS — chips, ghost buttons
   ============================================================================ */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-stroke);
  color: var(--ash-300);
  font-size: 11px;
  letter-spacing: 0.03em;
}
.chip.amber {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.22);
  color: var(--amber-300);
}

.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-stroke);
  color: var(--ash-300);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ash-100);
}
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-stroke);
  color: var(--ash-300);
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ash-100);
}

/* ============================================================================
   STAGGERED ENTRANCE
   ============================================================================ */

/* Static-capture-safe: default to fully visible; animation only adds a
   transform flourish on first paint. If the keyframes don't run (e.g. static
   capture, prefers-reduced-motion), cards stay visible at opacity 1. */
.fade-in { opacity: 1; animation: fade-in 0.55s cubic-bezier(.2,.7,.3,1); }
.fade-in-1 { animation-delay: 0ms; }
.fade-in-2 { animation-delay: 60ms; }
.fade-in-3 { animation-delay: 120ms; }
.fade-in-4 { animation-delay: 180ms; }
.fade-in-5 { animation-delay: 240ms; }
.fade-in-6 { animation-delay: 300ms; }
@keyframes fade-in {
  from { transform: translateY(10px); }
  to   { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .fade-in { animation: none; }
}

/* ============================================================================
   TWEAKS PANEL
   ============================================================================ */

.tweaks-toggle {
  position: fixed; right: 22px; bottom: 22px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--amber-400), var(--amber-600));
  color: #0a0f1c;
  border: 0;
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.45);
  z-index: 9998;
  transition: transform 0.2s;
}
.tweaks-toggle:hover { transform: scale(1.06); }

.tweaks {
  position: fixed; right: 22px; bottom: 22px;
  width: 300px;
  z-index: 9999;
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-stroke);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  font-size: 13px;
  overflow: hidden;
  display: none;
}
.tweaks.open { display: block; }
.tweaks header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-stroke-soft);
}
.tweaks header h3 {
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash-300);
  margin: 0;
}
.tweaks .close {
  color: var(--ash-400);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.tweaks .close:hover { color: var(--ash-100); }
.tweaks .body {
  padding: 14px 16px 18px;
  display: flex; flex-direction: column;
  gap: 18px;
}
.tweaks .group { display: flex; flex-direction: column; gap: 7px; }
.tweaks .group-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash-400);
}
.tweaks .seg {
  display: flex; gap: 3px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 3px;
  border: 1px solid var(--glass-stroke-soft);
}
.tweaks .seg button {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--ash-300);
  font-size: 11px;
  padding: 6px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tweaks .seg button:hover { color: var(--ash-100); }
.tweaks .seg button[aria-pressed="true"] {
  background: var(--amber-500);
  color: #0a0f1c;
  font-weight: 600;
}
.tweaks .slider-row { display: flex; align-items: center; gap: 10px; }
.tweaks input[type="range"] { flex: 1; accent-color: var(--amber-500); }
.tweaks .val {
  font-size: 11px;
  color: var(--ash-300);
  font-family: ui-monospace, monospace;
  min-width: 36px;
  text-align: right;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

.layout {
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 100vh;
}
.main {
  padding: 24px 28px 80px;
  max-width: 1700px;
}

@media (max-width: 1100px) {
  .main { padding: 20px 22px 80px; }
}

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar  { display: flex !important; }
  .main { padding: 12px 14px 100px; }
  .tweaks { width: calc(100vw - 24px); right: 12px; left: 12px; bottom: 12px; }
  .tweaks-toggle { right: 14px; bottom: 14px; }
}

.topbar { display: none; }

/* ============================================================================
   FOCUS RING
   ============================================================================ */

button:focus-visible, a:focus-visible, [role="button"]:focus-visible {
  outline: 2px solid var(--amber-400);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ============================================================================
   SCROLLBAR
   ============================================================================ */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.12); }
