/* ==========================================================================
   GALAKTUS — base.css
   Design tokens, reset, typography, layout utilities
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* palette */
  --c-ink: #0a0b0d;
  --c-ink-2: #111318;
  --c-ink-3: #181b21;
  --c-paper: #e9e6df;
  --c-paper-2: #dedad1;
  --c-white: #f2f0ea;
  --c-signal: #44d62c;      /* signal green — brand accent */
  --c-signal-deep: #237010; /* accent for text on paper */
  --c-amber: #ffb23f;       /* activity LED */
  --c-green: #44d62c;       /* link LED (= brand) */
  --c-red: #ff5a4e;

  /* type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Instrument Serif", "Times New Roman", serif;

  --fs-display: clamp(3.2rem, 10.4vw, 12rem);
  --fs-h2: clamp(2.4rem, 6.2vw, 6.6rem);
  --fs-h3: clamp(1.5rem, 2.6vw, 2.4rem);
  --fs-lead: clamp(1.05rem, 0.4vw + 0.95rem, 1.3rem);
  --fs-body: clamp(0.98rem, 0.2vw + 0.92rem, 1.08rem);
  --fs-small: 0.875rem;
  --fs-mono: 0.75rem;

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur: 0.7s;

  /* layout */
  --gutter: clamp(16px, 3.2vw, 48px);
  --max: 1680px;
  --header-h: 76px;
  --radius: 16px;
  --radius-lg: 28px;
}

/* Theme tokens — applied on <html> (drives fixed UI) and on each section */
:root,
[data-theme="dark"],
.js-theme--dark {
  --bg: var(--c-ink);
  --bg-2: var(--c-ink-2);
  --fg: var(--c-white);
  --muted: rgba(242, 240, 234, 0.58);
  --faint: rgba(242, 240, 234, 0.34);
  --line: rgba(242, 240, 234, 0.12);
  --line-strong: rgba(242, 240, 234, 0.24);
  --surface: rgba(242, 240, 234, 0.04);
  --accent: var(--c-signal);
  --accent-ink: var(--c-signal);
  --on-accent: var(--c-ink);
}

[data-theme="light"],
.js-theme--light {
  --bg: var(--c-paper);
  --bg-2: var(--c-paper-2);
  --fg: #0e0f12;
  --muted: rgba(14, 15, 18, 0.62);
  --faint: rgba(14, 15, 18, 0.38);
  --line: rgba(14, 15, 18, 0.13);
  --line-strong: rgba(14, 15, 18, 0.26);
  --surface: rgba(14, 15, 18, 0.045);
  --accent: var(--c-signal);
  --accent-ink: var(--c-signal-deep);
  --on-accent: var(--c-ink);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--c-ink);
}

html.lenis,
html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--c-ink);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video, canvas { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
address { font-style: normal; }

::selection { background: var(--c-signal); color: var(--c-ink); }

/* green scrollbar — standard (Chrome 121+, Firefox, Safari 18.2+) */
html {
  scrollbar-color: var(--c-signal) var(--c-ink);
  scrollbar-width: thin;
}
textarea,
[data-lenis-prevent] { scrollbar-color: var(--c-signal) transparent; scrollbar-width: thin; }
/* older WebKit / Safari */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--c-ink); }
::-webkit-scrollbar-thumb {
  background: var(--c-signal);
  border: 2px solid var(--c-ink);
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(68, 214, 44, 0.6);
}
::-webkit-scrollbar-thumb:hover { background: #5fe24a; }
::-webkit-scrollbar-corner { background: var(--c-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* film grain — subtle texture over everything */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 200;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  background: var(--bg);
  color: var(--fg);
  padding-block: clamp(96px, 13vw, 200px);
}

.section--flush { padding-block: 0; }

/* ---------- Typography ---------- */
.display {
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.052em;
}

.section-title {
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.display em,
.section-title em,
.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  font-size: 1.06em;
  line-height: 0.8;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--muted);
  max-width: 34rem;
  text-wrap: pretty;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* split-text line masks — extra room so diacritics (Č, Ž, Š) and descenders aren't clipped */
[data-split] > [class*="mask"],
[data-hero-title] [class*="mask"] {
  padding-block: 0.16em 0.1em;
  margin-block: -0.16em -0.1em;
}

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 300;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--c-signal);
  color: var(--c-ink);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.4s var(--ease-out);
}
.skip-link:focus { transform: none; }

/* Elements that JS animates in — hidden only when JS + motion are on */
.js:not(.reduced) [data-reveal],
.js:not(.reduced) .js-reveal { opacity: 0; }

@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;
  }
}
