/* ==========================================================================
   PROVEN COOPERATIVE — BASE DESIGN SYSTEM & TOKENS
   Standard: Plain HTML5 + CSS3 + Vanilla JS (No build step required)
   Design System Reference: Doc/DESIGN_SYSTEM.md & Doc/PROMPTS.md
   ========================================================================== */

:root {
  /* Color Palette (Client Direction: 90% Green, 10% Gold accent, White dominant) */
  --color-white: #ffffff;
  --color-green-900: #0a2e24; /* Dark green sections, footer */
  --color-green-800: #0d3d30;
  --color-green-700: #0f4d3a; /* Primary brand green: headings, buttons */
  --color-green-600: #146149;
  --color-green-100: #dcece3;
  --color-green-50: #eef5f1;  /* Subtle alternate section tint */
  
  --color-gold-500: #00e676;  /* Neon green accent (Primary CTA, highlights, icons) */
  --color-gold-600: #00c853;  /* Neon green hover state */
  --color-gold-400: #00e676;  /* Neon green bright */
  --color-gold-100: #e8f5e9;  /* Light tint for neon green backgrounds */

  --color-black: #0d0f0e;     /* Body text, high-contrast headings */
  --color-gray-700: #37413c;
  --color-gray-600: #5b6660;  /* Secondary / subtitle text */
  --color-gray-300: #cad4cf;
  --color-gray-200: #e3e8e5;  /* Dividers, borders */
  --color-gray-100: #f6f8f7;

  /* Semantic Theme Tokens - Light Mode Default */
  --bg-page: var(--color-white);
  --bg-surface: var(--color-white);
  --bg-surface-elevated: #ffffff;
  --bg-tint: var(--color-green-50);
  --bg-dark: var(--color-green-900);
  --bg-dark-card: #12382e;

  --text-main: var(--color-black);
  --text-muted: var(--color-gray-600);
  --text-inverted: var(--color-white);
  --text-inverted-muted: #b9cfc7;

  --border-subtle: var(--color-gray-200);
  --border-green: var(--color-green-100);

  --shadow-sm: 0 2px 4px rgba(13, 15, 14, 0.04);
  --shadow-md: 0 8px 24px rgba(13, 15, 14, 0.08);
  --shadow-lg: 0 16px 40px rgba(10, 46, 36, 0.12);

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;

  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px base */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  --text-5xl: 3rem;      /* 48px */
  --text-6xl: 3.75rem;   /* 60px */

  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.6;

  /* Layout Spacing */
  --section-pad-y: 4rem;      /* 64px mobile */
  --section-pad-y-lg: 7rem;   /* 112px desktop */
  --container-max: 1200px;
  --container-pad: 1.25rem;   /* 20px */

  /* UI Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --radius-arch: 999px 999px 20px 20px; /* Signature Arch Crop */
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-page: #071913;
  --bg-surface: #0c251d;
  --bg-surface-elevated: #103328;
  --bg-tint: #0e2920;
  --bg-dark: #051410;
  --bg-dark-card: #092019;

  --text-main: #f0f5f2;
  --text-muted: #9eb5aa;
  --text-inverted: #0d0f0e;
  --text-inverted-muted: #4e6157;

  --border-subtle: #194033;
  --border-green: #1f4f3f;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
}

/* System Dark Mode Fallback when no user preference stored */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-page: #071913;
    --bg-surface: #0c251d;
    --bg-surface-elevated: #103328;
    --bg-tint: #0e2920;
    --bg-dark: #051410;
    --bg-dark-card: #092019;

    --text-main: #f0f5f2;
    --text-muted: #9eb5aa;
    --text-inverted: #0d0f0e;
    --text-inverted-muted: #4e6157;

    --border-subtle: #194033;
    --border-green: #1f4f3f;

    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  }
}

/* ==========================================================================
   Modern Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-main);
  background-color: var(--bg-page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Skip link for keyboard accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--color-gold-500);
  color: #000000;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  text-decoration: none;
  z-index: 9999;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--color-green-900);
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  color: inherit;
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.25rem, 5vw + 1rem, var(--text-6xl));
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(1.75rem, 3vw + 0.5rem, var(--text-4xl));
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.25rem, 2vw + 0.25rem, var(--text-2xl));
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.25rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-green-700);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-gold-500);
}

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--color-gold-500);
  outline-offset: 3px;
}

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

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

ul, ol {
  list-style: none;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.section {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
}

@media (min-width: 768px) {
  .section {
    padding-top: var(--section-pad-y-lg);
    padding-bottom: var(--section-pad-y-lg);
  }
}

/* Section Background Alternation System */
.section-white {
  background-color: var(--bg-page);
  color: var(--text-main);
}

.section-tint {
  background-color: var(--bg-tint);
  color: var(--text-main);
}

.section-green {
  background-color: var(--color-green-900);
  color: var(--color-white);
}

/* Signature Eyebrow & Gold Rule (Design System Part 0) */
.eyebrow-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.gold-bar {
  display: block;
  width: 56px;
  height: 3px;
  background-color: var(--color-gold-500);
  border-radius: 2px;
  margin-bottom: 0.5rem;
}

.eyebrow {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--color-green-700);
}

.section-green .eyebrow {
  color: var(--color-gold-500);
}

[data-theme="dark"] .eyebrow {
  color: var(--color-gold-500);
}

/* One Emphasised Word per H1 (Fraunces Italic) */
.emphasis-word {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  color: var(--color-green-700);
}

.section-green .emphasis-word,
.dark-hero .emphasis-word {
  color: var(--color-gold-500);
}

[data-theme="dark"] .emphasis-word {
  color: var(--color-gold-500);
}

.text-gold {
  color: #00703c;
  font-weight: 700;
}

[data-theme="dark"] .text-gold,
.section-green .text-gold,
.dark-hero .text-gold {
  color: var(--color-gold-500);
}

/* Fraunces Numerals */
.numeral-display {
  font-family: var(--font-display);
  font-feature-settings: "tnum" 1;
}

/* Arch Photo Mask */
.arch-mask {
  border-radius: var(--radius-arch);
  overflow: hidden;
  position: relative;
}

.arch-mask-wrap {
  position: relative;
  display: inline-block;
}

.arch-mask-wrap::before {
  content: "";
  position: absolute;
  top: 12px;
  left: -12px;
  width: 100%;
  height: 100%;
  background-color: var(--color-green-100);
  border-radius: var(--radius-arch);
  z-index: 0;
  pointer-events: none;
}

[data-theme="dark"] .arch-mask-wrap::before {
  background-color: var(--border-green);
}

.arch-mask-wrap img {
  position: relative;
  z-index: 1;
  display: block;
  border-radius: var(--radius-arch);
  object-fit: cover;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

