/* ============================================================
   DHRUV PATIL — Personal Site
   style.css — Red & White / Deep Crimson Editorial
   ============================================================ */

/* ── CUSTOM PROPERTIES ──────────────────────────────────────── */
:root {
  /* Light mode (default) — warm parchment yellow, deep crimson accent */
  --bg:            #F5E6C8;
  --text:          #2C2116;
  --text-secondary:#7A6B5A;
  --accent:        #C41E3A;
  --accent-light:  #E8334A;
  --accent-muted:  rgba(196, 30, 58, 0.1);
  --border:        rgba(61, 50, 37, 0.08);
  --border-strong: rgba(61, 50, 37, 0.15);

  /* Particle colors — reds and warm browns */
  --particle-1:    #C41E3A;
  --particle-2:    #E8334A;
  --particle-3:    #7A6B5A;

  /* Typography */
  --font-display:  'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:     'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-label:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-pixel:    'Press Start 2P', monospace;

  /* Sizing */
  --prose-width:   680px;
  --section-gap:   clamp(100px, 12vw, 200px);
  --heading-size:  clamp(2rem, 4vw, 3.5rem);

  /* Transitions */
  --ease-golden:   cubic-bezier(0.16, 1, 0.3, 1);
  --transition-theme: background-color 0.5s ease, color 0.5s ease;
}

/* Dark mode — .dark-mode on html (early script) or body (JS toggle) */
.dark-mode {
  --bg:            #1A1508;
  --text:          #ECECEC;
  --text-secondary:#9A8E7E;
  --accent:        #E8334A;
  --accent-light:  #F04D60;
  --accent-muted:  rgba(232, 51, 74, 0.1);
  --border:        rgba(236, 220, 190, 0.08);
  --border-strong: rgba(236, 220, 190, 0.14);
  --particle-1:    #E8334A;
  --particle-2:    #C41E3A;
  --particle-3:    #9A8E7E;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* No scroll-behavior: smooth — Lenis handles scrolling */
}

body {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.05rem + 0.1vw, 1.125rem);
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  transition: var(--transition-theme);
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: #FFF8F0;
}

.dark-mode ::selection {
  color: #1A1508;
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-light);
}

/* ── LOADING SCREEN ─────────────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease, background-color 0.5s ease;
}

#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-monogram {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 400;
  color: var(--text);
  animation: loaderPulse 1.8s ease-in-out infinite;
}

@keyframes loaderPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ── LOCK SCREEN (THE GATE) ─────────────────────────────────── */
#lock-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.6s ease, background-color 0.5s ease;
}

#lock-screen.visible {
  opacity: 1;
}

#lock-screen.unlocking {
  opacity: 0;
  transition: opacity 1s ease;
}

.lock-theme-toggle {
  position: fixed;
  top: 20px;
  right: clamp(24px, 5vw, 48px);
  z-index: 9001;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.lock-theme-toggle:hover {
  color: var(--text);
  background-color: var(--border);
}

.lock-back {
  position: fixed;
  top: 20px;
  left: clamp(24px, 5vw, 48px);
  z-index: 9001;
  font-family: var(--font-label);
  font-size: 1.1rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.lock-back:hover {
  color: var(--text);
}

.lock-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 480px;
  padding: 0 24px;
  width: 100%;
  position: relative;
}

.lock-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  text-align: center;
  transition: color 0.5s ease;
}

.lock-prompt {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(0.9rem, 1rem + 0.1vw, 1.05rem);
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
  transition: color 0.5s ease;
}

.lock-form {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lock-input-wrap {
  width: 100%;
  position: relative;
}

.lock-input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-label);
  font-size: 0.95rem;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, color 0.5s ease;
  letter-spacing: 0.04em;
  text-align: center;
}

.lock-input::placeholder {
  color: var(--text-secondary);
  font-style: italic;
}

/* Red accent border on focus — the gate's only color */
.lock-input:focus {
  border-color: rgba(196, 30, 58, 0.6);
  box-shadow: 0 0 0 1px rgba(196, 30, 58, 0.15);
}

/* Hide the submit button visually — Enter key submits */
.lock-submit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  padding: 4px;
  transition: color 0.2s ease;
}

.lock-submit:hover {
  color: var(--text-secondary);
}

.lock-error {
  font-family: var(--font-label);
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-height: 1.2em;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lock-error.visible {
  opacity: 1;
}

/* Shake animation for wrong password */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(6px); }
}

.lock-input.shake {
  animation: shake 0.5s ease;
  border-color: rgba(196, 30, 58, 0.5);
}

/* Faint red decorative line on the gate */
.gate-line {
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 1px;
  background: rgba(196, 30, 58, 0.2);
}

/* ── SCROLL PROGRESS INDICATOR ─────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 1100;
  transition: none;
  pointer-events: none;
}

/* ── SITE BAR (TOP) ─────────────────────────────────────────── */
.site-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(24px, 5vw, 48px);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease, background-color 0.3s ease;
  pointer-events: none;
}

.site-bar.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.site-bar.scrolled {
  background-color: var(--bg);
  box-shadow: 0 1px 0 var(--border);
}

/* Monogram "D" in red accent */
.monogram {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

/* ── SECTION COUNTER (in bar) ──────────────────────────────── */
.section-counter {
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text);
  background-color: var(--border);
}

/* ── CONTENT FLOW ───────────────────────────────────────────── */
.content-flow {
  /* No max-width — sections are full-width sticky cards.
     Prose width constraint lives on .essay-section > * children. */
  margin: 0 auto;
  padding: 0;
  overflow: visible;
}

/* ── ESSAY SECTIONS (STICKY STACKING CARDS) ────────────────── */
.essay-section {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg);
  padding: clamp(60px, 8vh, 120px) 0;
  z-index: 1;
  transition: var(--transition-theme);
}

/* Incrementing z-index so later sections stack on top */
.essay-section[data-section="1"] { z-index: 1; }
.essay-section[data-section="2"] { z-index: 2; }
.essay-section[data-section="3"] { z-index: 3; }
.essay-section[data-section="4"] { z-index: 4; }
.essay-section[data-section="5"] { z-index: 5; }
.essay-section[data-section="6"] { z-index: 6; }
.essay-section[data-section="7"] { z-index: 7; }
.essay-section[data-section="8"] { z-index: 8; }
.essay-section[data-section="9"] { z-index: 9; }
.essay-section[data-section="10"] { z-index: 10; }
.essay-section[data-section="11"] { z-index: 11; }
.essay-section[data-section="close"] { z-index: 12; }

/* Subtle top-edge shadow on sections (except first) for stacking feel */
.essay-section:not([data-section="1"]) {
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.06);
}

/* Content inside sticky sections: constrain to prose width */
.essay-section > * {
  max-width: calc(var(--prose-width) + clamp(40px, 10vw, 64px));
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(20px, 5vw, 32px);
  padding-right: clamp(20px, 5vw, 32px);
  position: relative;
  z-index: 1;
}

/* Emoji container should be full-width, not constrained */
.essay-section > .section-emojis {
  max-width: none;
  padding: 0;
  z-index: 0;
}

.section-marker {
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  opacity: 0.5;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.essay-section h2 {
  font-family: var(--font-display);
  font-size: var(--heading-size);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: clamp(24px, 3vw, 40px);
  letter-spacing: -0.01em;
  max-width: none;
}

/* Heading letter spans for GSAP animation */
.essay-section h2 .letter {
  display: inline-block;
  opacity: 0;
  clip-path: inset(0 100% 0 0);
}

.essay-section h2 .letter-space {
  display: inline-block;
  width: 0.3em;
}

.emoji-inline {
  font-style: normal;
  font-size: 0.85em;
}

/* ── READING TIME BADGE ────────────────────────────────────── */
.reading-time-badge {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-muted);
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  margin-bottom: clamp(24px, 3vw, 40px);
  opacity: 0.85;
}

/* Prose */
.prose p {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.05rem + 0.1vw, 1.125rem);
  line-height: 1.78;
  color: var(--text);
  margin-bottom: 1.5em;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-top: 0.5em;
  margin-bottom: 1em;
  letter-spacing: -0.01em;
}

.prose hr {
  border: none;
  height: 1px;
  background: var(--border-strong);
  margin: 2.5em 0;
}

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

.prose em {
  font-style: italic;
  color: var(--text-secondary);
}

/* Section aside (italicized notes) */
.section-aside {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: clamp(20px, 2.5vw, 32px);
}

/* ── SECTION SPACER (STACKING SCROLL) ──────────────────────── */
.section-spacer {
  height: 150vh;
}

.section-spacer-close {
  height: auto;
  min-height: 60vh;
}

/* ── TEXT HIGHLIGHT UNDERLINE ──────────────────────────────── */
.highlight-line {
  position: relative;
  display: inline;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 92%;
  background-repeat: no-repeat;
  background-size: 0% 2px;
  transition: background-size 0.8s var(--ease-golden);
  padding-bottom: 2px;
}

.highlight-line.hl-active {
  background-size: 100% 2px;
}

/* ── NUMEROLOGY NUMBERS (GLOW) ─────────────────────────────── */
.num-glow {
  display: inline-block;
  font-weight: 600;
  color: var(--text);
  transition: color 0.3s ease, transform 0.3s var(--ease-golden), text-shadow 0.3s ease;
  cursor: default;
  position: relative;
}

.num-glow:hover {
  color: var(--accent);
  transform: scale(1.25);
  text-shadow: 0 0 12px var(--accent), 0 0 24px rgba(196, 30, 58, 0.3);
}

/* Sparkle particles on hover */
.num-sparkle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: sparkle-fly 0.6s ease-out forwards;
}

@keyframes sparkle-fly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--sx), var(--sy)) scale(0);
  }
}

/* ── GAMING EASTER EGG ─────────────────────────────────────── */
.emoji-controller {
  display: inline-block;
  transition: transform 0.15s ease;
}

.emoji-controller:hover {
  animation: controller-vibrate 0.3s ease infinite;
}

@keyframes controller-vibrate {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-1px, 1px) rotate(-1deg); }
  50% { transform: translate(1px, -1px) rotate(1deg); }
  75% { transform: translate(-1px, -1px) rotate(-0.5deg); }
}

.konami-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  background: rgba(196, 30, 58, 0.06);
}

.konami-overlay.konami-active {
  animation: konami-flash 2s ease forwards;
}

@keyframes konami-flash {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  50%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Konami text — RED flash */
.konami-text {
  font-family: var(--font-pixel);
  font-size: clamp(0.7rem, 1.5vw, 1rem);
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent), 0 0 40px rgba(196, 30, 58, 0.5), 0 0 80px rgba(196, 30, 58, 0.2);
  animation: konami-pulse 0.4s ease infinite alternate;
  letter-spacing: 0.05em;
}

@keyframes konami-pulse {
  from { transform: scale(1); }
  to   { transform: scale(1.05); }
}

/* ── FLOATING EMOJIS ───────────────────────────────────────── */
.section-emojis {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.float-emoji {
  position: absolute;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  opacity: 0.08;
  pointer-events: none;
  animation: float-drift var(--float-duration, 20s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

/* Position each emoji differently using nth-child */
.float-emoji:nth-child(1) { top: 15%; right: 8%; --float-duration: 18s; --float-delay: 0s; }
.float-emoji:nth-child(2) { top: 45%; right: 15%; --float-duration: 22s; --float-delay: -5s; }
.float-emoji:nth-child(3) { bottom: 20%; right: 5%; --float-duration: 25s; --float-delay: -10s; }
.float-emoji:nth-child(4) { top: 70%; right: 20%; --float-duration: 20s; --float-delay: -15s; }

@keyframes float-drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-8px, -12px) rotate(3deg); }
  50% { transform: translate(5px, -20px) rotate(-2deg); }
  75% { transform: translate(-5px, -8px) rotate(4deg); }
}

/* ── AMBIENT FLOATING PARTICLES ────────────────────────────── */
.ambient-particle {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

/* ── SIGNATURE ANIMATION ───────────────────────────────────── */
.signature-animate {
  position: relative;
  display: inline-block;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1s var(--ease-golden);
}

.signature-animate.sig-revealed {
  clip-path: inset(0 0% 0 0);
}

/* ── THE CLOSE ──────────────────────────────────────────────── */
.essay-close {
  padding-top: 20px;
}

.close-text {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--text-secondary);
}

.close-signature {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.5vw, 2.5rem);
  font-weight: 400;
  color: var(--text);
  margin-top: 48px !important;
  letter-spacing: -0.02em;
}

/* ── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
  max-width: var(--prose-width);
  margin: 0 auto;
  padding: clamp(80px, 10vw, 160px) clamp(20px, 5vw, 32px) 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.back-to-top {
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.back-to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.footer-text {
  font-family: var(--font-label);
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.5;
  letter-spacing: 0.06em;
  cursor: default;
  -webkit-user-select: text;
  user-select: text;
}

/* ── SCROLL REVEAL ──────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.reveal.visible {
  opacity: 1;
}

/* ── DECRYPTED CONTAINER ────────────────────────────────────── */
#decrypted-container {
  opacity: 0;
  animation: fadeInContent 1s ease 0.1s forwards;
}

@keyframes fadeInContent {
  to { opacity: 1; }
}

/* ── BODY LOCK (during loading/lock) ────────────────────────── */
body.locked {
  overflow: hidden;
}


/* ════════════════════════════════════════════════════════════════
   EMOTIONAL SECTION STYLING
   Each "chapter" has a subtly different character
   ════════════════════════════════════════════════════════════════ */

/* ── Sections 1-4: CLEAN, PROFESSIONAL WARMTH ──────────────── */
/* Default styling applies. Red accent appears sparingly —
   in the reading time badge, scroll progress, highlights.
   No overrides needed; the base theme IS the professional zone. */


/* ── Sections 5-6: INTROSPECTIVE, SLIGHTLY NERDY ──────────── */
/* Section markers turn red. Numerology numbers glow red.
   Section-aside text gets more presence. */
.essay-section[data-section="5"] .section-marker,
.essay-section[data-section="6"] .section-marker {
  color: var(--accent);
  opacity: 0.7;
}

.essay-section[data-section="5"] .section-aside,
.essay-section[data-section="6"] .section-aside {
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-left: 2px solid var(--accent-muted);
  padding-left: 16px;
}

/* Numerology nums in section 5 glow red on hover — already handled
   by base .num-glow:hover, but strengthen the glow here */
.essay-section[data-section="5"] .num-glow:hover {
  text-shadow: 0 0 14px var(--accent), 0 0 28px rgba(196, 30, 58, 0.35), 0 0 48px rgba(196, 30, 58, 0.15);
}


/* ── Section 7: GAMING — HIDDEN ENERGY, VULNERABLE ─────────── */
/* The most dramatic shift. Subtle dark strip even in light mode.
   Red left border that pulses. A secret being shared. */
.essay-section[data-section="7"] {
  position: sticky;
  border-left: none;
  padding-left: 0;
  margin-left: 0;
}

/* Red left accent on inner content children */
.essay-section[data-section="7"] > *:not(.section-emojis) {
  border-left: 2px solid var(--accent);
  padding-left: calc(clamp(20px, 5vw, 32px) + 24px);
}

/* Faint dark background strip in light mode — full width */
.essay-section[data-section="7"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 12, 0.025);
  z-index: 0;
  pointer-events: none;
}

.dark-mode .essay-section[data-section="7"]::before {
  background: rgba(232, 51, 74, 0.03);
}

/* Pulsing border on inner content */
.essay-section[data-section="7"] > *:not(.section-emojis) {
  animation: gaming-border-pulse 3s ease-in-out infinite;
}

@keyframes gaming-border-pulse {
  0%, 100% { border-left-color: var(--accent); }
  50%      { border-left-color: rgba(196, 30, 58, 0.35); }
}

.dark-mode .essay-section[data-section="7"] > *:not(.section-emojis) {
  animation-name: gaming-border-pulse-dark;
}

@keyframes gaming-border-pulse-dark {
  0%, 100% { border-left-color: var(--accent); }
  50%      { border-left-color: rgba(232, 51, 74, 0.3); }
}

.essay-section[data-section="7"] .section-marker {
  color: var(--accent);
  opacity: 0.6;
}

.essay-section[data-section="7"] .section-aside {
  font-size: 0.88rem;
  opacity: 0.75;
  letter-spacing: 0.01em;
}


/* ── Section 8: CARS — ASPIRATIONAL, CONFIDENT ─────────────── */
/* Bold energy. Red marker. Slightly larger heading. Generous spacing. */
.essay-section[data-section="8"] .section-marker {
  color: var(--accent);
  opacity: 0.7;
}

.essay-section[data-section="8"] h2 {
  font-size: calc(var(--heading-size) * 1.05);
  letter-spacing: -0.015em;
}

.essay-section[data-section="8"] .prose {
  letter-spacing: 0.002em;
}

.essay-section[data-section="8"] .prose p {
  margin-bottom: 1.7em;
}


/* ── Sections 9-10: RAW, HONEST, NO FILTER ─────────────────── */
/* Stripped back. Minimal decoration. Highlight underlines thinner
   and muted gray instead of red. Almost ascetic. */
.essay-section[data-section="9"],
.essay-section[data-section="10"] {
  /* Let typography do the talking */
}

.essay-section[data-section="9"] .section-marker,
.essay-section[data-section="10"] .section-marker {
  opacity: 0.35;
}

.essay-section[data-section="9"] .highlight-line,
.essay-section[data-section="10"] .highlight-line {
  background-image: linear-gradient(var(--text-secondary), var(--text-secondary));
  background-size: 0% 1px;
  padding-bottom: 1px;
}

.essay-section[data-section="9"] .highlight-line.hl-active,
.essay-section[data-section="10"] .highlight-line.hl-active {
  background-size: 100% 1px;
}


/* ── Section 11: QUIET LONGING, FUTURE-FACING ──────────────── */
/* Soft. Spacing opens up. Text exhales. */
.essay-section[data-section="11"] {
  padding-top: 8px;
}

.essay-section[data-section="11"] .section-marker {
  opacity: 0.4;
}

.essay-section[data-section="11"] .prose p {
  margin-bottom: 1.9em;
  line-height: 1.85;
}

/* The Close: signature in red */
.essay-section[data-section="close"] .close-signature {
  color: var(--accent);
}

/* Highlight in close section — keep default red */


/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .site-bar {
    padding: 16px 20px;
  }

  .content-flow {
    padding-top: clamp(60px, 10vw, 120px);
  }

  .lock-inner {
    gap: 24px;
  }

  .lock-prompt {
    font-size: 1.05rem;
  }

  .section-counter {
    font-size: 0.65rem;
  }

  .reading-time-badge {
    font-size: 0.65rem;
  }

  /* Section 7 gaming left border — tighter on mobile */
  .essay-section[data-section="7"] > *:not(.section-emojis) {
    padding-left: calc(clamp(20px, 5vw, 32px) + 16px);
    border-left-width: 2px;
  }

  /* Sections 5-6 aside indent — tighter on mobile */
  .essay-section[data-section="5"] .section-aside,
  .essay-section[data-section="6"] .section-aside {
    padding-left: 12px;
  }
}

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}


/* ════════════════════════════════════════════════════════════════
   BLOG LAYER — Public-facing homepage & post pages
   ════════════════════════════════════════════════════════════════ */

/* ── BLOG TOP BAR ──────────────────────────────────────────── */
.blog-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(24px, 5vw, 48px);
  background-color: var(--bg);
  transition: var(--transition-theme);
}

.monogram-btn {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.monogram-btn:hover {
  opacity: 0.7;
}

/* ── SIDEBAR ───────────────────────────────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 1999;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.sidebar-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.dark-mode .sidebar-overlay.open {
  background: rgba(0, 0, 0, 0.5);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 2000;
  width: clamp(280px, 35vw, 380px);
  background: var(--bg);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.4s var(--ease-golden);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: 24px clamp(20px, 4vw, 32px);
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-posts {
  list-style: none;
  padding: 8px 0;
  flex: 1;
}

.sidebar-post-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px clamp(20px, 4vw, 32px);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.sidebar-post-link:hover {
  background-color: var(--accent-muted);
}

.sidebar-post-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  transition: color 0.2s ease;
}

.sidebar-post-link:hover .sidebar-post-title {
  color: var(--accent);
}

.sidebar-post-subtitle {
  font-family: var(--font-label);
  font-size: 0.78rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.sidebar-empty {
  padding: 24px clamp(20px, 4vw, 32px);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

body.sidebar-open {
  overflow: hidden;
}

/* ── BLOG HERO ─────────────────────────────────────────────── */
.blog-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(20px, 5vw, 32px);
}

.blog-hero {
  text-align: center;
}

.blog-hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.blog-hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.1rem + 0.1vw, 1.2rem);
  color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
}

.blog-hero-line {
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: 32px auto 0;
  opacity: 0.4;
}

/* ── BLOG FEED ─────────────────────────────────────────────── */
.blog-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.blog-feed-empty {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-secondary);
  opacity: 0.6;
}

.blog-post-card {
  border-top: 1px solid var(--border);
}

.blog-post-card a {
  display: block;
  padding: clamp(24px, 3vw, 40px) 0;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.blog-post-card a:hover .blog-post-title {
  color: var(--accent);
}

.blog-post-date {
  font-family: var(--font-label);
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 8px;
}

.blog-post-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.blog-post-excerpt {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── BLOG FOOTER ───────────────────────────────────────────── */
.blog-footer {
  max-width: var(--prose-width);
  margin: 0 auto;
  padding: 48px clamp(20px, 5vw, 32px);
  text-align: center;
}

/* ── POST PAGE ─────────────────────────────────────────────── */
.post-main {
  max-width: calc(var(--prose-width) + clamp(40px, 10vw, 64px));
  margin: 0 auto;
  padding: clamp(100px, 15vh, 160px) clamp(20px, 5vw, 32px) clamp(80px, 10vw, 160px);
}

.post-header {
  margin-bottom: clamp(40px, 5vw, 64px);
}

.post-back {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-bottom: 32px;
  transition: color 0.2s ease;
}

.post-back:hover {
  color: var(--accent);
}

.post-title {
  font-family: var(--font-display);
  font-size: var(--heading-size);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-label);
  font-size: 0.78rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.post-meta-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-secondary);
  opacity: 0.4;
}

.post-body {
  /* Uses .prose class from base styles */
}


/* ── SECRET DOOR (gate wash) ────────────────────────────────── */
.gate-wash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.gate-wash.filling {
  opacity: 1;
  pointer-events: all;
}


/* ── GENESIS POST (sidebar) ─────────────────────────────────── */
.sidebar-post-link--genesis {
  background: var(--accent);
}

.sidebar-post-link--genesis .sidebar-post-title {
  color: #F5E6C8;
}

.sidebar-post-link--genesis .sidebar-post-subtitle {
  color: rgba(245, 230, 200, 0.6);
}

.sidebar-post-link--genesis:hover {
  background-color: var(--bg);
}

.sidebar-post-link--genesis:hover .sidebar-post-title {
  color: var(--text);
}

.sidebar-post-link--genesis:hover .sidebar-post-subtitle {
  color: var(--text-secondary);
}

.dark-mode .sidebar-post-link--genesis .sidebar-post-title {
  color: #1A1508;
}

.dark-mode .sidebar-post-link--genesis .sidebar-post-subtitle {
  color: rgba(26, 21, 8, 0.5);
}

.dark-mode .sidebar-post-link--genesis:hover .sidebar-post-title {
  color: var(--text);
}

/* ── GENESIS POST (page) ───────────────────────────────────── */
.post-main--genesis {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
}

.genesis-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.genesis-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: clamp(32px, 5vh, 60px);
}

.genesis-body p {
  text-align: center;
  font-size: clamp(1.1rem, 1.2rem + 0.2vw, 1.35rem);
  line-height: 1.9;
  margin-bottom: 0.8em;
}

.genesis-body .genesis-equation {
  font-family: var(--font-label);
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-top: 0.5em;
  margin-bottom: 0;
}

/* Typing cursor */
.genesis-body .typing::after {
  content: '|';
  color: var(--accent);
  font-weight: 300;
}

.genesis-timestamp {
  display: block;
  font-family: var(--font-label);
  font-size: 0.72rem;
  color: var(--text-secondary);
  opacity: 0;
  letter-spacing: 0.06em;
  margin-top: 48px;
  transition: opacity 1.5s ease;
}

.genesis-timestamp.gen-time-visible {
  opacity: 0.6;
}

/* ── DRAFT MENU TOGGLE (fixed, visible post-unlock) ────────── */
.draft-menu-toggle {
  position: fixed;
  top: 20px;
  left: clamp(24px, 5vw, 48px);
  z-index: 1001;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: opacity 0.2s ease;
  display: none;
}

.draft-menu-toggle:hover {
  opacity: 0.7;
}

.draft-menu-toggle.visible {
  display: block;
}

/* ── SCROLL TO TOP BUTTON ───────────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(196, 30, 58, 0.15);
  color: var(--accent);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background-color 0.2s ease;
  cursor: pointer;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: all;
}

.scroll-top:hover {
  background: rgba(196, 30, 58, 0.25);
}

@media (max-width: 600px) {
  .scroll-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* ── HOMEPAGE EPIGRAPH ─────────────────────────────────────── */
.blog-epigraph {
  text-align: center;
  margin-top: clamp(60px, 10vh, 120px);
  opacity: 0.35;
  transition: opacity 0.5s ease;
}

.blog-epigraph:hover {
  opacity: 0.6;
}

.blog-epigraph p {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 0.4em;
}

.blog-epigraph .epigraph-equation {
  font-family: var(--font-label);
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-top: 0.5em;
  margin-bottom: 0;
}

.blog-epigraph .epigraph-time {
  font-family: var(--font-label);
  font-style: normal;
  font-size: 0.65rem;
  color: var(--text-secondary);
  opacity: 0.5;
  letter-spacing: 0.04em;
  margin-top: 16px;
  display: block;
}

/* ── BLOG RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 600px) {
  .blog-bar {
    padding: 16px 20px;
  }

  .sidebar {
    width: 85vw;
  }
}
