/* ============================================================
   base.css — Design tokens, reset, typography & shared utilities
   Arty Node — Original design system
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Color: dark theme */
  --bg-0: #0a0a0b;
  --bg-1: #101013;
  --bg-2: #16161a;
  --line-dark: rgba(255, 255, 255, 0.12);
  --line-dark-strong: rgba(255, 255, 255, 0.24);
  --text-dark: #f5f5f2;
  --muted-dark: rgba(245, 245, 242, 0.62);

  /* Color: light theme */
  --bg-paper: #f4f4f1;
  --bg-paper-2: #ebebe7;
  --line-light: rgba(12, 12, 15, 0.14);
  --line-light-strong: rgba(12, 12, 15, 0.28);
  --text-light: #101013;
  --muted-light: rgba(16, 16, 19, 0.62);

  /* Accent */
  --accent: #c8ff00;
  --accent-deep: #a2d600;
  --accent-ink: #1a2400;
  --violet: #8b5cf6;
  --cyan: #38e8ff;

  /* Typography */
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --container: 1280px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-pad: clamp(5rem, 11vw, 9.5rem);
  --radius: 20px;
  --radius-sm: 12px;
  --nav-h: 78px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.25s;
  --t-med: 0.5s;
  --t-slow: 0.8s;

  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

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

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

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.8rem, 8vw, 6.5rem);
}

h2 {
  font-size: clamp(2rem, 5vw, 3.6rem);
}

h3 {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  letter-spacing: -0.01em;
}

p {
  text-wrap: pretty;
}

.display-lg {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 8.4vw, 7rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.display-md {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6.5vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

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

.eyebrow::before {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: var(--accent);
}

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

.section {
  position: relative;
  padding-block: var(--section-pad);
}

.section--dark {
  background: var(--bg-0);
  color: var(--text-dark);
}

.section--light {
  background: var(--bg-paper);
  color: var(--text-light);
}

.section--soft {
  background: var(--bg-1);
  color: var(--text-dark);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.section-head__title {
  max-width: 20ch;
}

.section-head__lead {
  max-width: 42ch;
  color: var(--muted-dark);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}

.section--light .section-head__lead {
  color: var(--muted-light);
}

/* ---------- Utilities ---------- */
.text-gradient {
  background: linear-gradient(100deg, var(--accent) 0%, var(--violet) 60%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-accent {
  color: var(--accent);
}

.section--light .text-accent {
  color: var(--accent-deep);
}

.hidden {
  display: none !important;
}

.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: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.6rem 1.1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border-radius: 8px;
  transform: translateY(-160%);
  transition: transform var(--t-fast) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
