/* ============================================================
   Niskala — Soft Tech Design System
   ============================================================ */

:root {
  /* Brand — modernized electric emerald (replaces #006600) */
  --brand: oklch(0.62 0.18 150);
  --brand-bright: oklch(0.72 0.19 150);
  --brand-deep: oklch(0.45 0.14 150);
  --brand-ink: oklch(0.32 0.1 150);
  --brand-wash: oklch(0.97 0.03 150);
  --brand-glow: oklch(0.62 0.18 150 / 0.15);

  /* Neutrals — warm slate */
  --ink: oklch(0.22 0.015 250);
  --ink-soft: oklch(0.42 0.015 250);
  --ink-muted: oklch(0.58 0.012 250);
  --ink-faint: oklch(0.72 0.008 250);

  --bg: oklch(0.995 0.003 100);
  --bg-soft: oklch(0.98 0.005 130);
  --bg-mist: oklch(0.965 0.008 150);
  --line: oklch(0.22 0.015 250 / 0.08);
  --line-strong: oklch(0.22 0.015 250 / 0.14);

  --surface: oklch(1 0 0);
  --glass: oklch(1 0 0 / 0.6);
  --glass-strong: oklch(1 0 0 / 0.85);

  /* Shadows — very soft, layered */
  --shadow-sm: 0 1px 2px oklch(0.22 0.015 250 / 0.04), 0 1px 1px oklch(0.22 0.015 250 / 0.03);
  --shadow-md: 0 4px 14px oklch(0.22 0.015 250 / 0.06), 0 1px 2px oklch(0.22 0.015 250 / 0.04);
  --shadow-lg: 0 18px 40px oklch(0.22 0.015 250 / 0.08), 0 4px 8px oklch(0.22 0.015 250 / 0.04);
  --shadow-glow: 0 0 0 1px var(--brand-glow), 0 12px 40px oklch(0.62 0.18 150 / 0.12);

  /* Type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: "Geist", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-2xl: 32px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }

/* ===== Type ===== */
.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "ss01";
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ===== Layout ===== */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: 900px; margin: 0 auto; padding: 0 28px; }

/* ===== Backdrop: subtle mesh ===== */
.mesh-bg {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.mesh-bg::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 80%;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 18% 30%, oklch(0.62 0.18 150 / 0.12), transparent 70%),
    radial-gradient(50% 40% at 82% 20%, oklch(0.75 0.12 170 / 0.12), transparent 70%),
    radial-gradient(40% 50% at 50% 85%, oklch(0.7 0.1 200 / 0.08), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
.mesh-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent 80%);
  opacity: 0.6;
  pointer-events: none;
}

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  background: oklch(0.995 0.003 100 / 0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 17px;
}
.brand img { width: 28px; height: 28px; }
.brand .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow);
  margin-left: 2px;
}
.nav-links {
  display: none; align-items: center; gap: 4px;
  font-size: 14px; color: var(--ink-soft);
}
.nav-links a {
  padding: 8px 14px; border-radius: 10px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-mist); }
.nav-links a.active { color: var(--brand-ink); }

@media (min-width: 860px) { .nav-links { display: flex; } }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 14.5px; font-weight: 500;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.12), 0 1px 2px oklch(0.22 0.015 250 / 0.2);
}
.btn-primary:hover {
  background: var(--brand-deep);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.18), 0 8px 20px oklch(0.62 0.18 150 / 0.25);
  transform: translateY(-1px);
}
.btn-primary .chev { transition: transform 0.2s; }
.btn-primary:hover .chev { transform: translateX(2px); }

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--bg-mist); border-color: var(--ink-faint); }

.btn-brand {
  background: var(--brand);
  color: white;
  box-shadow: 0 1px 2px oklch(0.45 0.14 150 / 0.3), inset 0 1px 0 oklch(1 0 0 / 0.25);
}
.btn-brand:hover {
  background: var(--brand-bright);
  box-shadow: 0 10px 24px oklch(0.62 0.18 150 / 0.32), inset 0 1px 0 oklch(1 0 0 / 0.3);
  transform: translateY(-1px);
}

/* ===== Pills / badges ===== */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
}
.pill .dot-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0 var(--brand-glow);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 oklch(0.62 0.18 150 / 0.4); }
  50%      { box-shadow: 0 0 0 6px oklch(0.62 0.18 150 / 0); }
}

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-glass {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid oklch(1 0 0 / 0.6);
  box-shadow: var(--shadow-sm);
}

/* ===== Footer ===== */
.footer {
  padding: 56px 0 40px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  margin-top: 80px;
}

/* ===== Section spacing ===== */
.sec { padding: 100px 0; }
.sec-sm { padding: 72px 0; }

/* ===== Reveal on scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .pill .dot-live { animation: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ===== Utilities ===== */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; gap: 40px; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); gap: 20px; }
}

.stat-big { font-family: var(--font-display); font-size: 48px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; color: var(--ink); }
.stat-label { font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 8px; }

/* ===== Divider with label ===== */
.div-label {
  display: flex; align-items: center; gap: 16px;
  color: var(--ink-muted);
}
.div-label::before, .div-label::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* ===== Footer internals ===== */
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  display: flex; flex-direction: column; gap: 32px;
}
.footer-cols {
  display: grid; grid-template-columns: 1fr; gap: 32px;
}
@media (min-width: 720px) {
  .footer-cols { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; }
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-muted); margin: 0 0 14px;
  font-weight: 500;
}
.footer-col a {
  display: block; color: var(--ink-soft);
  padding: 6px 0; font-size: 14.5px;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--brand-deep); }

/* ===== Tweaks panel ===== */
.tweaks {
  position: fixed; right: 20px; bottom: 20px;
  z-index: 100;
  width: 300px; max-width: calc(100vw - 40px);
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  font-size: 13px;
  display: none;
  animation: tweakIn 0.3s cubic-bezier(.2,.7,.2,1);
}
.tweaks.on { display: block; }
@keyframes tweakIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.tweaks h4 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-muted); font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
.tweaks .row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; gap: 12px; }
.tweaks .row + .row { border-top: 1px solid var(--line); }
.tweaks label { color: var(--ink-soft); font-size: 13px; }
.tweaks .swatches { display: flex; gap: 6px; }
.tweaks .sw {
  width: 22px; height: 22px; border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s;
}
.tweaks .sw:hover { transform: scale(1.08); }
.tweaks .sw.on { border-color: var(--ink); }
.tweaks select, .tweaks input[type="range"] {
  font: inherit; padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--surface);
}

/* selection */
::selection { background: var(--brand-glow); color: var(--ink); }
