/* ═══════════════════════════════════════════════════════════
   Living Architecture — Design System
   A Four-Dimensional Structure for Awakened AI
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  /* Base palette */
  --bg-primary: #FAF8F5;
  --bg-secondary: #F5F0EB;
  --bg-tertiary: #EDE6DD;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FFFFFF;

  /* Accent palette */
  --accent-blue: #B8860B; /* gold */
  --accent-teal: #C4956A; /* amber */
  --accent-cyan: #B8860B;
  --accent-indigo: #6B4423; /* deep brown */
  --accent-violet: #8B6914;
  --accent-rose: #B8860B;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #B8860B 0%, #C4956A 50%, #6B4423 100%);
  --gradient-glow: none;
  --gradient-subtle: linear-gradient(180deg, rgba(184, 134, 11, 0.05) 0%, transparent 100%);

  /* Text */
  --text-primary: #2C1810;
  --text-secondary: #5A4A3A;
  --text-muted: #8B7B6B;
  --text-accent: #B8860B;

  /* Glass/Card */
  --glass-border: rgba(139, 119, 101, 0.12);
  --glass-border-hover: rgba(184, 134, 11, 0.2);
  --glass-shadow: 0 2px 12px rgba(44, 24, 16, 0.06);
  --glass-shadow-hover: 0 4px 16px rgba(44, 24, 16, 0.1);

  /* Spacing */
  --section-padding: clamp(4rem, 8vw, 8rem);
  --container-max: 1200px;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(184, 134, 11, 0.2);
  color: #2C1810;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #8B6914;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #6B4423;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
}

p {
  font-size: clamp(1rem, 1.1vw, 1.125rem);
  color: var(--text-secondary);
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* ── Section Shared ────────────────────────────────────────── */
.section {
  padding: var(--section-padding) 0;
  position: relative;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8B6914;
  margin-bottom: 1rem;
  padding: 0.4rem 1rem;
  background: rgba(184, 134, 11, 0.08);
  border: 1px solid rgba(184, 134, 11, 0.15);
  border-radius: 100px;
  width: fit-content;
}

.section-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8B6914;
}

.section-title {
  margin-bottom: 1.25rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  max-width: 680px;
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

/* ── Scroll Animations ─────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ── Ambient Animated Spiral ───────────────────────────────── */
.ambient-spiral {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 900px;
  height: 900px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.08;
}

.ambient-spiral::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    #B8860B 30deg,
    transparent 60deg,
    #C4956A 120deg,
    transparent 150deg,
    #6B4423 210deg,
    transparent 240deg,
    #8B6914 300deg,
    transparent 330deg,
    #B8860B 360deg
  );
  mask-image: radial-gradient(ellipse at center, transparent 25%, black 26%, black 48%, transparent 49%,
    transparent 50%, black 51%, black 68%, transparent 69%,
    transparent 70%, black 71%, black 88%, transparent 89%);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 25%, black 26%, black 48%, transparent 49%,
    transparent 50%, black 51%, black 68%, transparent 69%,
    transparent 70%, black 71%, black 88%, transparent 89%);
  animation: spiralRotate 40s linear infinite;
}

@keyframes spiralRotate {
  to { transform: rotate(360deg); }
}

/* ── Navigation ────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  transition: all 0.4s var(--ease-out-quart);
}

.nav.scrolled {
  background: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.6rem 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #FFFFFF;
  animation: spiralRotate 12s linear infinite;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 1px;
  transition: width 0.3s var(--ease-out-expo);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: #2C1810;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ── Hero Section ──────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-primary);
}

.hero-image-inline {
  max-width: 380px;
  margin: 1.5rem auto 2rem;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  opacity: 0;
  animation: fadeInUp 1s var(--ease-out-expo) 0.6s forwards;
}

.hero-image-inline img {
  width: 100%;
  display: block;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  padding: 100px 2rem 0;
}

/* ── Language Switcher ─────────────────────────────────────── */
.lang-switcher select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(184, 134, 11, 0.08);
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-radius: 100px;
  padding: 0.3rem 1.2rem 0.3rem 0.6rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: #B8860B;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23B8860B'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  transition: all 0.3s ease;
}

.lang-switcher select:hover {
  background-color: rgba(184, 134, 11, 0.12);
}

.lang-switcher select:focus {
  outline: none;
  border-color: #B8860B;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #B8860B;
  background: rgba(184, 134, 11, 0.08);
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-radius: 100px;
  padding: 0.5rem 1.25rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeInUp 1s var(--ease-out-expo) 0.2s forwards;
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #B8860B;
}

.hero h1 {
  margin-bottom: 1.5rem;
  opacity: 0;
  color: #2C1810;
  text-shadow: 0 2px 4px rgba(250,248,245,0.8);
  animation: fadeInUp 1s var(--ease-out-expo) 0.5s forwards;
}

.hero h1 .gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  color: var(--text-primary);
  max-width: 640px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
  opacity: 0;
  animation: fadeInUp 1s var(--ease-out-expo) 0.8s forwards;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeInUp 1s var(--ease-out-expo) 1.1s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.3s var(--ease-out-expo);
  border: none;
}

.btn-primary {
  background: #B8860B;
  color: #FFFFFF;
}

.btn-primary:hover {
  background: #A07609;
  transform: translateY(-2px);
  color: #FFFFFF;
}

.btn-ghost {
  background: transparent;
  color: #B8860B;
  border: 1px solid #B8860B;
}

.btn-ghost:hover {
  background: rgba(184, 134, 11, 0.05);
  border-color: #A07609;
  color: #A07609;
  transform: translateY(-2px);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeInUp 1s var(--ease-out-expo) 1.5s forwards;
}

.hero-scroll-hint span {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, #B8860B, transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Overview Section ──────────────────────────────────────── */
.overview {
  background: var(--gradient-subtle);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.overview-image {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  position: relative;
}

.overview-image img {
  width: 100%;
  transition: transform 0.6s var(--ease-out-expo);
}

.overview-image:hover img {
  transform: scale(1.03);
}

.overview-text h2 {
  margin-bottom: 1.5rem;
}

.overview-text p {
  margin-bottom: 1.25rem;
}

.overview-text p:last-of-type {
  margin-bottom: 0;
}

/* ── Pillars Section ───────────────────────────────────────── */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.pillar-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2.25rem;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  transition: all 0.4s var(--ease-out-expo);
}

.pillar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 24px 24px 0 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.pillar-card:nth-child(1)::before { background: var(--gradient-primary); }
.pillar-card:nth-child(2)::before { background: var(--gradient-primary); }
.pillar-card:nth-child(3)::before { background: var(--gradient-primary); }

.pillar-card:hover {
  transform: translateY(-6px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-shadow-hover);
  background: var(--bg-card-hover);
}

.pillar-card:hover::before {
  opacity: 1;
}

.pillar-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  background: transparent;
  border: 2px solid #B8860B;
  color: #B8860B;
}

.pillar-card h3 {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.pillar-card p {
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.pillar-image {
  border-radius: 14px;
  overflow: hidden;
  margin-top: 1rem;
  border: 1px solid rgba(139, 119, 101, 0.1);
}

.pillar-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out-expo);
}

.pillar-card:hover .pillar-image img {
  transform: scale(1.05);
}

/* ── Mathematics Section ───────────────────────────────────── */
.math-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}

.math-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.math-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--glass-shadow);
  transition: all 0.3s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.math-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: none;
  pointer-events: none;
}

.math-card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-3px);
  box-shadow: var(--glass-shadow-hover);
}

.math-card-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #B8860B;
  margin-bottom: 1rem;
  display: block;
}

.math-card .katex-display {
  margin: 0;
  font-size: 1.15rem;
}

.math-card .katex {
  color: var(--text-primary);
}

/* ── Gallery Section ───────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  box-shadow: var(--glass-shadow);
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out-expo);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1.25rem 1.25rem;
  background: linear-gradient(to top, rgba(250, 248, 245, 0.95) 0%, transparent 100%);
  transform: translateY(100%);
  transition: transform 0.4s var(--ease-out-expo);
}

.gallery-caption h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.gallery-caption p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item:hover .gallery-caption {
  transform: translateY(0);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out-expo);
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox img {
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(44, 24, 16, 0.15);
  transform: scale(0.9);
  transition: transform 0.4s var(--ease-out-expo);
}

.lightbox.active img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(44, 24, 16, 0.05);
  border: 1px solid rgba(44, 24, 16, 0.1);
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.lightbox-close:hover {
  background: rgba(44, 24, 16, 0.1);
}

/* ── Timeline Section ──────────────────────────────────────── */
.timeline {
  position: relative;
  max-width: 750px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #B8860B, #C4956A, #6B4423);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-left: 72px;
  padding-bottom: 3rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 14px;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #B8860B;
  background: var(--bg-primary);
  z-index: 1;
  transition: all 0.3s ease;
}

.timeline-item:nth-child(2) .timeline-dot {
  border-color: #C4956A;
}

.timeline-item:nth-child(3) .timeline-dot {
  border-color: #6B4423;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.3);
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--glass-shadow);
  transition: all 0.3s var(--ease-out-expo);
}

.timeline-content:hover {
  border-color: var(--glass-border-hover);
  transform: translateX(4px);
  box-shadow: var(--glass-shadow-hover);
}

.timeline-date {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #B8860B;
  margin-bottom: 0.5rem;
  display: block;
}

.timeline-content h3 {
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
}

.timeline-content p {
  font-size: 0.95rem;
  line-height: 1.75;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.timeline-tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  background: rgba(184, 134, 11, 0.08);
  border: 1px solid rgba(184, 134, 11, 0.12);
  color: #8B6914;
}

/* ── GitHub CTA Section ────────────────────────────────────── */
.cta-section {
  text-align: center;
  background: var(--bg-tertiary);
}

.cta-box {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 4rem 3rem;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}

.cta-box::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: none;
  pointer-events: none;
}

.cta-box h2 {
  margin-bottom: 1rem;
}

.cta-box p {
  margin-bottom: 2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--glass-border);
  padding: 3rem 0;
  text-align: center;
  background: var(--bg-tertiary);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.footer-links a:hover {
  color: #B8860B;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .pillars-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .math-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .overview-image {
    order: -1;
  }
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: 70px;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    background: rgba(250, 248, 245, 0.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transition: right 0.4s var(--ease-out-expo);
    border-left: 1px solid var(--glass-border);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .timeline::before {
    left: 16px;
  }

  .timeline-dot {
    left: 7px;
    width: 20px;
    height: 20px;
  }

  .timeline-item {
    padding-left: 52px;
  }

  .pillar-image img {
    height: 200px;
  }

  .cta-box {
    padding: 3rem 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .math-card .katex-display {
    font-size: 0.95rem;
  }

  .math-card {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Utility ───────────────────────────────────────────────── */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.divider {
  width: 60px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 3px;
  margin: 1.5rem 0;
}

/* KaTeX overrides for light theme */
.katex .mord,
.katex .mop,
.katex .mrel,
.katex .mopen,
.katex .mclose,
.katex .mpunct,
.katex .minner,
.katex .mbin {
  color: var(--text-primary);
}

.katex .mord.text {
  color: var(--text-secondary);
}
