/* ==========================================================================
   Impressionist Blue Theme - Hao Xu Personal Site
   Color palette inspired by Monet's water lilies and impressionist paintings
   ========================================================================== */

:root {
  /* Impressionist Blue-Violet Palette
     Inspired by Monet's Water Lilies, Renoir's skies,
     and the purple-pink twilight of impressionist gardens */
  --blue-deep: #2E3A6E;
  --blue-primary: #4E6BAE;
  --blue-mid: #7090C5;
  --blue-light: #A3BCDB;
  --blue-sky: #C5D8EE;
  --blue-wash: #EBF0F9;

  /* Purple & violet tones (impressionist twilight) */
  --lavender: #8E7CC3;
  --violet: #7B61B8;
  --violet-light: #B8A9D8;
  --violet-wash: #EDEBF6;

  /* Pink & rose tones (impressionist garden) */
  --rose: #C46B8A;
  --rose-light: #DCA0B5;
  --pink: #E488A0;
  --pink-wash: #F8EDF0;

  /* Warm accents (impressionist sunlight) */
  --gold: #D4A574;
  --peach: #E4A08A;

  /* Canvas tones — subtle warm lavender undertone */
  --canvas: #FAF8F5;
  --canvas-alt: #F2EFF0;
  --canvas-dark: #E5E1E4;

  /* Text — hint of blue-violet */
  --text-primary: #2A2D42;
  --text-secondary: #555770;
  --text-muted: #868A9E;
  --text-light: #AEB2C3;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-pixel: 'Silkscreen', monospace;

  /* Borders & Shadows — purple-tinted */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(46, 58, 110, 0.08);
  --shadow-md: 0 4px 20px rgba(46, 58, 110, 0.12);
  --shadow-lg: 0 8px 40px rgba(46, 58, 110, 0.15);
  --shadow-glow: 0 0 30px rgba(142, 124, 195, 0.18);

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   Dark Mode - Impressionist Night (Starry Night palette)
   ========================================================================== */

[data-theme="dark"] {
  --blue-deep: #C5D8EE;
  --blue-primary: #7090C5;
  --blue-mid: #4E6BAE;
  --blue-light: #3B5088;
  --blue-sky: #2A3A6E;
  --blue-wash: #1A2240;

  --violet: #B8A9D8;
  --violet-light: #7B61B8;
  --violet-wash: #1E1A30;

  --rose: #E488A0;
  --rose-light: #C46B8A;
  --pink: #DCA0B5;
  --pink-wash: #2A1A22;

  --gold: #E4C094;
  --peach: #E4A08A;

  --canvas: #141525;
  --canvas-alt: #1A1B2E;
  --canvas-dark: #2A2B42;

  --text-primary: #E8E6F0;
  --text-secondary: #B0ADBE;
  --text-muted: #8886A0;
  --text-light: #5A5870;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(142, 124, 195, 0.25);
}

[data-theme="dark"] .nav.scrolled {
  background: rgba(20, 21, 37, 0.92);
}

[data-theme="dark"] .interest-card,
[data-theme="dark"] .pub-item,
[data-theme="dark"] .blog-card {
  background: var(--canvas-alt);
}

[data-theme="dark"] .hero-name {
  color: var(--text-primary);
}

[data-theme="dark"] .hero-name .highlight {
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] ::selection {
  background: var(--violet-light);
  color: white;
}

@media (max-width: 600px) {
  [data-theme="dark"] .section-header {
    background: rgba(20, 21, 37, 0.92);
  }
}

/* Dark mode toggle */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Sun / Moon toggle --- */
.sky-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  position: relative;
}

.sky-icon {
  position: relative;
  width: 26px;
  height: 26px;
}

.sun-svg, .moon-svg {
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.4s ease;
}

/* Light mode: sun visible, moon hidden */
.sun-svg {
  color: var(--gold);
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.moon-svg {
  color: var(--violet-light);
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

/* Dark mode: moon visible, sun hidden */
[data-theme="dark"] .sun-svg {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

[data-theme="dark"] .moon-svg {
  opacity: 1;
  transform: rotate(0deg) scale(1);
  color: #F0E68C;
  filter: drop-shadow(0 0 6px rgba(240, 230, 140, 0.4));
}

.sky-toggle:hover .sun-svg {
  transform: rotate(15deg) scale(1.1);
}

.sky-toggle:hover .moon-svg {
  transform: rotate(-8deg) scale(1.1);
}

[data-theme="dark"] .sky-toggle:hover .sun-svg {
  transform: rotate(90deg) scale(0.5);
}

[data-theme="dark"] .sky-toggle:hover .moon-svg {
  transform: rotate(-8deg) scale(1.1);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  font-size: clamp(13px, 2.2vw, 18px);
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--canvas);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--violet-light);
  color: var(--blue-deep);
}

a {
  color: var(--blue-primary);
  text-decoration: none;
  transition: color 0.3s var(--ease-out);
}

a:hover {
  color: var(--blue-deep);
}

img {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   Pixel Art Icons (CSS-based)
   ========================================================================== */

.pixel-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  vertical-align: middle;
  margin-right: 6px;
}

/* Pixel flower icon */
/* --- Nav lotus (water lily / bud) --- */
.nav-lotus {
  position: relative;
  flex-shrink: 0;
  line-height: 0;
}

.lotus-open {
  display: block;
  transition: opacity 0.6s ease, transform 0.6s ease;
  transform-origin: center bottom;
}

.lotus-bud {
  position: absolute;
  left: 0;
  top: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  transform-origin: center bottom;
}

.lotus-open {
  opacity: 1;
  transform: scaleX(1) scaleY(1);
}

.lotus-bud {
  opacity: 0;
  transform: scaleX(0.4) scaleY(0.6);
}

[data-theme="dark"] .lotus-open {
  opacity: 0;
  transform: scaleX(0.4) scaleY(0.6);
}

[data-theme="dark"] .lotus-bud {
  opacity: 1;
  transform: scaleX(1) scaleY(1);
}

/* Pixel star */
/* Section flower icons */
.section-flower {
  display: inline-block;
  vertical-align: middle;
  line-height: 0;
  flex-shrink: 0;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.4s var(--ease-out);
  backdrop-filter: blur(0px);
}

.nav.scrolled {
  background: rgba(250, 247, 242, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  padding: 0.6rem 2rem;
}

.nav-logo {
  font-family: var(--font-pixel);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--blue-deep);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo .nav-lotus {
  transition: transform 0.4s var(--ease-spring);
}

.nav-logo:hover .nav-lotus {
  transform: rotate(15deg) scale(1.15);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

/* On desktop, center the dark toggle between logo and links */
@media (min-width: 769px) {
  .nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .nav-logo {
    flex: 1;
  }
  .nav-right {
    order: 2;
    flex: 0 0 auto;
  }
  .nav-links {
    order: 3;
    flex: 1;
    justify-content: flex-end;
  }
  .nav-toggle {
    display: none;
  }
}

.nav-links a {
  font-family: var(--font-pixel);
  font-size: 1.1rem;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-primary), var(--violet), var(--rose));
  transition: width 0.3s var(--ease-out);
  border-radius: 2px;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--blue-primary);
}

/* Mobile menu */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s var(--ease-out);
  border-radius: 2px;
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    flex-direction: column;
    background: var(--canvas);
    padding: 5rem 2rem;
    gap: 1.5rem;
    transition: right 0.4s var(--ease-out);
    box-shadow: var(--shadow-lg);
  }

  .nav-links.open {
    right: 0;
  }

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

/* ==========================================================================
   Hero Section (Homepage)
   ========================================================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 2rem 4rem;
  background:
    linear-gradient(170deg, #EBD8EC 0%, #D4E2F4 30%, #C8DAF0 50%, #F0D8E4 75%, #E8D0E8 100%);
}

[data-theme="dark"] .hero {
  background:
    linear-gradient(170deg, #0A0E24 0%, #0E1A38 25%, #111E45 50%, #162040 75%, #0D1530 100%);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--canvas));
  z-index: 1;
  pointer-events: none;
}

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 3rem;
}

.hero-content {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.hero-greeting {
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--blue-primary);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s var(--ease-out) 0.2s forwards;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  color: var(--blue-deep);
  line-height: 1.15;
  margin-bottom: var(--space-md);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s var(--ease-out) 0.4s forwards;
}

.hero-name .highlight {
  background: linear-gradient(120deg, var(--violet), var(--rose), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

/* Hero flower - pixel art growing from (Flower) text */
.hero-flower {
  display: inline-block;
  vertical-align: middle;
  margin-left: 2px;
  margin-top: -0.3em;
  cursor: pointer;
  position: relative;
}

.flower-svg {
  display: block;
}

/* Flower is always visible */
.flower-petals {
  transform-origin: 15px 12px;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flower-leaf {
  transition: transform 0.4s ease;
}

/* Water drops hidden by default */
.flower-drops {
  opacity: 0;
}

.flower-drops .drop {
  animation: none;
}

/* Hover & touch: watering effect — drops fall, flower sways */
.hero-flower:hover .flower-drops,
.hero-flower.watering .flower-drops {
  opacity: 1;
}

.hero-flower:hover .drop-1,  .hero-flower.watering .drop-1  { animation: dropFall 1.2s ease-in infinite 0s; }
.hero-flower:hover .drop-2,  .hero-flower.watering .drop-2  { animation: dropFall 1.2s ease-in infinite 0.2s; }
.hero-flower:hover .drop-3,  .hero-flower.watering .drop-3  { animation: dropFall 1.4s ease-in infinite 0.4s; }
.hero-flower:hover .drop-4,  .hero-flower.watering .drop-4  { animation: dropFall 1.4s ease-in infinite 0.3s; }
.hero-flower:hover .drop-5,  .hero-flower.watering .drop-5  { animation: dropFall 1.0s ease-in infinite 0.5s; }
.hero-flower:hover .drop-6,  .hero-flower.watering .drop-6  { animation: dropFall 1.0s ease-in infinite 0.1s; }
.hero-flower:hover .drop-7,  .hero-flower.watering .drop-7  { animation: dropFall 1.3s ease-in infinite 0.6s; }
.hero-flower:hover .drop-8,  .hero-flower.watering .drop-8  { animation: dropFall 1.3s ease-in infinite 0.15s; }
.hero-flower:hover .drop-9,  .hero-flower.watering .drop-9  { animation: dropFall 1.1s ease-in infinite 0.35s; }
.hero-flower:hover .drop-10, .hero-flower.watering .drop-10 { animation: dropFall 1.1s ease-in infinite 0.55s; }
.hero-flower:hover .drop-11, .hero-flower.watering .drop-11 { animation: dropFall 1.3s ease-in infinite 0.25s; }
.hero-flower:hover .drop-12, .hero-flower.watering .drop-12 { animation: dropFall 1.2s ease-in infinite 0.45s; }
.hero-flower:hover .drop-13, .hero-flower.watering .drop-13 { animation: dropFall 1.0s ease-in infinite 0.7s; }
.hero-flower:hover .drop-14, .hero-flower.watering .drop-14 { animation: dropFall 1.4s ease-in infinite 0.08s; }
.hero-flower:hover .drop-15, .hero-flower.watering .drop-15 { animation: dropFall 1.1s ease-in infinite 0.5s; }
.hero-flower:hover .drop-16, .hero-flower.watering .drop-16 { animation: dropFall 1.3s ease-in infinite 0.38s; }

.hero-flower:hover .flower-petals,
.hero-flower.watering .flower-petals {
  transform: scale(1.1);
  filter: brightness(1.1) saturate(1.2);
}

.hero-flower:hover .flower-leaf,
.hero-flower.watering .flower-leaf {
  transform: scaleX(1.15);
}

@keyframes dropFall {
  0%   { transform: translateY(0); opacity: 0; }
  8%   { opacity: 1; }
  60%  { opacity: 0.8; }
  100% { transform: translateY(30px); opacity: 0; }
}

.hero-tagline {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: var(--space-lg);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s var(--ease-out) 0.6s forwards;
}

.hero-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s var(--ease-out) 0.8s forwards;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s var(--ease-out);
  border: 2px solid transparent;
}

.hero-link.primary {
  background: var(--blue-primary);
  color: white;
}

.hero-link.primary:hover {
  background: var(--blue-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.hero-link.outline {
  border-color: var(--blue-light);
  color: var(--blue-primary);
}

.hero-link.outline:hover {
  border-color: var(--blue-primary);
  background: var(--blue-wash);
  transform: translateY(-2px);
}

/* Pixel art avatar frame */
.hero-avatar {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  order: 1;
  opacity: 0;
  animation: fadeIn 1s var(--ease-out) 1s forwards;
}

/* Avatar stack container */
.avatar-stack {
  width: 240px;
  height: 240px;
  position: relative;
  cursor: pointer;
  perspective: 600px;
}

.avatar-frame {
  width: 240px;
  height: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 4px solid var(--violet-light);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  transition: transform 0.4s var(--ease-spring);
}

.avatar-frame:hover {
  transform: scale(1.05) rotate(2deg);
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Stacked photo cards */
.avatar-card {
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.5s var(--ease-spring),
              opacity 0.5s var(--ease-out),
              box-shadow 0.4s var(--ease-out);
}

.avatar-card:hover {
  transform: none; /* override default hover, stack handles it */
}

/* Stack positioning: card behind peeks out with offset + rotation */
.avatar-card[data-stack="0"] {
  z-index: 3;
  transform: rotate(0deg) translate(0, 0);
  opacity: 1;
}

.avatar-card[data-stack="1"] {
  z-index: 2;
  transform: rotate(4deg) translate(8px, 6px);
  opacity: 0.85;
  border-color: var(--rose-light);
}

.avatar-card[data-stack="2"] {
  z-index: 1;
  transform: rotate(-3deg) translate(-6px, 10px);
  opacity: 0.7;
  border-color: var(--blue-light);
}

/* Fly-away animation for clicked card */
.avatar-card.fly-away {
  animation: cardFlyAway 0.5s var(--ease-out) forwards;
  z-index: 10;
}

@keyframes cardFlyAway {
  0%   { transform: rotate(0deg) translate(0, 0) scale(1); opacity: 1; }
  40%  { transform: rotate(12deg) translate(80px, -40px) scale(0.9); opacity: 0.8; }
  100% { transform: rotate(20deg) translate(200px, -80px) scale(0.7); opacity: 0; }
}

/* Decorative pixel dots around avatar */
.avatar-deco {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: float 3s ease-in-out infinite;
  z-index: 5;
}

.avatar-deco:nth-child(1) { top: -12px; left: 20%; background: var(--pink); animation-delay: 0s; }
.avatar-deco:nth-child(2) { top: 10%; right: -12px; background: var(--violet); animation-delay: 0.5s; }
.avatar-deco:nth-child(3) { bottom: -12px; right: 20%; background: var(--lavender); animation-delay: 1s; }
.avatar-deco:nth-child(4) { bottom: 10%; left: -12px; background: var(--rose); animation-delay: 1.5s; }
.avatar-deco:nth-child(5) { top: -8px; right: 10%; background: var(--peach); animation-delay: 0.7s; width: 6px; height: 6px; }

@media (max-width: 900px) {
  .hero {
    min-height: 100svh;
    padding: 5rem 1.5rem 3rem;
  }

  .hero-inner {
    flex-direction: column;
    text-align: center;
  }

  .hero-avatar {
    margin-bottom: var(--space-sm);
    order: 0;
  }

  .avatar-stack {
    width: 140px;
    height: 140px;
    margin: 0 auto;
  }

  .avatar-frame {
    width: 140px;
    height: 140px;
  }

  .hero-greeting {
    margin-top: var(--space-xs);
  }

  .hero-tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-links {
    justify-content: center;
  }

  .hero-link {
    flex: 0 0 calc(50% - 0.5rem);
    justify-content: center;
  }

  .fishbowl-wrap {
    justify-content: flex-end;
    text-align: right;
  }

  @keyframes cardFlyAway {
    0%   { transform: rotate(0deg) translate(0, 0) scale(1); opacity: 1; }
    40%  { transform: rotate(10deg) translate(50px, -30px) scale(0.9); opacity: 0.8; }
    100% { transform: rotate(15deg) translate(120px, -50px) scale(0.7); opacity: 0; }
  }

}

/* ==========================================================================
   Fish Bowl Button & Drawing Modal
   ========================================================================== */

.fishbowl-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-sm);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 1s forwards;
}

.fishbowl-btn {
  display: inline-block;
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--blue-mid);
  transition: color 0.3s, transform 0.3s;
  line-height: 0;
}

.fishbowl-btn:hover {
  color: var(--rose);
  transform: scale(1.1);
}

.fishbowl-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  width: 16px;
  height: 16px;
  background: var(--rose);
  color: white;
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  line-height: 16px;
  text-align: center;
  border-radius: 50%;
  pointer-events: none;
}

.fishbowl-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: 220px;
  padding: 10px 12px;
  background: var(--text-primary);
  color: var(--canvas);
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  line-height: 1.5;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
  pointer-events: none;
}

.fishbowl-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 16px;
  border: 6px solid transparent;
  border-top-color: var(--text-primary);
}

.fishbowl-btn:hover .fishbowl-tooltip {
  display: block;
}

[data-theme="dark"] .fishbowl-btn {
  color: #c0d4ee;
}

[data-theme="dark"] .fishbowl-btn:hover {
  color: var(--pink);
}

[data-theme="dark"] .fishbowl-tooltip {
  background: var(--canvas);
  color: var(--text-primary);
}

[data-theme="dark"] .fishbowl-tooltip::after {
  border-top-color: var(--canvas);
}

/* Fish Drawing Modal */
.fish-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding-right: 10%;
  backdrop-filter: blur(4px);
}

.fish-modal-overlay.open {
  display: flex;
}

.fish-modal {
  background: var(--canvas);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.3s var(--ease-out);
}

[data-theme="dark"] .fish-modal {
  background: #1a1e35;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.fish-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}

.fish-modal-close:hover {
  color: var(--rose);
}

.fish-modal-title {
  font-family: var(--font-pixel);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.fish-modal-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.fish-drawing-area {
  background: var(--canvas-alt);
  border: 2px solid var(--canvas-dark);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1rem;
  line-height: 0;
  cursor: crosshair;
}

[data-theme="dark"] .fish-drawing-area {
  background: #0e1225;
  border-color: #2a2e48;
}

.fish-drawing-area canvas {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.fish-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.fish-palette {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}

.fish-palette .swatch {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.fish-palette .swatch:hover {
  transform: scale(1.15);
}

.fish-palette .swatch.active {
  border-color: var(--text-primary);
  transform: scale(1.15);
}

[data-theme="dark"] .fish-palette .swatch.active {
  border-color: #fff;
}

.fish-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 2px solid var(--canvas-dark);
  border-radius: 3px;
  background: var(--canvas);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  transition: all 0.2s;
}

.fish-tool-btn:hover,
.fish-tool-btn.active {
  border-color: var(--rose);
  color: var(--rose);
}

[data-theme="dark"] .fish-tool-btn {
  background: #1a1e35;
  border-color: #2a2e48;
  color: var(--text-muted);
}

.fish-submit-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.fish-name-input {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid var(--canvas-dark);
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  color: var(--text-primary);
  background: var(--canvas);
  outline: none;
  transition: border-color 0.2s;
}

.fish-name-input:focus {
  border-color: var(--blue-mid);
}

[data-theme="dark"] .fish-name-input {
  background: #0e1225;
  border-color: #2a2e48;
  color: #e0e0f0;
}

.fish-submit-btn {
  width: 100%;
  padding: 10px 20px;
  background: var(--blue-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  white-space: nowrap;
}

.fish-submit-btn:hover {
  background: var(--blue-deep);
  transform: translateY(-1px);
}

.fish-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.fish-gallery-toggle {
  width: 100%;
  margin-top: 0.5rem;
  padding: 8px 20px;
  background: none;
  border: 2px solid var(--canvas-dark);
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.fish-gallery-toggle:hover {
  border-color: var(--blue-mid);
  color: var(--blue-primary);
}

[data-theme="dark"] .fish-gallery-toggle {
  border-color: #2a2e48;
  color: var(--text-muted);
}

[data-theme="dark"] .fish-gallery-toggle:hover {
  border-color: var(--blue-mid);
  color: var(--blue-light);
}

/* Fish Gallery Modal */
.fish-gallery-modal {
  max-width: 600px;
}

.fish-gallery {
  max-height: 60vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  padding: 4px;
}

.fish-gallery-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  padding: 2rem;
}

.fish-gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  padding: 2rem;
}

.fish-gallery-card {
  background: var(--canvas-alt);
  border: 2px solid var(--canvas-dark);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.fish-gallery-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue-light);
}

[data-theme="dark"] .fish-gallery-card {
  background: #0e1225;
  border-color: #2a2e48;
}

.fish-gallery-card canvas {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-radius: 2px;
  margin-bottom: 6px;
}

.fish-gallery-card .fish-card-name {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.fish-gallery-card .fish-card-author {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.fish-gallery-card .fish-card-date {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--text-light);
  margin: 2px 0 0;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding: var(--space-2xl) 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: var(--space-xl);
}

@media (max-width: 600px) {
  .section-header {
    position: sticky;
    top: 50px;
    z-index: 10;
    background: rgba(250, 247, 242, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--space-sm) 2rem;
    margin: 0 -2rem 0;
    box-shadow: 0 1px 0 var(--canvas-dark);
  }

  .section-header .section-label {
    font-size: 0.85rem;
    margin-bottom: 2px;
  }

  .section-header .section-title {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .nav.scrolled {
    box-shadow: none;
    border-bottom: 1px solid var(--canvas-dark);
  }

  .section {
    padding-top: var(--space-md);
    padding-bottom: var(--space-md);
  }

  .pub-list,
  .interest-grid,
  .timeline,
  .bio-text {
    padding-top: var(--space-sm);
  }
}

.section-label {
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--violet);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--blue-deep);
  font-weight: 700;
}

/* ==========================================================================
   About / Bio Section
   ========================================================================== */

.bio-text {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.bio-text p + p {
  margin-top: 1.2rem;
}

.bio-text strong {
  color: var(--text-primary);
}

.bio-text a {
  color: var(--blue-primary);
  border-bottom: 1px dashed var(--blue-light);
  transition: all 0.3s var(--ease-out);
}

.bio-text a:hover {
  border-bottom-color: var(--blue-primary);
  border-bottom-style: solid;
}

/* ==========================================================================
   Research Interests - Interactive Cards
   ========================================================================== */

.interest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.interest-card {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--canvas-dark);
  transition: all 0.4s var(--ease-out);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.interest-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-primary), var(--violet), var(--rose));
  transform: scaleX(0);
  transition: transform 0.4s var(--ease-out);
  transform-origin: left;
}

.interest-card:hover,
.interest-card.active {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-light);
}

.interest-card:hover::before,
.interest-card.active::before {
  transform: scaleX(1);
}

.interest-card .card-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  display: block;
}

.interest-card h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--blue-deep);
  margin-bottom: var(--space-sm);
}

.interest-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.interest-card .pub-links {
  margin-top: auto;
  padding-top: 1rem;
}

@media (max-width: 600px) {
  .interest-grid {
    grid-template-columns: 1fr;
  }

  /* Research cards: icon left, title+description right (title above description, left-aligned) */
  .interest-card {
    display: grid;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    gap: 0 var(--space-md);
    padding: var(--space-md);
  }

  .interest-card .card-icon {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 48px;
    margin-bottom: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2px;
  }

  .interest-card .card-icon svg {
    width: 36px;
    height: 36px;
  }

  .interest-card h3 {
    grid-column: 2;
    grid-row: 1;
    margin-bottom: var(--space-xs);
  }

  .interest-card > p {
    grid-column: 2;
    grid-row: 2;
  }

  /* Tool cards: icon | title + tags | description */
  #tools .interest-card {
    display: grid;
    grid-template-columns: 48px auto 1fr;
    grid-template-rows: auto auto;
    gap: 0 var(--space-md);
  }

  #tools .interest-card .card-icon {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 48px;
    align-self: flex-start;
    padding-top: 2px;
  }

  #tools .interest-card h3 {
    grid-column: 2;
    grid-row: 1;
    align-self: baseline;
  }

  #tools .interest-card .pub-links {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: baseline;
    margin-top: 0;
    padding-top: 0;
  }

  #tools .interest-card > p {
    grid-column: 2 / 4;
    grid-row: 2;
    margin-top: var(--space-xs);
  }
}

/* ==========================================================================
   Publications
   ========================================================================== */

.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.pub-item {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--canvas-dark);
  transition: all 0.4s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.pub-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--violet), var(--rose), var(--pink));
  transform: scaleY(0);
  transition: transform 0.4s var(--ease-out);
  transform-origin: top;
}

.pub-item:hover,
.pub-item.active {
  border-color: var(--violet-light);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  background: linear-gradient(135deg, white 60%, var(--violet-wash));
}

.pub-item:hover::before,
.pub-item.active::before {
  transform: scaleY(1);
}

.pub-item:hover .pub-title,
.pub-item.active .pub-title {
  color: var(--violet);
}

[data-theme="dark"] .pub-item:hover,
[data-theme="dark"] .pub-item.active {
  background: var(--canvas-dark);
  border-color: var(--violet-light);
  box-shadow: var(--shadow-md), 0 0 20px rgba(123, 97, 184, 0.15);
}

[data-theme="dark"] .interest-card:hover,
[data-theme="dark"] .interest-card.active {
  background: var(--canvas-dark);
  border-color: var(--violet-light);
  box-shadow: var(--shadow-md), 0 0 20px rgba(123, 97, 184, 0.15);
}

.pub-title {
  font-weight: 600;
  color: var(--blue-deep);
  font-size: 1rem;
  margin-bottom: var(--space-xs);
  display: block;
}

.pub-title a {
  color: inherit;
  border-bottom: 1px dashed var(--blue-light);
}

.pub-title a:hover {
  color: var(--blue-primary);
  border-bottom-color: var(--blue-primary);
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.pub-authors .me {
  font-weight: 600;
  color: var(--rose);
}

.pub-venue {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.pub-link {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: lowercase;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--pink-wash);
  color: var(--rose);
  border: 1px solid var(--rose-light);
  transition: all 0.3s var(--ease-out);
  font-weight: 700;
}

.pub-link:hover {
  background: var(--rose);
  color: white;
  border-color: var(--rose);
}

/* ==========================================================================
   Updates / Timeline
   ========================================================================== */

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--violet), var(--rose-light), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-lg);
  padding-left: var(--space-md);
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.5s var(--ease-out);
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--violet);
  border: 3px solid var(--canvas);
  box-shadow: 0 0 0 2px var(--violet-light);
  transition: all 0.3s var(--ease-spring);
}

.timeline-item:hover::before,
.timeline-item.active::before {
  transform: scale(1.3) rotate(45deg);
  background: var(--pink);
}

.timeline-item.active .timeline-text {
  color: var(--violet);
}

.timeline-item.active .timeline-date {
  color: var(--rose);
}

.timeline-date {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--violet);
  letter-spacing: 1px;
  margin-bottom: var(--space-xs);
  transition: color 0.3s var(--ease-out);
}

.timeline-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  transition: all 0.3s var(--ease-out);
}

.timeline-text a {
  border-bottom: 1px dashed var(--blue-light);
}

.timeline-links {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

/* ==========================================================================
   Blog Cards
   ========================================================================== */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.blog-card-link {
  display: flex;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-md);
  transition: all 0.4s var(--ease-out);
}

.blog-card-link:hover {
  transform: translateY(-6px);
}

.blog-card-link:hover .blog-card {
  box-shadow: var(--shadow-lg);
  border-color: var(--blue-light);
}

.blog-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--canvas-dark);
  transition: all 0.4s var(--ease-out);
  display: flex;
  flex-direction: column;
  width: 100%;
}

.blog-card-header {
  height: 160px;
  background: linear-gradient(135deg, var(--blue-primary), var(--violet), var(--rose-light));
  position: relative;
  overflow: hidden;
}

.blog-card-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-out);
}

.blog-card-link:hover .blog-card-header img {
  transform: scale(1.05);
}

.blog-card-body {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-date {
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  color: var(--violet);
  letter-spacing: 1px;
  margin-bottom: var(--space-sm);
}

.blog-card-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--blue-deep);
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}

.blog-card-link:hover .blog-card-title {
  color: var(--violet);
}

.blog-card-excerpt {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.tag {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--violet-wash);
  color: var(--violet);
  border: 1px solid var(--violet-light);
  font-weight: 600;
}

/* ==========================================================================
   Blog Post Page
   ========================================================================== */

.post-header {
  padding: 8rem 2rem 3rem;
  text-align: center;
  background: linear-gradient(180deg, var(--blue-wash) 0%, var(--canvas) 100%);
}

.post-header .post-date {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--blue-primary);
  letter-spacing: 2px;
  margin-bottom: var(--space-md);
}

.post-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--blue-deep);
  font-weight: 700;
  max-width: 800px;
  margin: 0 auto var(--space-md);
  line-height: 1.3;
}

.post-header .post-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.post-content {
  max-width: 740px;
  margin: 0 auto;
  padding: var(--space-xl) 2rem var(--space-2xl);
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-secondary);
}

.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
  font-family: var(--font-serif);
  color: var(--blue-deep);
  margin: 2rem 0 1rem;
  font-weight: 600;
}

.post-content h2 { font-size: 1.6rem; }
.post-content h3 { font-size: 1.3rem; }
.post-content h4 { font-size: 1.1rem; }

.post-content p {
  margin-bottom: 1.2rem;
}

.post-content img {
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0;
  box-shadow: var(--shadow-sm);
}

.post-content blockquote {
  border-left: 4px solid var(--blue-primary);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  background: var(--blue-wash);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--blue-wash);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--blue-deep);
}

.post-content pre {
  background: #f8f8f8;
  color: #383a42;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-lg) 0;
  line-height: 1.7;
  white-space: pre;
  border: 1px solid #e8e8e8;
}

.post-content .highlight {
  margin: var(--space-lg) 0;
  border-radius: var(--radius-md);
}

.post-content .highlight pre {
  margin: 0;
}

.code-block-wrapper {
  position: relative;
}

.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(128, 128, 128, 0.15);
  border: none;
  border-radius: 6px;
  color: #888;
  cursor: pointer;
  padding: 6px 8px;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
  z-index: 1;
}

.code-copy-btn:hover {
  background: rgba(128, 128, 128, 0.3);
  color: #555;
}

.code-copy-btn.copied {
  color: #098658;
  opacity: 1;
}

[data-theme="dark"] .code-copy-btn {
  color: #999;
}

[data-theme="dark"] .code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ccc;
}

[data-theme="dark"] .code-copy-btn.copied {
  color: #6a9955;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.85rem;
}

/* Rouge Syntax Highlighting — VS Code Light+ */
.highlight pre, .post-content .highlight pre { background: #f8f8f8; color: #383a42; border: 1px solid #e8e8e8; }
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs { color: #008000; font-style: italic; }
.highlight .cp { color: #af00db; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt { color: #0000ff; }
.highlight .kc { color: #0000ff; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sh, .highlight .sx { color: #a31515; }
.highlight .sd { color: #a31515; font-style: italic; }
.highlight .si { color: #b5760e; }
.highlight .sr { color: #811f3f; }
.highlight .se { color: #b5760e; }
.highlight .nb, .highlight .bp { color: #267f99; }
.highlight .nf, .highlight .fm { color: #795e26; }
.highlight .nc { color: #267f99; }
.highlight .nn { color: #267f99; }
.highlight .no { color: #0070c1; }
.highlight .nd { color: #795e26; }
.highlight .ni { color: #383a42; }
.highlight .ne { color: #267f99; }
.highlight .na { color: #e50000; }
.highlight .nv, .highlight .vi, .highlight .vg, .highlight .vc { color: #001080; }
.highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il { color: #098658; }
.highlight .o, .highlight .ow { color: #383a42; }
.highlight .p { color: #383a42; }
.highlight .err { color: #e51400; }
.highlight .gd { color: #e51400; }
.highlight .gi { color: #008000; }
.highlight .gh, .highlight .gu { color: #0000ff; font-weight: bold; }

/* Rouge Syntax Highlighting — VS Code Dark+ (dark mode) */
[data-theme="dark"] .post-content pre { background: #1e1e2e; color: #d4d4d4; border-color: #333; }
[data-theme="dark"] .highlight pre, [data-theme="dark"] .post-content .highlight pre { background: #1e1e2e; color: #d4d4d4; border-color: #333; }
[data-theme="dark"] .highlight .c, [data-theme="dark"] .highlight .c1, [data-theme="dark"] .highlight .cm, [data-theme="dark"] .highlight .cs { color: #6a9955; }
[data-theme="dark"] .highlight .cp { color: #c586c0; }
[data-theme="dark"] .highlight .k, [data-theme="dark"] .highlight .kd, [data-theme="dark"] .highlight .kn, [data-theme="dark"] .highlight .kp, [data-theme="dark"] .highlight .kr, [data-theme="dark"] .highlight .kt { color: #569cd6; }
[data-theme="dark"] .highlight .kc { color: #569cd6; }
[data-theme="dark"] .highlight .s, [data-theme="dark"] .highlight .s1, [data-theme="dark"] .highlight .s2, [data-theme="dark"] .highlight .sb, [data-theme="dark"] .highlight .sc, [data-theme="dark"] .highlight .sh, [data-theme="dark"] .highlight .sx { color: #ce9178; }
[data-theme="dark"] .highlight .sd { color: #ce9178; }
[data-theme="dark"] .highlight .si { color: #d7ba7d; }
[data-theme="dark"] .highlight .sr { color: #d16969; }
[data-theme="dark"] .highlight .se { color: #d7ba7d; }
[data-theme="dark"] .highlight .nb, [data-theme="dark"] .highlight .bp { color: #4ec9b0; }
[data-theme="dark"] .highlight .nf, [data-theme="dark"] .highlight .fm { color: #dcdcaa; }
[data-theme="dark"] .highlight .nc { color: #4ec9b0; }
[data-theme="dark"] .highlight .nn { color: #4ec9b0; }
[data-theme="dark"] .highlight .no { color: #4fc1ff; }
[data-theme="dark"] .highlight .nd { color: #dcdcaa; }
[data-theme="dark"] .highlight .ni { color: #d4d4d4; }
[data-theme="dark"] .highlight .ne { color: #4ec9b0; }
[data-theme="dark"] .highlight .na { color: #9cdcfe; }
[data-theme="dark"] .highlight .nv, [data-theme="dark"] .highlight .vi, [data-theme="dark"] .highlight .vg, [data-theme="dark"] .highlight .vc { color: #9cdcfe; }
[data-theme="dark"] .highlight .mi, [data-theme="dark"] .highlight .mf, [data-theme="dark"] .highlight .mh, [data-theme="dark"] .highlight .mo, [data-theme="dark"] .highlight .il { color: #b5cea8; }
[data-theme="dark"] .highlight .o, [data-theme="dark"] .highlight .ow { color: #d4d4d4; }
[data-theme="dark"] .highlight .p { color: #d4d4d4; }
[data-theme="dark"] .highlight .err { color: #f44747; }
[data-theme="dark"] .highlight .gd { color: #f44747; }
[data-theme="dark"] .highlight .gi { color: #6a9955; }
[data-theme="dark"] .highlight .gh, [data-theme="dark"] .highlight .gu { color: #569cd6; font-weight: bold; }


.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
}

.post-content th, .post-content td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--canvas-dark);
  text-align: left;
}

.post-content th {
  background: var(--blue-wash);
  font-weight: 600;
  color: var(--blue-deep);
}

/* Post navigation */
.post-nav {
  max-width: 740px;
  margin: 0 auto;
  padding: var(--space-xl) 2rem;
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  border-top: 1px solid var(--canvas-dark);
}

.post-nav a {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--blue-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--blue-light);
  transition: all 0.3s var(--ease-out);
}

.post-nav a:hover {
  background: var(--blue-primary);
  color: white;
  border-color: var(--blue-primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background: var(--blue-deep);
  color: var(--blue-light);
  padding: var(--space-xl) 2rem;
  text-align: center;
}

[data-theme="dark"] .footer {
  background: #1A1B2E;
  color: var(--text-secondary);
}

[data-theme="dark"] .footer-links a {
  color: var(--violet);
}

[data-theme="dark"] .footer-links a:hover {
  color: var(--gold);
}

[data-theme="dark"] .footer-copy {
  color: var(--text-muted);
  border-top-color: rgba(255, 255, 255, 0.06);
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--blue-light);
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  letter-spacing: 1px;
  transition: color 0.3s var(--ease-out);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-links a:hover {
  color: white;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--blue-mid);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-lg);
}

/* Social icon pixel art */
.social-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-size: contain;
  image-rendering: pixelated;
}

/* ==========================================================================
   Blog Listing Page
   ========================================================================== */

.page-header {
  padding: 8rem 2rem 3rem;
  text-align: center;
  background: linear-gradient(180deg, var(--blue-wash) 0%, var(--canvas) 100%);
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--blue-deep);
}

.page-header p {
  color: var(--text-secondary);
  margin-top: var(--space-sm);
  font-size: 1.15rem;
}

/* Tag filter bar */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-xl);
}

.tag-btn {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--violet-wash);
  color: var(--violet);
  border: 1px solid var(--violet-light);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  font-weight: 600;
}

.tag-btn:hover {
  background: var(--violet-light);
  color: white;
}

.tag-btn.active {
  background: var(--violet);
  color: white;
  border-color: var(--violet);
}

.blog-card-link.hidden {
  display: none;
}

.blog-listing {
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--space-xl) 2rem var(--space-2xl);
}

/* ==========================================================================
   Blog Page - Impressionist Rose / Romantic Theme
   ========================================================================== */

.blog-page {
  background: linear-gradient(180deg, var(--pink-wash) 0%, var(--canvas) 40%);
}

.blog-header {
  background: linear-gradient(180deg, #F8E8EE 0%, var(--pink-wash) 50%, var(--canvas) 100%);
}

.blog-header h1 {
  font-family: var(--font-serif);
  color: var(--rose);
}

.blog-header p {
  color: var(--rose-light);
}

/* Cards with rose tint */
.blog-page .blog-card {
  background: #FFFBFC;
  border-color: #F0D8E0;
}

.blog-page .blog-card-link:hover .blog-card {
  border-color: var(--rose-light);
  box-shadow: 0 8px 40px rgba(196, 107, 138, 0.15);
}

.blog-page .blog-card-header {
  background: linear-gradient(135deg, var(--rose-light), var(--pink), var(--violet-light));
}

.blog-page .blog-card-date {
  color: var(--rose);
}

.blog-page .blog-card-title {
  color: #5A3048;
}

.blog-page .blog-card-link:hover .blog-card-title {
  color: var(--rose);
}

/* Tags with rose accent */
.blog-page .tag {
  background: #FCEDF2;
  color: var(--rose);
  border-color: #F0D0DC;
}

.blog-page .tag-btn {
  background: #FCEDF2;
  color: var(--rose);
  border-color: var(--rose-light);
}

.blog-page .tag-btn:hover {
  background: var(--rose-light);
  color: white;
}

.blog-page .tag-btn.active {
  background: var(--rose);
  color: white;
  border-color: var(--rose);
}

/* Dark mode blog - warm rose night */
[data-theme="dark"] .blog-page {
  background: linear-gradient(180deg, #1E1520 0%, var(--canvas) 40%);
}

[data-theme="dark"] .blog-header {
  background: linear-gradient(180deg, #221828 0%, #1E1520 50%, var(--canvas) 100%);
}

[data-theme="dark"] .blog-header h1 {
  color: var(--pink);
}

[data-theme="dark"] .blog-header p {
  color: var(--rose-light);
}

[data-theme="dark"] .blog-page .blog-card {
  background: #1E1525;
  border-color: #3A2535;
}

[data-theme="dark"] .blog-page .blog-card-link:hover .blog-card {
  border-color: var(--rose-light);
  box-shadow: 0 8px 40px rgba(228, 136, 160, 0.12);
}

[data-theme="dark"] .blog-page .blog-card-header {
  background: linear-gradient(135deg, #6B3A5A, var(--rose), var(--violet-light));
}

[data-theme="dark"] .blog-page .blog-card-date {
  color: var(--pink);
}

[data-theme="dark"] .blog-page .blog-card-title {
  color: #F0D0DC;
}

[data-theme="dark"] .blog-page .blog-card-link:hover .blog-card-title {
  color: var(--pink);
}

[data-theme="dark"] .blog-page .tag {
  background: #2A1822;
  color: var(--rose-light);
  border-color: #4A2838;
}

[data-theme="dark"] .blog-page .tag-btn {
  background: #2A1822;
  color: var(--rose-light);
  border-color: #4A2838;
}

[data-theme="dark"] .blog-page .tag-btn:hover {
  background: var(--rose);
  color: white;
}

[data-theme="dark"] .blog-page .tag-btn.active {
  background: var(--rose);
  color: white;
  border-color: var(--rose);
}

/* ==========================================================================
   Animations
   ========================================================================== */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes brushStroke {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* Intersection observer reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s var(--ease-out);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ==========================================================================
   Impressionist Background Blobs
   ========================================================================== */

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.15;
  pointer-events: none;
}

.bg-blob-1 {
  width: 400px;
  height: 400px;
  background: var(--violet);
  top: -100px;
  right: -100px;
}

.bg-blob-2 {
  width: 300px;
  height: 300px;
  background: var(--rose);
  bottom: -50px;
  left: -50px;
}

.bg-blob-3 {
  width: 200px;
  height: 200px;
  background: var(--pink);
  top: 40%;
  right: 10%;
}

/* ==========================================================================
   Scroll-to-top
   ========================================================================== */

.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--blue-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s var(--ease-out);
  border: none;
  font-family: var(--font-pixel);
  font-size: 1.2rem;
  z-index: 999;
  box-shadow: var(--shadow-md);
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--blue-deep);
  transform: translateY(-3px);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.text-center { text-align: center; }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-lg { margin-bottom: var(--space-lg); }

/* MathJax overrides */
.MathJax { font-size: 1em !important; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

.pagination a, .pagination span {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--canvas-dark);
  color: var(--text-secondary);
  transition: all 0.3s var(--ease-out);
}

.pagination a:hover {
  border-color: var(--blue-primary);
  background: var(--blue-wash);
  color: var(--blue-primary);
}

.pagination .current {
  background: var(--blue-primary);
  color: white;
  border-color: var(--blue-primary);
}

/* ==========================================================================
   SVG Pixel Icons
   ========================================================================== */

.icon-svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  vertical-align: middle;
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  .nav, .footer, .scroll-top, .hero-canvas { display: none; }
  body { background: white; }
  .hero { min-height: auto; padding: 2rem; }
}

/* ==========================================================================
   Digital Garden
   ========================================================================== */

/* Garden tag filter bar */
.garden-tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.garden-tag-btn {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--canvas-dark);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.garden-tag-btn:hover {
  border-color: var(--blue-light);
  color: var(--text-secondary);
}

.garden-tag-btn.active {
  border-color: var(--violet);
  color: var(--violet);
  background: var(--violet-wash);
}

.garden-tag-extra {
  display: none;
}

.garden-tag-toggle {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  letter-spacing: 0.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.garden-tag-toggle:hover {
  color: var(--violet);
}

/* AND/OR sliding toggle */
.garden-tag-divider {
  display: inline-flex;
  align-items: center;
  margin: 0 0.2rem;
  font-size: 0.7rem;
  opacity: 0.5;
  flex-shrink: 0;
}

.garden-logic-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--canvas-alt);
  border-radius: 999px;
  padding: 2px;
  cursor: pointer;
  margin-right: 0.35rem;
  flex-shrink: 0;
}

.garden-logic-label {
  position: relative;
  z-index: 1;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  color: var(--text-muted);
  transition: color 0.25s;
  user-select: none;
}

.garden-logic-label.active {
  color: white;
}

.garden-logic-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  background: var(--violet);
  border-radius: 999px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.garden-logic-switch.is-or .garden-logic-slider {
  transform: translateX(100%);
}

[data-theme="dark"] .garden-logic-switch {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .garden-tag-btn {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .garden-tag-btn:hover {
  border-color: var(--blue-mid);
  color: var(--text-secondary);
}

[data-theme="dark"] .garden-tag-btn.active {
  border-color: var(--violet-light);
  color: var(--violet-light);
  background: rgba(123, 97, 184, 0.15);
}

/* Hidden states for filtering */
.garden-card-link.tag-hidden,
.garden-card-link.overflow-hidden {
  display: none;
}

/* Garden card meta */
.garden-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.garden-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 3px;
}

.garden-type-note { background: #e8f5e9; color: #2e7d32; }
.garden-type-essay { background: var(--pink-wash); color: var(--rose); }
.garden-type-project { background: #efebe9; color: #5d4037; }
.garden-type-log { background: #e8f5e9; color: #558b2f; }

.garden-stage {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

.garden-stage-seedling::before { content: ""; }
.garden-stage-growing::before { content: ""; }
.garden-stage-evergreen::before { content: ""; }

/* Garden article header */
.garden-article .garden-meta {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: var(--space-sm);
}

/* ==========================================================================
   Garden — Layered Landscape
   ========================================================================== */

/* Layer sections */
.garden-layer {
  padding: var(--space-xl) 2rem var(--space-2xl);
  max-width: 1000px;
  margin: 0 auto;
}

.garden-layer-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.garden-layer-icon {
  flex-shrink: 0;
}

.garden-layer-header h2 {
  font-family: var(--font-pixel);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: 1px;
}

.garden-layer-header p {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0 0;
  font-style: italic;
}

/* Subtle layer backgrounds */
.garden-orchard {
  background: linear-gradient(180deg, var(--canvas) 0%, rgba(93, 64, 55, 0.04) 50%, var(--canvas) 100%);
  border-bottom: 1px solid var(--canvas-dark);
}

.garden-flowerbed {
  background: linear-gradient(180deg, var(--canvas) 0%, rgba(196, 107, 138, 0.05) 50%, var(--canvas) 100%);
  border-bottom: 1px solid var(--canvas-dark);
}

.garden-nursery {
  background: linear-gradient(180deg, var(--canvas) 0%, rgba(90, 158, 74, 0.05) 50%, var(--canvas) 100%);
  border-bottom: 1px solid var(--canvas-dark);
}

.garden-compost {
  background: linear-gradient(180deg, var(--canvas) 0%, rgba(139, 195, 74, 0.04) 50%, var(--canvas) 100%);
}

/* Layer grids */
.garden-layer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

/* Unified card */
.garden-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  transition: transform 0.3s var(--ease-out);
}

.garden-card-link:hover {
  transform: translateY(-4px);
}

.garden-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--canvas-dark);
  padding: var(--space-md);
  display: flex;
  gap: var(--space-sm);
  width: 100%;
  transition: all 0.3s var(--ease-out);
}

.garden-card-link:hover .garden-card {
  box-shadow: var(--shadow-md);
  border-color: var(--blue-light);
}

.garden-card-icon {
  flex-shrink: 0;
  width: 20px;
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
}

.garden-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.garden-card-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 0;
}

.garden-card-link:hover .garden-card-title {
  color: var(--violet);
}

.garden-card-excerpt {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.garden-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.garden-card-footer time {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.garden-card-badge {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--blue-wash);
  color: var(--blue-primary);
}

.gc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 0.3rem;
}

.gc-tags .tag {
  font-size: 0.6rem;
  padding: 1px 5px;
}

/* Subtle stage differences — continuous progression */
.garden-card[data-stage="seedling"] {
  border-color: var(--canvas-alt);
  opacity: 0.85;
}

.garden-card[data-stage="seedling"] .garden-card-title {
  color: var(--text-secondary);
}

/* growing = default, no extra styles needed */

.garden-card[data-stage="evergreen"],
.garden-orchard .garden-card {
  border-color: var(--blue-light);
}

.garden-card-link:hover .garden-card[data-stage="evergreen"],
.garden-orchard .garden-card-link:hover .garden-card {
  box-shadow: var(--shadow-glow);
}

/* Show more button */
.garden-show-more {
  display: none;
  justify-content: center;
  margin-top: var(--space-md);
}

.garden-show-more-btn {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--canvas-dark);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.garden-show-more-btn:hover {
  border-color: var(--blue-light);
  color: var(--blue-primary);
}

/* Garden subtitle */
/* ====== Garden Hero — Gris-inspired, warm palette ====== */
.garden-hero {
  position: relative;
  text-align: center;
  padding: 0;
  min-height: 520px;
  background: linear-gradient(180deg,
    #FDF6F8 0%,
    #FAF0F4 10%,
    #F6E8F0 25%,
    #F0DCEC 40%,
    #E8D0E0 55%,
    #D8E8D0 75%,
    #D0E4CC 88%,
    var(--canvas) 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.garden-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(255,240,244,0.2) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 80% 15%, rgba(252,228,184,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 75%, rgba(168,208,160,0.1) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 50% 80%, rgba(184,216,168,0.08) 0%, transparent 60%);
  pointer-events: none;
}

/* Garden scene — fills entire hero */
.garden-hero-scene {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.garden-scene-svg {
  width: 100%;
  height: 100%;
}

/* Floating pixel particles */
.garden-particles {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 2;
}

.gp {
  position: absolute;
  display: block;
  pointer-events: none;
  opacity: 0;
}

.gp-petal {
  width: 6px;
  height: 6px;
  background: var(--rose-light);
  border-radius: 1px;
  animation: gpPetal 7s ease-in-out infinite;
}

.gp-spark {
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  animation: gpSpark 5s ease-in-out infinite;
}

.gp-leaf {
  width: 5px;
  height: 7px;
  background: #8bc34a;
  border-radius: 1px;
  animation: gpLeaf 8s ease-in-out infinite;
}

@keyframes gpPetal {
  0%   { opacity: 0; transform: translateY(0) rotate(0deg); }
  15%  { opacity: 0.55; }
  50%  { opacity: 0.35; transform: translateY(25px) rotate(25deg) translateX(8px); }
  85%  { opacity: 0.15; }
  100% { opacity: 0; transform: translateY(50px) rotate(60deg) translateX(-5px); }
}

@keyframes gpSpark {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  30%  { opacity: 0.65; transform: scale(1.3); }
  60%  { opacity: 0.3; transform: scale(0.8); }
  80%  { opacity: 0.5; transform: scale(1.1); }
}

@keyframes gpLeaf {
  0%   { opacity: 0; transform: translateY(0) translateX(0) rotate(0deg); }
  20%  { opacity: 0.45; }
  60%  { opacity: 0.25; transform: translateY(20px) translateX(12px) rotate(20deg); }
  100% { opacity: 0; transform: translateY(40px) translateX(-8px) rotate(45deg); }
}

/* Sky sun/moon toggle — responds to dark mode */
.garden-sky-sun,
.garden-sky-moon {
  transition: opacity 1s ease;
}
.garden-sky-sun { opacity: 1; }
.garden-sky-moon { opacity: 0; }

/* Cloud drift animation */
.garden-cloud { animation: cloudDrift 40s linear infinite; }
.garden-cloud-1 { animation-duration: 45s; }
.garden-cloud-2 { animation-duration: 55s; animation-delay: -15s; }
.garden-cloud-3 { animation-duration: 50s; animation-delay: -8s; }
.garden-cloud-4 { animation-duration: 60s; animation-delay: -25s; }

@keyframes cloudDrift {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(40px); }
  100% { transform: translateX(0); }
}

/* Butterfly float animation */
.garden-butterfly-1 { animation: butterflyFloat1 8s ease-in-out infinite; }
.garden-butterfly-2 { animation: butterflyFloat2 10s ease-in-out infinite; }
.garden-butterfly-3 { animation: butterflyFloat3 9s ease-in-out infinite; }

@keyframes butterflyFloat1 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(12px, -8px); }
  50% { transform: translate(5px, -15px); }
  75% { transform: translate(-8px, -5px); }
}
@keyframes butterflyFloat2 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-10px, -12px); }
  66% { transform: translate(8px, -6px); }
}
@keyframes butterflyFloat3 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(8px, 6px); }
  50% { transform: translate(-5px, -10px); }
  75% { transform: translate(-12px, 3px); }
}

/* Firefly twinkle */
.garden-firefly { animation: fireflyTwinkle 3s ease-in-out infinite; }
.garden-firefly:nth-child(odd) { animation-duration: 4s; }
.garden-firefly:nth-child(3n) { animation-delay: -1s; }
.garden-firefly:nth-child(5n) { animation-delay: -2s; }

@keyframes fireflyTwinkle {
  0%, 100% { opacity: 0.15; r: 1.5; }
  50% { opacity: 0.6; r: 3; }
}

/* (Cat is now a floating companion — see .garden-cat-float above) */

.garden-hero-content {
  position: relative;
  z-index: 3;
  padding: 8rem 2rem 4rem;
}

.garden-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  color: var(--rose);
  margin: 0 0 0.5rem;
  position: relative;
  z-index: 3;
  letter-spacing: -1px;
  font-weight: 300;
  text-shadow: 0 2px 20px rgba(255,255,255,0.6);
}

.garden-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--rose-light);
  font-size: 1.2rem;
  margin: 0;
  position: relative;
  z-index: 3;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 10px rgba(255,255,255,0.5);
}

/* ====== Tag filter — standalone section below hero ====== */
.garden-filter-section {
  position: relative;
  z-index: 5;
  padding: 1rem 2rem;
  max-width: 1000px;
  margin: -1.5rem auto 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(196, 107, 138, 0.1);
  box-shadow: 0 4px 24px rgba(196, 107, 138, 0.06);
}

.garden-filter-section .garden-tag-bar {
  justify-content: center;
}

/* ====== Floating cat companion ====== */
.garden-cat-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
}

.garden-cat-avatar {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(196, 107, 138, 0.15), 0 0 0 2px rgba(196, 107, 138, 0.08);
  transition: all 0.3s var(--ease-out);
  position: relative;
  animation: catFloat 4s ease-in-out infinite;
}

.garden-cat-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(196, 107, 138, 0.22), 0 0 0 3px rgba(196, 107, 138, 0.12);
}

.garden-cat-avatar svg {
  width: 44px;
  height: 44px;
}

.cat-speech-hint {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: var(--violet);
  color: white;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  box-shadow: 0 2px 6px rgba(123, 97, 184, 0.3);
  animation: hintPulse 2s ease-in-out infinite;
}

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

@keyframes hintPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

/* Cat chat dialog */
.garden-cat-dialog {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 320px;
  max-height: 420px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  border: 1px solid rgba(196, 107, 138, 0.12);
  box-shadow: 0 8px 40px rgba(196, 107, 138, 0.1);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: dialogSlideUp 0.3s var(--ease-out);
}

.garden-cat-dialog.open {
  display: flex;
}

@keyframes dialogSlideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cat-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(196, 107, 138, 0.08);
  background: rgba(253, 240, 244, 0.6);
}

.cat-dialog-name {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--rose);
  letter-spacing: 1px;
}

.cat-dialog-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.cat-dialog-close:hover {
  color: var(--rose);
}

.cat-dialog-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  min-height: 80px;
}

.cat-msg {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 12px;
  max-width: 85%;
  word-wrap: break-word;
}

.cat-msg-bot {
  background: rgba(253, 240, 244, 0.8);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.cat-msg-user {
  background: var(--violet);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.cat-dialog-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(196, 107, 138, 0.08);
  background: rgba(253, 248, 250, 0.8);
}

.cat-dialog-input input {
  flex: 1;
  border: 1px solid rgba(196, 107, 138, 0.12);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  background: white;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.cat-dialog-input input:focus {
  border-color: var(--violet-light);
}

.cat-dialog-input input::placeholder {
  color: var(--text-light);
}

.cat-dialog-input button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--violet);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.cat-dialog-input button:hover {
  background: var(--lavender);
}

/* Page-level background decoration for garden */
.garden-page {
  position: relative;
}

.garden-page::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 30% 20% at 5% 30%, rgba(139,195,74,0.03) 0%, transparent 70%),
    radial-gradient(ellipse 25% 15% at 95% 50%, rgba(196,107,138,0.03) 0%, transparent 70%),
    radial-gradient(ellipse 20% 20% at 50% 90%, rgba(123,97,184,0.02) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.garden-page > * {
  position: relative;
  z-index: 1;
}

/* Dark mode garden hero */
[data-theme="dark"] .garden-hero {
  background: linear-gradient(180deg,
    #0D0B1A 0%,
    #12101E 15%,
    #1A1530 30%,
    #201A38 50%,
    #251E40 70%,
    #1A1530 85%,
    var(--canvas) 100%);
}

[data-theme="dark"] .garden-hero::before {
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(40,30,60,0.3) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 80% 20%, rgba(240,230,140,0.03) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 70%, rgba(100,80,140,0.08) 0%, transparent 70%);
}

[data-theme="dark"] .garden-hero-title {
  color: #D4C4DD;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

[data-theme="dark"] .garden-subtitle {
  color: #A890B4;
  text-shadow: 0 1px 10px rgba(0,0,0,0.4);
}

[data-theme="dark"] .garden-filter-section {
  background: rgba(26, 21, 48, 0.85);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

/* Dark mode: cat dialog */
[data-theme="dark"] .garden-cat-avatar {
  background: rgba(26, 21, 48, 0.9);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(139, 110, 152, 0.15);
}

[data-theme="dark"] .garden-cat-dialog {
  background: rgba(26, 21, 48, 0.95);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .cat-dialog-header {
  background: rgba(32, 26, 56, 0.6);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .cat-dialog-name {
  color: #D4C4DD;
}

[data-theme="dark"] .cat-msg-bot {
  background: rgba(32, 26, 56, 0.6);
  color: #D4C4DD;
}

[data-theme="dark"] .cat-dialog-input {
  background: rgba(20, 16, 36, 0.8);
  border-top-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .cat-dialog-input input {
  background: rgba(32, 26, 56, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

/* Dark mode: sky toggle */
[data-theme="dark"] .garden-sky-sun { opacity: 0; }
[data-theme="dark"] .garden-sky-moon { opacity: 1; }

/* Dark mode: dimmed scene elements */
[data-theme="dark"] .garden-hero-scene svg {
  filter: brightness(0.55) saturate(0.6);
}

[data-theme="dark"] .garden-clouds { opacity: 0.1; }

/* Dark mode: particles glow differently */
[data-theme="dark"] .gp-petal { background: rgba(220, 160, 181, 0.4); }
[data-theme="dark"] .gp-spark { background: rgba(240, 230, 140, 0.5); }
[data-theme="dark"] .gp-leaf { background: rgba(139, 195, 74, 0.25); }

/* Dark mode: fireflies glow brighter at night */
[data-theme="dark"] .garden-firefly { opacity: 0.6; }

/* Dark mode: cat eyes glow (floating cat) */
[data-theme="dark"] .garden-cat-avatar svg rect[fill="#64B5F6"] { filter: drop-shadow(0 0 4px rgba(100, 181, 246, 0.6)); }

[data-theme="dark"] .garden-page::before {
  background:
    radial-gradient(ellipse 30% 20% at 5% 30%, rgba(139,195,74,0.02) 0%, transparent 70%),
    radial-gradient(ellipse 25% 15% at 95% 50%, rgba(196,107,138,0.02) 0%, transparent 70%);
}

/* Dark mode: Garden layers */
[data-theme="dark"] .garden-orchard {
  background: linear-gradient(180deg, var(--canvas) 0%, rgba(93, 64, 55, 0.06) 50%, var(--canvas) 100%);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .garden-flowerbed {
  background: linear-gradient(180deg, var(--canvas) 0%, rgba(196, 107, 138, 0.06) 50%, var(--canvas) 100%);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .garden-nursery {
  background: linear-gradient(180deg, var(--canvas) 0%, rgba(90, 158, 74, 0.06) 50%, var(--canvas) 100%);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .garden-compost {
  background: linear-gradient(180deg, var(--canvas) 0%, rgba(139, 195, 74, 0.05) 50%, var(--canvas) 100%);
}

[data-theme="dark"] .garden-card {
  background: var(--canvas-alt);
}

[data-theme="dark"] .garden-card[data-stage="seedling"] {
  border-color: rgba(255, 255, 255, 0.05);
  opacity: 0.8;
}

[data-theme="dark"] .garden-card[data-stage="evergreen"],
[data-theme="dark"] .garden-orchard .garden-card {
  border-color: var(--blue-mid);
}

[data-theme="dark"] .garden-card-badge {
  background: rgba(78, 107, 174, 0.15);
  color: var(--blue-light);
}

[data-theme="dark"] .garden-show-more-btn {
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

[data-theme="dark"] .garden-type-note { background: rgba(46, 125, 50, 0.15); color: #81c784; }
[data-theme="dark"] .garden-type-essay { background: rgba(196, 107, 138, 0.15); color: var(--rose-light); }
[data-theme="dark"] .garden-type-project { background: rgba(93, 64, 55, 0.15); color: #bcaaa4; }
[data-theme="dark"] .garden-type-log { background: rgba(85, 139, 47, 0.15); color: #aed581; }

/* Mobile garden */
@media (max-width: 600px) {
  .garden-hero {
    min-height: 380px;
  }
  .garden-hero-content {
    padding: 6rem 1.2rem 3rem;
  }
  .garden-hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  .garden-filter-section {
    margin: -1rem 0.8rem 0;
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-md);
  }
  .gp { animation-duration: 10s !important; }
  .garden-layer {
    padding: var(--space-lg) 1rem var(--space-xl);
  }
  .garden-layer-header {
    flex-direction: column;
    text-align: center;
    gap: var(--space-xs);
  }
  .garden-layer-grid {
    grid-template-columns: 1fr;
  }
  .garden-cat-float {
    bottom: 16px;
    right: 16px;
  }
  .garden-cat-avatar {
    width: 54px;
    height: 54px;
  }
  .garden-cat-avatar svg {
    width: 38px;
    height: 38px;
  }
  .garden-cat-dialog {
    width: calc(100vw - 32px);
    right: -8px;
    bottom: 66px;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .garden-layer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   GALLERY / MOMENTS PAGE
   ============================================================ */

/* ====== Moments Hero ====== */
.moments-hero {
  position: relative;
  text-align: center;
  padding: 6rem 2rem 1.5rem;
  background: linear-gradient(180deg, #FDF6ED 0%, #F8EDDF 30%, #FAF0E4 60%, var(--canvas) 100%);
  overflow: hidden;
}

.moments-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 70% 50% at 20% 75%, rgba(212,165,116,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 65%, rgba(228,160,138,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 50% 15%, rgba(197,216,238,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.moments-hero-scene {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  pointer-events: none;
}

.moments-scene-svg {
  width: 100%;
  height: 100%;
}

.moments-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  color: #9B6B3A;
  margin: 0 0 0.3rem;
  position: relative;
  letter-spacing: -0.5px;
}

.moments-hero-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  color: #C4976A;
  font-size: 1.15rem;
  margin: 0 0 2rem;
  position: relative;
}

.moments-hero .moments-views {
  position: relative;
  padding: 0.7rem 1.5rem;
  margin: 0 auto;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(212, 165, 116, 0.15);
  border-bottom: none;
  margin-bottom: 0;
}

/* Dark mode moments hero */
[data-theme="dark"] .moments-hero {
  background: linear-gradient(180deg, #1E1A14 0%, #1A1610 40%, var(--canvas) 100%);
}

[data-theme="dark"] .moments-hero::before {
  background:
    radial-gradient(ellipse 70% 50% at 20% 75%, rgba(212,165,116,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 65%, rgba(228,160,138,0.03) 0%, transparent 70%);
}

[data-theme="dark"] .moments-hero-title {
  color: #D4A574;
}

[data-theme="dark"] .moments-hero-subtitle {
  color: var(--text-muted);
}

[data-theme="dark"] .moments-hero .moments-views {
  background: rgba(26, 27, 46, 0.7);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .moments-hero-scene svg rect {
  opacity: 0.08;
}

.gallery-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem var(--space-2xl);
}

/* View switcher */
.moments-views {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  align-items: center;
}

.moments-view-btn {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.3px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--canvas-dark);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.moments-view-btn svg {
  opacity: 0.5;
}

.moments-view-btn:hover {
  border-color: #D4A574;
  color: var(--text-secondary);
}

.moments-view-btn.active {
  border-color: #B8864A;
  color: #9B6B3A;
  background: #FDF6ED;
}

.moments-view-btn.active svg {
  opacity: 1;
}

[data-theme="dark"] .moments-view-btn {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .moments-view-btn.active {
  border-color: var(--violet);
  background: rgba(142, 124, 195, 0.12);
}

/* Panels */
.moments-panel {
  display: none;
}

.moments-panel.active {
  display: block;
}

/* Tag bar inside tag panel */
.moments-tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-bottom: var(--space-md);
  align-items: center;
}

/* Timeline view */
.timeline-year {
  margin-bottom: var(--space-xl);
}

.timeline-year-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--canvas-dark);
}

.timeline-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px;
}

/* Theme & City group view */
.moments-group {
  margin-bottom: var(--space-xl);
}

.moments-group-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
}

/* Desktop: 2-row grid with overflow hidden */
.moments-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px;
  max-height: calc(150px * 2 + 4px);
  overflow: hidden;
}

.moments-group.is-expanded .moments-group-grid {
  max-height: none;
}

.moments-show-more-btn {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.moments-show-more-btn:hover {
  color: var(--violet);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px;
}

.gallery-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  border-radius: 2px;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.gallery-thumb:hover img {
  transform: scale(1.05);
  filter: brightness(0.9);
}

/* Video thumbnail overlay */
.gallery-thumb-video {
  position: relative;
}

.gallery-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  pointer-events: none;
  transition: background 0.2s;
}

.gallery-thumb-video:hover .gallery-play-icon {
  background: rgba(0, 0, 0, 0.7);
}

/* Lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.gallery-lightbox-container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 3rem;
}

.gallery-lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 85vh;
}

.gallery-lightbox-img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.gallery-lightbox-video {
  display: none;
  width: 80vw;
  max-width: 860px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.gallery-lightbox-video iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.gallery-lightbox-info {
  margin-top: var(--space-md);
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
}

.gallery-lightbox-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: white;
}

.gallery-lightbox-desc {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 0.5rem;
}

.gallery-lightbox-meta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.3px;
}

.gallery-lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  z-index: 2;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
}

.gallery-lightbox-close:hover {
  color: white;
}

.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 12px;
  transition: color 0.2s;
}

.gallery-lightbox-nav:hover {
  color: white;
}

.gallery-lightbox-prev {
  left: 1rem;
}

.gallery-lightbox-next {
  right: 1rem;
}

/* Gallery responsive */
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
  }

  .gallery-page {
    padding: 0 0 var(--space-xl);
  }

  .moments-hero {
    padding: 4.5rem 1rem 1rem;
  }

  .moments-hero .moments-views {
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-md);
  }

  .moments-hero-scene {
    height: 120px;
  }

  .moments-panel {
    padding: 0 0.5rem;
  }

  .moments-view-btn {
    font-size: 0.7rem;
    padding: 5px 10px;
  }

  .timeline-year-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
  }

  .moments-group-grid {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    max-height: none;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .moments-group-grid::-webkit-scrollbar {
    height: 3px;
  }

  .moments-group-grid::-webkit-scrollbar-track {
    background: var(--canvas-alt);
    border-radius: 2px;
  }

  .moments-group-grid::-webkit-scrollbar-thumb {
    background: var(--canvas-dark);
    border-radius: 2px;
  }

  .moments-group-grid .gallery-thumb {
    flex: 0 0 130px;
    width: 130px;
    height: 130px;
    scroll-snap-align: start;
  }

  .moments-show-more-btn {
    display: none;
  }

  .gallery-lightbox-container {
    padding: 1rem;
  }

  .gallery-lightbox-img {
    max-height: 55vh;
  }

  .gallery-lightbox-prev {
    left: 0.3rem;
  }

  .gallery-lightbox-next {
    right: 0.3rem;
  }
}
