/* =============================================================================
   SAFEGROUND EARLY WARNING SYSTEM
   safegroundews.com
   ============================================================================= */

/* 1. Custom Properties
   ============================================================================= */
:root {
  --bg-page:       #f2ede4;
  --bg-surface:    #ffffff;
  --bg-ink:        #1a2535;
  --bg-card:       #ffffff;
  --bg-card-hover: #f8f5f0;
  --bg-glass:      rgba(242,237,228,0.95);
  --border:        rgba(26,37,53,0.10);
  --border-hover:  rgba(26,37,53,0.22);

  --amber:         #c97c1a;
  --amber-light:   #e8941f;
  --amber-dim:     rgba(201,124,26,0.10);
  --amber-glow:    rgba(201,124,26,0.20);
  --green:         #2d6e4a;
  --green-dim:     rgba(45,110,74,0.10);
  --green-glow:    rgba(45,110,74,0.20);
  --blue:          #1d4ed8;
  --blue-dim:      rgba(29,78,216,0.10);
  --red:           #b91c1c;
  --red-dim:       rgba(185,28,28,0.10);

  --text:          #1a2535;
  --text-muted:    #4a5568;
  --text-faint:    #5c6b7e;   /* darkened for WCAG AA on light backgrounds */
  --text-on-ink:   #f2ede4;

  --font-head:     'Rajdhani', system-ui, sans-serif;
  --font-body:     'IBM Plex Serif', Georgia, serif;
  --font-ui:       'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:     'IBM Plex Mono', 'Courier New', monospace;

  --radius-sm:     6px;
  --radius:        12px;
  --radius-lg:     20px;
  --radius-xl:     32px;

  --shadow-sm:     0 2px 8px rgba(26,37,53,0.07);
  --shadow:        0 8px 32px rgba(26,37,53,0.11);
  --shadow-lg:     0 24px 64px rgba(26,37,53,0.15);
  --shadow-amber:  0 8px 40px rgba(201,124,26,0.15);
  --shadow-green:  0 8px 40px rgba(45,110,74,0.15);

  --nav-h:         72px;
  --transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  background-color: var(--bg-page);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }

/* Grain overlay removed — looks bad on cream background */

/* 3. Typography
   ============================================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  line-height: 1.1;
  letter-spacing: 0.02em;
  font-weight: 700;
}

h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
h4 { font-size: 1.2rem; font-weight: 600; }

p { line-height: 1.75; color: var(--text-muted); max-width: 65ch; }
p.lead { font-size: 1.15rem; color: var(--text); }

.label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9a5800;  /* darkened amber — WCAG AA on cream/white backgrounds */
}

/* Restore bright amber for labels on dark/ink backgrounds */
.hero .label,
.page-hero .label,
.ew4all-hero .label,
.section--ink .label { color: var(--amber); }

.label-green { color: var(--green); }

/* 4. Layout
   ============================================================================= */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.container--wide { max-width: 1440px; }
.container--narrow { max-width: 800px; }

section { position: relative; }

.section-pad {
  padding: clamp(5rem, 10vw, 8rem) 0;
}

.section-pad--sm {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 5. Navigation
   ============================================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--bg-ink);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  background: var(--bg-ink);
  backdrop-filter: none;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav-logo__img { width: 38px; height: 38px; }

.nav-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.nav-logo__name {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-on-ink);
}

.nav-logo__tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(242,237,228,0.75);
  transition: color var(--transition);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text-on-ink); }

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--amber);
  border-radius: 2px;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-burger {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.2);
}

.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-on-ink);
  transition: var(--transition);
  border-radius: 2px;
}

.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--nav-h);
  background: var(--bg-ink);
  z-index: 999;
  padding: 2rem;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-on-ink);
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: color var(--transition);
}

.mobile-nav a:hover { color: var(--amber); }

/* 6. Buttons
   ============================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}

.btn--primary {
  background: var(--amber);
  color: #000;
  border-color: var(--amber);
}

.btn--primary:hover {
  background: var(--amber-light);
  box-shadow: var(--shadow-amber);
  transform: translateY(-1px);
}

.btn--secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-hover);
}

.btn--secondary:hover {
  background: var(--bg-card);
  border-color: var(--text-faint);
  transform: translateY(-1px);
}

/* Secondary button on dark/ink backgrounds */
.hero .btn--secondary,
.section--ink .btn--secondary,
.ew4all-hero .btn--secondary {
  color: var(--text-on-ink);
  border-color: rgba(242,237,228,0.35);
}

.hero .btn--secondary:hover,
.section--ink .btn--secondary:hover,
.ew4all-hero .btn--secondary:hover {
  background: rgba(242,237,228,0.1);
  border-color: rgba(242,237,228,0.6);
}

.btn--outline-amber {
  background: transparent;
  color: var(--amber);
  border-color: var(--amber);
}

.btn--outline-amber:hover {
  background: var(--amber-dim);
  box-shadow: var(--shadow-amber);
}

.btn--outline-green {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
}

.btn--outline-green:hover {
  background: var(--green-dim);
  box-shadow: var(--shadow-green);
}

.btn--lg {
  padding: 1rem 2.5rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn--sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.82rem;
}

.btn svg, .btn img { width: 1em; height: 1em; }

/* 7. Hero Section
   ============================================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg-ink);
}

.hero__video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero__kenburns {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  animation: kenburns 30s ease-in-out infinite alternate;
}

@keyframes kenburns {
  0%   { transform: scale(1.08) translate(-2%, 1%); }
  100% { transform: scale(1.0) translate(2%, -1%); }
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(26,37,53,0.88) 0%,
    rgba(26,37,53,0.75) 50%,
    rgba(26,37,53,0.82) 100%
  );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: calc(var(--nav-h) + 4rem) 0 5rem;
  text-align: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  border: 1px solid rgba(201,124,26,0.42);
  background: rgba(201,124,26,0.14);
  margin-bottom: 1.75rem;
}

.hero__eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.hero__headline {
  font-size: clamp(2.4rem, 5.5vw, 5.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.75) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__headline .accent {
  background: linear-gradient(135deg, var(--amber) 0%, #fde68a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: rgba(242,237,228,0.85);
  max-width: 640px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero__ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

.hero__scroll {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: rgba(242,237,228,0.45);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.hero__scroll-line {
  width: 40px;
  height: 1px;
  background: rgba(242,237,228,0.35);
}

/* Hero inline countdown */
.hero__countdown {
  margin: 0 auto 2.5rem;
  max-width: 680px;
}

.hero__countdown-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.25rem;
  max-width: 100%;
  text-align: center;
}

.hero__countdown-grid {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.75rem;
}

.hero__countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.hero__countdown-num {
  font-family: var(--font-head);
  font-size: clamp(3rem, 7.5vw, 6rem);
  font-weight: 700;
  color: var(--amber);
  line-height: 1;
  letter-spacing: 0.04em;
  min-width: 2ch;
  text-align: center;
}

.hero__countdown-unitlabel {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(242,237,228,0.60);
}

.hero__countdown-sep {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 4.5rem);
  color: var(--amber);
  opacity: 0.35;
  line-height: 1;
  padding-top: 0.05em;
  align-self: flex-start;
}

.hero__countdown-footer {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: rgba(242,237,228,0.55);
  text-transform: uppercase;
  margin-top: 1.25rem;
  text-align: center;
  max-width: 100%;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 0.85rem;
}

/* 8. Alert Banner
   ============================================================================= */
.alert-banner {
  background: linear-gradient(135deg, rgba(185,28,28,0.08) 0%, rgba(201,124,26,0.08) 100%);
  border-top: 1px solid rgba(185,28,28,0.2);
  border-bottom: 1px solid rgba(201,124,26,0.2);
  padding: 0.85rem 0;
  overflow: hidden;
}

.alert-banner__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  text-align: center;
}

.alert-banner__icon {
  width: 18px;
  height: 18px;
  color: var(--red);
  flex-shrink: 0;
}

.alert-banner__text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  max-width: none;
  font-family: var(--font-ui);
}

.alert-banner__text strong { color: var(--amber); }

/* 9. Countdown Timer
   ============================================================================= */
.countdown-section {
  background: var(--bg-ink);
  padding: 4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.countdown-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.countdown-header .label { margin-bottom: 0.75rem; }
.countdown-header h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.countdown-num {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--amber);
  line-height: 1;
}

.countdown-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(242,237,228,0.55);
}

.countdown-sep {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: rgba(242,237,228,0.35);
  align-self: flex-start;
  padding-top: 0.15em;
  line-height: 1;
}

/* 10. Stats Row
   ============================================================================= */
.stats-section {
  background: var(--bg-ink);
  padding: 4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.stat-item {
  padding: 1.5rem 2rem;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.stat-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.stat-item + .stat-item {
  border-left: 1px solid rgba(255,255,255,0.1);
}

.stat-num {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-on-ink);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.stat-num .unit { color: var(--amber); }

.stat-label {
  font-size: 0.85rem;
  color: rgba(242,237,228,0.65);
  line-height: 1.4;
  max-width: 100%;
}

/* 11. Section Headers
   ============================================================================= */
.section-header {
  text-align: center;
  margin-bottom: clamp(3rem, 5vw, 4.5rem);
}

.section-header .label { margin-bottom: 1rem; }

.section-header h2 {
  margin-bottom: 1rem;
  color: var(--text);
}

.section-header p {
  margin: 0 auto;
  font-size: 1.05rem;
}

/* 12. Cards
   ============================================================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background var(--transition);
}

.card:hover::before { background: linear-gradient(90deg, var(--amber), transparent); }
.card--green:hover::before { background: linear-gradient(90deg, var(--green), transparent); }
.card--blue:hover::before { background: linear-gradient(90deg, var(--blue), transparent); }

.card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.4rem;
}

.card__icon--amber { background: var(--amber-dim); }
.card__icon--green { background: var(--green-dim); }
.card__icon--blue { background: var(--blue-dim); }

.card__title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.card__body {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 100%;
}

/* Glow card variant */
.card--glow {
  background: var(--bg-card);
  border: 1px solid rgba(201,124,26,0.2);
  box-shadow: var(--shadow-sm);
}

/* 13. Photo Sections
   ============================================================================= */
.photo-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 600px;
}

.photo-split__image {
  position: relative;
  overflow: hidden;
}

.photo-split__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.photo-split__image:hover img { transform: scale(1.03); }

.photo-split__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(4,7,15,0.5) 0%, transparent 70%);
}

.photo-split__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3rem, 6vw, 5rem);
  background: var(--bg-surface);
}

/* 14. Timeline
   ============================================================================= */
.timeline {
  position: relative;
  padding-left: 3rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--amber) 0%, rgba(245,158,11,0.1) 100%);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
  opacity: 0;
  transform: translateX(-15px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.55rem;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--bg-page);
  box-shadow: none;
}

.timeline-item__year {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--amber);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.timeline-item__title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.timeline-item__body {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 100%;
}

/* 15. Tech Diagrams
   ============================================================================= */
.tier-diagram {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.tier-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  transition: all var(--transition);
}

.tier-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
  position: relative;
}

.tier-badge::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid;
  opacity: 0.3;
}

.tier-1 .tier-badge { background: var(--blue-dim); }
.tier-1 .tier-badge::after { border-color: var(--blue); }
.tier-2 .tier-badge { background: var(--amber-dim); }
.tier-2 .tier-badge::after { border-color: var(--amber); }
.tier-3 .tier-badge { background: var(--green-dim); }
.tier-3 .tier-badge::after { border-color: var(--green); }

.tier-card__tier {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.tier-1 .tier-card__tier { color: var(--blue); }
.tier-2 .tier-card__tier { color: var(--amber); }
.tier-3 .tier-card__tier { color: var(--green); }

.tier-card__name {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.tier-card__specs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}

.spec-row:last-child { border-bottom: none; }
.spec-label { color: var(--text-faint); }
.spec-val { color: var(--text); font-weight: 500; }

/* 16. Mesh Visualization
   ============================================================================= */
#pissouri-canvas {
  width: 100%;
  height: 600px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  display: block;
  overflow: hidden;
  background: var(--bg-ink);
}

.viz-container {
  position: relative;
}

.viz-legend {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  background: rgba(26,37,53,0.88);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.viz-legend__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: rgba(242,237,228,0.75);
}

.viz-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.viz-caption {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* 17. EW4All Page
   ============================================================================= */
.ew4all-hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  background: var(--bg-ink);
  overflow: hidden;
  position: relative;
}

.ew4all-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 50% 50%, rgba(16,185,129,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 80% 20%, rgba(245,158,11,0.05) 0%, transparent 50%);
}

/* All text inside the ink hero needs to be light */
.ew4all-hero h1,
.ew4all-hero h2,
.ew4all-hero h3 { color: var(--text-on-ink); }
.ew4all-hero p   { color: rgba(242,237,228,0.80); }
.ew4all-hero p.lead { color: rgba(242,237,228,0.90); }

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
}

.pillar-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
}

.pillar-num {
  font-family: var(--font-head);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--amber) 0%, rgba(245,158,11,0.4) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 0;
}

.progress-fill--amber { background: linear-gradient(90deg, var(--amber), var(--amber-light)); }
.progress-fill--red { background: linear-gradient(90deg, var(--red), #f87171); }
.progress-fill--green { background: linear-gradient(90deg, var(--green), #34d399); }

.progress-pct {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 18. Forms
   ============================================================================= */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--amber);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px var(--amber-dim);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-faint); }

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--amber);
  cursor: pointer;
  margin-top: 2px;
}

.form-checkbox span {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-success {
  background: var(--green-dim);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: var(--green);
  font-size: 0.9rem;
  display: none;
  align-items: center;
  gap: 0.6rem;
}

.form-success.show { display: flex; }

/* Email capture inline */
.email-capture {
  display: flex;
  gap: 0.75rem;
  max-width: 480px;
}

.email-capture .form-input {
  flex: 1;
}

/* 19. Whitepaper Download CTA
   ============================================================================= */
.whitepaper-cta {
  background: var(--bg-card);
  border: 1px solid rgba(201,124,26,0.25);
  border-radius: var(--radius-xl);
  padding: 3rem;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.whitepaper-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--amber-dim) 0%, transparent 70%);
  pointer-events: none;
}

.whitepaper-cta__icon {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  background: var(--amber-dim);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.whitepaper-cta__text { flex: 1; }
.whitepaper-cta__text h3 { margin-bottom: 0.5rem; }
.whitepaper-cta__text p { max-width: 100%; font-size: 0.9rem; }

/* 20. Involved Options
   ============================================================================= */
.involve-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.involve-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.involve-card:hover {
  border-color: var(--amber);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(201,124,26,0.1);
}

.involve-card__emoji {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.involve-card__title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.involve-card__body {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  max-width: 100%;
}

.involve-card__link {
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: #9a5800;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap var(--transition);
}

.involve-card:hover .involve-card__link { gap: 0.7rem; }

/* 21. Partner Form
   ============================================================================= */
.partner-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem;
  box-shadow: var(--shadow-sm);
}

/* 22. Map / Location
   ============================================================================= */
.location-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.location-badge::before {
  content: '📍';
  font-size: 0.9em;
}

/* 23. Image Sections
   ============================================================================= */
.full-bleed-image {
  width: 100%;
  height: 500px;
  object-fit: cover;
  display: block;
}

.image-frame {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-frame__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1.5rem 1.5rem;
  background: linear-gradient(0deg, rgba(4,7,15,0.9) 0%, transparent 100%);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.72);
  font-family: var(--font-mono);
}

/* 24. Open Source Section
   ============================================================================= */
.oss-block {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 3rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

.oss-block__badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge--green { background: var(--green-dim); color: var(--green); }
.badge--amber { background: var(--amber-dim); color: var(--amber); }
.badge--blue { background: var(--blue-dim); color: var(--blue); }

/* 25a. Section Ink (dark inverted)
   ============================================================================= */
.section--ink {
  background: var(--bg-ink);
}

.section--ink h2, .section--ink h3, .section--ink h4,
.section--ink .hero__headline { color: var(--text-on-ink); }

.section--ink p { color: rgba(242,237,228,0.72); }
.section--ink .label { color: var(--amber); }
.section--ink .text-amber { color: var(--amber-light); }

/* Bright amber/green on all dark-ink contexts */
.hero .text-amber,
.page-hero .text-amber,
.ew4all-hero .text-amber,
.stats-section .text-amber { color: var(--amber-light); }

/* 25b. Article Cards
   ============================================================================= */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-hover);
  transform: translateY(-3px);
}

.article-card__type-bar {
  height: 4px;
}
.article-card__type-bar--publication { background: var(--amber); }
.article-card__type-bar--update     { background: var(--green); }
.article-card__type-bar--github     { background: var(--blue); }

.article-card__body {
  padding: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.article-card__tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 500;
}
.article-card__tag--publication { background: var(--amber-dim); color: #9a5800; }
.article-card__tag--update      { background: var(--green-dim); color: var(--green); }
.article-card__tag--github      { background: var(--blue-dim); color: var(--blue); }

.article-card__date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

.article-card__title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.25;
  text-transform: uppercase;
}

.article-card__excerpt {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  max-width: 100%;
  margin-bottom: 1.25rem;
}

.article-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
}

.article-card__author {
  font-family: var(--font-ui);
  color: var(--text-faint);
}

.article-card__link {
  font-family: var(--font-ui);
  color: #9a5800;
  font-weight: 600;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap var(--transition);
}

.article-card:hover .article-card__link { gap: 0.55rem; }

/* Featured article (first/top) */
.article-card--featured {
  grid-column: 1 / -1;
}
.article-card--featured .article-card__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.article-card--featured .article-card__title { font-size: 1.5rem; }

/* 25. Footer
   ============================================================================= */
.site-footer {
  background: var(--bg-ink);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 5rem 0 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.65;
  max-width: 280px;
  color: rgba(242,237,228,0.65);
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-on-ink);
  margin-bottom: 1.25rem;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-col ul li a {
  font-size: 0.875rem;
  color: rgba(242,237,228,0.65);
  transition: color var(--transition);
}

.footer-col ul li a:hover { color: var(--text-on-ink); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(242,237,228,0.45);
  max-width: 100%;
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}

.footer-bottom-links a {
  font-size: 0.8rem;
  color: rgba(242,237,228,0.45);
  transition: color var(--transition);
}

.footer-bottom-links a:hover { color: var(--text-on-ink); }

.un-mandate-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--green-dim);
  border: 1px solid rgba(16,185,129,0.25);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Badge sits in the footer (dark ink) — needs light text */
.site-footer .un-mandate-badge {
  color: #86efac;
  background: rgba(45,110,74,0.20);
  border-color: rgba(45,110,74,0.40);
}

/* 26. Page Heroes (internal pages)
   ============================================================================= */
.page-hero {
  padding: clamp(6rem,12vw,10rem) 0 4rem;
  background: var(--bg-ink);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201,124,26,0.06) 0%, transparent 60%);
}

.page-hero .container { position: relative; z-index: 1; }

.page-hero__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-hero h1 {
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  color: var(--text-on-ink);
  background: none;
  -webkit-text-fill-color: unset;
}

.page-hero p {
  font-size: 1.1rem;
  max-width: 660px;
  color: rgba(242,237,228,0.75);
}

.page-hero__meta .tag {
  border-color: rgba(201,124,26,0.4);
  color: var(--amber-light);
}

/* 27. Protocol / Technical Spec Blocks
   ============================================================================= */
.spec-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.spec-block__header {
  padding: 1rem 1.5rem;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.spec-block__title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.spec-block__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.spec-block .spec-row {
  padding: 0.65rem 0;
}

/* 28. Callout / Blockquote
   ============================================================================= */
.callout {
  background: rgba(245,158,11,0.06);
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.callout p {
  color: var(--text);
  font-size: 1rem;
  font-style: italic;
  max-width: 100%;
}

.callout .attribution {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: normal;
  margin-top: 0.5rem;
}

.callout--green {
  background: rgba(16,185,129,0.06);
  border-color: var(--green);
}

/* 29. Scroll Animations
   ============================================================================= */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-up-delay-1 { transition-delay: 0.1s; }
.fade-up-delay-2 { transition-delay: 0.2s; }
.fade-up-delay-3 { transition-delay: 0.3s; }
.fade-up-delay-4 { transition-delay: 0.4s; }

/* 30. Responsive
   ============================================================================= */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-item + .stat-item { border-left: none; }
  .stat-item:nth-child(odd) { border-right: 1px solid rgba(255,255,255,0.1); }
  .article-card--featured .article-card__body { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .photo-split { grid-template-columns: 1fr; }
  .photo-split__image { height: 350px; }
  .tier-diagram { grid-template-columns: 1fr; }
  .oss-block { grid-template-columns: 1fr; }
  .whitepaper-cta { flex-direction: column; text-align: center; }
}

@media (max-width: 768px) {
  h1 { font-size: clamp(2.2rem, 8vw, 3rem); }
  h2 { font-size: clamp(1.6rem, 6vw, 2.2rem); }

  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .involve-grid { grid-template-columns: 1fr; }
  .pillar-grid { grid-template-columns: 1fr; }
  .countdown-grid { grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
  .countdown-num { font-size: clamp(1.8rem, 8vw, 3rem); }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .email-capture { flex-direction: column; }
  .partner-form { padding: 1.75rem; }
  #pissouri-canvas { height: 400px; }
}

@media (max-width: 480px) {
  .hero__ctas { flex-direction: column; align-items: center; }
  .btn--lg { padding: 0.875rem 2rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-item + .stat-item { border-left: none; border-top: 1px solid var(--border); }
  .stat-item:nth-child(odd) { border-right: none; }
  .hero__countdown-num { font-size: clamp(2rem, 10vw, 3rem); }
  .hero__countdown-sep { font-size: clamp(1.5rem, 7vw, 2.5rem); }
}

/* 31. Utilities
   ============================================================================= */
.text-amber { color: #9a5800; }  /* darkened for WCAG on cream/white */
.text-green { color: var(--green); }
.text-blue { color: var(--blue); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-left { text-align: left; }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-3 { margin-bottom: 3rem; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.tag--amber { background: var(--amber-dim); color: #9a5800; }
.tag--green { background: var(--green-dim); color: var(--green); }
.tag--blue  { background: var(--blue-dim);  color: var(--blue); }

/* Highlighted stat inline */
.highlight-num {
  font-family: var(--font-head);
  font-size: 1.4em;
  font-weight: 700;
  color: #9a5800;
}
