/* ============================================================
   macroutine — Design System
   Tokens, reset, base typography, shared utilities
   ============================================================ */

:root {
  /* ---- Brand palette (from logo) ---- */
  --forest:      #0A382E;
  --teal:        #2E5B48;
  --sage:        #537E6B;
  --mint:        #90CCA8;
  --mint-soft:   #C3E4D1;
  --offwhite:    #F6FBFA;
  --cream:       #EEF7F3;

  /* ---- Surfaces ---- */
  --bg:            #E4F1EA;
  --surface:       #FFFFFF;
  --surface-2:     #F4FAF7;
  --surface-inset: #ECF5F0;

  /* ---- Text ---- */
  --text:         #10241E;
  --text-soft:    #47695C;
  --text-mute:    #7A9488;
  --on-dark:      #F6FBFA;
  --on-dark-soft: #B9CEC4;
  --on-dark-mute: #8CA79A;

  /* ---- Lines ---- */
  --border:        rgba(10, 56, 46, 0.12);
  --border-strong: rgba(10, 56, 46, 0.22);
  --border-dark:   rgba(144, 204, 168, 0.22);

  /* ---- Status ---- */
  --good:     #35785A;
  --good-bg:  rgba(53, 120, 90, 0.10);
  --good-br:  rgba(53, 120, 90, 0.32);
  --warn:     #B26B2E;
  --warn-bg:  rgba(178, 107, 46, 0.10);
  --warn-br:  rgba(178, 107, 46, 0.32);
  --info:     #2E7D8C;
  --info-bg:  rgba(46, 125, 140, 0.10);
  --info-br:  rgba(46, 125, 140, 0.32);
  --danger:   #B23A3A;
  --danger-bg: rgba(178, 58, 58, 0.10);
  --danger-br: rgba(178, 58, 58, 0.32);

  /* ---- Typography ---- */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* ---- Radius ---- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* ---- Elevation ---- */
  --shadow-sm: 0 1px 2px rgba(10, 56, 46, 0.05), 0 2px 6px rgba(10, 56, 46, 0.05);
  --shadow-md: 0 10px 28px rgba(10, 56, 46, 0.10);
  --shadow-lg: 0 28px 64px rgba(10, 56, 46, 0.16);

  /* ---- Layout ---- */
  --page-max:     1180px;
  --content-max:  1040px;
  --header-h:     66px;
  --bottomnav-h:  70px;
  --gutter:       clamp(20px, 5vw, 64px);

  /* ---- Motion ---- */
  --ease:  cubic-bezier(0.22, 0.8, 0.24, 1);
  --dur:   0.22s;
}

/* ============================================================
   Reset
   ============================================================ */

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

* { margin: 0; }

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

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

svg { height: auto; }

ul, ol { list-style: none; padding: 0; }

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

::selection { background: var(--mint); color: var(--forest); }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--forest);
  text-wrap: balance;
}

p { text-wrap: pretty; }

strong, b { font-weight: 600; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
}

.lede {
  max-width: 62ch;
  font-size: clamp(15.5px, 1.4vw, 17px);
  color: var(--text-soft);
}

/* ============================================================
   Utilities
   ============================================================ */

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

.stack > * + * { margin-top: 1rem; }

.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: 10px; left: 10px;
  z-index: 999;
  padding: 10px 16px;
  background: var(--forest);
  color: var(--on-dark);
  border-radius: var(--r-sm);
  transform: translateY(-150%);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* Reveal-on-scroll (progressive; visible by default if JS is off) */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
