/* ============================================================
   DESIGN TOKENS — Interdependence Governance Site
   Palette: Deep civic navy/slate + warm gold accent
   ============================================================ */

:root {
  /* Type scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* Spacing (4px base) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  /* Font families */
  --font-display: 'Source Serif 4', 'Georgia', serif;
  --font-body: 'Source Sans 3', 'Helvetica Neue', sans-serif;
}

/* ---- LIGHT MODE (default) ---- */
:root, [data-theme="light"] {
  --color-bg:             #f5f4f0;
  --color-surface:        #ffffff;
  --color-surface-2:      #faf9f7;
  --color-surface-offset: #eceae5;
  --color-border:         #d1cec7;
  --color-divider:        #dddbd6;

  --color-text:           #1a2332;
  --color-text-muted:     #5a6474;
  --color-text-faint:     #9ca3af;
  --color-text-inverse:   #f5f4f0;

  --color-primary:        #1b3a5c;
  --color-primary-hover:  #14283f;
  --color-primary-active: #0d1b2a;

  --color-accent:         #b8860b;
  --color-accent-hover:   #9a7209;
  --color-accent-light:   #f5ecd4;

  --color-success:        #2d6a4f;
  --color-error:          #9b2c2c;

  --shadow-sm: 0 1px 3px rgba(26,35,50,0.06);
  --shadow-md: 0 4px 12px rgba(26,35,50,0.08);
  --shadow-lg: 0 12px 32px rgba(26,35,50,0.12);
}

/* ---- DARK MODE ---- */
[data-theme="dark"] {
  --color-bg:             #0d1b2a;
  --color-surface:        #132336;
  --color-surface-2:      #182d44;
  --color-surface-offset: #1a2332;
  --color-border:         #2a3a4e;
  --color-divider:        #223348;

  --color-text:           #d4dae3;
  --color-text-muted:     #8a95a6;
  --color-text-faint:     #5a6474;
  --color-text-inverse:   #0d1b2a;

  --color-primary:        #6ba3d6;
  --color-primary-hover:  #8ab8e3;
  --color-primary-active: #a8cceb;

  --color-accent:         #daa520;
  --color-accent-hover:   #e6b83a;
  --color-accent-light:   #2a2415;

  --color-success:        #52b788;
  --color-error:          #e57373;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #0d1b2a;
    --color-surface:        #132336;
    --color-surface-2:      #182d44;
    --color-surface-offset: #1a2332;
    --color-border:         #2a3a4e;
    --color-divider:        #223348;
    --color-text:           #d4dae3;
    --color-text-muted:     #8a95a6;
    --color-text-faint:     #5a6474;
    --color-text-inverse:   #0d1b2a;
    --color-primary:        #6ba3d6;
    --color-primary-hover:  #8ab8e3;
    --color-primary-active: #a8cceb;
    --color-accent:         #daa520;
    --color-accent-hover:   #e6b83a;
    --color-accent-light:   #2a2415;
    --color-success:        #52b788;
    --color-error:          #e57373;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  }
}


/* ============================================================
   COMPONENTS
   ============================================================ */

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 100;
  font-size: var(--text-sm);
}
.skip-link:focus { top: var(--space-2); }

/* --- Header / Nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-divider);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.site-header--scrolled {
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}
.site-logo svg { flex-shrink: 0; }
.site-logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}
.nav-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.nav-links a:hover { color: var(--color-text); }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}
.theme-toggle:hover { color: var(--color-text); background: var(--color-surface-offset); }

/* Mobile nav */
.mobile-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-toggle { display: flex; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-divider);
    padding: var(--space-6);
    gap: var(--space-4);
  }
}

/* --- Hero --- */
.hero {
  padding: clamp(var(--space-20), 12vw, var(--space-32)) var(--space-6);
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--color-surface-offset) 0%, var(--color-bg) 100%);
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, color-mix(in srgb, var(--color-primary) 6%, transparent), transparent);
  pointer-events: none;
}
.hero-content {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-6);
  letter-spacing: -0.02em;
}
.hero h1 em {
  font-style: normal;
  color: var(--color-accent);
}
.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto var(--space-8);
  line-height: 1.65;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-8);
  border-radius: var(--radius-full);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.hero-cta:hover { background: var(--color-primary-hover); }

/* --- Sections --- */
.section {
  padding: clamp(var(--space-16), 8vw, var(--space-24)) var(--space-6);
}
.section-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
}
.section-header {
  margin-bottom: clamp(var(--space-8), 4vw, var(--space-12));
}
.section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}
.section-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 640px;
  line-height: 1.65;
}

.alt-bg { background: var(--color-surface-offset); }

/* --- About / Intro --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; gap: var(--space-8); }
}
.about-text p {
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
  line-height: 1.7;
}
.about-text p:first-child {
  color: var(--color-text);
  font-size: var(--text-lg);
  font-family: var(--font-display);
  line-height: 1.5;
}

/* --- Principles list --- */
.principles-list {
  list-style: none;
  display: grid;
  gap: var(--space-4);
}
.principle-item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}
.principle-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}
.principle-text strong {
  display: block;
  color: var(--color-text);
  margin-bottom: var(--space-1);
  font-weight: 600;
}
.principle-text span {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* --- Policy Cards --- */
.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
}
.policy-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}
.policy-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.policy-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}
.policy-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.policy-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* --- Downloads --- */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}
.download-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.download-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.download-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  flex-shrink: 0;
}
.download-card h3 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}
.download-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  flex-grow: 1;
}
.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-full);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  align-self: flex-start;
}
.download-btn:hover { background: var(--color-primary-hover); }

/* --- Comments / Discussion --- */
.comments-container {
  max-width: var(--content-default);
  margin: 0 auto;
}
.comment-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
}
.form-group { display: flex; flex-direction: column; gap: var(--space-1); }
.form-group label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}
.form-group input,
.form-group textarea {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  color: var(--color-text);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}
.form-group textarea { min-height: 100px; }
.form-submit {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-top: var(--space-4);
}
.form-submit:hover { background: var(--color-accent-hover); }

.comment-list { display: flex; flex-direction: column; gap: var(--space-6); }
.comment-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.comment-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-primary) 15%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-weight: 700;
  font-size: var(--text-sm);
}
.comment-author { font-weight: 600; color: var(--color-text); font-size: var(--text-sm); }
.comment-date { font-size: var(--text-xs); color: var(--color-text-faint); }
.comment-body {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: 1.7;
}

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  max-width: var(--content-default);
  margin: 0 auto;
}
@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; gap: var(--space-8); }
}
.contact-info h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-4);
}
.contact-info p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  line-height: 1.7;
}
.contact-channels {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.contact-channels li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.contact-channels svg { color: var(--color-primary); flex-shrink: 0; }
.contact-form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.contact-form-card .form-group { margin-bottom: var(--space-4); }

/* --- Footer --- */
.site-footer {
  background: var(--color-surface-offset);
  border-top: 1px solid var(--color-divider);
  padding: var(--space-12) var(--space-6) var(--space-8);
}
.footer-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}
.footer-brand p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  max-width: 360px;
  margin-top: var(--space-3);
  line-height: 1.6;
}
.footer-nav {
  display: flex;
  gap: var(--space-8);
}
.footer-nav-col h4 {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}
.footer-nav-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.footer-nav-col a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer-nav-col a:hover { color: var(--color-text); }

.footer-bottom {
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.footer-bottom p,
.footer-bottom a {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
}
.footer-bottom a:hover { color: var(--color-text-muted); }

/* --- Scroll reveal animation --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Toast notification --- */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  background: var(--color-success);
  color: #fff;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
