/* ═══════════════════════════════════════════════
   AgroNutikas Web — base.css
   Reset, global element styles, utility classes.
   All values from tokens.css — zero hardcoded values.
   ═══════════════════════════════════════════════ */

/* ── Minimal reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* ── Body ───────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--fg1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ─────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-web-display);
  color: var(--fg1);
  line-height: 1.1;
}
h1 { font-size: clamp(40px, 5vw, 68px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
h2 { font-size: clamp(28px, 3vw, 44px); font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 19px; font-weight: 600; line-height: 1.3; }
p { color: var(--fg2); line-height: 1.7; }

/* ── Focus ring ─────────────────────────────────────── */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring-web);
}

/* ── Skip link ──────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: calc(-1 * var(--sp-12));
  left: var(--sp-4);
  background: var(--verdant-dark);
  color: white;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--rad-sm);
  z-index: calc(var(--z-modal) + 1);
  transition: top var(--dur-fast) var(--ease-smooth);
}
.skip-link:focus {
  top: var(--sp-4);
}

/* ── Container ──────────────────────────────────────── */
.ds-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}
@media (max-width: 720px) {
  .ds-container { padding: 0 var(--container-padding-mobile); }
}

/* ── Section spacing ────────────────────────────────── */
.ds-section {
  padding: var(--section-py) 0;
  position: relative;
}
.ds-section-alt {
  background: var(--bg2);
}

/* ── Overline ───────────────────────────────────────── */
.ds-overline {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--verdant-web);
  margin-bottom: var(--sp-3);
}

/* ── Lead text ──────────────────────────────────────── */
.ds-lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg2);
  max-width: 560px;
}

/* ── Emphasis span (verdant highlight in headings) ─── */
.ds-em { color: var(--verdant-dark); }

/* ── Scroll reveal ──────────────────────────────────── */
.rv {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-reveal) var(--ease-reveal),
              transform var(--dur-reveal) var(--ease-reveal);
}
.rv.vis {
  opacity: 1;
  transform: translateY(0);
}

/* ── Back to top ────────────────────────────────────── */
.ds-back-to-top {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  width: var(--touch-min);
  height: var(--touch-min);
  border-radius: var(--rad-full);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-normal) var(--ease-smooth);
  z-index: var(--z-sticky);
}
.ds-back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Scroll progress ────────────────────────────────── */
.ds-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--verdant-web);
  z-index: calc(var(--z-header) + 1);
  transition: width 100ms linear;
}

/* ── Version footer ─────────────────────────────────── */
.ds-version-footer {
  position: fixed;
  bottom: var(--sp-2);
  right: var(--sp-3);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg3);
  opacity: 0.35;
  pointer-events: none;
  z-index: var(--z-sticky);
}

/* ── Dark mode overrides ────────────────────────────── */
.dark-mode {
  --bg: var(--deep-earth);
  --bg2: var(--loam);
  --bg3: var(--canopy);
  --surface: var(--canopy);
  --fg1: var(--fg1-dark);
  --fg2: var(--fg3-dark);
  --fg3: var(--fg4-dark);
  --border: var(--border-dark);
  --shadow-sm: var(--shadow-sm-dark);
  --shadow-md: var(--shadow-md-dark);
  --shadow-lg: var(--shadow-lg-dark);
}
