/* ========================================
   PORTFOLIO — Wuthering Heights gothic romance aesthetic
   Warm parchment tones, deep burgundy accents, IM Fell French Canon + EB Garamond
   ======================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Palette — light parchment & mossy chartreuse */
  --bg:        #fdfcfa;
  --bg-raised: #fdfcfa;
  --bg-card:   #fefdfb;
  --bg-hover:  #f0ece4;
  --border:    #d6cfb8;
  --text:      #2a1810;
  --text-dim:  #5e4636;
  --text-muted:#967b65;
  --accent:    #291C17;
  --accent-2:  #291C17;
  --accent-3:  #291C17;
  --accent-4:  #3d2b23;
  --accent-red:#291C17;

  /* Typography */
  --font-display: 'IM Fell French Canon', serif;
  --font-body: 'EB Garamond', 'Georgia', 'Times New Roman', serif;

  /* Spacing */
  --container: 1120px;
  --gap: 24px;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

/* Subtle Carrara marble parallax texture — toned down so paintings carry the visual weight */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    /* Fine veining layer */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.04' numOctaves='5' seed='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.06' intercept='0'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)' fill='%23857b6f'/%3E%3C/svg%3E"),
    /* Broad vein layer */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='1200'%3E%3Cfilter id='v'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 0.015' numOctaves='3' seed='8'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.045' intercept='0'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23v)' fill='%236e645a'/%3E%3C/svg%3E");
  background-size: 800px 800px, 1200px 1200px;
}

/* Ensure all content sits above the marble texture */
body > * {
  position: relative;
  z-index: 1;
}

a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent);
}

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

/* ---------- Container ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: none;
}

/* Soft gradient fade below nav — no harsh line */
.nav::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 24px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.02), transparent);
  pointer-events: none;
  mask-image: linear-gradient(to bottom, black, transparent);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gap);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 28px;
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.02em;
}
.nav-links a:hover,
.nav-links a.active {
  color: #fff;
}

/* Reading page — white nav over dark hero, matching home page */
body:has(.reading-hero) .nav-logo {
  color: #fff;
}
body:has(.reading-hero) .nav-links a {
  color: rgba(255, 255, 255, 0.7);
}
body:has(.reading-hero) .nav-links a:hover,
body:has(.reading-hero) .nav-links a.active {
  color: #fff;
}
body:has(.reading-hero) .nav-toggle-bar {
  background: #fff;
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 1.5px;
  background: #fff;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

/* Animate to X when open */
.nav-toggle.open .nav-toggle-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-toggle.open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ---------- Accent ---------- */
.accent {
  color: var(--accent);
}

/* ---------- Tag ---------- */
.tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  font-style: italic;
  padding: 4px 14px;
  border-radius: 4px;
  background: rgba(122, 154, 58, 0.1);
  backdrop-filter: blur(4px);
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* ========================================
   HERO
   ======================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 60px;
  padding-bottom: 80px;
  overflow: hidden;
}

/* Full-bleed painting background */
.hero-painting {
  position: absolute;
  inset: 0;
  background: url('../images/still life.jpeg') center 40%/cover no-repeat;
  transform: scale(1.25);
  transition: opacity 0.6s ease;
  z-index: 0;
}

/* Subtle full-bleed darkening overlay for legibility */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.34);
}

/* Grid background — disabled */
.hero-grid-bg {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
}

/* Decorative white border box */
.hero-box {
  border: 1px solid #fff;
  padding: 40px 44px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
  color: #fff;
}

.hero-bio {
  font-family: var(--font-body);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
  max-width: 560px;
  margin-bottom: 28px;
}

.hero-meta {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tag {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  padding: 5px 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  letter-spacing: 0.14em;
  z-index: 2;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  animation: scrollBounce 2.4s ease-in-out infinite;
}

.scroll-line {
  width: 2px;
  height: 56px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 1), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ========================================
   SECTIONS — Shared
   ======================================== */
.section {
  padding: 80px 0;
  position: relative;
}

.section-alt {
  background: var(--bg-raised);
}

.section-header {
  margin-bottom: 48px;
}

.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 16px;
}

.section-subtitle {
  font-family: var(--font-body);
  color: var(--text-dim);
  font-size: 17px;
  font-style: italic;
  max-width: 520px;
}

/* ========================================
   ART INTERLUDES — full-bleed painting breaks
   ======================================== */
.art-interlude {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.art-interlude img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 60vh;
  object-fit: cover;
}

/* ---------- Subsections ---------- */
.subsection {
  margin-bottom: 48px;
}

.subsection:last-child {
  margin-bottom: 0;
}

.subsection-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  font-style: italic;
  color: var(--text-dim);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

/* ========================================
   AUDIO
   ======================================== */
.audio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--gap);
}

.audio-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}
.audio-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.audio-embed {
  width: 100%;
  aspect-ratio: 3 / 1;
  position: relative;
  overflow: hidden;
}

.audio-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.audio-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-hover));
  padding: 20px;
}

/* Waveform — sharp bars, animate on hover only */
.waveform {
  display: flex;
  align-items: end;
  gap: 1.5px;
  height: 48px;
  width: 100%;
  padding: 0 12px;
}

.waveform span {
  display: block;
  flex: 1;
  max-width: 4px;
  min-width: 1px;
  border-radius: 0.5px;
  background: var(--accent);
  opacity: 0.35;
  transform-origin: bottom;
  transition: height 0.08s ease, transform 0.15s ease, opacity 0.15s ease;
}

/* Play button for audio waveform cards */
.audio-link {
  text-decoration: none;
  display: block;
}

.waveform-play {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: none;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin-right: 12px;
}

.waveform-play svg {
  width: 14px;
  height: 14px;
  margin-left: 2px;
}

.audio-card:hover .waveform-play {
  background: var(--accent);
  color: var(--bg-card);
}

.audio-placeholder:has(.waveform-play) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.waveform span:nth-child(1)  { height: 20%; }
.waveform span:nth-child(2)  { height: 45%; }
.waveform span:nth-child(3)  { height: 70%; }
.waveform span:nth-child(4)  { height: 50%; }
.waveform span:nth-child(5)  { height: 90%; }
.waveform span:nth-child(6)  { height: 60%; }
.waveform span:nth-child(7)  { height: 80%; }
.waveform span:nth-child(8)  { height: 40%; }
.waveform span:nth-child(9)  { height: 65%; }
.waveform span:nth-child(10) { height: 95%; }
.waveform span:nth-child(11) { height: 55%; }
.waveform span:nth-child(12) { height: 75%; }
.waveform span:nth-child(13) { height: 35%; }
.waveform span:nth-child(14) { height: 85%; }
.waveform span:nth-child(15) { height: 50%; }
.waveform span:nth-child(16) { height: 70%; }
.waveform span:nth-child(17) { height: 40%; }
.waveform span:nth-child(18) { height: 60%; }
.waveform span:nth-child(19) { height: 30%; }
.waveform span:nth-child(20) { height: 50%; }
.waveform span:nth-child(21) { height: 45%; }
.waveform span:nth-child(22) { height: 80%; }
.waveform span:nth-child(23) { height: 55%; }
.waveform span:nth-child(24) { height: 90%; }
.waveform span:nth-child(25) { height: 35%; }
.waveform span:nth-child(26) { height: 70%; }
.waveform span:nth-child(27) { height: 50%; }
.waveform span:nth-child(28) { height: 85%; }
.waveform span:nth-child(29) { height: 40%; }
.waveform span:nth-child(30) { height: 65%; }
.waveform span:nth-child(31) { height: 75%; }
.waveform span:nth-child(32) { height: 45%; }
.waveform span:nth-child(33) { height: 90%; }
.waveform span:nth-child(34) { height: 60%; }
.waveform span:nth-child(35) { height: 80%; }
.waveform span:nth-child(36) { height: 30%; }
.waveform span:nth-child(37) { height: 55%; }
.waveform span:nth-child(38) { height: 70%; }
.waveform span:nth-child(39) { height: 40%; }
.waveform span:nth-child(40) { height: 60%; }
.waveform span:nth-child(41) { height: 55%; }
.waveform span:nth-child(42) { height: 75%; }
.waveform span:nth-child(43) { height: 35%; }
.waveform span:nth-child(44) { height: 85%; }
.waveform span:nth-child(45) { height: 50%; }
.waveform span:nth-child(46) { height: 65%; }
.waveform span:nth-child(47) { height: 40%; }
.waveform span:nth-child(48) { height: 90%; }
.waveform span:nth-child(49) { height: 55%; }
.waveform span:nth-child(50) { height: 70%; }
.waveform span:nth-child(51) { height: 45%; }
.waveform span:nth-child(52) { height: 80%; }
.waveform span:nth-child(53) { height: 30%; }
.waveform span:nth-child(54) { height: 65%; }
.waveform span:nth-child(55) { height: 55%; }
.waveform span:nth-child(56) { height: 75%; }
.waveform span:nth-child(57) { height: 40%; }
.waveform span:nth-child(58) { height: 85%; }
.waveform span:nth-child(59) { height: 50%; }
.waveform span:nth-child(60) { height: 60%; }

/* Animate only on card hover */
.audio-card:hover .waveform span {
  opacity: 1;
  animation: waveformBounce 0.8s ease-in-out infinite;
}

.audio-card:hover .waveform span:nth-child(1)  { animation-delay: 0.00s; }
.audio-card:hover .waveform span:nth-child(2)  { animation-delay: 0.04s; }
.audio-card:hover .waveform span:nth-child(3)  { animation-delay: 0.08s; }
.audio-card:hover .waveform span:nth-child(4)  { animation-delay: 0.12s; }
.audio-card:hover .waveform span:nth-child(5)  { animation-delay: 0.16s; }
.audio-card:hover .waveform span:nth-child(6)  { animation-delay: 0.20s; }
.audio-card:hover .waveform span:nth-child(7)  { animation-delay: 0.24s; }
.audio-card:hover .waveform span:nth-child(8)  { animation-delay: 0.28s; }
.audio-card:hover .waveform span:nth-child(9)  { animation-delay: 0.32s; }
.audio-card:hover .waveform span:nth-child(10) { animation-delay: 0.36s; }
.audio-card:hover .waveform span:nth-child(11) { animation-delay: 0.40s; }
.audio-card:hover .waveform span:nth-child(12) { animation-delay: 0.44s; }
.audio-card:hover .waveform span:nth-child(13) { animation-delay: 0.48s; }
.audio-card:hover .waveform span:nth-child(14) { animation-delay: 0.52s; }
.audio-card:hover .waveform span:nth-child(15) { animation-delay: 0.56s; }
.audio-card:hover .waveform span:nth-child(16) { animation-delay: 0.60s; }
.audio-card:hover .waveform span:nth-child(17) { animation-delay: 0.64s; }
.audio-card:hover .waveform span:nth-child(18) { animation-delay: 0.68s; }
.audio-card:hover .waveform span:nth-child(19) { animation-delay: 0.72s; }
.audio-card:hover .waveform span:nth-child(20) { animation-delay: 0.76s; }
.audio-card:hover .waveform span:nth-child(21) { animation-delay: 0.80s; }
.audio-card:hover .waveform span:nth-child(22) { animation-delay: 0.84s; }
.audio-card:hover .waveform span:nth-child(23) { animation-delay: 0.88s; }
.audio-card:hover .waveform span:nth-child(24) { animation-delay: 0.92s; }
.audio-card:hover .waveform span:nth-child(25) { animation-delay: 0.96s; }
.audio-card:hover .waveform span:nth-child(26) { animation-delay: 1.00s; }
.audio-card:hover .waveform span:nth-child(27) { animation-delay: 1.04s; }
.audio-card:hover .waveform span:nth-child(28) { animation-delay: 1.08s; }
.audio-card:hover .waveform span:nth-child(29) { animation-delay: 1.12s; }
.audio-card:hover .waveform span:nth-child(30) { animation-delay: 1.16s; }
.audio-card:hover .waveform span:nth-child(31) { animation-delay: 1.20s; }
.audio-card:hover .waveform span:nth-child(32) { animation-delay: 1.24s; }
.audio-card:hover .waveform span:nth-child(33) { animation-delay: 1.28s; }
.audio-card:hover .waveform span:nth-child(34) { animation-delay: 1.32s; }
.audio-card:hover .waveform span:nth-child(35) { animation-delay: 1.36s; }
.audio-card:hover .waveform span:nth-child(36) { animation-delay: 1.40s; }
.audio-card:hover .waveform span:nth-child(37) { animation-delay: 1.44s; }
.audio-card:hover .waveform span:nth-child(38) { animation-delay: 1.48s; }
.audio-card:hover .waveform span:nth-child(39) { animation-delay: 1.52s; }
.audio-card:hover .waveform span:nth-child(40) { animation-delay: 1.56s; }
.audio-card:hover .waveform span:nth-child(41) { animation-delay: 1.60s; }
.audio-card:hover .waveform span:nth-child(42) { animation-delay: 1.64s; }
.audio-card:hover .waveform span:nth-child(43) { animation-delay: 1.68s; }
.audio-card:hover .waveform span:nth-child(44) { animation-delay: 1.72s; }
.audio-card:hover .waveform span:nth-child(45) { animation-delay: 1.76s; }
.audio-card:hover .waveform span:nth-child(46) { animation-delay: 1.80s; }
.audio-card:hover .waveform span:nth-child(47) { animation-delay: 1.84s; }
.audio-card:hover .waveform span:nth-child(48) { animation-delay: 1.88s; }
.audio-card:hover .waveform span:nth-child(49) { animation-delay: 1.92s; }
.audio-card:hover .waveform span:nth-child(50) { animation-delay: 1.96s; }
.audio-card:hover .waveform span:nth-child(51) { animation-delay: 2.00s; }
.audio-card:hover .waveform span:nth-child(52) { animation-delay: 2.04s; }
.audio-card:hover .waveform span:nth-child(53) { animation-delay: 2.08s; }
.audio-card:hover .waveform span:nth-child(54) { animation-delay: 2.12s; }
.audio-card:hover .waveform span:nth-child(55) { animation-delay: 2.16s; }
.audio-card:hover .waveform span:nth-child(56) { animation-delay: 2.20s; }
.audio-card:hover .waveform span:nth-child(57) { animation-delay: 2.24s; }
.audio-card:hover .waveform span:nth-child(58) { animation-delay: 2.28s; }
.audio-card:hover .waveform span:nth-child(59) { animation-delay: 2.32s; }
.audio-card:hover .waveform span:nth-child(60) { animation-delay: 2.36s; }

@keyframes waveformBounce {
  0%, 100% { transform: scaleY(0.3); }
  50%      { transform: scaleY(1.2); }
}

/* SoundCloud-style custom player */
.audio-player {
  position: relative;
}
.player-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-hover));
}
.player-play {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 2px;
  border: none;
  background: var(--accent);
  color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.player-play svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}
.player-play .icon-pause {
  display: none;
}
.player-play.playing .icon-play {
  display: none;
}
.player-play.playing .icon-pause {
  display: block;
}
.player-play:hover {
  background: var(--accent-2);
  transform: scale(1.05);
}
.player-play .icon-play svg {
  margin-left: 2px;
}

.player-waveform {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}
.player-waveform .waveform {
  height: 48px;
}

/* Disable hover-bounce on player waveform while playing — progress drives opacity instead */
.audio-player.is-playing:hover .waveform span {
  animation: none;
}
.audio-player .waveform span {
  opacity: 0.2;
  transition: height 0.08s ease, opacity 0.1s;
}
.audio-player .waveform span.played {
  opacity: 1;
}
.audio-player.is-playing .waveform span {
  opacity: 0.85;
}
.audio-player.is-playing .waveform span.played {
  opacity: 1;
}

.player-time {
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

.audio-info {
  padding: 16px 20px;
}

.audio-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.audio-meta {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
}

/* ========================================
   VIDEO
   ======================================== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--gap);
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}
.video-card:hover {
  border-color: var(--accent-2);
  transform: translateY(-2px);
}

.video-horizontal .video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-hover);
}

.video-horizontal .video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Custom thumbnail + play button overlay */
.video-thumb {
  position: absolute;
  inset: 0;
  cursor: pointer;
  z-index: 1;
  overflow: hidden;
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.75);
  transition: filter 0.4s ease;
}
.video-card:hover .video-thumb img {
  filter: brightness(1);
}
/* Keep play button above the colour overlay */
.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 56px;
  height: 40px;
  background: var(--accent);
  border: 2px solid var(--accent-2);
  border-radius: 2px;
  color: #fcf9f4;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.video-play svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}
.video-play:hover {
  background: var(--accent-2);
  transform: translate(-50%, -50%) scale(1.1);
}

.video-info {
  padding: 16px 20px;
}

.video-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.video-meta {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
}

/* Shorts (vertical) */
.shorts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--gap);
}

.video-vertical .video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: var(--bg-hover);
}

.video-vertical .video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-vertical:hover {
  border-color: var(--accent-3);
}

/* ========================================
   WRITING & EDITING
   ======================================== */

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  padding: 6px 16px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.filter-btn:hover {
  border-color: rgba(255, 255, 255, 0.8);
  color: #fff;
}

.filter-btn.active {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.8);
  color: #fff;
}

/* Writing section — still life background */
.writing-section {
  position: relative;
  overflow: hidden;
  min-height: 600px;
}
.writing-bg {
  position: absolute;
  inset: 0;
  background: url('../images/still life 2.jpeg') center top/cover no-repeat;
  transform: scale(1.15);
  z-index: 0;
}
.writing-dark-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.34);
  z-index: 0;
}
.writing-section .container {
  position: relative;
  z-index: 1;
}

/* Two-column hero: header left, featured right */
.writing-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 32px;
}
.writing-hero-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.writing-hero-left .section-header {
  margin-bottom: 0;
}
.writing-section .section-label {
  color: rgba(255, 255, 255, 0.8);
}
.writing-section .section-title {
  color: #fff;
}
.writing-section .section-subtitle {
  color: rgba(255, 255, 255, 0.85);
}
.writing-hero-left .filter-bar {
  margin-bottom: 0;
}

/* Featured Piece */
.featured-piece {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 0.25s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.featured-piece:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.featured-image {
  position: relative;
  overflow: hidden;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.featured-piece:hover .featured-image img {
  transform: scale(1.03);
}

.featured-badge {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  font-style: italic;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-block;
  margin-bottom: 16px;
}

.featured-content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-content .tag {
  margin-bottom: 16px;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
}

.featured-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
  line-height: 1.3;
  color: #fff;
}

.featured-excerpt {
  font-family: var(--font-body);
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.read-link {
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: gap 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 5px 16px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.read-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

/* Writing Grid */
.writing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.writing-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  padding: 28px;
  transition: border-color 0.25s, transform 0.25s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.writing-card:hover {
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.writing-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.writing-card .tag {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
}

.writing-date {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.6);
}

.writing-card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: #fff;
}

a.writing-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.writing-card-excerpt {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
  margin-bottom: 16px;
}

/* Audio section — bouquet background (same treatment as writing) */
.audio-section {
  position: relative;
  overflow: hidden;
}
.audio-bg {
  position: absolute;
  inset: 0;
  background: url('../images/bouquet.jpeg') center 30%/cover no-repeat;
  transform: scale(1.15);
  z-index: 0;
}
.audio-dark-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.34);
  z-index: 0;
}
.audio-section .container {
  position: relative;
  z-index: 1;
}
.audio-section .section-label {
  color: rgba(255, 255, 255, 0.8);
}
.audio-section .section-title {
  color: #fff;
}
.audio-section .section-subtitle {
  color: rgba(255, 255, 255, 0.85);
}
.audio-section .audio-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.audio-section .audio-card:hover {
  border-color: rgba(255, 255, 255, 0.5);
}
.audio-section .player-controls {
  background: rgba(255, 255, 255, 0.06);
}
.audio-section .player-play {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.audio-section .player-play:hover {
  background: rgba(255, 255, 255, 0.35);
}
.audio-section .waveform span {
  background: rgba(255, 255, 255, 0.7);
}
.audio-section .player-time {
  color: rgba(255, 255, 255, 0.7);
}
.audio-section .audio-title {
  color: #fff;
}
.audio-section .audio-meta {
  color: rgba(255, 255, 255, 0.6);
}

/* Filtering: hidden cards */
.writing-card.hidden,
.featured-piece.hidden,
.book-card.hidden,
.book-year-heading.hidden {
  display: none;
}

/* Year headings inside book grid */
.book-year-heading {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  margin-top: 8px;
  margin-bottom: -8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.book-year-heading:first-child {
  margin-top: 0;
}

/* ========================================
   GROWTH
   ======================================== */
.growth-timeline {
  position: relative;
  padding-left: 40px;
}

/* Timeline vertical line with gothic terminal caps */
.growth-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}

/* Small fleur cap at bottom of the line */
.growth-timeline::after {
  content: '';
  position: absolute;
  left: 1px;
  bottom: 0;
  width: 11px;
  height: 11px;
  border: 1px solid var(--border);
  transform: rotate(45deg);
  background: var(--bg);
}

.growth-item {
  position: relative;
  margin-bottom: 48px;
}
.growth-item:last-child {
  margin-bottom: 0;
}

/* Per-item line segment that glows on hover */
.growth-item::before {
  content: '';
  position: absolute;
  left: -34px;
  top: 0;
  bottom: -48px;
  width: 1px;
  background: transparent;
  z-index: 0;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}
.growth-item:last-child::before {
  bottom: 0;
}

.growth-item:hover::before {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(122, 154, 58, 0.3);
}

/* Gothic flourish marker — subtle pointed diamond */
.growth-marker {
  position: absolute;
  left: -40px;
  top: 6px;
  width: 13px;
  height: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  transform: rotate(45deg);
  z-index: 1;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

/* Inner dot detail */
.growth-marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  background: var(--border);
  transform: translate(-50%, -50%);
  transition: background 0.4s ease, width 0.4s ease, height 0.4s ease;
}

/* Hover — gentle scale and accent shift */
.growth-item:hover .growth-marker {
  transform: rotate(45deg) scale(1.15);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(122, 154, 58, 0.2);
}

.growth-item:hover .growth-marker::after {
  background: var(--accent);
  width: 4px;
  height: 4px;
}

/* First marker — accent-filled */
.growth-item:first-child .growth-marker {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(122, 154, 58, 0.2);
}

.growth-item:first-child .growth-marker::after {
  background: #fff;
}

.growth-item:first-child:hover .growth-marker {
  box-shadow: 0 0 12px rgba(122, 154, 58, 0.35);
}

/* Growth card — add border glow transition */
.growth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 32px;
  transition: border-color 0.25s, box-shadow 0.35s ease;
}
.growth-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(122, 154, 58, 0.08);
}

.growth-role h4 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}

.growth-company {
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
  color: var(--accent);
  margin-right: 12px;
}

.growth-date {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
}

.growth-desc {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.8;
  margin-top: 16px;
  margin-bottom: 20px;
}

.growth-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-3);
  letter-spacing: 0.01em;
}

.stat-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-style: italic;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ========================================
   READING PAGE
   ======================================== */
/* Reading Hero — dark painting background like writing/audio sections */
.reading-hero {
  position: relative;
  overflow: hidden;
  padding: 140px 0 48px;
}
.reading-hero-bg {
  position: absolute;
  inset: 0;
  background: url('../images/still life.jpg') center 40%/cover no-repeat;
  transform: scale(1.15);
  z-index: 0;
}
.reading-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.34);
  z-index: 0;
}
.reading-hero .container {
  position: relative;
  z-index: 1;
}
.reading-hero .section-header {
  margin-bottom: 0;
}
.reading-hero .section-title {
  color: #fff;
}
.reading-hero .section-subtitle {
  color: rgba(255, 255, 255, 0.85);
}

/* Book toolbar — filter left, legend right */
.book-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.book-toolbar .filter-bar {
  margin-bottom: 0;
}
.book-toolbar .filter-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.book-toolbar .filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.book-toolbar .filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Reading legend (heart/star key) */
.reading-legend {
  display: flex;
  gap: 20px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.legend-icon {
  width: 16px;
  height: 23px;
  flex-shrink: 0;
}

/* Reading Stats Chart */
.reading-stats {
  padding: 48px 0 0;
}
.chart-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--text);
  margin-bottom: 28px;
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.chart-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chart-tab {
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  padding: 6px 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.2s;
}
.chart-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}
.chart-tab.active {
  background: #2A1B3D;
  border-color: #2A1B3D;
  color: #fdfcfa;
}
.chart-year-select {
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  padding: 6px 28px 6px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  letter-spacing: 0.02em;
  appearance: none;
  -webkit-appearance: none;
  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='%235e4636'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.chart-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}
.chart-rating-select {
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  padding: 6px 28px 6px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  letter-spacing: 0.02em;
  appearance: none;
  -webkit-appearance: none;
  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='%235e4636'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.chart-year-filter[hidden],
.chart-rating-filter[hidden] {
  display: none;
}

/* Collapse button on expanded POV parent */
.bubble-collapse {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: background 0.2s ease;
}
.bubble-collapse:hover {
  background: var(--border);
}

/* Chart bars */
.chart-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chart-row {
  display: grid;
  grid-template-columns: 140px 1fr 36px;
  align-items: center;
  gap: 16px;
}
.chart-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-style: normal;
  color: var(--text);
  text-align: right;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart-bar-track {
  height: 28px;
  background: var(--bg-hover);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.chart-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0;
}
.chart-count {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  text-align: left;
  min-width: 20px;
}

/* Trope legend */
.trope-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.trope-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.trope-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Trope bar expanded book list */
.trope-books {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  margin-left: 156px;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.5;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}
.trope-books.open {
  max-height: 600px;
  padding: 6px 0 10px;
}
.trope-book-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid var(--bg-hover);
}
.trope-book-item:last-child {
  border-bottom: none;
}
.trope-book-title {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  flex: 1;
}
.trope-book-author {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
  flex-shrink: 0;
}
.trope-book-stars {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  flex-shrink: 0;
}
.chart-row.trope-row {
  cursor: pointer;
}
.chart-row.trope-row:hover .chart-label {
  color: var(--text);
}

/* Trope description tooltip (on label hover) */
.trope-desc-tip {
  position: fixed;
  background: var(--text);
  color: #fdfcfa;
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  padding: 8px 14px;
  border-radius: 6px;
  z-index: 200;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.trope-desc-tip.visible {
  opacity: 1;
}

/* Secret recipes tab */
.recipe-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.recipe-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px 22px;
  background: var(--bg-card);
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateY(8px);
}
.recipe-card.in {
  opacity: 1;
  transform: translateY(0);
}
.recipe-name {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.recipe-desc {
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.recipe-books {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-dim);
}
.recipe-books span::before {
  content: '\2022 ';
  color: var(--text-muted);
}
.recipe-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 3px;
  color: #fdfcfa;
  margin-right: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* ========================================
   BOOKS OVER TIME
   ======================================== */
.chart-books-over-time {
  padding-top: 8px;
}
.bot-totals {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
}
.bot-totals strong {
  font-weight: 700;
  font-size: 18px;
}
.bot-total-divider {
  color: var(--text-dim);
}
.bot-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.bot-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-dim);
}
.bot-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bot-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ========================================
   MOOD DRIFT
   ======================================== */
.chart-mood-drift {
  padding-top: 8px;
}
.md-legend {
  display: none;
}
.md-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ========================================
   SCATTER PLOT (trope analysis)
   ======================================== */
.chart-scatter {
  position: relative;
  height: 460px;
  padding-top: 8px;
}
.scatter-area {
  position: absolute;
  top: 62px;
  left: 50px;
  right: 16px;
  bottom: 44px;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.scatter-quadrant-line-x {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  border-left: 1px dashed var(--border);
  opacity: 0.6;
}
.scatter-quadrant-line-y {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  border-top: 1px dashed var(--border);
  opacity: 0.6;
}
.scatter-quadrant-label {
  position: absolute;
  font-family: var(--font-display);
  font-size: 12px;
  font-style: italic;
  color: var(--text);
  opacity: 0.7;
  pointer-events: none;
  white-space: nowrap;
}
.scatter-dot {
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
  transform: translate(-50%, -50%) scale(0);
}
.scatter-dot:hover {
  transform: translate(-50%, -50%) scale(1.3);
  z-index: 10;
}
.scatter-dot::before {
  content: '';
  position: absolute;
  top: -8px; left: -8px; right: -8px; bottom: -8px;
}
.scatter-corner-tip {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--text);
  color: #fdfcfa;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  padding: 10px 14px;
  border-radius: 6px;
  line-height: 1.6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 20;
  max-width: 260px;
  white-space: normal;
  word-wrap: break-word;
}
.scatter-corner-tip.active {
  opacity: 1;
}
.scatter-axis-label {
  position: absolute;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text);
  letter-spacing: 0.03em;
}
.scatter-axis-label-x {
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
}
.scatter-axis-label-y {
  top: 50%;
  left: 4px;
  transform: rotate(-90deg) translateX(-50%);
  transform-origin: left center;
}
.scatter-tick {
  position: absolute;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text);
}

/* ========================================
   NARRATIVE ENERGY (axes labels)
   ======================================== */
.chart-narrative {
  height: 520px;
  padding-top: 0;
}
.chart-narrative .scatter-area {
  top: 72px;
}
.narrative-axis-left {
  bottom: 4px;
  left: 50px;
}
.narrative-axis-right {
  bottom: 4px;
  right: 16px;
}
.narrative-axis-bottom {
  bottom: 4px;
  left: calc(50% + 17px);
  transform: translateX(-50%);
  opacity: 0.7;
  font-style: italic;
}
.narrative-axis-top {
  top: 42px;
  left: calc(50% + 17px);
  transform: translateX(-50%);
  opacity: 0.7;
  font-style: italic;
}

/* ========================================
   BUBBLE CHARTS (inside chart-body)
   ======================================== */
.chart-bubbles {
  position: relative;
  min-height: 350px;
  overflow: hidden;
}
.bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--parchment);
  font-family: var(--font-body);
  font-weight: 600;
  text-align: center;
  cursor: grab;
  line-height: 1.15;
  padding: 6px;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  box-shadow: 0 2px 8px rgba(41, 28, 23, 0.15);
  transition: box-shadow 0.2s ease;
}
.bubble:hover {
  box-shadow: 0 6px 20px rgba(41, 28, 23, 0.35);
  z-index: 5;
}
.bubble:active {
  cursor: grabbing;
}
.bubble-label {
  font-size: inherit;
  pointer-events: none;
}
.bubble-tooltip {
  display: none;
  position: fixed;
  background: var(--text);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  padding: 10px 14px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
  line-height: 1.6;
}
.bubble:hover .bubble-tooltip {
  display: block;
}

.authors-panel {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--text);
  color: #fdfcfa;
  border-radius: 6px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.6;
  z-index: 50;
  max-height: calc(100% - 16px);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  max-width: 260px;
  white-space: nowrap;
}
.authors-panel.visible {
  opacity: 1;
}
.authors-panel-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.authors-panel-entry {
  margin-bottom: 6px;
}
.authors-panel-name {
  font-weight: 600;
  font-style: italic;
}
.authors-panel-books {
  color: rgba(253, 252, 250, 0.75);
}

.reading-page {
  padding-top: 48px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 24px;
}

.book-card {
  position: relative;
  transition: transform 0.25s;
}
.book-card:hover {
  transform: translateY(-4px);
}

.book-cover-wrap {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 8px 32px rgba(42, 24, 16, 0.2);
  border: 1px solid var(--border);
  transition: border-color 0.25s;
}
.book-card:hover .book-cover-wrap {
  border-color: var(--accent);
}

.book-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}

.book-hover-review {
  position: absolute;
  inset: 0;
  background: rgba(244, 236, 225, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.3s;
}

.book-hover-review p {
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.7;
  text-align: center;
  font-style: italic;
}

.book-card:hover .book-hover-review,
.book-card.review-active .book-hover-review {
  opacity: 1;
}

.book-info {
  text-align: center;
}

/* Star ratings — hidden, kept for data */
.book-stars {
  display: none;
}

.book-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: 0.01em;
}

.book-author {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
}

.book-status-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  font-style: italic;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(139, 90, 43, 0.85);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  z-index: 2;
}
.book-status-tag.tag-up-next {
  background: rgba(90, 90, 90, 0.75);
}

/* Bookmark ribbon behind badge — no longer used, kept for compat */
.book-badge-ribbon { display: none; }

/* Book cover bookmark badges (hearts / stars) */
.book-badge {
  position: absolute;
  top: 0;
  right: 12px;
  width: 36px;
  height: 52px;
  z-index: 3;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  opacity: 0.85;
}
.book-badge svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.12));
}
.book-card:hover .book-badge {
  opacity: 1;
  transform: scale(1.06);
}
.badge-heart, .badge-star {
  color: var(--accent);
}

/* Make the cover the click target for explosion */
.book-cover-wrap {
  cursor: pointer;
}

/* Heart particle containers — fixed layer on body so they float above all cards */
.book-particle-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  overflow: visible;
}
.book-particle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.book-particle svg {
  width: 100%;
  height: auto;
  display: block;
}
.book-particle img {
  width: 100%;
  height: auto;
  display: block;
}
.book-card.exploding {
  z-index: 10;
}
.book-card.exploding .book-badge {
  animation: badge-pop 0.3s cubic-bezier(0.3, 1.4, 0.5, 1);
}
@keyframes badge-pop {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* Face particle (Palmer rain) — wrap is appended to <body> with fixed positioning */
.face-particle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  border-radius: 50%;
  overflow: hidden;
}
.face-particle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Mountain particle (hill video) — same fixed-position layer as faces */
.mountain-particle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  line-height: 1;
}

/* ========================================
   ABOUT
   ======================================== */
.about-section {
  position: relative;
  overflow: hidden;
}
.about-bg {
  position: absolute;
  inset: 0;
  background: url('../images/tulips.jpeg') center 30%/cover no-repeat;
  transform: scale(1.15);
  z-index: 0;
}
.about-dark-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 0;
}
.about-section .container {
  position: relative;
  z-index: 1;
}
.about-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 60px;
  align-items: center;
}
.about-photo img {
  width: 100%;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.about-section .section-title {
  color: #fff;
  margin-bottom: 20px;
}
.about-text p {
  font-family: var(--font-body);
  font-size: 16px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.8;
  margin-bottom: 16px;
}
.about-text p:last-of-type {
  margin-bottom: 24px;
}
.about-links {
  display: flex;
  gap: 24px;
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
}
.about-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}
.about-links a:hover {
  color: #fff;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text {
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
}

/* ========================================
   PASSWORD GATE
   ======================================== */

/* When locked: hide gated nav links, sections below hero, and footer */
.site-locked .nav-gated {
  opacity: 0;
  pointer-events: none;
}

.site-locked .nav-toggle {
  display: none !important;
}

/* When locked on mobile, keep nav-links visible so "reading" link shows inline */
.site-locked .nav-links {
  position: static;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  padding: 0;
  flex-direction: row;
  align-items: center;
  height: 100%;
}

.nav-gated {
  transition: opacity 0.5s ease;
}

.site-locked .section,
.site-locked .footer,
.site-locked .art-interlude {
  display: none;
}

.site-locked .hero-scroll-hint {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
}

/* Hero painting stays visible after unlock */
.hero-painting {
  opacity: 1;
}
/* Overlay stays visible after unlock — keep the same subtle darkening */
.hero-overlay {
  opacity: 1;
}

.hero-scroll-hint {
  transition: opacity 0.8s ease 0.3s;
}

/* Gate container in hero — fixed size, no layout shift */
.hero-gate {
  margin-top: 32px;
  position: relative;
  height: 44px;          /* match button height so container never resizes */
}

.gate-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
  padding: 10px 28px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gate-btn:hover {
  background: #fff;
  color: var(--text);
}

.gate-btn.hidden {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

/* Password form — unfurls smoothly from the left via clip-path */
.gate-form {
  display: flex;
  align-items: center;
  gap: 10px;
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  clip-path: inset(0 100% 0 0);
  opacity: 0;
  transition: clip-path 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.35s ease;
}

.gate-form.visible {
  clip-path: inset(0 0 0 0);
  opacity: 1;
}

.gate-input {
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 200px;
  outline: none;
  transition: border-color 0.25s;
}

.gate-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.gate-input:focus {
  border-color: #fff;
}

.gate-submit {
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
  padding: 10px 24px;
  border: 1px solid #fff;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.25s, border-color 0.25s;
}

.gate-submit:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.85);
}

.gate-error {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: rgba(255, 200, 200, 1);
  opacity: 0;
  transition: opacity 0.3s;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  white-space: nowrap;
}

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

/* Hide gate entirely once unlocked */
.hero-gate.unlocked {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.4s ease;
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  :root {
    --gap: 16px;
  }

  .hero-title {
    font-size: 32px;
    line-height: 1.15;
  }

  .hero-name {
    font-size: 32px;
    display: block;
    line-height: 1.15;
    margin-bottom: 6px;
  }

  .hero-box {
    padding: 28px 24px;
  }

  .hero-scroll-hint {
    right: 24px;
    bottom: 24px;
  }

  .section {
    padding: 48px 0;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .art-interlude img {
    max-height: 40vh;
  }

  /* Writing hero stacks on mobile */
  .writing-hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .featured-content {
    padding: 24px;
  }

  /* Video grids */
  .video-grid {
    grid-template-columns: 1fr;
  }

  .shorts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Growth stats */
  .growth-stats {
    gap: 20px;
  }

  .growth-timeline {
    padding-left: 32px;
  }

  .growth-marker {
    left: -32px;
  }

  .growth-item::before {
    left: -26px;
  }

  /* About */
  .about-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  .about-photo img {
    max-width: 220px;
    margin: 0 auto;
    display: block;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  /* Chart */
  .chart-row {
    grid-template-columns: 100px 1fr 30px;
    gap: 10px;
  }
  .timeline-lane-label {
    width: 80px;
    min-width: 80px;
    font-size: 10px;
    padding-right: 8px;
  }
  .timeline-dot {
    width: 9px;
    height: 9px;
  }
  .chart-label {
    font-size: 12px;
  }
  .chart-bar-track {
    height: 22px;
  }

  /* Books */
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* Nav — hamburger menu */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(250, 248, 244, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 24px var(--gap);
    gap: 20px;
    font-size: 16px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .reading-hero {
    padding: 120px 0 48px;
  }
  .reading-page {
    padding-top: 32px;
  }
}

@media (max-width: 480px) {
  .shorts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .audio-grid {
    grid-template-columns: 1fr;
  }

  .writing-grid {
    grid-template-columns: 1fr;
  }

  .book-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
