/* ==========================================================================
   Design System: Warm, Friendly Light Theme for James Kanka
   ========================================================================== */

:root {
  /* Warm Light Color Palette */
  --bg-primary: #fbfbf9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f3f4f6;
  --bg-warm-tint: #fef8f0;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;

  --border-subtle: #e5e7eb;
  --border-medium: #d1d5db;
  --border-glow: #e0e7ff;
  --border-focus: #3b82f6;

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-accent: #2563eb;

  /* Friendly Brand Accents */
  --accent-blue: #2563eb;
  --accent-indigo: #4f46e5;
  --accent-amber: #d97706;
  --accent-teal: #0d9488;
  --accent-coral: #e11d48;
  --accent-emerald: #059669;
  --accent-railway: #d92662;

  /* Gradients */
  --gradient-friendly: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  --gradient-warm: linear-gradient(135deg, #fef3c7 0%, #fee2e2 100%);
  --gradient-pill: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);

  /* Typography & Layout */
  --max-width: 1120px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 4px 16px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 12px 28px -4px rgba(0, 0, 0, 0.1), 0 4px 10px -2px rgba(0, 0, 0, 0.04);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

html {
  color-scheme: light;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Subtle Tactile Paper Grain Texture (Hardware Accelerated) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10; /* Above base background, below canopy shadows & page content */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paperNoise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.18  0 0 0 0 0.14  0 0 0 0 0.10  0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paperNoise)' opacity='0.09'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 160px 160px;
  mix-blend-mode: multiply;
  opacity: 0.8;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
}

code, pre, .font-mono {
  font-family: 'JetBrains Mono', monospace;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all var(--transition-fast);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(251, 251, 249, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.1rem 0;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--gradient-friendly);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.brand-name {
  color: var(--text-primary);
}

.brand-name .accent {
  color: var(--accent-blue);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.nav-link:hover {
  color: var(--accent-blue);
}

.nav-btn {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-subtle);
}

.nav-btn:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

/* ==========================================================================
   Buttons & UI Elements
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition-normal);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-subtle);
}

.btn-secondary:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: #ffffff;
  border-color: var(--border-medium);
}

.btn-large {
  padding: 0.85rem 1.8rem;
  font-size: 1rem;
}

.btn-icon {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 590px;
  padding: 6rem 0;
  background:
    radial-gradient(circle at 78% 24%, rgba(96, 165, 250, 0.42), transparent 28%),
    radial-gradient(circle at 18% 88%, rgba(79, 70, 229, 0.34), transparent 34%),
    linear-gradient(125deg, #0b1f4d 0%, #173b81 52%, #225db5 100%);
  border-bottom: 1px solid rgba(37, 99, 235, 0.18);
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to right, black, transparent 72%);
}

.hero-section::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 520px;
  height: 520px;
  right: -150px;
  bottom: -330px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 0 72px rgba(255, 255, 255, 0.035), 0 0 0 144px rgba(255, 255, 255, 0.025);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 3.5rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.85rem;
  font-weight: 600;
  color: #eff6ff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 1.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(5, 150, 105, 0.5);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.hero-title {
  font-size: clamp(3.5rem, 7vw, 5.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.98;
  color: #ffffff;
  margin-bottom: 1.1rem;
  text-wrap: balance;
}

.hero-subtitle {
  font-size: 1.4rem;
  font-weight: 600;
  color: #bfdbfe;
  margin-bottom: 1.25rem;
}

.hero-description {
  font-size: 1.12rem;
  color: rgba(239, 246, 255, 0.82);
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 650px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.hero-socials {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.hero-actions .btn-primary {
  background: #ffffff;
  border-color: #ffffff;
  color: #1d4ed8;
  box-shadow: 0 10px 28px rgba(2, 8, 23, 0.22);
}

.hero-actions .btn-primary:hover {
  background: #eff6ff;
  border-color: #eff6ff;
  transform: translateY(-2px);
}

.hero-actions .btn-ghost {
  color: #eff6ff;
}

.hero-actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #eff6ff;
  box-shadow: 0 4px 16px rgba(2, 8, 23, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition-fast);
}

.social-icon:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.55);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

/* Hero Photo Frame */
.hero-photo-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-photo-frame {
  width: min(340px, 100%);
  aspect-ratio: 1;
  height: auto;
  border-radius: var(--radius-full);
  padding: 6px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: 0 30px 70px rgba(2, 8, 23, 0.35), 0 0 0 12px rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.hero-photo-frame:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-blue);
}

.hero-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius-full);
  display: block;
}

/* ==========================================================================
   Section Headers
   ========================================================================== */

.section {
  padding: 4.5rem 0;
  position: relative;
}

.bg-section-alt {
  background: #f4f4f0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: none;
}

.section-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 3rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-blue);
  background: #eff6ff;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Featured Projects (MarScout, Neighborly, Taggist) — Compact & Visual
   ========================================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-blue);
}

/* Project Logo Header Frame */
.project-logo-frame {
  height: 125px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

.preview-marscout {
  background: radial-gradient(circle at center, #241442 0%, #0f0a1c 100%);
}

.logo-marscout-img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.4);
  object-fit: contain;
  transition: transform var(--transition-fast);
}

.project-card:hover .logo-marscout-img {
  transform: scale(1.08);
}

.preview-neighborly {
  background: radial-gradient(circle at center, #0f2d59 0%, #071326 100%);
}

.mockup-neighborly-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.25);
  backdrop-filter: blur(8px);
  transition: transform var(--transition-fast);
}

.project-card:hover .mockup-neighborly-brand {
  transform: scale(1.05);
}

.neighborly-text-logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.preview-taggist {
  background: radial-gradient(circle at center, #1c1917 0%, #09090b 100%);
}

.logo-taggist-img {
  height: 34px;
  max-width: 170px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(255, 255, 255, 0.2));
  transition: transform var(--transition-fast);
}

.project-card:hover .logo-taggist-img {
  transform: scale(1.08);
}

.preview-soda {
  background: radial-gradient(circle at center, #1e1b4b 0%, #090d16 100%);
}

.mockup-soda-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(244, 63, 94, 0.4);
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.25);
  backdrop-filter: blur(8px);
  transition: transform var(--transition-fast);
}

.project-card:hover .mockup-soda-brand {
  transform: scale(1.05);
}

.soda-brand-logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  background: linear-gradient(135deg, #fb7185 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}

.soda-emoji-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 8px rgba(244, 63, 94, 0.4));
}

.preview-oracle {
  background: radial-gradient(circle at center, #1b1035 0%, #060913 100%);
}

.mockup-oracle-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(168, 85, 247, 0.4);
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.25);
  backdrop-filter: blur(8px);
  transition: transform var(--transition-fast);
}

.project-card:hover .mockup-oracle-brand {
  transform: scale(1.05);
}

.oracle-brand-logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  background: linear-gradient(135deg, #38bdf8 0%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}

.oracle-die-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 8px rgba(168, 85, 247, 0.4));
}

/* Card Content Area */
.project-content-wrap {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.project-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-railway {
  background: #fdf2f8;
  color: var(--accent-railway);
  border: 1px solid #fce7f3;
}

.badge-tech {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.badge-production {
  background: #ecfdf5;
  color: var(--accent-emerald);
  border: 1px solid #d1fae5;
}

.badge-active {
  background: #eff6ff;
  color: var(--accent-blue);
  border: 1px solid #dbeafe;
}

.dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.project-domain {
  font-size: 0.8rem;
  color: var(--accent-blue);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  margin-bottom: 0.65rem;
}

.project-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 1.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-footer {
  margin-top: auto;
}

.btn-card-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.btn-card-primary:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.project-direct-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
}

/* ==========================================================================
   AI Mini-Apps Section
   ========================================================================== */

.apps-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-tab {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition: all var(--transition-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

.filter-tab.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 280px;
}

.search-box svg {
  position: absolute;
  left: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-medium);
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  box-shadow: var(--shadow-subtle);
  transition: all var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.app-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-blue);
}

.app-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.app-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.app-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.app-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.btn-app-action {
  width: 100%;
  padding: 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  border: 1px solid var(--border-medium);
  background: #ffffff;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.btn-app-action:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}

/* ==========================================================================
   Interactive Workbench
   ========================================================================== */

.interactive-workbench {
  margin-top: 2.5rem;
  background: #ffffff;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.workbench-header {
  padding: 1.25rem 1.75rem;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.workbench-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.live-pill {
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--accent-emerald);
  color: #ffffff;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.workbench-content {
  padding: 2rem;
}

.tool-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.tool-pane {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tool-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.tool-textarea {
  width: 100%;
  height: 200px;
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 1rem;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
}

.tool-textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tool-output {
  min-height: 200px;
  background: #111827;
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  color: #a5f3fc;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  white-space: pre-wrap;
  overflow-y: auto;
}

.tool-actions-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ==========================================================================
   Executive Experience & Impact Timeline
   ========================================================================== */

.timeline-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.timeline-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.timeline-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-glow);
}

.timeline-card-main {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.25rem;
}

.timeline-meta {
  border-right: 1px solid var(--border-subtle);
  padding-right: 1.75rem;
  display: flex;
  flex-direction: column;
}

.timeline-logos-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.timeline-logo {
  height: 24px;
  max-width: 130px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.04));
  transition: transform var(--transition-fast);
}

.timeline-card:hover .timeline-logo {
  transform: scale(1.04);
}

.timeline-recruited-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.6rem;
  line-height: 1.4;
}

.timeline-role {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.timeline-company {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 0.4rem;
}

.timeline-dates {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.timeline-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.timeline-bullets li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-bullets li::before {
  content: "•";
  position: absolute;
  left: 0.25rem;
  color: var(--accent-blue);
  font-size: 1.25rem;
  line-height: 1;
}

/* Story Toggle Action */
.timeline-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0.5rem;
}

.btn-toggle-story {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--accent-blue);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: inherit;
}

.btn-toggle-story:hover {
  background: #eff6ff;
  border-color: var(--accent-blue);
  color: #1d4ed8;
  transform: translateY(-1px);
}

.toggle-chevron {
  transition: transform var(--transition-fast);
}

.btn-toggle-story[aria-expanded="true"] .toggle-chevron {
  transform: rotate(180deg);
}

.btn-toggle-story[aria-expanded="true"] {
  background: #eff6ff;
  border-color: var(--accent-blue);
}

/* Expandable Story Drawer */
.timeline-story-drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.35s ease;
  overflow: hidden;
  margin-top: 0;
}

.timeline-story-drawer.is-open {
  grid-template-rows: 1fr;
  margin-top: 1.75rem;
  border-top: 1px dashed var(--border-medium);
  padding-top: 1.75rem;
}

.story-drawer-inner {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.story-narrative-box {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.6) 100%);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-blue);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.story-narrative-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.story-narrative-text {
  font-size: 0.94rem;
  line-height: 1.68;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.story-narrative-text:last-child {
  margin-bottom: 0;
}

.story-artifacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.story-artifact-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.story-artifact-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-subtle);
}

.story-artifact-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-blue);
  margin-bottom: 0.35rem;
}

.story-artifact-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.story-artifact-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.story-artifact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-blue);
  text-decoration: none;
}

.story-artifact-link:hover {
  text-decoration: underline;
}

/* Video / Media Card */
.story-video-card {
  background: #0f172a;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border: 1px solid #1e293b;
}

.story-video-card::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, transparent 70%);
  border-radius: 50%;
}

.story-video-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #38bdf8;
  margin-bottom: 0.5rem;
}

.story-video-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.4rem;
}

.story-video-desc {
  font-size: 0.86rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.story-video-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #38bdf8;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  align-self: flex-start;
}

.story-video-btn:hover {
  background: #7dd3fc;
  transform: translateY(-1px);
}

.story-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.story-tag-chip {
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.timeline-bullets li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.timeline-bullets li::before {
  content: "•";
  position: absolute;
  left: 0.25rem;
  color: var(--accent-blue);
  font-size: 1.25rem;
  line-height: 1;
}

/* ==========================================================================
   Side B & Quick Facts (Personality & Highlights)
   ========================================================================== */

.side-b-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.side-b-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.side-b-icon {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.side-b-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.side-b-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Notes / Writings Grid & Cards (Modern Editorial Style)
   ========================================================================== */

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.note-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.note-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-friendly);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.note-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-hover);
}

.note-card:hover::before {
  opacity: 1;
}

.note-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.note-card-readtime {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.note-card-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.6rem;
  transition: color var(--transition-fast);
}

.note-card:hover .note-card-title {
  color: var(--accent-blue);
}

.note-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.note-tag-chip {
  font-size: 0.72rem;
  color: var(--accent-blue);
  background: var(--bg-tertiary);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.note-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.note-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.note-card-action {
  font-size: 0.86rem;
  color: var(--accent-blue);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: transform var(--transition-fast);
}

.note-card:hover .note-card-action {
  transform: translateX(3px);
}

.post-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.post-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   Home Work Logos Bar (Borderless, Clean, Optically Balanced)
   ========================================================================== */

.work-logos-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3rem 2.5rem;
  margin: 1.5rem 0 2.5rem;
}

.work-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0.85;
  transition: all var(--transition-fast);
  padding: 0.5rem 0.75rem;
}

.work-logo-link:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.work-bar-logo {
  height: 32px;
  max-width: 145px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.04));
  transition: transform var(--transition-fast);
}

.work-logo-link:hover .work-bar-logo {
  transform: scale(1.05);
}

/* Specific optical sizing adjustments */
.logo-inboxhealth { height: 25px; }
.logo-neuroflow { height: 23px; }
.logo-healthnote { height: 25px; }
.logo-relatient { height: 21px; }
.logo-sharecare { height: 25px; }
.logo-healthways { height: 27px; }

.home-work-cta {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

/* ==========================================================================
   Contact Box
   ========================================================================== */

.contact-box {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
}

.contact-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.contact-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 2rem;
}

.contact-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   Full-Screen Blog Note View
   ========================================================================== */

.note-view-container {
  min-height: 100vh;
  padding-bottom: 5rem;
  background: var(--bg-primary);
  animation: fadeIn 0.2s ease-in-out;
}

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

.note-nav-bar {
  position: sticky;
  top: 73px;
  z-index: 90;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(251, 251, 249, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.9rem 0;
  margin-bottom: 2.5rem;
}

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

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-subtle);
  transition: all var(--transition-fast);
}

.btn-back:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  transform: translateX(-3px);
}

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition: all var(--transition-fast);
}

.btn-share:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.note-article-content {
  max-width: 760px;
  margin: 0 auto;
}

.note-header {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 2rem;
}

.note-meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 1rem;
}

.note-separator {
  color: var(--border-medium);
}

.note-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.note-author-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.note-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-subtle);
}

.note-author-info {
  display: flex;
  flex-direction: column;
}

.note-author-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.note-author-title {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.note-footer-nav {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.prose {
  color: #374151;
  font-size: 1.1rem;
  line-height: 1.85;
}

.prose p {
  margin-bottom: 1.5rem;
}

.prose h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 2.25rem 0 1rem;
}

.prose h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.75rem 0 0.75rem;
}

.prose ol, .prose ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose pre {
  background: #1e293b;
  color: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

/* Note links: reads as a link, then a highlighter pen sweeps across on hover
   and stays highlighted (app.js adds .is-highlit on first hover/focus). */
.note-body a[href] {
  --marker: 214, 240, 92; /* felt-tip yellow-green */
  color: var(--accent-blue, #2563eb);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.4);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  border-radius: 2px;
  background-image: linear-gradient(
    104deg,
    transparent 0.35em,
    rgba(var(--marker), 0.78) 0.35em,
    rgba(var(--marker), 0.78) calc(100% - 0.3em),
    transparent calc(100% - 0.3em)
  );
  background-repeat: no-repeat;
  background-position: 0 82%;
  background-size: 0% 0.68em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition:
    background-size 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.3s ease,
    text-decoration-color 0.3s ease;
}

.note-body a[href]:hover,
.note-body a[href]:focus-visible,
.note-body a[href].is-highlit {
  color: #1f2937;
  text-decoration-color: transparent;
  background-size: 100% 0.68em;
}

@media (prefers-reduced-motion: reduce) {
  .note-body a[href] {
    transition: none;
  }
}

/* ── Interactive Reading Library Book Mentions & Hover Popovers ── */
.note-body a.book-mention {
  background-image: none !important; /* Disables the highlighter marker pen */
  display: inline;
  color: var(--accent-blue, #2563eb) !important;
  font-style: italic;
  font-weight: 600;
  text-decoration: underline !important;
  text-decoration-style: dotted !important;
  text-decoration-color: rgba(37, 99, 235, 0.5) !important;
  text-decoration-thickness: 1.5px !important;
  text-underline-offset: 3px !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  cursor: pointer;
  transition: color var(--transition-fast, 0.15s ease), text-decoration-color var(--transition-fast, 0.15s ease);
}

.book-mention-wrap {
  position: relative;
  display: inline;
  white-space: normal;
}

.note-body a.book-mention:hover,
.note-body a.book-mention:focus-visible,
.book-mention-wrap:hover .book-mention,
.book-mention-wrap:focus-within .book-mention,
.book-mention-wrap.is-active .book-mention {
  color: #1d4ed8 !important;
  text-decoration-style: solid !important;
  text-decoration-color: #1d4ed8 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.book-popover-card {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 380px;
  max-width: min(380px, 88vw);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md, 14px);
  box-shadow: 0 20px 40px -8px rgba(15, 23, 42, 0.18), 0 8px 16px -4px rgba(15, 23, 42, 0.08);
  padding: 1.1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s;
  z-index: 1000;
  text-align: left;
  line-height: 1.4;
  white-space: normal;
}

/* Downward arrow */
.book-popover-card::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0 8px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.06));
}

/* Upward arrow if flipped */
.book-popover-card.flipped {
  bottom: auto;
  top: calc(100% + 14px);
  transform: translateX(-50%) translateY(-8px);
}
.book-popover-card.flipped::after {
  top: auto;
  bottom: 100%;
  border-width: 0 8px 8px 8px;
  border-color: transparent transparent #ffffff transparent;
}

.book-mention-wrap:hover .book-popover-card,
.book-mention-wrap:focus-within .book-popover-card,
.book-mention-wrap.is-active .book-popover-card {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.book-popover-inner {
  display: flex;
  gap: 0.95rem;
  align-items: flex-start;
}

.book-popover-cover-wrap {
  width: 76px;
  flex-shrink: 0;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  background: #f1f5f9;
  aspect-ratio: 2 / 3;
}

.book-popover-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-popover-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.book-popover-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.1rem;
}

.book-popover-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  line-height: 1.3;
}

.book-popover-badge-format {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.book-popover-badge-rating {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  letter-spacing: 0.02em;
}

.book-popover-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-popover-author {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: -0.1rem;
}

.book-popover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.book-popover-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #f1f5f9;
}

.book-popover-review {
  font-size: 0.78rem;
  color: #334155;
  font-style: italic;
  background: #f8fafc;
  border-left: 3px solid var(--accent-blue, #2563eb);
  padding: 0.45rem 0.6rem;
  border-radius: 0 6px 6px 0;
  margin-top: 0.35rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-popover-footer {
  margin-top: 0.45rem;
  display: flex;
  justify-content: flex-end;
}

.book-popover-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-blue, #2563eb);
  transition: transform var(--transition-fast, 0.15s ease);
}

.book-mention-wrap:hover .book-popover-btn {
  transform: translateX(2px);
}

/* ── Responsive Video Embeds (YouTube & Video iFrames) ── */
.video-embed-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 2.25rem 0;
  border-radius: var(--radius-md, 14px);
  overflow: hidden;
  background-color: #000000;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.12), 0 2px 6px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-subtle, #e5e7eb);
}

.video-embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: block;
}

/* Fallback for raw direct iframes in markdown prose (not in container) */
.prose > iframe,
.prose > p > iframe {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  margin: 2.25rem 0;
  border-radius: var(--radius-md, 14px);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.12), 0 2px 6px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-subtle, #e5e7eb);
  display: block;
}

/* ── Home: Photography feature — a light auto-scrolling contact-sheet strip ── */
.photos-feature {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-secondary, #ffffff);
  border-top: 1px solid var(--border-subtle);
  padding: 4.25rem 0 0;
}
.photos-feature-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 2.25rem;
  text-align: center;
}
.photos-feature .section-header {
  margin-bottom: 1.5rem;
}

.film-strip {
  position: relative;
  padding: 16px 0;
  background: #eef0f4;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent,
    #000 5%,
    #000 95%,
    transparent
  );
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 5%,
    #000 95%,
    transparent
  );
}
/* sprocket-hole rails */
.film-strip::before,
.film-strip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 7px;
  opacity: 0.55;
  background: repeating-linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.22) 0 8px,
    transparent 8px 22px
  );
}
.film-strip::before {
  top: 3px;
}
.film-strip::after {
  bottom: 3px;
}

.film-strip-track {
  display: flex;
  width: max-content;
  padding: 6px 0;
  animation: filmScroll 55s linear infinite;
}
.film-strip:hover .film-strip-track,
.film-strip:focus-within .film-strip-track {
  animation-play-state: paused;
}
@keyframes filmScroll {
  to {
    transform: translateX(-50%);
  }
}

.film-frame {
  flex: 0 0 auto;
  width: clamp(200px, 22vw, 300px);
  aspect-ratio: 3 / 2;
  margin-right: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.35s ease;
}
.film-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 3px;
}
.film-frame:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.24);
}

@media (prefers-reduced-motion: reduce) {
  .film-strip-track {
    animation: none;
  }
}

/* Utilities */
.hidden {
  display: none !important;
}

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

/* ==========================================================================
/* Ensure all page content and main sections stack above footer background reflections */
main,
.work-main,
.notes-main,
.note-detail-main,
.books-main,
.soda-page main,
.section,
.container {
  position: relative;
  z-index: 2;
}

.site-footer.underwater-footer {
  position: relative;
  background: transparent; /* No static box: fluid canvas is the background */
  color: #e0f2fe;
  padding: 3.5rem 0 2.2rem;
  border: none;
  overflow: visible;
  z-index: 1;
}

/* Water Surface Boundary & Fluid Body Wrap */
.water-surface-wrap {
  position: absolute;
  top: -45px;
  left: 0;
  width: 100%;
  height: calc(100% + 45px);
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

/* Upward Projecting Water Caustic Reflection on the section above - rendered BEHIND page content */
.water-surface-reflection-up {
  position: absolute;
  top: -160px;
  left: -5%;
  width: 110%;
  height: 180px;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse 600px 140px at 30% 100%, rgba(56, 189, 248, 0.22) 0%, rgba(56, 189, 248, 0.06) 50%, transparent 80%),
    radial-gradient(ellipse 700px 160px at 75% 100%, rgba(56, 189, 248, 0.20) 0%, rgba(56, 189, 248, 0.05) 55%, transparent 85%),
    linear-gradient(0deg, rgba(56, 189, 248, 0.18) 0%, rgba(56, 189, 248, 0.05) 55%, transparent 100%);
  mix-blend-mode: color-dodge;
  filter: blur(16px);
  animation: waterCausticReflectionGlow 7s ease-in-out infinite alternate;
}

@keyframes waterCausticReflectionGlow {
  0% { opacity: 0.65; transform: scaleY(0.9) translate3d(0, 0, 0); }
  50% { opacity: 1; transform: scaleY(1.2) translate3d(15px, -8px, 0) skewX(1.5deg); }
  100% { opacity: 0.75; transform: scaleY(0.95) translate3d(-10px, 4px, 0); }
}

/* Interactive Water Surface Canvas */
.water-surface-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Underwater Ambient Sun Rays / Shafts */
.water-shafts-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    radial-gradient(ellipse 500px 250px at 20% 25%, rgba(56, 189, 248, 0.10) 0%, transparent 70%),
    radial-gradient(ellipse 600px 300px at 75% 25%, rgba(56, 189, 248, 0.08) 0%, transparent 75%),
    linear-gradient(115deg, transparent 40%, rgba(56, 189, 248, 0.05) 50%, transparent 60%);
  mix-blend-mode: screen;
  animation: waterShaftDrift 14s ease-in-out infinite alternate;
}

@keyframes waterShaftDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.7; }
  50% { transform: translate3d(20px, 5px, 0) scale(1.05); opacity: 1; }
  100% { transform: translate3d(-15px, 10px, 0) scale(0.98); opacity: 0.75; }
}

/* Underwater Caustics Web */
.underwater-caustics-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background-image: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.07) 0%, transparent 60%);
  mix-blend-mode: screen;
  filter: blur(8px);
}

/* Underwater Typography & Links */
.site-footer.underwater-footer .footer-inner {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.site-footer.underwater-footer .footer-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-footer.underwater-footer .footer-copy {
  color: #7dd3fc;
  font-weight: 500;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.site-footer.underwater-footer .footer-right {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.site-footer.underwater-footer .footer-back-top {
  color: #38bdf8;
  font-weight: 600;
  text-decoration: none;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.2);
  transition: all var(--transition-normal);
}

.site-footer.underwater-footer .footer-back-top:hover {
  background: rgba(14, 165, 233, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
  transform: translateY(-2px);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-title {
    font-size: 3.5rem;
  }

  .timeline-card-main {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .timeline-meta {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-right: 0;
    padding-bottom: 1.25rem;
  }

  .tool-layout {
    grid-template-columns: 1fr;
  }
}

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

  .mobile-toggle {
    display: block;
  }

  .hero-section {
    padding: 3rem 0 2rem;
    min-height: auto;
  }

  .hero-title {
    font-size: clamp(2.7rem, 14vw, 3.5rem);
  }

  .hero-layout {
    gap: 3rem;
  }

  .hero-photo-frame {
    width: min(300px, 82vw);
  }

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

  .modal-body {
    padding: 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Books Library & Interactive Gallery Styles
   ========================================================================== */

.books-page {
  background-color: var(--bg-primary);
  min-height: 100vh;
}

.books-main-container {
  padding: 3rem 0 6rem;
}

.books-hero {
  margin-bottom: 2.5rem;
  text-align: center;
  max-width: 840px;
  margin-left: auto;
  margin-right: auto;
}

.books-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--shadow-subtle);
  margin-bottom: 1.25rem;
}

.books-hero-badge .badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(5, 150, 105, 0.5);
}

.books-hero-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.books-hero-subtitle {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Listening Callout Card */
.books-callout-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-blue);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  text-align: left;
  box-shadow: var(--shadow-subtle);
  margin-bottom: 2rem;
}

.callout-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.callout-content {
  flex: 1;
}

.callout-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.callout-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.inline-link {
  color: var(--accent-blue);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(37, 99, 235, 0.2);
  transition: var(--transition-fast);
}

.inline-link:hover {
  border-bottom-color: var(--accent-blue);
}

/* Stats Grid */
.books-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  text-align: center;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 0.2rem;
  font-family: 'JetBrains Mono', monospace;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* Toolbar: Search, Filter & Sort */
.books-toolbar {
  margin-bottom: 2.5rem;
}

.search-box-wrapper {
  position: relative;
  max-width: 680px;
  margin: 0 auto 1.5rem;
}

.toolbar-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
}

.filter-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.filter-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-subtle);
}

.filter-pill:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--text-primary);
  color: #ffffff;
  border-color: var(--text-primary);
}

.sort-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.85rem;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition-fast);
  margin-left: auto;
}

.sort-select-wrapper:hover,
.sort-select-wrapper:focus-within {
  border-color: var(--accent-blue);
  background: var(--bg-tertiary);
}

.sort-icon-svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.sort-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
  padding: 0.35rem 1.4rem 0.35rem 0.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.15rem center;
  background-size: 10px;
}

.sort-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

#bookSearchInput {
  width: 100%;
  padding: 0.85rem 3rem 0.85rem 3.25rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  box-shadow: var(--shadow-subtle);
  outline: none;
  transition: var(--transition-normal);
}

#bookSearchInput:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.clear-search-btn {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  line-height: 1;
}

.clear-search-btn:hover {
  color: var(--text-primary);
}

/* Books Grid & Cards */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 2rem 1.5rem;
}

.book-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition-normal);
}

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

.book-cover-frame {
  position: relative;
  aspect-ratio: 2 / 3;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.15), 0 2px 6px -1px rgba(0, 0, 0, 0.08);
  margin-bottom: 0.9rem;
  transition: var(--transition-normal);
}

.book-card:hover .book-cover-frame {
  box-shadow: 0 16px 32px -6px rgba(0, 0, 0, 0.22), 0 4px 12px -2px rgba(0, 0, 0, 0.12);
}

.book-cover-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.25rem 1rem;
  text-align: center;
  border-left: 6px solid #334155;
  z-index: 1;
}

.fallback-title {
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.fallback-author {
  color: #94a3b8;
  font-size: 0.78rem;
}

.book-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
  transition: transform 0.35s ease;
}

.book-card:hover .book-cover-img {
  transform: scale(1.04);
}

/* Series Subline and Ribbon */
.card-series-subline {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-indigo);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.series-order-ribbon {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--accent-indigo);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.02em;
}

/* Series Collections Shelves Layout */
.books-series-shelves-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.series-shelf-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}

.series-shelf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.series-shelf-title-group {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.series-shelf-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.series-shelf-author {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 600;
}

.series-shelf-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.22);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

.series-shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem 1.5rem;
}

/* Special Treatment: Currently Reading Book Card */
.book-card.is-currently-reading .book-cover-frame {
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.5), 0 8px 24px -2px rgba(16, 185, 129, 0.3);
  position: relative;
}

.book-card.is-currently-reading:hover .book-cover-frame {
  box-shadow: 0 0 0 2.5px rgba(16, 185, 129, 0.8), 0 16px 36px -4px rgba(16, 185, 129, 0.45);
}

.book-card.is-currently-reading .book-card-title {
  color: var(--text-primary);
}

@keyframes readingPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Badges */
.card-rating-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fbbf24;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(251, 191, 36, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

.card-rating-badge.reading {
  background: rgba(6, 78, 59, 0.9);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.5);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

.card-rating-badge.reading::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: readingPulse 1.8s infinite;
}

.card-rating-badge.partial {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.35);
}

.card-rating-badge.unrated {
  color: #cbd5e1;
  border-color: rgba(203, 213, 225, 0.25);
}

.card-rating-badge.queue {
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.3);
}

.modal-rating-badge.partial {
  background: rgba(167, 139, 250, 0.12);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.modal-rating-badge.reading {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.modal-rating-badge.read {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.format-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #38bdf8;
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.3);
  z-index: 2;
}

.book-cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 1rem;
  text-align: center;
  z-index: 3;
}

.book-cover-overlay span {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  background: var(--accent-blue);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.book-card:hover .book-cover-overlay {
  opacity: 1;
}

/* Card Info */
.book-card-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card-author {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-card-category {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-indigo);
  background: var(--bg-tertiary);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* Empty State */
.books-empty-state {
  text-align: center;
  padding: 4rem 1rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  margin: 2rem 0;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

/* Interactive Review Modal */
.book-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: modalFadeIn 0.2s ease-out;
}

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

.book-modal-content {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 820px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 2.25rem;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.book-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--bg-tertiary);
  border: none;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.book-modal-close:hover {
  background: var(--border-medium);
  color: var(--text-primary);
}

.modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 2.25rem;
  align-items: flex-start;
  min-width: 0;
}

.modal-details-wrapper {
  min-width: 0;
  max-width: 100%;
}

.modal-cover-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.2);
}

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

.modal-format-badge {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  background: rgba(17, 24, 39, 0.85);
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.modal-meta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.modal-rating-badge {
  background: #fef3c7;
  color: #b45309;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid #fde68a;
}

.modal-rating-badge.five-star {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.modal-rating-badge.queue {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.modal-category-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.modal-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 0.4rem;
  overflow-wrap: anywhere;
}

.modal-author {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.modal-meta-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-meta-extra strong {
  color: var(--text-primary);
}

.meta-dot {
  color: var(--border-medium);
}

.modal-review-section {
  margin-bottom: 2rem;
}

.review-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.modal-review-text {
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--text-secondary);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

.modal-review-text > * {
  max-width: 100%;
}

.modal-review-text blockquote {
  border-left: 3px solid var(--accent-blue);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-primary);
  font-style: italic;
  background: var(--bg-tertiary);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.modal-review-text ul {
  padding-left: 1.25rem;
  margin: 0.75rem 0;
}

.modal-review-text li {
  margin-bottom: 0.5rem;
}

.modal-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

/* Modal Responsive */
@media (max-width: 768px) {
  .books-hero-title {
    font-size: 2.3rem;
  }

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

  .book-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .book-modal-content {
    width: 100%;
    max-width: none;
    max-height: 96dvh;
    border-radius: 1.35rem 1.35rem 0 0;
    border-bottom: 0;
    padding: 1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .book-modal-close {
    position: sticky;
    top: 0;
    right: auto;
    z-index: 10;
    width: 44px;
    height: 44px;
    margin: 0 0 -2.75rem auto;
    background: rgba(241, 245, 249, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .modal-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .modal-cover-wrapper {
    max-width: 132px;
    margin: 0 auto;
  }

  .modal-details-wrapper {
    min-width: 0;
  }

  .modal-meta-row {
    padding-right: 3.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
  }

  .modal-title {
    font-size: clamp(1.55rem, 7vw, 2rem);
    line-height: 1.16;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
  }

  .modal-author {
    font-size: 1rem;
    margin-bottom: 0.9rem;
  }

  .modal-meta-extra {
    align-items: stretch;
    gap: 0.45rem;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
  }

  .modal-meta-extra > span:not(.meta-dot) {
    padding: 0.38rem 0.6rem;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
  }

  .modal-meta-extra .meta-dot {
    display: none;
  }

  .modal-review-section {
    margin-bottom: 1.35rem;
  }

  .review-heading {
    font-size: 1.15rem;
    margin-bottom: 0.65rem;
  }

  .modal-review-text {
    font-size: 1rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
  }

  .modal-review-text blockquote {
    margin-left: 0;
    margin-right: 0;
    padding: 0.75rem 0.9rem;
  }

  .modal-review-text ul,
  .modal-review-text ol {
    padding-left: 1.15rem;
  }

  .modal-links-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding-top: 1rem;
  }

  .modal-links-row .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    text-align: center;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem 1rem;
  }
}

@media (max-width: 640px) {
  .book-modal-content {
    max-height: 100dvh;
    min-height: min(100dvh, 34rem);
    border-radius: 0;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .modal-cover-wrapper {
    display: none;
  }

  .modal-layout {
    display: block;
  }

  .modal-meta-row {
    padding-top: 0.25rem;
  }
}

/* ==========================================================================
   Work Page & Core Competencies Styles
   ========================================================================== */

.work-hero-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 5.5rem 0 4rem;
  background:
    radial-gradient(circle at 82% 18%, rgba(56, 189, 248, 0.28), transparent 32%),
    radial-gradient(circle at 12% 82%, rgba(99, 102, 241, 0.32), transparent 42%),
    linear-gradient(130deg, #09142b 0%, #0f2756 50%, #1e3a8a 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.work-hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.09;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.4) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.work-hero-header {
  max-width: 860px;
}

.work-hero-title {
  font-size: clamp(2.6rem, 5.5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: #ffffff;
  margin: 1.25rem 0 1rem;
}

.work-hero-subtitle {
  font-size: 1.22rem;
  color: rgba(239, 246, 255, 0.88);
  line-height: 1.62;
  margin-bottom: 1.6rem;
}

.work-hero-actions {
  margin-bottom: 2.5rem;
}

.work-hero-meta-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

@media (max-width: 768px) {
  .work-hero-meta-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 1.25rem;
  }
}

.work-hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.work-hero-stat .stat-num {
  font-size: 1.55rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: -0.02em;
}

.work-hero-stat .stat-lbl {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(239, 246, 255, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.competencies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.competency-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.competency-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: var(--border-medium);
}

.competency-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.competency-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.competency-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.education-card {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2rem;
  max-width: 720px;
}

.education-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.education-degree {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.education-school {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 0.25rem;
}

.education-dates {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.education-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ==========================================================================
   Homepage: Featured Books Spotlight
   ========================================================================== */

.home-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.home-book-card {
  display: flex;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.home-book-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-hover);
}

.home-book-cover-wrap {
  position: relative;
  width: 90px;
  min-width: 90px;
  height: 132px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-book-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.home-book-card:hover .home-book-cover {
  transform: scale(1.04);
}

.home-book-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
}

.home-book-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-book-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.home-book-rating {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}
.star-meter {
  --pct: 100%;
  position: relative;
  display: inline-block;
  font-size: 0.9rem;
  line-height: 1;
  color: #e5e7eb;
}
.star-meter::before,
.star-meter::after {
  content: "★★★★★";
  letter-spacing: 0.06em;
}
.star-meter::after {
  position: absolute;
  inset: 0;
  width: var(--pct);
  overflow: hidden;
  color: #f59e0b;
}

.home-book-snippet {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-style: italic;
}

.home-books-cta-box {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
}

/* Taggist Icon Box */
.icon-taggist {
  background: rgba(225, 29, 72, 0.1);
  color: var(--accent-coral);
}

/* Responsive tweaks for Work & Books preview */
@media (max-width: 768px) {
  .work-hero-title {
    font-size: 2.2rem;
  }
  .work-hero-meta-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .competencies-grid {
    grid-template-columns: 1fr;
  }
  .home-books-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   Notes Index Page (/notes/)
   ============================================= */

.notes-index-hero {
  padding: 5rem 0 3.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
}

.notes-index-hero .section-tag {
  margin-bottom: 1rem;
}

.notes-index-hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.notes-index-hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 2rem;
  line-height: 1.65;
}

.notes-index-count {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
}

/* Search & Filters Toolbar */
.notes-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem 0 1.5rem;
}

.notes-search-wrap {
  position: relative;
  max-width: 440px;
}

.notes-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.notes-search-input {
  width: 100%;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  padding: 0.65rem 1rem 0.65rem 2.4rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.notes-search-input::placeholder {
  color: var(--text-muted);
}

.notes-search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.notes-tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.notes-tag-pill {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.notes-tag-pill:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.notes-tag-pill.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Notes Grid for Index Page */
.notes-index-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  min-height: 200px;
}

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

@media (max-width: 640px) {
  .notes-index-grid {
    grid-template-columns: 1fr;
  }

  .notes-search-wrap {
    max-width: 100%;
  }

  .notes-index-hero {
    padding: 3.5rem 0 2.5rem;
  }
}

/* Load More */
.notes-load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 2.5rem 0 1rem;
}

.notes-load-more-btn {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 2rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.notes-load-more-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.06);
}

.notes-load-more-btn.hidden {
  display: none;
}

/* Empty / no-results state */
.notes-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.notes-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.notes-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

/* Homepage notes CTA */
.notes-index-cta-wrap {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* Notes count badge shown on nav or page */
.notes-page-section {
  padding: 3rem 0 5rem;
}

/* ==========================================================================
   Atmospheric Tree Canopy Dappled Shadows & Sunlight (Komorebi System)
   ========================================================================== */
#canopyShadowsOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15; /* Glides over background & cards, below interactive nav */
  mix-blend-mode: multiply;
  overflow: hidden;
  contain: paint;
  transition: opacity 1.2s ease;
}

.canopy-svg {
  position: absolute;
  pointer-events: none;
  filter: blur(18px);
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

/* Left Tree Structure (Connected trunk along left edge + sweeping boughs) */
.canopy-tree-left {
  top: -100px;
  left: -160px;
  width: 112vw;
  max-width: 1750px;
  min-width: 850px;
  transform-origin: 0% 25%;
  animation:
    treeSwayLeft 24s ease-in-out infinite alternate,
    cloudPassingLeft 37s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Right Tree Structure (Connected trunk along right edge + sweeping boughs) */
.canopy-tree-right {
  top: 780px;
  right: -150px;
  width: 108vw;
  max-width: 1680px;
  min-width: 800px;
  transform-origin: 100% 30%;
  animation:
    treeSwayRight 20s ease-in-out infinite alternate,
    cloudPassingRight 43s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Dappled Golden Sunlight Caustics (Filtering through leaves across sections) */
.canopy-sunlight-top {
  top: -60px;
  left: -80px;
  width: 105vw;
  max-width: 1650px;
  filter: blur(22px);
  mix-blend-mode: screen;
  opacity: 0.85;
  animation:
    sunCausticPulseTop 11s ease-in-out infinite alternate,
    cloudPassingSunTop 37s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.canopy-sunlight-mid {
  top: 1100px;
  left: 0;
  width: 100vw;
  max-width: 1550px;
  filter: blur(22px);
  mix-blend-mode: screen;
  opacity: 0.8;
  animation:
    sunCausticPulseMid 13s ease-in-out infinite alternate,
    cloudPassingSunMid 43s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Deep, Sweeping Branch Movements (Firmly rooted to the side trunk) */
@keyframes treeSwayLeft {
  0% {
    transform: rotate(0deg) translate3d(0, 0, 0) scale(1);
  }
  35% {
    transform: rotate(3.2deg) translate3d(48px, 24px, 0) scale(1.025);
  }
  70% {
    transform: rotate(-2.4deg) translate3d(-30px, 38px, 0) scale(0.98);
  }
  100% {
    transform: rotate(1.8deg) translate3d(25px, -15px, 0) scale(1.015);
  }
}

@keyframes treeSwayRight {
  0% {
    transform: rotate(0deg) translate3d(0, 0, 0) scale(1);
  }
  40% {
    transform: rotate(-3.8deg) translate3d(-52px, 30px, 0) scale(1.03);
  }
  75% {
    transform: rotate(2.5deg) translate3d(35px, -22px, 0) scale(0.975);
  }
  100% {
    transform: rotate(-1.2deg) translate3d(-18px, 15px, 0) scale(1.01);
  }
}

/* Passing Cloud Shadow Transparency Cycles */
@keyframes cloudPassingLeft {
  0% {
    opacity: 0.95;
    filter: blur(18px);
  }
  16% {
    opacity: 1;
    filter: blur(17px);
  }
  28% {
    opacity: 0.22;
    filter: blur(26px);
  }
  38% {
    opacity: 0.12;
    filter: blur(28px);
  }
  48% {
    opacity: 0.48;
    filter: blur(21px);
  }
  56% {
    opacity: 0.28;
    filter: blur(25px);
  }
  70% {
    opacity: 0.92;
    filter: blur(18px);
  }
  84% {
    opacity: 0.88;
    filter: blur(18px);
  }
  92% {
    opacity: 0.38;
    filter: blur(24px);
  }
  100% {
    opacity: 0.95;
    filter: blur(18px);
  }
}

@keyframes cloudPassingRight {
  0% {
    opacity: 0.35;
    filter: blur(24px);
  }
  14% {
    opacity: 0.88;
    filter: blur(18px);
  }
  26% {
    opacity: 0.98;
    filter: blur(17px);
  }
  42% {
    opacity: 0.90;
    filter: blur(18px);
  }
  52% {
    opacity: 0.20;
    filter: blur(27px);
  }
  64% {
    opacity: 0.10;
    filter: blur(29px);
  }
  76% {
    opacity: 0.68;
    filter: blur(21px);
  }
  86% {
    opacity: 0.32;
    filter: blur(25px);
  }
  94% {
    opacity: 0.72;
    filter: blur(19px);
  }
  100% {
    opacity: 0.35;
    filter: blur(24px);
  }
}

@keyframes cloudPassingSunTop {
  0% {
    opacity: 0.85;
  }
  16% {
    opacity: 1;
  }
  28% {
    opacity: 0.08;
  }
  38% {
    opacity: 0.03;
  }
  48% {
    opacity: 0.35;
  }
  56% {
    opacity: 0.12;
  }
  70% {
    opacity: 0.88;
  }
  84% {
    opacity: 0.82;
  }
  92% {
    opacity: 0.20;
  }
  100% {
    opacity: 0.85;
  }
}

@keyframes cloudPassingSunMid {
  0% {
    opacity: 0.18;
  }
  14% {
    opacity: 0.78;
  }
  26% {
    opacity: 0.92;
  }
  42% {
    opacity: 0.82;
  }
  52% {
    opacity: 0.06;
  }
  64% {
    opacity: 0.02;
  }
  76% {
    opacity: 0.55;
  }
  86% {
    opacity: 0.15;
  }
  94% {
    opacity: 0.60;
  }
  100% {
    opacity: 0.18;
  }
}

@keyframes sunCausticPulseTop {
  0% {
    transform: translate3d(0, 0, 0) scale(0.96);
  }
  50% {
    transform: translate3d(32px, 18px, 0) scale(1.04);
  }
  100% {
    transform: translate3d(-20px, 26px, 0) scale(0.98);
  }
}

@keyframes sunCausticPulseMid {
  0% {
    transform: translate3d(0, 0, 0) scale(0.97);
  }
  50% {
    transform: translate3d(-28px, 20px, 0) scale(1.04);
  }
  100% {
    transform: translate3d(22px, -15px, 0) scale(0.99);
  }
}
