/*
 * styles.css — CASC (Coalition for Academic Scientific Computation)
 * Built from design-direction.md — every section has a declared memorable decision.
 */

/* ============================================================
   Design Tokens
   ============================================================ */
:root {
  --color-primary: #142952;
  --color-primary-dark: #0D1B38;
  --color-primary-light: #E8EDF5;
  --color-secondary: #3A4A5C;
  --color-accent: #1A9BA5;
  --color-bg: #F7F8FA;
  --color-surface: #FFFFFF;
  --color-text: #1A1F2E;
  --color-text-secondary: #5A6578;
  --color-text-on-primary: #FFFFFF;
  --color-border: #D8DCE3;
  --font-primary: 'Bricolage Grotesque', sans-serif;
  --font-secondary: 'Crimson Pro', serif;
  --font-size-base: 18px;
  --spacing-base: 8px;
  --header-height: 80px;
  --header-height-compact: 60px;
}

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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-secondary);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  padding-bottom: 42px;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* ============================================================
   Typography
   ============================================================ */
.font-display {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

h1 {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--color-primary);
}

h2 {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-primary);
}

h3 {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--color-primary);
}

h4 {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
  color: var(--color-primary);
}

.text-lead {
  font-family: var(--font-secondary);
  font-size: 22px;
  line-height: 1.55;
}

.text-body {
  font-family: var(--font-secondary);
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: 0.005em;
}

.text-small {
  font-family: var(--font-secondary);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.text-caption {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.text-label {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================
   Layout Utilities
   ============================================================ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 8%;
}

.section-padding {
  padding: 96px 0;
}

.section-padding-lg {
  padding: 120px 0;
}

/* ============================================================
   Header / Navigation
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-surface);
  height: var(--header-height);
  transition: height 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
}

.site-header.scrolled {
  height: var(--header-height-compact);
  box-shadow: 0 1px 0 var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.site-logo img {
  height: 44px;
  width: auto;
  transition: height 0.2s ease;
}

.site-header.scrolled .site-logo img {
  height: 36px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.main-nav a {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
  transition: opacity 0.2s ease;
}

.main-nav a:hover {
  opacity: 0.7;
  text-decoration: none;
}

.main-nav a.active {
  color: var(--color-primary);
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile nav overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-primary);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

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

.mobile-nav-overlay a {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 28px;
  color: var(--color-text-on-primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.mobile-nav-overlay a:hover {
  opacity: 0.7;
  text-decoration: none;
}

/* Spacer for fixed header */
.header-spacer {
  height: var(--header-height);
}

/* ============================================================
   Homepage Hero
   ============================================================ */
.hero-home {
  position: relative;
  min-height: 100vh;
  background-image: url('../images/hero-fluid-dynamics.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
}

.hero-home::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(13, 27, 56, 0.2);
  z-index: 1;
}

.hero-home .hero-content {
  position: relative;
  z-index: 2;
  width: 60%;
  padding: 0 8%;
  padding-top: 5vh;
}

.hero-home .hero-title {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 24px;
}

.hero-home .hero-rule {
  width: 120px;
  height: 2px;
  background: var(--color-accent);
  margin-bottom: 24px;
}

.hero-home .hero-subtitle {
  font-family: var(--font-secondary);
  font-size: 20px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 40px;
  max-width: 540px;
}

.btn-primary {
  display: inline-block;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 16px;
  background: var(--color-accent);
  color: #fff;
  padding: 14px 32px;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: #168a93;
  text-decoration: none;
}

.btn-secondary {
  display: inline-block;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 16px;
  background: var(--color-primary);
  color: #fff;
  padding: 14px 32px;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--color-primary-dark);
  text-decoration: none;
}

/* ============================================================
   Impact Statistics
   ============================================================ */
.impact-stats {
  background: var(--color-surface);
  padding: 96px 0;
}

.impact-stats .container {
  display: flex;
}

.impact-stats-content {
  width: 45%;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.impact-stats-space {
  width: 55%;
}

.stat-item .stat-number {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 72px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-primary);
}

.stat-item .stat-rule {
  width: 40px;
  height: 1px;
  background: var(--color-accent);
  margin: 16px 0;
}

.stat-item .stat-label {
  font-family: var(--font-secondary);
  font-size: 18px;
  color: var(--color-text-secondary);
}

/* ============================================================
   Engagement Pathways (30/40/30 asymmetric panels)
   ============================================================ */
.engagement-pathways {
  background: var(--color-primary-light);
  padding: 96px 0;
}

.engagement-panels {
  display: flex;
  gap: 12px;
}

.engagement-panel {
  background: var(--color-primary);
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 500px;
  min-width: 0;
}

.engagement-panel:nth-child(1),
.engagement-panel:nth-child(3) {
  flex: 0 0 30%;
}

.engagement-panel:nth-child(2) {
  flex: 0 0 calc(40% - 24px);
}

.engagement-panel h3 {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 28px;
  color: #fff;
  margin-bottom: 16px;
}

.engagement-panel p {
  font-family: var(--font-secondary);
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 24px;
  line-height: 1.6;
}

.engagement-panel .panel-link {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 15px;
  color: var(--color-accent);
  text-decoration: underline;
}

.engagement-panel .panel-link:hover {
  color: #22b8c4;
}

/* ============================================================
   Latest Publications (Journal TOC)
   ============================================================ */
.publications-section {
  background: var(--color-surface);
  padding: 96px 0;
}

.section-heading-accent {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

.section-heading-accent .heading-border {
  width: 4px;
  height: 36px;
  background: var(--color-accent);
  flex-shrink: 0;
}

.publications-list {
  list-style: none;
}

.publication-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.2s ease;
}

.publication-row:hover {
  background: var(--color-bg);
}

.pub-date {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 14px;
  color: var(--color-text-secondary);
  flex: 0 0 120px;
}

.pub-badge {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  padding: 3px 10px;
  border-radius: 12px;
  flex-shrink: 0;
  white-space: nowrap;
}

.pub-title {
  font-family: var(--font-secondary);
  font-size: 18px;
  color: var(--color-text);
  flex: 1;
  min-width: 0;
}

.pub-title:hover {
  text-decoration: underline;
}

.publications-footer {
  margin-top: 32px;
  text-align: right;
}

/* ============================================================
   Upcoming Event (dark section)
   ============================================================ */
.upcoming-event {
  background: var(--color-primary-dark);
  padding: 96px 0;
}

.event-layout {
  display: flex;
  align-items: center;
  gap: 48px;
}

.event-content {
  flex: 0 0 55%;
  min-width: 0;
}

.event-image-frame {
  flex: 1;
  display: flex;
  justify-content: center;
}

.event-image-frame img {
  border: 1px solid var(--color-accent);
  padding: 16px;
  max-width: 100%;
  height: auto;
}

.event-content h2 {
  color: #fff;
  margin-bottom: 16px;
}

.event-meta {
  font-family: var(--font-primary);
  font-size: 16px;
  color: var(--color-accent);
  margin-bottom: 24px;
}

.event-meta i {
  margin-right: 6px;
}

.event-content p {
  font-family: var(--font-secondary);
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 32px;
  line-height: 1.65;
  max-width: 540px;
}

/* ============================================================
   Community / Experience the Power (zigzag)
   ============================================================ */
.community-section {
  background: var(--color-surface);
  padding: 96px 0;
}

.community-section > .container > h2 {
  text-align: center;
  margin-bottom: 64px;
}

.community-block {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 64px;
}

.community-block:last-child {
  margin-bottom: 0;
}

.community-block.align-left {
  justify-content: flex-start;
}

.community-block.align-right {
  justify-content: flex-end;
  text-align: right;
}

.community-text {
  max-width: 560px;
}

.community-text h3 {
  margin-bottom: 16px;
}

.community-text p {
  font-size: 18px;
  line-height: 1.65;
  color: var(--color-text);
}

.community-img {
  flex-shrink: 0;
}

.community-img img {
  width: 300px;
  height: auto;
  border: 1px solid var(--color-primary);
}

/* ============================================================
   Member Institutions (auto-scroll logos)
   ============================================================ */
.members-scroll-section {
  background: var(--color-primary-light);
  padding: 64px 0;
  overflow: hidden;
}

.members-scroll-section .section-label {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-secondary);
  text-align: center;
  margin-bottom: 40px;
}

.logo-scroll-track {
  display: flex;
  gap: 48px;
  animation: logoScroll 60s linear infinite;
  width: max-content;
}

.logo-scroll-track:hover {
  animation-play-state: paused;
}

.logo-scroll-track img {
  height: 48px;
  width: auto;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.logo-scroll-track img:hover {
  opacity: 1;
  transform: scale(1.05);
}

@keyframes logoScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.members-scroll-footer {
  text-align: center;
  margin-top: 32px;
}

/* ============================================================
   CTA Section (dark centered)
   ============================================================ */
.cta-section {
  background: var(--color-primary-dark);
  padding: 120px 0;
  text-align: center;
}

.cta-section h2 {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 48px;
  color: #fff;
  margin-bottom: 24px;
}

.cta-section p {
  font-family: var(--font-secondary);
  font-size: 20px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto 40px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--color-primary);
  padding: 64px 0 0;
  color: var(--color-text-on-primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}

.footer-brand .footer-logo {
  height: 36px;
  width: auto;
  margin-bottom: 16px;
  filter: brightness(0) invert(1);
}

.footer-brand p {
  font-family: var(--font-secondary);
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  max-width: 280px;
}

.footer-col h4 {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-bottom: 20px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 12px;
}

.footer-col a {
  font-family: var(--font-secondary);
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-col .contact-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--font-secondary);
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 12px;
}

.footer-col .contact-item i {
  margin-top: 3px;
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid #3A4A5C;
  padding: 24px 0;
  text-align: center;
}

.footer-bottom p {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ============================================================
   About Page — Hero (text-only)
   ============================================================ */
.hero-about {
  background: var(--color-surface);
  padding: 128px 0 80px;
}

.hero-about h1 {
  width: 55%;
  margin-bottom: 24px;
}

.hero-about .text-lead {
  max-width: 680px;
  color: var(--color-text);
}

/* ============================================================
   About — Mission & Vision (teal separator)
   ============================================================ */
.mission-vision {
  background: var(--color-primary-light);
  padding: 96px 0;
}

.mission-vision-grid {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.mv-block {
  flex: 1;
  min-width: 0;
  padding: 0 40px;
}

.mv-block:first-child {
  padding-left: 0;
}

.mv-block:last-child {
  padding-right: 0;
}

.mv-separator {
  width: 2px;
  background: var(--color-accent);
  flex-shrink: 0;
  align-self: stretch;
}

.mv-block h2 {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 28px;
  margin-bottom: 20px;
}

.mv-block p,
.mv-block ul {
  font-size: 18px;
  line-height: 1.65;
}

.mv-block ul {
  list-style: none;
  padding: 0;
}

.mv-block ul li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 12px;
}

.mv-block ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* ============================================================
   About — Executive Committee (raw B&W on white)
   ============================================================ */
.exec-committee {
  background: var(--color-surface);
  padding: 96px 0;
}

.exec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 48px;
}

.exec-member {
  text-align: left;
}

.exec-member img {
  width: 280px;
  height: 280px;
  object-fit: cover;
  object-position: top center;
  filter: grayscale(100%);
  margin-bottom: 16px;
}

.exec-member .member-name {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 20px;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.exec-member .member-role {
  font-family: var(--font-secondary);
  font-style: italic;
  font-size: 16px;
  color: var(--color-text-secondary);
}

/* ============================================================
   About — Committees (accordion)
   ============================================================ */
.committees-section {
  background: var(--color-primary-light);
  padding: 96px 0;
}

.accordion-item {
  background: transparent;
  border-bottom: 1px solid var(--color-border);
}

.accordion-item:first-child {
  border-top: 1px solid var(--color-border);
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 20px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 24px;
  color: var(--color-primary);
  text-align: left;
}

.accordion-header i {
  color: var(--color-accent);
  font-size: 20px;
  transition: transform 0.3s ease;
}

.accordion-header.open i {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--color-surface);
  border-radius: 4px;
}

.accordion-body.open {
  max-height: 600px;
}

.accordion-body-inner {
  padding: 24px;
  columns: 2;
  column-gap: 32px;
}

.accordion-body-inner p {
  font-family: var(--font-secondary);
  font-size: 16px;
  break-inside: avoid;
  margin-bottom: 8px;
  color: var(--color-text);
}

/* ============================================================
   About — History Timeline (dual-track)
   ============================================================ */
.timeline-section {
  background: var(--color-surface);
  padding: 96px 0;
}

.timeline {
  position: relative;
  max-width: 900px;
  margin: 48px auto 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-accent);
  transform: translateX(-50%);
}

.timeline-entry {
  display: flex;
  align-items: flex-start;
  margin-bottom: 48px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-entry.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-entry .tl-left,
.timeline-entry .tl-right {
  width: calc(50% - 24px);
  min-width: 0;
}

.timeline-entry .tl-left {
  text-align: right;
  padding-right: 24px;
}

.timeline-entry .tl-right {
  padding-left: 24px;
}

.timeline-entry .tl-node {
  width: 48px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  margin-top: 6px;
}

.tl-dot.large {
  width: 16px;
  height: 16px;
}

.tl-dot.pulse {
  animation: tlPulse 2s ease-in-out infinite;
}

@keyframes tlPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26, 155, 165, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(26, 155, 165, 0); }
}

.tl-year {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 20px;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.tl-heading {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 18px;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.tl-desc {
  font-family: var(--font-secondary);
  font-size: 15px;
  color: var(--color-text);
  line-height: 1.55;
}

/* ============================================================
   About — Governance (dictionary entries)
   ============================================================ */
.governance-section {
  background: var(--color-surface);
  padding: 96px 0;
}

.governance-entry {
  display: flex;
  align-items: baseline;
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
}

.governance-entry:first-child {
  border-top: 1px solid var(--color-border);
}

.gov-term {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 20px;
  color: var(--color-primary);
  flex: 0 0 280px;
}

.gov-definition {
  font-family: var(--font-secondary);
  font-size: 16px;
  color: var(--color-text);
  flex: 1;
  min-width: 0;
  max-width: 520px;
  line-height: 1.6;
}

/* ============================================================
   Members Page — Hero (dark)
   ============================================================ */
.hero-members {
  background: var(--color-primary-dark);
  padding: 96px 0;
}

.hero-split {
  display: flex;
  align-items: center;
  gap: 48px;
}

.hero-split-text {
  flex: 1;
  min-width: 0;
}

.hero-split-text h1 {
  color: #fff;
  margin-bottom: 20px;
}

.hero-split-text .text-lead {
  color: rgba(255, 255, 255, 0.85);
}

.hero-split-image {
  flex-shrink: 0;
}

.hero-split-image img {
  border: 1px solid var(--color-accent);
  padding: 12px;
}

/* ============================================================
   Members — Directory Grid
   ============================================================ */
.member-directory {
  background: var(--color-surface);
  padding: 96px 0;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.member-cell {
  border: 1px solid var(--color-border);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  transition: box-shadow 0.2s ease;
}

.member-cell:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.member-cell img {
  height: 48px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.member-cell .inst-name {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 15px;
  color: var(--color-primary);
  line-height: 1.3;
}

.member-cell .dept-name {
  font-family: var(--font-secondary);
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ============================================================
   Members — CTA (teal fill — only section with teal bg)
   ============================================================ */
.members-cta {
  background: var(--color-accent);
  padding: 96px 0;
  text-align: center;
}

.members-cta h2 {
  color: #fff;
  font-size: 40px;
  margin-bottom: 16px;
}

.members-cta p {
  font-family: var(--font-secondary);
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* ============================================================
   Advocacy — Hero
   ============================================================ */
.hero-advocacy {
  background: var(--color-surface);
  padding: 96px 0;
}

.hero-with-photo {
  display: flex;
  align-items: flex-start;
  gap: 48px;
}

.hero-with-photo-text {
  flex: 1;
  min-width: 0;
}

.hero-with-photo-text h1 {
  margin-bottom: 20px;
}

.hero-with-photo-text p {
  font-size: 20px;
  line-height: 1.55;
  max-width: 600px;
}

.hero-with-photo-image {
  flex-shrink: 0;
}

.hero-with-photo-image img {
  max-width: 225px;
  height: auto;
}

/* ============================================================
   Advocacy — Publications Filter
   ============================================================ */
.filter-bar {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 4px 0;
  position: relative;
  transition: color 0.2s ease;
}

.filter-btn:hover {
  color: var(--color-primary);
}

.filter-btn.active {
  color: var(--color-primary);
}

.filter-btn.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
}

/* ============================================================
   Advocacy — Federal Engagement
   ============================================================ */
.federal-section {
  background: var(--color-primary-light);
  padding: 96px 0;
}

.agency-entry {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--color-border);
}

.agency-entry:last-child {
  border-bottom: none;
}

.agency-logo {
  flex-shrink: 0;
}

.agency-logo img {
  height: 64px;
  width: auto;
}

.agency-text h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.agency-text p {
  font-size: 17px;
  line-height: 1.6;
}

/* ============================================================
   Events — Current Event Hero (dark)
   ============================================================ */
.hero-events {
  background: var(--color-primary-dark);
  padding: 96px 0;
}

.hero-events h1 {
  color: #fff;
}

/* ============================================================
   Events — Past Meetings
   ============================================================ */
.past-events {
  background: var(--color-surface);
  padding: 96px 0;
}

.past-event-entry {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.pe-name {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 18px;
  color: var(--color-primary);
  flex: 1;
  min-width: 0;
}

.pe-date {
  font-family: var(--font-secondary);
  font-size: 16px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

/* ============================================================
   Membership — Value Proposition
   ============================================================ */
.membership-value {
  background: var(--color-surface);
  padding: 96px 0;
}

.benefit-block {
  margin-bottom: 48px;
  max-width: 680px;
}

.benefit-block:nth-child(even) {
  margin-left: 24px;
}

.benefit-block h3 {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 24px;
  border-left: 3px solid var(--color-accent);
  padding-left: 16px;
  margin-bottom: 16px;
}

.benefit-block p {
  font-size: 18px;
  line-height: 1.65;
}

/* ============================================================
   Membership — Application CTA
   ============================================================ */
.application-cta {
  background: var(--color-primary-dark);
  padding: 96px 0;
  text-align: center;
}

.application-cta h2 {
  color: #fff;
  font-size: 40px;
  margin-bottom: 16px;
}

.application-cta p {
  font-family: var(--font-secondary);
  font-size: 18px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* ============================================================
   Careers — Hero (gradient-edge image)
   ============================================================ */
.hero-careers {
  background: var(--color-surface);
  padding: 96px 0;
}

.careers-hero-layout {
  display: flex;
  align-items: center;
  gap: 0;
}

.careers-hero-text {
  flex: 1;
  min-width: 0;
  padding-right: 48px;
}

.careers-hero-text h1 {
  margin-bottom: 20px;
}

.careers-hero-text p {
  font-size: 20px;
  line-height: 1.55;
  max-width: 540px;
}

.careers-hero-image {
  flex: 0 0 50%;
  position: relative;
}

.careers-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.careers-hero-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 80px;
  background: linear-gradient(to right, var(--color-surface), transparent);
  z-index: 1;
}

/* ============================================================
   Careers — CI Leadership Academy
   ============================================================ */
.ci-academy {
  background: var(--color-primary-light);
  padding: 96px 0;
}

.ci-academy h2 {
  margin-bottom: 24px;
}

.ci-academy p {
  font-size: 18px;
  line-height: 1.65;
  max-width: 680px;
  margin-bottom: 16px;
}

/* ============================================================
   Careers — Scholarship (blockquote style)
   ============================================================ */
.scholarship-section {
  background: var(--color-surface);
  padding: 96px 0;
}

.scholarship-content {
  border-left: 4px solid var(--color-accent);
  padding-left: 32px;
  max-width: 680px;
}

.scholarship-content h2 {
  font-size: 32px;
  margin-bottom: 8px;
}

.scholarship-attribution {
  font-family: var(--font-secondary);
  font-style: italic;
  font-size: 18px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.scholarship-content p {
  font-size: 18px;
  line-height: 1.65;
  margin-bottom: 16px;
}

/* ============================================================
   Contact Form
   ============================================================ */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 14px;
  color: var(--color-text);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-secondary);
  font-size: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 3px;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-accent);
  outline: none;
}

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

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.contact-form .btn-primary {
  width: 100%;
  text-align: center;
}

/* Dark form variant */
.form-dark .form-group label {
  color: rgba(255, 255, 255, 0.85);
}

.form-dark .form-group input,
.form-dark .form-group textarea {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.form-dark .form-group input::placeholder,
.form-dark .form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-dark .form-group input:focus,
.form-dark .form-group textarea:focus {
  border-color: var(--color-accent);
}

/* ============================================================
   404 Page
   ============================================================ */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 96px 32px;
}

.error-page .error-code {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 120px;
  color: var(--color-primary-light);
  line-height: 1;
  margin-bottom: 24px;
}

.error-page h1 {
  margin-bottom: 16px;
}

.error-page p {
  font-size: 18px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  max-width: 480px;
}

/* ============================================================
   Page-specific hero variants
   ============================================================ */
.hero-page {
  padding: 96px 0;
}

.hero-page.dark {
  background: var(--color-primary-dark);
}

.hero-page.dark h1 {
  color: #fff;
}

.hero-page.dark .text-lead {
  color: rgba(255, 255, 255, 0.85);
}

.hero-page.light {
  background: var(--color-surface);
}

/* ============================================================
   Scroll animations
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Responsive — Tablet
   ============================================================ */
@media (max-width: 1024px) {
  .hero-home .hero-title {
    font-size: 48px;
  }

  .hero-home .hero-content {
    width: 75%;
  }

  .stat-item .stat-number {
    font-size: 60px;
  }

  .impact-stats-content {
    width: 55%;
  }

  .impact-stats-space {
    width: 45%;
  }

  .engagement-panels {
    flex-wrap: wrap;
  }

  .engagement-panel:nth-child(1),
  .engagement-panel:nth-child(3) {
    flex: 0 0 calc(50% - 6px);
  }

  .engagement-panel:nth-child(2) {
    flex: 0 0 100%;
    border-top: 3px solid var(--color-accent);
  }

  .event-layout {
    flex-direction: column;
  }

  .event-content {
    flex: 1;
  }

  .member-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .timeline-entry .tl-left,
  .timeline-entry .tl-right {
    width: calc(50% - 20px);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   Responsive — Mobile
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
    --header-height-compact: 56px;
  }

  .hamburger {
    display: block;
  }

  .main-nav {
    display: none;
  }

  .site-logo img {
    height: 36px;
  }

  .site-header.scrolled .site-logo img {
    height: 30px;
  }

  .hero-home {
    min-height: 80vh;
    background-attachment: scroll;
  }

  .hero-home .hero-content {
    width: 100%;
    padding-top: 10vh;
  }

  .hero-home .hero-title {
    font-size: 40px;
    letter-spacing: -0.01em;
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 28px;
  }

  h3 {
    font-size: 22px;
  }

  .cta-section h2 {
    font-size: 36px;
  }

  .impact-stats .container {
    flex-direction: column;
  }

  .impact-stats-content {
    width: 100%;
    gap: 48px;
  }

  .impact-stats-space {
    width: 100%;
    height: 20%;
  }

  .stat-item .stat-number {
    font-size: 56px;
  }

  .engagement-panels {
    flex-direction: column;
  }

  .engagement-panel:nth-child(1),
  .engagement-panel:nth-child(2),
  .engagement-panel:nth-child(3) {
    flex: 1;
    min-height: 320px;
  }

  .engagement-panel:nth-child(2) {
    border-top: 3px solid var(--color-accent);
  }

  .publication-row {
    flex-direction: column;
    gap: 8px;
  }

  .pub-date {
    flex: none;
  }

  .event-layout {
    flex-direction: column;
  }

  .event-content {
    flex: 1;
  }

  .community-block {
    flex-direction: column;
  }

  .community-block.align-right {
    text-align: left;
  }

  .community-img {
    order: -1;
  }

  .community-img img {
    width: 100%;
    max-width: 300px;
  }

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

  .exec-grid {
    grid-template-columns: 1fr;
  }

  .exec-member img {
    width: 100%;
    max-width: 280px;
    height: auto;
    aspect-ratio: 1;
  }

  .mission-vision-grid {
    flex-direction: column;
    gap: 40px;
  }

  .mv-separator {
    width: 100%;
    height: 2px;
  }

  .mv-block {
    padding: 0;
  }

  .accordion-body-inner {
    columns: 1;
  }

  /* Timeline: single-track mobile */
  .timeline::before {
    left: 16px;
  }

  .timeline-entry {
    flex-direction: row;
  }

  .timeline-entry .tl-left {
    display: none;
  }

  .timeline-entry .tl-node {
    flex: 0 0 32px;
  }

  .timeline-entry .tl-right {
    width: 100%;
    padding-left: 16px;
  }

  .governance-entry {
    flex-direction: column;
    gap: 8px;
  }

  .gov-term {
    flex: none;
  }

  .gov-definition {
    max-width: none;
  }

  .hero-about h1 {
    width: 100%;
  }

  .hero-split {
    flex-direction: column;
  }

  .hero-with-photo {
    flex-direction: column;
  }

  .careers-hero-layout {
    flex-direction: column;
  }

  .careers-hero-image {
    flex: 1;
    width: 100%;
  }

  .careers-hero-image::before {
    display: none;
  }

  .careers-hero-text {
    padding-right: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .past-event-entry {
    flex-direction: column;
    gap: 4px;
  }

  .filter-bar {
    gap: 12px;
  }

  .hero-page {
    padding: 64px 0;
  }

  .section-padding {
    padding: 64px 0;
  }

  .container {
    padding: 0 6%;
  }
}

@media (max-width: 480px) {
  .hero-home .hero-title {
    font-size: 32px;
  }

  .stat-item .stat-number {
    font-size: 48px;
  }

  .member-grid {
    grid-template-columns: 1fr;
  }

  .engagement-panel {
    min-height: 280px;
    padding: 32px 24px;
  }
}
