/* ==========================================================================
   CYWater · Design System — Base
   Layered approach: tokens → reset → typography → primitives
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand palette — restrained, editorial */
  --ink:        #0E1B2C;   /* deep navy, primary text & header bg */
  --ink-soft:   #2A3950;   /* secondary text */
  --ink-mute:   #6B7689;   /* tertiary text, meta */
  --line:       #E4E1D8;   /* hairline borders */
  --line-soft:  #EFECE4;   /* faint dividers */
  --paper:      #F6F3EC;   /* warm off-white body bg */
  --paper-warm: #EFE9DC;   /* card / section tint */
  --paper-deep: #E8E2D2;   /* footer / prefooter */
  --white:      #FFFFFF;

  /* Accent — a single deep teal for trust + water */
  --teal:       #0F766E;
  --teal-deep:  #0B5A53;
  --teal-soft:  #CFE6E2;
  --teal-tint:  #E8F1EF;

  /* Functional */
  --gold:       #B68A35;   /* sparing accent for awards / members */
  --rust:       #B23A2E;   /* alerts / errors */
  --ok:         #2E7D52;

  /* Typography */
  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --fs-xs:   0.75rem;   /* 12 */
  --fs-sm:   0.875rem;  /* 14 */
  --fs-base: 1rem;      /* 16 */
  --fs-md:   1.125rem;  /* 18 */
  --fs-lg:   1.375rem;  /* 22 */
  --fs-xl:   1.75rem;   /* 28 */
  --fs-2xl:  2.25rem;   /* 36 */
  --fs-3xl:  3rem;      /* 48 */
  --fs-4xl:  4rem;      /* 64 */

  /* Spacing scale (4px base) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;
  --sp-10: 8rem;

  /* Layout */
  --container: 1240px;
  --container-narrow: 880px;
  --radius: 4px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(14, 27, 44, 0.06);
  --shadow:    0 6px 24px rgba(14, 27, 44, 0.08);
  --shadow-lg: 0 18px 50px rgba(14, 27, 44, 0.14);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.25s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html:focus-within { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, picture, svg { display: block; max-width: 100%; height: auto; }
svg { fill: currentColor; }

input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
}
h1 { font-size: var(--fs-3xl); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p { color: var(--ink-soft); }
strong { color: var(--ink); font-weight: 600; }
small { font-size: var(--fs-sm); }

.lead {
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--ink-soft);
  font-weight: 400;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--teal);
  display: inline-block;
}
.eyebrow.center::before { display: none; }

.link {
  color: var(--teal);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  transition: gap var(--dur) var(--ease), color var(--dur) var(--ease);
}
.link::after {
  content: "→";
  transition: transform var(--dur) var(--ease);
}
.link:hover { color: var(--teal-deep); }
.link:hover::after { transform: translateX(3px); }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}
.container-narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section-tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section-tint { background: var(--paper-warm); }
.section-dark { background: var(--ink); color: rgba(255,255,255,0.86); }
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: var(--white); }
.section-dark p { color: rgba(255,255,255,0.72); }
.section-dark .eyebrow { color: var(--teal-soft); }

.stack > * + * { margin-top: var(--flow, 1rem); }
.divider { height: 1px; background: var(--line); border: 0; }
.divider-soft { height: 1px; background: var(--line-soft); border: 0; }

.grid { display: grid; gap: var(--sp-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.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;
}

/* ---------- Page transitions / reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Selection ---------- */
::selection { background: var(--teal); color: var(--white); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
