@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&display=swap');

:root {
  --font-body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.625rem;
  --text-2xl: 2.0625rem;
  --text-3xl: 2.625rem;
  --text-4xl: 3.375rem;
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;
  --space-xs: 6px;
  --space-sm: 14px;
  --space-md: 28px;
  --space-lg: 48px;
  --space-xl: 64px;
  --space-2xl: 96px;
  
  --color-gold: #d4c87a;
  --color-gold-light: #e8e0a8;
  --color-gold-dark: #b8a852;
  --color-blue: #6a8fd8;
  --color-blue-light: #8ab0f0;
  --color-bg: #0c0b0a;
  --color-surface: #1a1917;
  --color-surface-elevated: #22211f;
  --color-border: #2a2824;
  --color-text: #d0cec8;
  --color-text-muted: #b0aea8;
  --color-text-heading: #e8e6e0;
}

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

html {
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  letter-spacing: -0.003em;
  padding: 48px 24px;
  min-height: 100vh;
}

/* Progress indicator */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.03);
  z-index: 1000;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-blue));
  transform-origin: left;
  transform: scaleX(0);
}

/* Main layout */
.layout {
  display: grid;
  grid-template-columns: 1fr minmax(auto, 900px) 1fr;
  gap: var(--space-xl);
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
}

.content-wrapper {
  grid-column: 2;
  background-color: var(--color-surface);
  border-radius: 20px;
  padding: var(--space-xl);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04),
              0 40px 80px -20px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}

.content-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle at center, rgba(212, 200, 122, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

/* Left accent rail */
.accent-rail {
  position: fixed;
  left: 0;
  top: 0;
  width: 3px;
  height: 100vh;
  background: linear-gradient(180deg, var(--color-gold) 0%, var(--color-surface) 100%);
  opacity: 0.25;
}

/* Typography */
h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--color-text-heading);
  line-height: var(--leading-tight);
  letter-spacing: -0.025em;
  margin-bottom: var(--space-xs);
}

h2 {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text-heading);
  line-height: var(--leading-snug);
  letter-spacing: -0.015em;
  margin: 38px 0 12px 0;
  position: relative;
  padding-left: 32px;
  display: flex;
  align-items: center;
  gap: 0;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--color-gold), var(--color-blue));
  border-radius: 2px;
}

h2.phase-subheading {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 30px 0 10px;
}

/* Sections */
.section {
  margin: 20px 0 28px;
}

.section-intro {
  margin: 12px 0 28px 0;
}

.section-list {
  margin: 8px 0 18px 30px;
}

.compact-list {
  margin-bottom: 0;
}

.list-kicker {
  margin: 22px 0 8px;
}

.section-divider {
  margin: var(--space-lg) 0;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-lg);
}

.section-final {
  margin: var(--space-lg) 0 var(--space-sm) 0;
}

blockquote {
  border-left: 3px solid var(--color-gold);
  padding-left: 20px;
  margin: 0 0 32px 0;
  font-style: italic;
  color: var(--color-text-muted);
}

blockquote p {
  margin: 0 0 8px 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

p {
  margin: 0 0 10px 0;
}

ul, ol {
  margin: 0 0 20px 30px;
}

li {
  margin-bottom: 7px;
}

strong {
  font-weight: 600;
  color: var(--color-text-heading);
}

em {
  font-style: italic;
}

/* Highlighting */
.highlight {
  background-color: var(--color-surface-elevated);
  color: var(--color-text-heading);
  padding: 2px 8px;
  border-radius: 4px;
}

.highlight-yellow {
  background-color: var(--color-gold);
  color: var(--color-bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.highlight-blue {
  background-color: var(--color-blue-light);
  color: var(--color-bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

a {
  color: var(--color-blue);
  text-decoration: none;
  text-underline-offset: 3px;
  background-image: linear-gradient(var(--color-blue), var(--color-blue));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease, color 0.2s ease;
}

a:hover {
  color: var(--color-blue-light);
  background-size: 100% 1px;
}

/* CTA Button */
.cta-button {
  display: inline-block;
  background-color: var(--color-gold);
  color: var(--color-bg);
  padding: 10px 24px;
  border-radius: 6px;
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease;
  position: relative;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 200, 122, 0.3);
  color: var(--color-bg);
}

.cta-button:active {
  transform: translateY(0);
  transition-duration: 0.1s;
}

/* Author section */
.author {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: var(--space-md) 0;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-surface-elevated) 0%, #3a3834 100%);
  position: relative;
  overflow: hidden;
  object-fit: cover;
}

.author-avatar[alt] {
  animation: none;
}

.author-avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 40%, rgba(212, 200, 122, 0.15) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

.author-name {
  font-weight: 500;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.footer-note {
  font-size: var(--text-xs);
  color: #888;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  letter-spacing: 0.02em;
}

/* Section widths for visual rhythm */
.section-wide {
  margin: 0 -48px;
  padding: 0 48px;
}

.section-narrow {
  max-width: 90%;
}

/* Scroll-driven animations */
.reveal {
  opacity: 0;
  transform: translateY(32px);
}

.reveal-visible {
  animation: revealIn 0.6s ease-out forwards;
}

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

/* Staggered children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-children.visible > *:nth-child(1) { animation: revealIn 0.5s ease-out 0.1s forwards; }
.stagger-children.visible > *:nth-child(2) { animation: revealIn 0.5s ease-out 0.2s forwards; }
.stagger-children.visible > *:nth-child(3) { animation: revealIn 0.5s ease-out 0.3s forwards; }
.stagger-children.visible > *:nth-child(4) { animation: revealIn 0.5s ease-out 0.4s forwards; }
.stagger-children.visible > *:nth-child(5) { animation: revealIn 0.5s ease-out 0.5s forwards; }

/* Parallax depth */
.parallax-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.parallax-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}

.parallax-orb-1 {
  width: 600px;
  height: 600px;
  background: var(--color-gold);
  top: -100px;
  right: -200px;
}

.parallax-orb-2 {
  width: 400px;
  height: 400px;
  background: var(--color-blue);
  bottom: 20%;
  left: -100px;
}

/* Page entrance */
.page-entrance {
  animation: fadeSlideIn 0.8s ease-out both;
}

.page-entrance-delay-1 { animation-delay: 0.15s; }
.page-entrance-delay-2 { animation-delay: 0.3s; }
.page-entrance-delay-3 { animation-delay: 0.45s; }

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  .page-entrance,
  .reveal-visible,
  .stagger-children.visible > * {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  .progress-bar-fill,
  .author-avatar::after {
    animation: none;
  }
  
  h2::before {
    opacity: 1;
    height: 60%;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  
  .content-wrapper {
    grid-column: 1;
    padding: var(--space-xl) var(--space-lg);
  }
  
  .accent-rail {
    display: none;
  }
}

@media (max-width: 640px) {
  body {
    padding: 24px 16px;
  }
  
  .content-wrapper {
    padding: var(--space-lg) var(--space-md);
    border-radius: 16px;
  }
  
  h1 {
    font-size: var(--text-3xl);
  }
  
  h2 {
    font-size: var(--text-xl);
    margin: var(--space-md) 0 var(--space-xs);
    padding-left: 0;
  }
  
  h2::before {
    display: none;
  }
  
  .section-wide {
    margin: 0;
    padding: 0;
  }
}
