/* ================================================================
   THE CYBERNETICS SOCIETY — Global Stylesheet
   Design system: Institutional British learned society
   Palette: Navy / Gold / Ivory
   Typography: EB Garamond (serif) + DM Sans (sans-serif)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── CSS Variables ── */
:root {
  --navy: #0B1D3A;
  --navy-deep: #071428;
  --navy-light: #1A2F52;
  --gold: #C9A84C;
  --gold-muted: #B89A45;
  --gold-pale: #E8D9A0;
  --ivory: #F6F3EC;
  --ivory-warm: #FAF8F3;
  --slate: #4A5568;
  --slate-light: #718096;
  --white: #FFFFFF;
  --border: #E2DDD3;
  --serif: 'EB Garamond', 'Georgia', serif;
  --sans: 'DM Sans', 'Helvetica Neue', sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  color: var(--navy);
  background: var(--ivory-warm);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-muted); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--gold); }

/* ── Container ── */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Utility Bar ── */
.utility-bar {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.55);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.utility-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.utility-bar a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color 0.2s;
  margin-left: 1.25rem;
}

.utility-bar a:hover { color: var(--gold-pale); }
.utility-links { display: flex; align-items: center; }

/* ── Site Header ── */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-block img {
  height: 44px;
  width: auto;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .society-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ivory);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.logo-text .society-subtitle {
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(201,168,76,0.6);
  margin-top: 2px;
}

.btn-join {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 0.5rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-join:hover {
  background: var(--gold);
  color: var(--navy);
}

/* ── Navigation ── */
.site-nav {
  background: var(--navy-light);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.site-nav .container {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
}

.site-nav a {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--gold-pale);
  border-bottom-color: var(--gold);
}

/* ── Hamburger (mobile) ── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ivory);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* ── Page Header (hero for inner pages) ── */
.page-header {
  background: var(--navy);
  padding: 3.5rem 0 3rem;
  border-bottom: 3px solid var(--gold);
}

.page-header h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 500;
  color: var(--ivory);
  line-height: 1.2;
}

.page-header .subtitle {
  font-family: var(--sans);
  font-size: 1rem;
  color: rgba(232,224,208,0.55);
  margin-top: 0.75rem;
  max-width: 600px;
}

/* ── Homepage Hero ── */
.hero {
  background: var(--navy);
  position: relative;
  overflow: hidden;
  min-height: 520px;
  display: flex;
  align-items: center;
  border-bottom: 3px solid var(--gold);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 560px;
  padding: 4rem 0;
}

.hero-content h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 400;
  color: var(--ivory);
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.hero-content h1 em {
  color: var(--gold);
  font-style: normal;
}

.hero-content .tagline {
  font-family: var(--sans);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  color: rgba(232,224,208,0.55);
  margin-top: 1.25rem;
  line-height: 1.7;
  max-width: 440px;
}

.hero-content .est {
  display: inline-block;
  margin-top: 1.75rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(201,168,76,0.5);
  border-top: 1px solid rgba(201,168,76,0.2);
  padding-top: 0.75rem;
}

/* Spiral container for homepage */
.hero-spiral-container {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(350px, 42vw, 550px);
  height: clamp(350px, 42vw, 550px);
  z-index: 1;
  pointer-events: none;
  opacity: 0.12;
}

/* ── Credentials Bar ── */
.credentials-bar {
  background: var(--ivory);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.credentials-bar .container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.credential {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--slate-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.credential strong {
  color: var(--navy);
  font-weight: 600;
}

/* ── Content Sections ── */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--ivory);
}

.section-dark {
  background: var(--navy);
  color: var(--ivory);
}

.section-dark a { color: var(--gold-pale); }
.section-dark a:hover { color: var(--gold); }

.section-heading {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.section-dark .section-heading { color: var(--ivory); }

.section-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-muted);
  margin-bottom: 0.5rem;
  display: block;
}

.section-intro {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--slate);
  max-width: 620px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.section-dark .section-intro { color: rgba(232,224,208,0.6); }

/* ── Three Pillars Grid ── */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.pillar-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 2rem;
  border-top: 3px solid var(--gold);
  transition: box-shadow 0.3s ease;
}

.pillar-card:hover {
  box-shadow: 0 4px 20px rgba(11,29,58,0.08);
}

.pillar-card h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.pillar-card p {
  font-size: 0.9rem;
  color: var(--slate);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.pillar-card .card-link {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gold-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pillar-card .card-link:hover { color: var(--gold); }

/* ── Stats Row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 2rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 2rem 0;
  text-align: center;
}

.stat-item .stat-number {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
}

.stat-item .stat-label {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--slate-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.4rem;
}

/* ── Content Pages — Prose ── */
.page-content {
  padding: 3rem 0 4rem;
}

.prose {
  max-width: 780px;
}

.prose h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--navy);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.prose h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--navy);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.prose h4 {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.prose p {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--slate);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.prose p a {
  color: var(--gold-muted);
  text-decoration: underline;
  text-decoration-color: rgba(201,168,76,0.3);
  text-underline-offset: 3px;
}

.prose p a:hover {
  color: var(--gold);
  text-decoration-color: var(--gold);
}

.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.prose li {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--slate);
  line-height: 1.75;
  margin-bottom: 0.5rem;
}

.prose blockquote {
  border-left: 3px solid var(--gold);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(201,168,76,0.04);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--navy);
  line-height: 1.6;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.prose .drop-cap::first-letter {
  font-family: var(--serif);
  float: left;
  font-size: 3.6rem;
  line-height: 0.85;
  padding-right: 0.15rem;
  padding-top: 0.05rem;
  color: var(--gold);
  font-weight: 500;
}

/* ── Event Cards ── */
.event-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.3s ease;
}

.event-card:hover {
  box-shadow: 0 3px 16px rgba(11,29,58,0.07);
}

.event-card .event-date {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-muted);
  margin-bottom: 0.5rem;
}

.event-card h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.event-card .event-speaker {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--slate-light);
  margin-bottom: 0.75rem;
}

.event-card p {
  font-size: 0.9rem;
  color: var(--slate);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.event-card .event-links a {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gold-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 1.5rem;
}

.event-card .event-links a:hover { color: var(--gold); }

/* ── Resource Links List ── */
.resource-list {
  list-style: none;
  padding: 0;
}

.resource-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.resource-list li:last-child { border-bottom: none; }

.resource-list a {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--navy);
  text-decoration: none;
  transition: color 0.2s;
}

.resource-list a:hover { color: var(--gold); }

.resource-list .resource-desc {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--slate-light);
  margin-top: 0.25rem;
}

/* ── Fellows List ── */
.fellows-list {
  list-style: none;
  padding: 0;
  columns: 2;
  column-gap: 3rem;
}

.fellows-list li {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--slate);
  padding: 0.5rem 0;
  break-inside: avoid;
  border-bottom: 1px solid rgba(226,221,211,0.5);
  line-height: 1.5;
}

/* ── Video Grid ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.video-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  transition: box-shadow 0.3s ease;
}

.video-card:hover {
  box-shadow: 0 3px 12px rgba(11,29,58,0.06);
}

.video-card h4 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.video-card a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gold-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Blog List (Cybsphere) ── */
.blog-list {
  list-style: none;
  padding: 0;
}

.blog-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.blog-list li a {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--navy);
}

.blog-list li a:hover { color: var(--gold); }

.blog-list .blog-meta {
  font-size: 0.78rem;
  color: var(--slate-light);
  margin-top: 0.2rem;
}

/* ── CTA Section ── */
.cta-section {
  background: var(--navy);
  padding: 3.5rem 0;
  text-align: center;
}

.cta-section h2 {
  font-family: var(--serif);
  font-size: 1.8rem;
  color: var(--ivory);
  margin-bottom: 0.75rem;
}

.cta-section p {
  font-size: 0.95rem;
  color: rgba(232,224,208,0.5);
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.btn-primary {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  padding: 0.7rem 2rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.25s ease;
  border: 2px solid var(--gold);
}

.btn-primary:hover {
  background: transparent;
  color: var(--gold);
}

.btn-outline {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 0.6rem 1.75rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-outline:hover {
  background: var(--gold);
  color: var(--navy);
}

/* ── Footer ── */
.site-footer {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.6);
  padding: 3.5rem 0 2rem;
  font-size: 0.85rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand .society-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--ivory);
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 0.82rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1rem;
  max-width: 320px;
}

.footer-brand .fca-note {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  line-height: 1.5;
}

.footer-col h5 {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-muted);
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 0.25rem 0;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--gold-pale); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  flex-wrap: wrap;
  gap: 0.5rem;
}

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

/* ── Responsive ── */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .fellows-list { columns: 1; }
}

@media (max-width: 700px) {
  .site-nav .container {
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav a {
    padding: 0.65rem 0.85rem;
    font-size: 0.75rem;
  }
  .header-main {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .page-header { padding: 2.5rem 0 2rem; }
  .section { padding: 2.5rem 0; }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .footer-bottom { flex-direction: column; text-align: center; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .hero { min-height: auto; }
  .hero-spiral-container { display: none; }
}
