@import url('/css/supers.css');

:root {
  --ink: #0a0908;
  --ink-2: #15130f;
  --bone: #faf8f5;
  --bone-dim: #b8b1a0;
  --leaf: #c41e3a;
  --leaf-glow: #e63950;
  --gold: #c9a227;
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --section-spacing: clamp(5rem, 15vh, 10rem);
}

[data-theme="dark"] {
  --bg: #0c0a09;
  --bg-2: #161412;
  --bg-3: #1e1b18;
  --bg-glass: rgba(22, 20, 18, 0.88);
  --text: #faf8f5;
  --text-dim: #a8a095;
  --accent: #e63950;
  --accent-glow: #ff4d6a;
  --accent-soft: rgba(230, 57, 80, 0.12);
  --accent-2: #c9a227;
  --rule: rgba(250, 248, 245, 0.08);
  --grain-opacity: 0.05;
  --mesh-red: 0.10;
}

[data-theme="light"] {
  --bg: #f5f2ed;
  --bg-2: #edeae4;
  --bg-3: #e5e1d9;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --text: #1a1714;
  --text-dim: #6b6259;
  --accent: #b91c3c;
  --accent-glow: #d42a4a;
  --accent-soft: rgba(185, 28, 60, 0.1);
  --accent-2: #8a6b12;
  --rule: rgba(139, 115, 85, 0.12);
  --grain-opacity: 0.012;
  --mesh-red: 0.045;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Cormorant Garamond', serif;
  font-feature-settings: "ss01", "lnum", "onum";
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.6s var(--ease-out-expo), color 0.6s var(--ease-out-expo);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Atmospheric Layers */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 15%, rgba(216, 51, 42, var(--mesh-red)) 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(216, 51, 42, calc(var(--mesh-red) * 0.5)) 0%, transparent 45%);
  pointer-events: none;
  z-index: 1;
}

/* Noise Texture Overlay */
body::after {
  content: '';
  position: fixed;
  inset: -100%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: var(--grain-opacity);
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: overlay;
  animation: grain 10s steps(10) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -5%); }
  20% { transform: translate(-10%, 5%); }
  30% { transform: translate(5%, -10%); }
  40% { transform: translate(-5%, 15%); }
  50% { transform: translate(-10%, 5%); }
  60% { transform: translate(15%, 0%); }
  70% { transform: translate(0%, 10%); }
  80% { transform: translate(3%, 15%); }
  90% { transform: translate(-5%, 10%); }
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 8.333vw 8.333vh;
  opacity: 0.25;
}

/* Page Layout */
.page {
  position: relative;
  z-index: 10;
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(2rem, 10vw, 8rem) clamp(1.5rem, 8vw, 6rem);
  padding-top: 5rem;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 2rem;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--nav-bg, rgba(250,250,250,0.8));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.08));
  gap: 2rem;
}

[data-theme="dark"] .nav {
  background: rgba(0,0,0,0.8);
}

.nav .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.nav .brand:hover,
.nav .brand:focus-visible {
  color: var(--accent);
}

.nav .brand-logo {
  width: 20px;
  height: 20px;
  color: var(--accent);
  transition: transform 0.3s ease, color 0.2s ease;
  flex-shrink: 0;
}

.nav .brand:hover .brand-logo {
  transform: scale(1.1) rotate(8deg);
  color: var(--accent-glow);
}

.nav .brand-text {
  font-weight: 500;
  letter-spacing: 0.18em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.support-link {
  color: var(--accent) !important;
}

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

.share-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 0.75rem;
  border-right: 1px solid var(--rule);
}

.share-icon {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: all 0.2s ease;
  border-radius: 4px;
}

.share-icon:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.share-icon svg {
  transition: transform 0.2s ease;
}

.share-icon:hover svg {
  transform: scale(1.1);
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s var(--ease-out-expo);
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: rotate(15deg) scale(1.1);
  background: var(--accent-soft);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .sun {
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 2;
  transition: stroke 0.3s;
  display: block;
}

.theme-toggle .moon {
  fill: var(--text-dim);
  stroke: none;
  transition: fill 0.3s;
  display: none;
}

.theme-toggle:hover .sun { stroke: var(--accent); }
.theme-toggle:hover .moon { fill: var(--accent); }

[data-theme="dark"] .theme-toggle .sun { display: none !important; }
[data-theme="dark"] .theme-toggle .moon { display: block !important; }
[data-theme="light"] .theme-toggle .sun { display: block !important; }
[data-theme="light"] .theme-toggle .moon { display: none !important; }

/* Editorial Header */
.header {
  grid-column: 1 / -1;
  margin-bottom: var(--section-spacing);
  display: flex;
  flex-direction: column;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  width: 100%;
}

.eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--rule) 50%, transparent);
}

.title {
  font-size: clamp(4.5rem, 18vw, 13rem);
  line-height: 0.82;
  font-weight: 300;
  letter-spacing: -0.05em;
  margin-bottom: 2rem;
  margin-left: -0.06em;
  color: var(--text);
  word-break: break-word;
}

.years-epithet {
  display: flex;
  align-items: baseline;
  gap: clamp(2rem, 5vw, 4rem);
  flex-wrap: wrap;
}

.years {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-weight: 500;
}

.epithet {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-style: italic;
  color: var(--text-dim);
  font-weight: 300;
  max-width: 32ch;
  line-height: 1.2;
}

/* Main Content Grid */
.main-content {
  grid-column: 1 / 8;
}

.sidebar {
  grid-column: 9 / 13;
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

@media (max-width: 1100px) {
  .main-content { grid-column: 1 / -1; }
  .sidebar { grid-column: 1 / -1; order: -1; margin-bottom: 4rem; }
  .super-card { position: relative !important; top: 0 !important; }
}

/* Body Text */
.body p {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.75;
  margin-bottom: 3rem;
  color: var(--text);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.body p:first-child::first-letter {
  font-size: clamp(6rem, 15vw, 9rem);
  float: left;
  line-height: 0.75;
  margin-right: 0.15em;
  margin-top: 0.1em;
  color: var(--accent);
  font-weight: 300;
  font-family: 'Cormorant Garamond', serif;
}

.section-heading {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 300;
  margin: clamp(4rem, 12vh, 8rem) 0 3.5rem;
  line-height: 1.1;
}

.section-heading .accent {
  color: var(--accent);
  font-style: italic;
}

/* Super Card */
.super-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--rule);
  padding: clamp(2rem, 4vw, 4rem);
  position: sticky;
  top: 4rem;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.3);
  transition: transform 0.6s var(--ease-out-expo);
}

.super-card:hover { transform: translateY(-5px); border-color: var(--text-dim); }

.super-card-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3rem;
  display: block;
}

.super-card-grid { display: grid; gap: 2.5rem; }

.super-card-item { display: flex; flex-direction: column; gap: 0.75rem; }

.super-card-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.super-card-value {
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.2;
}

/* Stats Grid */
.stats-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: var(--section-spacing) 0;
}

.stat {
  background: var(--bg-2);
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid var(--rule);
  transition: all 0.6s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 2px; height: 0;
  background: var(--accent);
  transition: height 0.6s var(--ease-out-expo);
}

.stat:hover { 
  transform: translateY(-12px); 
  border-color: var(--rule);
  box-shadow: 0 30px 60px -15px rgba(0,0,0,0.2);
}
.stat:hover::before { height: 100%; }

.stat-value {
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  font-weight: 300;
  color: var(--accent);
  line-height: 0.9;
  margin-bottom: 1.5rem;
}

.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Timeline */
.timeline {
  margin: 4rem 0;
  position: relative;
}

.timeline-item {
  display: grid;
  grid-template-columns: clamp(100px, 15vw, 180px) 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4rem;
  transition: opacity 0.6s ease;
}

.timeline-item:hover { opacity: 1; }
.timeline-item:not(:hover) { opacity: 0.7; }

.timeline-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--accent);
  font-weight: 500;
  padding-top: 0.5rem;
}

.timeline-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 300;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.timeline-desc {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 60ch;
}

/* Quote Section */
.quote-section {
  grid-column: 1 / -1;
  margin: var(--section-spacing) 0;
  padding: 6rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: center;
}

.quote-section blockquote {
  font-size: clamp(2rem, 5vw, 4rem);
  font-style: italic;
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 3rem;
  max-width: 25ch;
  margin-left: auto;
  margin-right: auto;
}

.quote-section cite {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-style: normal;
}

/* Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.5s var(--ease-out-expo), transform 1.5s var(--ease-out-expo);
  animation: revealFallback 0.1s 2s forwards;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
  animation: none;
}

@keyframes revealFallback {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer */
.footer {
  grid-column: 1 / -1;
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.4s var(--ease-out-expo);
  position: relative;
}

.footer-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease-out-expo);
}

.footer-links a:hover { color: var(--text); }
.footer-links a:hover::after { width: 100%; }

.footer-copyright {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: 0.1em;
}

.footer-copyright .heart {
  color: var(--accent);
}

/* Tablet Adjustments */
@media (max-width: 1100px) {
  .nav {
    gap: 1.5rem;
  }
  .nav-links {
    gap: 1.25rem;
  }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  .page { padding: 3rem 1.25rem; padding-top: 5rem; max-width: 100vw; }
  .title { font-size: clamp(2.5rem, 12vw, 5rem); line-height: 0.9; }

  .nav {
    flex-direction: column;
    gap: 1.25rem;
    text-align: center;
    padding: 1rem 1.25rem;
  }

  .nav .brand {
    order: 1;
  }

  .nav-links {
    order: 3;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    width: 100%;
  }

  .nav-links a {
    font-size: 0.65rem;
  }

  .nav-actions {
    order: 2;
    justify-content: center;
    gap: 1.25rem;
  }

  .share-buttons {
    border-right: none;
    padding-right: 0;
  }

  .years-epithet { flex-direction: column; gap: 1rem; }
  .timeline-item { grid-template-columns: 1fr; gap: 1rem; }
  .footer-links { flex-direction: column; gap: 1.5rem; }
  .prose { font-size: 1.1rem; }
  .theme-toggle { width: 36px; height: 36px; }
  .theme-toggle svg { width: 14px; height: 14px; }
}
