/* ============================================================
   Base — reset, design tokens, typography, utilities
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
  padding: 0;
}

ul[class], ol[class] { list-style: none; }

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

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

table { border-collapse: collapse; width: 100%; }

/* ---- Tokens ----
   One restrained accent (green) against a deep charcoal. Deliberately no
   glows, no gradients on interactive elements, no saturated neon: the brand
   colour reads as a signal, not as decoration.

   --green-deep is the logo's own ink, sampled off the artwork. --green is that
   same hue lifted until it clears 4.5:1 against --ink, because the accent has
   to work both as a fill carrying dark text and as text on the dark chrome —
   the logo green alone is far too dark for the second job. */
:root {
  /* Surfaces */
  --ink:        #0f1012;
  --ink-soft:   #17191d;
  --ink-raised: #1e2127;
  --paper:      #ffffff;
  --surface:    #f6f6f7;
  --surface-alt:#eeeef0;

  /* Text */
  --text:       #16171a;
  --text-soft:  #4a4d55;
  --muted:      #74777f;
  --faint:      #9a9da4;
  --on-dark:    #f3f3f4;
  --on-dark-mut:#a9abb2;

  /* Accent */
  --green:      #5cc98a;
  --green-deep: #276646;
  --green-tint: #e8f6ee;

  /* Status */
  --ok:      #2f7d4f;
  --ok-tint: #eaf5ee;
  --warn:      #a8720f;
  --warn-tint: #fdf3e2;
  --danger:      #b3261e;
  --danger-tint: #fbeceb;
  --info:      #275d9e;
  --info-tint: #ebf2fa;

  /* Lines */
  --line:       #e0e0e3;
  --line-soft:  #ececee;
  --line-dark:  rgba(243, 243, 244, 0.14);

  /* Shape */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* Elevation — soft and low, never a halo */
  --shadow-sm: 0 1px 2px rgba(15, 16, 18, 0.06), 0 1px 3px rgba(15, 16, 18, 0.04);
  --shadow-md: 0 2px 6px rgba(15, 16, 18, 0.07), 0 8px 20px rgba(15, 16, 18, 0.06);
  --shadow-lg: 0 8px 24px rgba(15, 16, 18, 0.12), 0 24px 60px rgba(15, 16, 18, 0.10);

  /* Motion */
  --dur: 0.42s;
  --dur-fast: 0.22s;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Type — a system stack so Cyrillic renders natively on every platform
     with zero font requests. See docs/DEPLOYMENT.md to self-host Inter. */
  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Noto Sans",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Layout */
  --wrap: 1200px;
  --gutter: clamp(1.15rem, 4vw, 2.75rem);
  --header-h: 76px;
}

/* ---- Document ---- */
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(2.1rem, 5.2vw, 3.9rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); letter-spacing: -0.01em; }
h4 { font-size: 1.05rem; letter-spacing: 0; }

p { color: var(--text-soft); }

.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green-deep);
}

.eyebrow--on-dark { color: var(--green); }

.lede {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--text-soft);
  max-width: 58ch;
}

.mono { font-family: var(--font-mono); }

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

.section { padding-block: clamp(3.25rem, 7vw, 6rem); }
.section--tight { padding-block: clamp(2.25rem, 4vw, 3.5rem); }
.section--dark { background: var(--ink); color: var(--on-dark); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--on-dark); }
.section--dark p { color: var(--on-dark-mut); }
.section--surface { background: var(--surface); }

.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: 0.5rem; }
.stack-lg > * + * { margin-top: 1.75rem; }

.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.75rem); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.86rem; }
.tiny { font-size: 0.76rem; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.full { width: 100%; }

/* Visible only to screen readers, until focused */
.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: absolute;
  top: -100px; left: 1rem;
  z-index: 999;
  padding: 0.7rem 1.15rem;
  background: var(--ink);
  color: var(--on-dark);
  border-radius: var(--r-sm);
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---- Focus ----
   Always visible, never removed. The green ring reads on both surfaces. */
:focus-visible {
  outline: 2px solid var(--green-deep);
  outline-offset: 2px;
  border-radius: 3px;
}
.section--dark :focus-visible,
.footer :focus-visible,
.side-menu :focus-visible { outline-color: var(--green); }

/* ---- Selection ---- */
::selection { background: var(--green); color: var(--ink); }

/* ---- Responsive grid collapse ---- */
@media (max-width: 940px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---- Reduced motion ----
   Honour the preference properly: transitions collapse rather than being
   left at a duration that still lurches. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Print ---- */
@media print {
  .menu-trigger, .scrim, .side-menu, .footer, .page-curtain, .no-print { display: none !important; }
  body { color: #000; background: #fff; }
}
