/* cbdc.study - The Frozen Library of Unwritten Money */
/* Palette: Glacier White #F0F4F8, Deep Ink #1B2A4A, Steel Mist #7B8FA3, 
   Pressed Sage #C8D5B9, Foxglove Blush #D4A0A0, Ice Clarity #B8CCE2, 
   Midnight Study #1B2438, Frost Veil rgba(224,233,245,0.55) */

:root {
  --glacier-white: #F0F4F8;
  --deep-ink: #1B2A4A;
  --steel-mist: #7B8FA3;
  --pressed-sage: #C8D5B9;
  --foxglove-blush: #D4A0A0;
  --ice-clarity: #B8CCE2;
  --midnight-study: #1B2438;
  --frost-veil: rgba(224, 233, 245, 0.55);
  --text-secondary: #2D3748;
  --panel-light: #E8EDF5;
  --scroll-pct: 0%;
  --wonk-val: 0;
  --soft-val: 100;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Serif 4', Georgia, serif;
  background-color: var(--glacier-white);
  color: var(--deep-ink);
  overflow-x: hidden;
  line-height: 1.72;
  font-size: 18px;
  font-weight: 400;
}

/* Frost texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  pointer-events: none;
  filter: url(#frostNoise);
  opacity: 1;
}

.frost-filter-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Timeline Spine */
.timeline-spine {
  position: fixed;
  left: 50%;
  top: 0;
  width: 40px;
  height: 100vh;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  opacity: 0.5;
}

.spine-svg {
  width: 100%;
  height: 100%;
}

/* Scroll Progress Indicator */
.scroll-indicator {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 32px;
  height: 32px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--ice-clarity) var(--scroll-pct),
    transparent var(--scroll-pct)
  );
  box-shadow: 0 0 12px rgba(184, 204, 226, 0.3);
  opacity: 0.8;
}

.scroll-ring::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  border-radius: 50%;
  background: var(--glacier-white);
}

.scroll-fern {
  position: relative;
  z-index: 2;
}

/* Main Timeline */
.timeline {
  position: relative;
  z-index: 10;
}

/* Frost Panels */
.frost-panel {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.frost-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: backdrop-filter 1.2s ease-out, -webkit-backdrop-filter 1.2s ease-out;
  z-index: 1;
  pointer-events: none;
}

.frost-panel.is-revealed::before {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Background Botanicals */
.panel-bg-botanical {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  z-index: 0;
  opacity: 0.08;
  pointer-events: none;
}

.botanical-svg {
  width: 100%;
  height: 100%;
}

/* Geometric Overlay */
.geometric-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.geometric-svg {
  width: 100%;
  height: 100%;
}

/* Panel Content */
.panel-content {
  position: relative;
  z-index: 10;
  max-width: 38em;
  padding: 2rem;
}

.panel-content--center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.panel-content--two-column {
  display: flex;
  align-items: center;
  gap: 4rem;
  max-width: 60em;
}

.panel-content--inset {
  max-width: 48em;
}

.panel-content--scattered {
  max-width: 44em;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Frost Inset Box */
.frost-inset {
  background: var(--frost-veil);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 3rem 2.5rem;
}

/* Typography */
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--steel-mist);
  text-transform: uppercase;
  display: block;
  margin-bottom: 1rem;
}

.section-label--light {
  color: var(--ice-clarity);
}

.display-heading {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(56px, 10vw, 140px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--deep-ink);
  font-variation-settings: 'WONK' var(--wonk-val), 'SOFT' var(--soft-val);
  transition: font-variation-settings 1.5s ease-out;
  margin-bottom: 1.5rem;
}

.display-heading--light {
  color: var(--glacier-white);
}

.display-heading--question {
  font-size: clamp(36px, 7vw, 96px);
  font-weight: 500;
}

.body-text {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.72;
  color: var(--text-secondary);
  max-width: 38em;
  margin-bottom: 1.2rem;
}

.body-text--large {
  font-size: 20px;
}

.body-text--light {
  color: var(--panel-light);
}

.body-text em {
  font-weight: 600;
  font-style: italic;
}

/* Marginalia */
.marginalia {
  position: absolute;
  z-index: 15;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
}

.marginalia--right {
  right: 3vw;
}

.marginalia--left {
  left: 3vw;
}

.marginalia-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--steel-mist);
  opacity: 0.5;
  white-space: nowrap;
}

.marginalia--light .marginalia-text {
  color: var(--ice-clarity);
  opacity: 0.4;
}

/* Column Layout */
.column-illustration {
  flex-shrink: 0;
  width: 200px;
}

.coin-illustration {
  width: 100%;
  height: auto;
}

.column-text {
  flex: 1;
}

/* Code Fragments */
.code-fragments {
  margin: 2rem 0;
  width: 100%;
}

.code-fragment {
  transform: rotate(var(--fragment-rotate, 0deg)) translateX(var(--fragment-x, 0));
  margin-bottom: 0.5rem;
}

.code-fragment code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--ice-clarity);
  opacity: 0.85;
  line-height: 2;
  letter-spacing: 0.02em;
}

/* Dark Panel (Programmability) */
.panel-programmability {
  background-color: var(--midnight-study);
}

/* Study Section */
.study-continues {
  margin-top: 2rem;
}

.continue-link {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 18px;
  color: var(--deep-ink);
  text-decoration: none;
  position: relative;
  display: inline-block;
  padding-bottom: 4px;
}

.continue-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background-color: var(--ice-clarity);
  transition: width 0.8s ease-out;
}

.continue-link:hover::after {
  width: 100%;
}

.continue-link .arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}

.continue-link:hover .arrow {
  transform: translateX(4px);
}

/* Reveal Animation */
.reveal-element {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 800ms ease-out, transform 800ms ease-out;
  transition-delay: var(--reveal-delay, 0ms);
}

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

/* Responsive */
@media (max-width: 768px) {
  .panel-content--two-column {
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 1.5rem;
  }
  
  .column-illustration {
    width: 140px;
  }
  
  .panel-content {
    padding: 2rem 1.5rem;
  }
  
  .frost-inset {
    padding: 2rem 1.5rem;
  }

  .marginalia {
    display: none;
  }
  
  .display-heading {
    font-size: clamp(40px, 8vw, 80px);
  }
  
  .display-heading--question {
    font-size: clamp(28px, 6vw, 60px);
  }
  
  .timeline-spine {
    opacity: 0.3;
  }
  
  .body-text {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .panel-content--scattered {
    padding: 2rem 1rem;
  }
  
  .code-fragment {
    transform: rotate(0deg) translateX(0);
  }
  
  .code-fragment code {
    font-size: 12px;
  }
}
