/* ============================================================
   UDAY BABBAR — Personal Website
   Japanese Minimalist Aesthetic  ·  Wabi-Sabi Design System
   ============================================================ */

/* --- Google Fonts loaded via <link> tags in HTML for better performance --- */

/* --- Design Tokens --- */
:root {
  /* Palette */
  --washi: #faf7f2;
  /* 和紙  warm off-white */
  --sumi: #1a1a1a;
  /* 墨   near-black */
  --nezumi: #756e69;
  /* 鼠   warm gray — WCAG AA against washi (4.7:1) */
  --shu: #8B3A2A;
  /* 朱   lacquer red — earthy, wabi-sabi */
  --yoru: #1c1c1e;
  /* 夜   dark section bg */
  --kinari: #ede7e0;
  /* 生成り light warm gray (fainter) */
  --kitsune: #c9a06b;
  /* 狐   warm gold for accents */

  /* Semantics */
  --bg: var(--washi);
  --text: var(--sumi);
  --text-sec: var(--nezumi);
  --accent: var(--shu);
  --border: var(--kinari);

  /* Typography */
  --serif: 'Cormorant Garamond', 'Georgia', serif;
  --sans: 'Inter', 'Helvetica Neue', sans-serif;
  --mono: 'IBM Plex Mono', 'Menlo', monospace;

  /* Sizes */
  --container: 1100px;
  --article-w: 640px;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--nezumi) transparent;
}

html::-webkit-scrollbar {
  width: 4px;
}

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

html::-webkit-scrollbar-thumb {
  background: var(--nezumi);
  border-radius: 2px;
}

::selection {
  background: rgba(193, 64, 61, 0.15);
}

body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: 0.015em;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 10% -10%, rgba(193, 64, 61, 0.05), transparent 40%),
    radial-gradient(circle at 90% 100%, rgba(193, 64, 61, 0.025), transparent 35%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  animation: bodyFadeIn 0.6s ease forwards;
}

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

a {
  transition: color 0.7s ease;
}

:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 1px solid rgba(139, 58, 42, 0.45);
  outline: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 4px;
}

/* --- Grain Overlay --- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
}

/* --- Utility --- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem;
}

.micro-label {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-sec);
}

.thin-rule {
  width: 40px;
  height: 1px;
  background: var(--border);
  border: none;
  margin: 1.5rem 0;
}

/* --- Fade-up Animation --- */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

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

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2.5rem;
  transition: background 0.5s var(--ease-out-expo), border-color 0.5s, box-shadow 0.6s var(--ease-out-expo);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(250, 247, 242, 0.78);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 24px rgba(0, 0, 0, 0.03);
}

.nav-logo {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: opacity 0.4s, transform 0.4s var(--ease-out-expo);
  animation: logoBreathe 4s ease-in-out infinite;
}

.nav-logo:hover {
  opacity: 0.7;
  transform: scale(1.08);
  animation-play-state: paused;
}

@keyframes logoBreathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.03); opacity: 0.85; }
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-sec);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.6s var(--ease-out-expo);
}

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

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

.nav-links a:active {
  opacity: 0.6;
  transition: opacity 0.1s;
}

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

.hero-canvas {
  position: absolute !important;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
}

/* Enso SVG */
.enso-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 90vw);
  height: min(420px, 90vw);
  z-index: 1;
  opacity: 0.18;
}

.enso-circle {
  fill: none;
  stroke: var(--sumi);
  stroke-width: 1.5;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: drawEnso 2.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.enso-circle:nth-child(2) {
  stroke-width: 1;
  opacity: 0.5;
  animation-delay: 0.3s;
}

@keyframes drawEnso {
  to {
    stroke-dashoffset: 0;
  }
}

/* Hanko (seal) */
.hanko-mark {
  display: inline-block;
  width: 36px;
  height: 36px;
  margin-bottom: 1.2rem;
  opacity: 1;
  animation: heroFadeIn 0.8s ease forwards, logoBreathe 5s ease-in-out infinite 1s;
  animation-delay: 0.3s, 0.3s;
}

.hanko-mark rect {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
}

.hanko-mark text {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  fill: var(--accent);
}

/* Hero text elements */
.hero-name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.8rem, 7.2vw, 4.6rem);
  letter-spacing: 0.03em;
  line-height: 1.08;
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  opacity: 1;
  animation: heroFadeIn 1s var(--ease-out-expo) forwards;
  animation-delay: 0.08s;
}

.hero-title {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-sec);
  margin-top: 1rem;
  opacity: 0.92;
  animation: heroFadeIn 0.8s ease forwards;
  animation-delay: 0.16s;
}

.hero-subtitle {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--nezumi);
  margin-top: 0.4rem;
  opacity: 0.86;
  animation: heroFadeIn 0.8s ease forwards;
  animation-delay: 0.22s;
}

.hero .thin-rule {
  margin: 1.5rem auto;
  opacity: 0.55;
  animation: heroFadeIn 0.8s ease forwards;
  animation-delay: 0.28s;
}

.hero-summary {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text-sec);
  max-width: 500px;
  margin: 0 auto;
  opacity: 0.82;
  animation: heroFadeIn 0.8s ease forwards;
  animation-delay: 0.34s;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

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

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  animation: heroFadeIn 0.8s ease forwards;
  animation-delay: 1.2s;
}

.scroll-hint span {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--nezumi);
}

.scroll-line {
  display: block;
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  margin: 0.6rem auto 0;
  animation: scrollPulse 2.5s ease-in-out infinite;
}

@keyframes scrollPulse {

  0%,
  100% {
    opacity: 0.2;
    transform: scaleY(0.5) translateY(0);
  }

  50% {
    opacity: 0.8;
    transform: scaleY(1) translateY(4px);
  }
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-sec);
  margin-bottom: 1.2rem;
}

.section-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 4.5vw, 3rem);
  color: var(--text);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.1rem;
  color: var(--text-sec);
  margin-bottom: 3.5rem;
}

/* ============================================================
   PATH / TIMELINE
   ============================================================ */
.path-section {
  padding: 8rem 0 6rem;
}

.timeline {
  position: relative;
  padding-left: 100px;
  margin-top: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 100px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  display: flex;
  padding-bottom: 2.5rem;
  transition: opacity 0.3s;
}

.timeline-item:not(:hover) ~ .timeline-item:not(:hover) {
  /* adjacency selector placeholder for future use */
  opacity: 1;
}

.timeline-period {
  position: absolute;
  left: -100px;
  width: 88px;
  text-align: right;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-sec);
  padding-top: 0.25rem;
}

.timeline-dot {
  position: absolute;
  left: -4px;
  top: 0.35rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.4s var(--ease-out-expo), box-shadow 0.4s, transform 0.4s var(--ease-out-expo);
  z-index: 2;
}

.timeline-content {
  padding-left: 2rem;
  padding-right: 1rem;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  border-radius: 0 6px 6px 0;
  transition: background 0.35s;
}

/* Hover accent line — overlays the ::before perfectly */
.timeline-item::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: transparent;
  transition: background 0.35s;
}

.timeline-item:hover .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(193, 64, 61, 0.1), 0 0 12px rgba(193, 64, 61, 0.25);
  transform: scale(1.2);
}

.timeline-item:hover::after {
  background: var(--accent);
}

.timeline-item:hover .timeline-content {
  background: rgba(193, 64, 61, 0.018);
}

.timeline-company {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.35rem;
  color: var(--text);
  margin-bottom: 0;
  letter-spacing: 0.01em;
}

.timeline-role {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-sec);
  margin-bottom: 0.6rem;
}

.timeline-desc {
  font-size: 0.92rem;
  color: var(--text-sec);
  line-height: 1.7;
  max-width: 520px;
}

/* Education */
.education-block {
  margin-top: 2rem;
  padding-top: 2rem;
}

.education-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
}

.education-item .school {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--text);
}

.education-item .degree {
  color: var(--text-sec);
  font-size: 0.85rem;
}

/* --- Ink-wash Divider --- */
.ink-divider {
  width: 100%;
  height: 40px;
  overflow: hidden;
  opacity: 0.5;
}

.ink-divider svg {
  width: 100%;
  height: 100%;
}

/* --- Koi Decoration (Sakana-inspired) --- */
.koi-decoration {
  position: absolute;
  top: 2rem;
  right: 0;
  width: 80px;
  height: 140px;
  opacity: 0.6;
  animation: koiFloat 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes koiFloat {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-12px) rotate(2deg);
  }
}

/* --- Timeline Header (icon + company) --- */
.timeline-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.1rem;
}

.timeline-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.6;
  transition: opacity 0.3s;
}

.timeline-item:hover .timeline-icon {
  opacity: 1;
}

/* --- Inline Role (same line as company) --- */
.timeline-role-inline {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-sec);
  opacity: 0.6;
  margin-left: 0.3rem;
  padding-top: 0.15rem;
}

/* --- Uber Hover: route dot travels --- */
.timeline-uber .route-dot {
  opacity: 0;
  transition: opacity 0.3s;
}
.timeline-uber:hover .route-dot {
  opacity: 0.7;
}

/* --- Tinder Hover: flame flicker --- */
.timeline-tinder .flame-path {
  transition: all 0.3s;
}
.timeline-tinder:hover .flame-path {
  animation: flameFlicker 1.2s ease-in-out infinite;
  stroke: var(--accent);
}
@keyframes flameFlicker {
  0%, 100% { transform: scaleY(1) translateY(0); opacity: 0.6; }
  25%      { transform: scaleY(1.06) translateY(-0.5px); opacity: 1; }
  50%      { transform: scaleY(0.96) translateY(0.5px); opacity: 0.8; }
  75%      { transform: scaleY(1.03) translateY(-0.3px); opacity: 1; }
}
.timeline-tinder .flame-path {
  transform-origin: center bottom;
}

/* --- Earlier Role Icons --- */
.earlier-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-sec);
  opacity: 0.35;
  margin-bottom: 0.15rem;
  transition: color 0.3s, opacity 0.3s;
}

.earlier-item:hover .earlier-icon {
  color: var(--accent);
  opacity: 1;
}

/* --- Quora: Bouncing Question Mark --- */
.earlier-quora:hover .q-mark {
  animation: qBounce 0.8s ease-in-out infinite;
  transform-origin: center;
}
@keyframes qBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* --- Quantcast: Growing Bars --- */
.earlier-quantcast:hover .bar-rect {
  animation: barGrow 1s ease-in-out infinite alternate;
  transform-origin: bottom;
}
.earlier-quantcast:hover .bar-rect:nth-child(2) { animation-delay: 0.1s; }
.earlier-quantcast:hover .bar-rect:nth-child(3) { animation-delay: 0.2s; }

@keyframes barGrow {
  from { transform: scaleY(1); }
  to { transform: scaleY(1.3); }
}

/* --- Yahoo: Pulsing Nodes & Links --- */
.earlier-yahoo:hover .network-node {
  animation: nodePulse 1.5s ease-in-out infinite;
}
.earlier-yahoo:hover .network-link {
  animation: linkFade 1.5s ease-in-out infinite;
}
@keyframes nodePulse {
  0%, 100% { r: 2; opacity: 0.5; }
  50% { r: 2.5; opacity: 1; }
}
@keyframes linkFade {
  0%, 100% { opacity: 0.2; stroke-dasharray: 2 1; }
  50% { opacity: 0.6; stroke-dasharray: 0; }
}

/* --- Comscore: Drawing Line --- */
.earlier-comscore:hover .chart-line {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: lineDraw 1.5s ease-out forwards;
}
@keyframes lineDraw {
  to { stroke-dashoffset: 0; }
}

/* --- Earlier Roles (collapsed) --- */
.earlier-roles {
  margin-top: 1rem;
  padding-top: 1.5rem;
}

.earlier-label {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-sec);
  opacity: 0.5;
  margin-bottom: 1rem;
}

.earlier-grid {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.earlier-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.earlier-company {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1rem;
  color: var(--text);
  opacity: 0.65;
}

.earlier-role {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-sec);
  opacity: 0.45;
}

.earlier-year {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-sec);
  opacity: 0.35;
}

/* ============================================================
   SHAYARI SECTION
   ============================================================ */
.shayari-section {
  background: #1a1816;
  padding: 8rem 0;
  position: relative;
  overflow: hidden;
}

.shayari-section::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(201, 160, 107, 0.05), transparent 70%);
  pointer-events: none;
}

.shayari-section .section-num {
  border-color: rgba(232, 224, 213, 0.2);
  color: var(--kinari);
}

.shayari-section .section-title {
  color: var(--washi);
}

.shayari-section .section-subtitle {
  color: rgba(232, 224, 213, 0.6);
}

.shayari-epigraph {
  text-align: center;
  margin: 4rem 0;
  padding: 0 2rem;
}

.epigraph-urdu {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--washi);
  opacity: 0.7;
  margin-bottom: 0.8rem;
  direction: rtl;
  line-height: 2;
}

.epigraph-trans {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--kinari);
  opacity: 0.45;
  margin-bottom: 0.6rem;
}

.epigraph-attr {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kinari);
  opacity: 0.3;
}

.shayari-grid {
  margin-top: 1rem;
}

.shayari-collection-cta {
  text-align: center;
  margin-top: 3.5rem;
}

.shayari-collection-link {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--kinari);
  opacity: 0.5;
  text-decoration: none;
  transition: opacity 0.3s;
}

.shayari-collection-link:hover {
  opacity: 0.85;
}

/* ============================================================
   INTERESTS SECTION
   ============================================================ */
.interests-section {
  background: #1a1816;
  padding: 5.25rem 0 6.25rem;
  position: relative;
  overflow: hidden;
}

.interests-section::before {
  content: '';
  position: absolute;
  top: -22%;
  right: -14%;
  width: 55%;
  height: 55%;
  background: radial-gradient(circle, rgba(201, 160, 107, 0.055), transparent 70%);
  pointer-events: none;
}

.interests-section::after {
  content: '';
  position: absolute;
  bottom: -28%;
  left: -18%;
  width: 58%;
  height: 58%;
  background: radial-gradient(circle, rgba(139, 58, 42, 0.05), transparent 72%);
  pointer-events: none;
}

.interests-section .section-num {
  border-color: rgba(232, 224, 213, 0.2);
  color: var(--kinari);
}

.interests-section .section-title {
  color: var(--washi);
}

.interests-section .section-subtitle {
  color: rgba(232, 224, 213, 0.6);
}

.interests-cta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.interests-section .writing-category {
  margin-top: 2.35rem;
}

.interests-section .writing-card-inner {
  min-height: 228px;
  border-radius: 8px;
}

.interests-section .writing-grid {
  margin-top: 1.6rem;
  gap: 1.25rem;
}

.interests-section .writing-category-header {
  padding-bottom: 1rem;
  border-bottom-color: rgba(232, 224, 213, 0.12);
}

.interests-section .writing-category-title {
  color: rgba(232, 224, 213, 0.78);
}

/* ============================================================
   WRITING SECTION
   ============================================================ */
.writing-section {
  background: var(--yoru);
  padding: 8rem 0;
  position: relative;
  overflow: hidden;
}

.writing-section::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(193, 64, 61, 0.06), transparent 70%);
  pointer-events: none;
}

.writing-section::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(193, 64, 61, 0.04), transparent 70%);
  pointer-events: none;
}

.writing-section .section-num {
  border-color: rgba(232, 224, 213, 0.2);
  color: var(--kinari);
}

.writing-section .section-title {
  color: var(--washi);
}

.writing-section .section-subtitle {
  color: rgba(232, 224, 213, 0.6);
}

/* Flowing SVG stroke */
.writing-stroke {
  position: absolute;
  top: 12rem;
  left: 0;
  width: 100%;
  height: 50%;
  z-index: 0;
  pointer-events: none;
}

/* Writing Category Grouping */
.writing-category {
  margin-top: 4rem;
  position: relative;
  z-index: 1;
}

.writing-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  border-bottom: 1px solid rgba(232, 224, 213, 0.1);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  color: inherit;
  font: inherit;
  text-align: left;
  transition: border-color 0.3s;
}

.writing-category-header:hover,
.writing-category-header:focus-visible {
  border-bottom-color: rgba(232, 224, 213, 0.3);
}

.writing-category-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.8rem;
  color: var(--washi);
  margin: 0;
  letter-spacing: 0.02em;
}

.category-toggle-icon {
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--washi);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.6;
  pointer-events: none;
}

.writing-category.expanded .category-toggle-icon {
  transform: rotate(45deg);
  opacity: 1;
}

.category-content {
  display: grid;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.4s;
  margin-top: 0;
}

.writing-category.expanded .category-content {
  max-height: 2000px;
  opacity: 1;
  margin-top: 2rem;
}

/* Writing Grid — organic, asymmetric */
.writing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
  position: relative;
  z-index: 1;
}

.writing-card {
  --offset: 0rem;
  --card-accent: #888;
  position: relative;
  text-decoration: none;
  display: block;
  min-width: 0;
  transform: translateY(var(--offset));
  transition: transform 0.7s var(--ease-out-expo), box-shadow 0.6s var(--ease-out-expo);
  cursor: pointer;
  will-change: transform;
}

/* Featured card spans 2 columns */
.writing-featured {
  grid-column: span 2;
}

.writing-card-inner {
  position: relative;
  min-width: 0;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 2.5rem 2.2rem 2rem;
  overflow: hidden;
  height: 100%;
  transition: border-color 0.5s var(--ease-out-expo), background 0.5s, box-shadow 0.5s;
}

/* Inner accent glow */
.writing-card-inner::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -20%;
  width: 80%;
  height: 80%;
  background: radial-gradient(ellipse at 20% 30%, var(--card-accent), transparent 70%);
  opacity: 0.03;
  transition: opacity 0.6s;
  pointer-events: none;
  z-index: 0;
}

/* Top accent line (appears on hover) */
.writing-card-inner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, var(--card-accent) 40%, var(--card-accent) 60%, transparent 95%);
  opacity: 0;
  transition: opacity 0.5s;
  z-index: 1;
}

.writing-card:hover .writing-card-inner {
  border-color: color-mix(in srgb, var(--card-accent) 30%, rgba(255,255,255,0.12));
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.writing-card:focus-visible .writing-card-inner {
  border-color: color-mix(in srgb, var(--card-accent) 38%, rgba(255,255,255,0.14));
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.writing-card:hover .writing-card-inner::before,
.writing-card:focus-visible .writing-card-inner::before {
  opacity: 0.08;
}

.writing-card:hover .writing-card-inner::after,
.writing-card:focus-visible .writing-card-inner::after {
  opacity: 0.6;
}

.writing-card:hover {
  transform: translateY(calc(var(--offset) - 10px));
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.35),
    0 0 50px color-mix(in srgb, var(--card-accent) 10%, transparent),
    0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Featured card extra treatment */
.writing-featured .writing-card-inner {
  padding: 2.8rem 2.8rem 2.2rem;
}

/* Kanji number watermark */
.writing-num {
  position: absolute;
  top: 0.6rem;
  right: 1rem;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 4rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.02);
  pointer-events: none;
  z-index: 0;
  transition: color 0.5s, transform 0.5s cubic-bezier(0.23,1,0.32,1);
}

.writing-card:hover .writing-num,
.writing-card:focus-visible .writing-num {
  color: rgba(255, 255, 255, 0.04);
  transform: scale(1.08);
}

/* Ink brushstroke accent — animated draw-in */
.writing-ink {
  width: 2px;
  height: 0;
  background: linear-gradient(to bottom, var(--card-accent), transparent);
  border-radius: 1px;
  opacity: 0;
  margin-bottom: 1rem;
  transition: height 0.7s var(--ease-out-expo) 0.08s, opacity 0.4s;
  position: relative;
  z-index: 1;
}

.writing-card:hover .writing-ink {
  height: 40px;
  opacity: 0.8;
}

.writing-card:focus-visible .writing-ink {
  height: 40px;
  opacity: 0.8;
}

/* Tag / category */
.writing-tag {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--card-accent);
  margin-bottom: 0.7rem;
  padding-left: 0;
  border-left: 2px solid transparent;
  transition: padding-left 0.3s, border-color 0.3s;
  position: relative;
  z-index: 1;
}

.writing-card:hover .writing-tag {
  padding-left: 0.6rem;
  border-left-color: var(--card-accent);
}

.writing-card:focus-visible .writing-tag {
  padding-left: 0.6rem;
  border-left-color: var(--card-accent);
}

/* Title */
.writing-card-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.45rem;
  color: var(--washi);
  line-height: 1.3;
  margin-bottom: 0.5rem;
  letter-spacing: 0.015em;
  position: relative;
  z-index: 1;
  transition: color 0.4s, transform 0.5s var(--ease-out-expo);
  overflow-wrap: break-word;
}

.writing-card:hover .writing-card-title {
  transform: translateX(2px);
}

.writing-card:focus-visible .writing-card-title {
  transform: translateX(2px);
}

.writing-featured .writing-card-title {
  font-size: 1.85rem;
  line-height: 1.22;
}

/* Description */
.writing-card-desc {
  font-size: 0.82rem;
  line-height: 1.7;
  color: rgba(232, 224, 213, 0.4);
  position: relative;
  z-index: 1;
  transition: color 0.4s;
  overflow-wrap: break-word;
}

.writing-card:hover .writing-card-desc {
  color: rgba(232, 224, 213, 0.6);
}

.writing-card:focus-visible .writing-card-desc {
  color: rgba(232, 224, 213, 0.6);
}

/* Arrow */
.writing-arrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--card-accent);
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.5s var(--ease-out-expo) 0.12s, transform 0.5s var(--ease-out-expo) 0.12s;
  margin-top: 1.2rem;
  position: relative;
  z-index: 1;
}

.writing-card:hover .writing-arrow {
  opacity: 0.7;
  transform: translateX(0);
}

.writing-card:focus-visible .writing-arrow {
  opacity: 0.7;
  transform: translateX(0);
}

@media (pointer: coarse) {
  .writing-arrow {
    opacity: 0.45;
    transform: translateX(0);
  }
}

/* Hover silhouette / Photo */
.card-silhouette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  color: var(--card-accent);
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
  z-index: 0;
  pointer-events: none;
}

img.card-photo {
  mix-blend-mode: multiply;
  filter: grayscale(100%) contrast(1.1) brightness(1.2);
  object-fit: cover;
  object-position: center;
  width: 100%;
  height: 100%;
}

.writing-card:hover .card-silhouette,
.writing-card:focus-visible .card-silhouette {
  opacity: 0.12;
  transform: scale(1);
}

/* Card accent colors */
.card-experiment {
  --card-accent: #4f83ff;
}

.card-ghar {
  --card-accent: #c9a06b;
}

.card-meditation {
  --card-accent: #9fa38f;
}

.card-investing {
  --card-accent: #3d6b4f;
}

.card-investing-models {
  --card-accent: #2d5a3d;
}

.card-intelligence {
  --card-accent: #4a4e8a;
}

.card-nostalgia {
  --card-accent: #8B3A2A;
}

.card-truisms {
  --card-accent: #6b6560;
}

.card-kalpana {
  --card-accent: #3a4860;
}

.card-rajjot {
  --card-accent: #a0845c;
}

.card-communication {
  --card-accent: #7a6b5e;
}

.card-heart {
  --card-accent: #8B3A2A;
}

.card-shayari {
  --card-accent: #8B3A2A;
}

.card-raat {
  --card-accent: #3d5a80;
}

.card-afsana {
  --card-accent: #7a5478;
}

.card-pal {
  --card-accent: #b8762a;
}

.card-aag {
  --card-accent: #b85c2f;
}

.card-jaun {
  --card-accent: #5a6670;
}

.card-bashir {
  --card-accent: #8a4a3c;
}

.card-ironies {
  --card-accent: #8a4a2a;
}

.card-faraaz {
  --card-accent: #6b3e5b;
}

.card-fazli {
  --card-accent: #b05b3b;
}

.card-dushyant {
  --card-accent: #b84235;
}

.card-akbar {
  --card-accent: #3c6b5e;
}

.card-faakir {
  --card-accent: #7a6658;
}

.card-momin {
  --card-accent: #465566;
}

.card-kaifi {
  --card-accent: #873830;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-section {
  padding: 8rem 0 5rem;
}

.contact-note {
  font-size: 1.05rem;
  color: var(--text-sec);
  margin-bottom: 2.5rem;
  font-style: italic;
  font-family: var(--serif);
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 0.8rem;
  border-top: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.4s var(--ease-out-expo), padding-left 0.4s var(--ease-out-expo), background 0.4s;
}

.contact-row:last-child {
  border-bottom: 1px solid var(--border);
}

.contact-row:hover {
  border-color: var(--accent);
  padding-left: 1.4rem;
  background: rgba(193, 64, 61, 0.018);
  box-shadow: 0 2px 16px rgba(193, 64, 61, 0.04);
}

.contact-label {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-sec);
}

.contact-value {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--text);
}

.contact-value a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s;
}

.contact-value a:hover {
  color: var(--accent);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  padding: 5rem 0 4rem;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}

.footer-hanko {
  display: inline-block;
  width: 34px;
  height: 34px;
  opacity: 0.3;
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
  margin-bottom: 1rem;
}

.footer-hanko:hover {
  opacity: 1;
  transform: scale(1.1) rotate(2deg);
}

.footer-hanko rect {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
}

.footer-hanko text {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 12px;
  fill: var(--accent);
}

.footer-text {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-sec);
  opacity: 0.4;
  transition: opacity 0.4s;
}

.footer:hover .footer-text {
  opacity: 0.6;
}

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.article-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(250, 247, 242, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 1100;
  pointer-events: none;
}

.reading-progress-bar {
  width: 0%;
  height: 100%;
  background: var(--shu);
  transition: width 0.1s linear;
}

.article-nav.scrolled {
  border-bottom-color: var(--border);
}

.article-nav .back-link {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-sec);
  text-decoration: none;
  transition: color 0.3s;
}

.article-nav .back-link:hover {
  color: var(--text);
}

.article-nav .nav-logo {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--accent);
  text-decoration: none;
}

/* Linear / Key Ideas switch — essays that also exist as interactive decks.
   Sits on the right of the fixed nav, before the logo. */
.article-nav .view-toggle {
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 1.6rem;
  padding: 0.18rem;
  border: 1px solid rgba(26, 26, 26, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
}

.article-nav .view-toggle a {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--text-sec);
  text-decoration: none;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  transition: color 0.3s, background-color 0.3s;
}

.article-nav .view-toggle a:hover {
  color: var(--text);
}

.article-nav .view-toggle a.active {
  background: var(--text);
  color: var(--bg);
}

@media (max-width: 520px) {
  .article-nav .view-toggle {
    margin-right: 0.9rem;
  }

  .article-nav .view-toggle a {
    font-size: 0.56rem;
    padding: 0.28rem 0.55rem;
    letter-spacing: 0.05em;
  }
}

/* Article Container */
.article-container {
  max-width: var(--article-w);
  margin: 0 auto;
  padding: 10rem 2rem 5rem;
  opacity: 0;
  transform: translateY(24px);
  animation: articleEnter 0.8s ease forwards;
}

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

.article-category {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  border: 1px solid rgba(189, 74, 71, 0.3);
  padding: 0.3rem 0.9rem;
  border-radius: 3px;
  margin-bottom: 1.5rem;
  transition: border-color 0.4s, background 0.4s;
}

.article-category:hover {
  background: rgba(189, 74, 71, 0.04);
  border-color: var(--accent);
}

.article-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.8rem;
  letter-spacing: 0.02em;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.06;
  text-wrap: balance;
}

.article-subtitle {
  max-width: 36rem;
  margin: 0.75rem auto 1rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.55;
  color: var(--text-sec);
  opacity: 0.68;
  text-wrap: balance;
}

.article-meta {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-sec);
  opacity: 0.45;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}

.article-meta span {
  position: relative;
  white-space: nowrap;
}

.article-meta span:not(:last-child)::after {
  content: '|';
  position: absolute;
  right: -0.85rem;
  opacity: 0.5;
}

.theme-heart .article-meta {
  justify-content: center;
}

.article-body {
  margin-top: 2.5rem;
  text-align: left;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1;
}

.article-body p {
  font-size: 1.05rem;
  line-height: 1.9;
  color: #5a5550;
  margin-bottom: 1.45rem;
  letter-spacing: 0.004em;
  text-wrap: pretty;
}

.article-body p:first-of-type {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 1.85rem;
}

.article-body p:first-of-type::first-letter {
  font-family: var(--serif);
  font-weight: 400;
  font-size: inherit;
  float: none;
  line-height: inherit;
  margin: 0;
  color: inherit;
}

.article-body p:first-of-type::first-line {
  font-family: var(--serif);
}

.article-body p em {
  color: var(--text);
  font-style: italic;
  letter-spacing: 0.005em;
}

.article-body p strong,
.article-body p b {
  color: var(--text);
  font-weight: 500;
}

.article-body aside,
.article-body blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--text-sec);
  border-left: 2px solid var(--accent);
  padding: 1rem 0 1rem 1.8rem;
  margin: 2.5rem 0;
  text-wrap: pretty;
  transition: border-color 0.3s, padding-left 0.3s;
}

.article-body aside:hover,
.article-body blockquote:hover {
  padding-left: 2.2rem;
  border-left-width: 3px;
}

.article-final {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1.8;
  margin-top: 2.5rem;
  position: relative;
  padding-top: 0.5rem;
}

.article-final::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
  opacity: 0.3;
  margin-bottom: 1.5rem;
}

.article-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.article-footer a {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-sec);
  text-decoration: none;
  transition: color 0.3s;
}

.article-footer a:hover {
  color: var(--accent);
  padding-left: 0.3rem;
}

.theme-not-found {
  --bg: var(--washi);
  --accent: var(--shu);
  --text: var(--sumi);
  --text-sec: var(--nezumi);
  --border: var(--kinari);
}

.theme-not-found .article-nav {
  background: rgba(250, 247, 242, 0.88);
}

.not-found-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.not-found-container .article-title {
  max-width: 680px;
}

.not-found-container .article-body {
  max-width: 540px;
}

.not-found-actions {
  display: flex;
  gap: 1.5rem;
}

/* ============================================================
   SLIDE ESSAY PROTOTYPES
   ============================================================ */
.slide-essay {
  --slide-panel: rgba(255, 255, 255, 0.58);
  --slide-panel-strong: rgba(255, 255, 255, 0.78);
  --slide-border: rgba(26, 26, 26, 0.1);
  --slide-muted: rgba(26, 26, 26, 0.52);
  --slide-grid: rgba(26, 26, 26, 0.06);
}

.slide-essay .article-container {
  max-width: 1040px;
  padding-top: 8.4rem;
}

.slide-essay .article-header {
  max-width: 720px;
  margin-bottom: 2.8rem;
}

.slide-essay .article-subtitle {
  margin-left: 0;
  margin-right: 0;
}

.slide-essay .article-meta {
  justify-content: flex-start;
}

.slide-essay .thin-rule {
  margin-top: 1.6rem;
}

.slide-essay .article-body {
  margin-top: 0;
}

.slide-essay .article-body p,
.slide-essay .article-body p:first-of-type {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-sec);
  margin-bottom: 0;
  letter-spacing: 0.002em;
}

.slide-essay .article-body p:first-of-type::first-line {
  font-family: var(--sans);
}

.slide-essay .deck-intro {
  max-width: 680px;
  margin-bottom: 2.4rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(26, 26, 26, 0.08);
}

.slide-essay .idea-deck {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.slide-essay .idea-slide {
  min-height: min(82vh, 760px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.78fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.2rem);
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid var(--slide-border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--slide-panel-strong), var(--slide-panel)),
    radial-gradient(circle at 0 0, color-mix(in srgb, var(--accent) 10%, transparent), transparent 34%);
  position: relative;
  overflow: hidden;
}

.slide-essay .idea-slide::before {
  content: attr(data-slide);
  position: absolute;
  right: clamp(1rem, 3vw, 2rem);
  top: clamp(0.8rem, 2vw, 1.4rem);
  font-family: var(--mono);
  font-size: clamp(4rem, 12vw, 9rem);
  line-height: 1;
  color: var(--text);
  opacity: 0.035;
  pointer-events: none;
}

.slide-essay .idea-copy,
.slide-essay .idea-visual {
  position: relative;
  z-index: 1;
}

.slide-essay .idea-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.3rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.slide-essay .idea-kicker::after {
  content: '';
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: 0.32;
}

.slide-essay .idea-slide h2 {
  max-width: 14ch;
  margin-bottom: 1.1rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.05rem, 4.3vw, 3.35rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  color: var(--text);
  text-wrap: balance;
}

.slide-essay .idea-slide h2.long {
  max-width: 18ch;
}

.slide-essay .idea-lede {
  max-width: 34rem;
  font-size: 1.04rem;
  line-height: 1.72;
  color: var(--text-sec);
}

.slide-essay .idea-points {
  display: grid;
  gap: 0.68rem;
  max-width: 34rem;
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
}

.slide-essay .idea-points li {
  position: relative;
  padding-left: 1.05rem;
  font-size: 0.9rem;
  line-height: 1.62;
  color: var(--slide-muted);
}

.slide-essay .idea-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.58;
}

.slide-essay .idea-visual {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.slide-essay .idea-visual svg {
  width: 100%;
  max-width: 380px;
  height: auto;
  overflow: visible;
}

.slide-essay .visual-frame {
  width: 100%;
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  border: 1px solid rgba(26, 26, 26, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(var(--slide-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--slide-grid) 1px, transparent 1px),
    rgba(255, 255, 255, 0.22);
  background-size: 24px 24px;
}

.slide-essay .visual-caption {
  max-width: 28rem;
  margin: 1.1rem auto 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1.55;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-sec);
  opacity: 0.58;
  text-align: center;
}

.slide-essay .diagram-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: currentColor;
  opacity: 0.56;
}

.slide-essay .diagram-small {
  font-family: var(--sans);
  font-size: 11px;
  fill: currentColor;
  opacity: 0.62;
}

.slide-essay .diagram-title {
  font-family: var(--serif);
  font-size: 17px;
  fill: currentColor;
  opacity: 0.84;
}

.slide-essay .deck-closing {
  max-width: 760px;
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.slide-essay .deck-closing p {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--text);
}

.slide-essay .article-footer {
  max-width: 720px;
}

.slide-essay-experiment {
  --slide-panel: rgba(248, 248, 250, 0.74);
  --slide-panel-strong: rgba(255, 255, 255, 0.9);
  --slide-border: rgba(37, 99, 235, 0.14);
  --slide-muted: rgba(26, 26, 26, 0.58);
}

.slide-essay-communication {
  --slide-panel: rgba(250, 250, 250, 0.72);
  --slide-panel-strong: rgba(255, 255, 255, 0.88);
  --slide-border: rgba(122, 107, 94, 0.18);
  --slide-muted: rgba(26, 26, 26, 0.56);
}

@media (max-width: 860px) {
  .slide-essay .article-container {
    padding-top: 7rem;
  }

  .slide-essay .idea-slide {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1.5rem;
  }

  .slide-essay .idea-slide h2,
  .slide-essay .idea-slide h2.long {
    max-width: 16ch;
  }

  .slide-essay .idea-visual,
  .slide-essay .visual-frame {
    min-height: 220px;
  }

  .slide-essay .idea-visual svg {
    max-width: 340px;
  }
}

@media (max-width: 520px) {
  .slide-essay .article-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .slide-essay .idea-slide {
    padding: 1.5rem 1.05rem;
  }

  .slide-essay .idea-kicker {
    font-size: 0.6rem;
  }

  .slide-essay .idea-slide h2 {
    font-size: 2rem;
  }

  .slide-essay .visual-frame {
    padding: 0.75rem;
  }
}

/* ============================================================
   THEME: EXPERIMENTATION
   ============================================================ */
.theme-experiment {
  --bg: #f8f8fa;
  --accent: #2563eb;
  --text: #1a1a1a;
  --text-sec: #6b6560;
  --border: #e2e0db;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle, rgba(0, 0, 0, 0.08) 0.5px, transparent 0.5px);
  background-size: 24px 24px;
}

.theme-experiment .article-nav {
  background: rgba(248, 248, 250, 0.88);
}

.theme-experiment ::selection {
  background: rgba(37, 99, 235, 0.15);
}

.theme-experiment .article-category {
  font-family: 'IBM Plex Mono', var(--sans);
}

.theme-experiment .article-body aside,
.theme-experiment .article-body blockquote {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.95rem;
  border-left: 3px solid var(--accent);
  background: rgba(37, 99, 235, 0.04);
  padding: 1.2rem 1.5rem;
  border-radius: 0 6px 6px 0;
}

.theme-experiment .article-final {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.theme-experiment .bell-curve {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
  transition: opacity 8s ease;
  animation: bellBreathe 14s ease-in-out infinite;
}

.theme-experiment .bell-curve .bell-curve-path {
  animation: bellPathPulse 14s ease-in-out infinite;
}

.theme-experiment .bell-curve .sampling-line {
  animation: sampleSweep 9s ease-in-out infinite;
}

@keyframes bellBreathe {
  0%, 100% { opacity: 0.05; }
  50% { opacity: 0.09; }
}

@keyframes bellPathPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.65; }
}

@keyframes sampleSweep {
  0% { transform: translateX(0); opacity: 0; }
  10% { opacity: 0.35; }
  50% { transform: translateX(360px); opacity: 0.35; }
  60% { opacity: 0; }
  100% { transform: translateX(360px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-experiment .bell-curve,
  .theme-experiment .bell-curve .bell-curve-path,
  .theme-experiment .bell-curve .sampling-line {
    animation: none;
  }
  .theme-experiment .bell-curve .sampling-line {
    opacity: 0;
  }
}

/* ============================================================
   THEME: GHAR
   ============================================================ */
.theme-ghar {
  --bg: #f5efe6;
  --accent: #a0845c;
  --text: #3a3020;
  --text-sec: #7a6e58;
  --border: #d8cfc2;
  background-color: var(--bg);
  background-image: none;
}

.theme-ghar .article-nav {
  background: rgba(245, 239, 230, 0.88);
}

.theme-ghar ::selection {
  background: rgba(160, 132, 92, 0.15);
}

.theme-ghar .grain {
  opacity: 0.04;
}

.theme-ghar .dust-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.theme-ghar .home-threshold {
  position: fixed;
  right: clamp(2rem, 10vw, 9rem);
  top: 18vh;
  width: min(260px, 38vw);
  color: var(--accent);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.theme-ghar .article-title {
  font-size: 3.5rem;
  letter-spacing: 0.06em;
}

.theme-ghar .article-body p:first-of-type {
  font-family: var(--serif);
  font-style: italic;
}

.theme-ghar .memory-line {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--text);
  padding: 2rem 0;
  line-height: 1.6;
}

.theme-ghar .article-body aside,
.theme-ghar .article-body blockquote {
  font-family: var(--serif);
  border-left-color: var(--accent);
  background: rgba(160, 132, 92, 0.04);
  padding: 1rem 1.5rem;
}

.theme-ghar .article-final {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

/* ============================================================
   THEME: MEDITATION
   ============================================================ */
.theme-meditation {
  --bg: #f6f5f2;
  --accent: #6b6b60;
  --text: #2a2a28;
  --text-sec: #7a7872;
  --border: #dddbd6;
  background-color: var(--bg);
  background-image: none;
}

.theme-meditation .article-nav {
  background: rgba(246, 245, 242, 0.88);
}

.theme-meditation ::selection {
  background: rgba(107, 107, 96, 0.15);
}

.theme-meditation .breathing-enso {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}

.theme-meditation .article-body {
  line-height: 2.1;
}

.theme-meditation .article-body p {
  line-height: 2.1;
  margin-bottom: 2.2rem;
}

.theme-meditation .article-body p:first-of-type {
  font-size: 1.3rem;
  line-height: 2;
}

.theme-meditation .article-body p:first-of-type::first-letter {
  font-size: inherit;
  float: none;
  line-height: inherit;
  margin: 0;
  color: inherit;
}

.theme-meditation .koan {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text);
  padding: 2rem 0;
  position: relative;
  margin: 2rem auto;
  max-width: 400px;
}

.theme-meditation .koan::before,
.theme-meditation .koan::after {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--border);
  margin: 0 auto 1.2rem;
}

.theme-meditation .koan::after {
  margin: 1.2rem auto 0;
}

.theme-meditation .koan.koan-final {
  font-size: 1.3rem;
  font-weight: 400;
}

.theme-meditation .article-body aside,
.theme-meditation .article-body blockquote {
  border-left: none;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-sec);
  opacity: 0.7;
  max-width: 480px;
  margin: 2.5rem auto;
  padding: 1.5rem 2rem;
}

/* ============================================================
   THEME: INVESTING
   ============================================================ */
.theme-investing {
  --bg: #f7f6f3;
  --accent: #3d6b4f;
  --text: #1a1a1a;
  --text-sec: #6b6b60;
  --border: #dddbd6;
  background-color: var(--bg);
  background-image: none;
}

.theme-investing .article-nav {
  background: rgba(247, 246, 243, 0.88);
}

.theme-investing ::selection {
  background: rgba(61, 107, 79, 0.15);
}

.theme-investing .candlestick-watermark {
  position: fixed;
  bottom: 2rem;
  right: 3rem;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
  color: var(--text);
  animation: candlestickDrift 8s ease-in-out infinite;
}

.theme-investing .agency-watermark {
  position: fixed;
  right: 3rem;
  bottom: 2.5rem;
  width: 280px;
  height: 220px;
  color: var(--accent);
  opacity: 0.055;
  pointer-events: none;
  z-index: 0;
  animation: candlestickDrift 12s ease-in-out infinite;
}

.theme-investing .thesis-ink-study {
  display: block;
  width: 100%;
  max-width: 680px;
  margin: 2rem auto 1rem;
  color: var(--text);
  border: 1px solid rgba(61, 107, 79, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
}

@keyframes candlestickDrift {
  0%, 100% { transform: translateY(0); opacity: 0.06; }
  50% { transform: translateY(-6px); opacity: 0.09; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-investing .candlestick-watermark,
  .theme-investing .agency-watermark {
    animation: none;
  }
}

.theme-investing .investing-heading {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
  letter-spacing: 0.02em;
}

.theme-investing .article-body p:first-of-type::first-letter {
  font-size: inherit;
  float: none;
  line-height: inherit;
  margin: 0;
  padding: 0;
}

.theme-investing .article-body aside,
.theme-investing .article-body blockquote {
  font-family: var(--serif);
  border-left: 2px solid var(--accent);
  background: rgba(61, 107, 79, 0.03);
  padding: 1rem 1.5rem;
  border-radius: 0 4px 4px 0;
}

.investing-toc {
  margin-bottom: 2.5rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
}

.investing-toc ol {
  list-style: none;
  counter-reset: toc-counter;
  padding: 0;
  margin: 0;
}

.investing-toc li {
  counter-increment: toc-counter;
  margin-bottom: 0.4rem;
}

.investing-toc li::before {
  content: counter(toc-counter, decimal-leading-zero) ".";
  font-family: var(--mono, monospace);
  font-size: 0.7rem;
  opacity: 0.4;
  margin-right: 0.6rem;
}

.investing-toc a {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--text-sec);
  text-decoration: none;
  transition: color 0.3s ease;
}

.investing-toc a:hover {
  color: var(--accent);
}

/* ============================================================
   THEME: INTELLIGENCE
   ============================================================ */
.theme-intelligence {
  --bg: #f6f6f8;
  --accent: #4a4e8a;
  --text: #1a1a1a;
  --text-sec: #6b6870;
  --border: #dedce2;
  background-color: var(--bg);
  background-image: none;
}

.theme-intelligence .article-nav {
  background: rgba(246, 246, 248, 0.88);
}

.theme-intelligence ::selection {
  background: rgba(74, 78, 138, 0.15);
}

.theme-intelligence .neural-watermark {
  position: fixed;
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
  color: var(--text);
}

.theme-intelligence .definition-block {
  text-align: center;
  padding: 2.8rem 2rem;
  margin: 2.5rem 0;
  position: relative;
  transition: transform 0.4s var(--ease-out-expo);
}

.theme-intelligence .definition-block:hover {
  transform: translateY(-2px);
}

.theme-intelligence .definition-block::before,
.theme-intelligence .definition-block::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--accent);
  margin: 0 auto 1.5rem;
  opacity: 0.4;
}

.theme-intelligence .definition-block::after {
  margin: 1.5rem auto 0;
}

.theme-intelligence .definition-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text);
}
.theme-intelligence .definition-attr {
  font-family: var(--sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-sec);
  opacity: 0.5;
  margin-top: 0.4rem;
}

.theme-intelligence .article-body aside,
.theme-intelligence .article-body blockquote {
  font-family: var(--serif);
  border-left: 2px solid var(--accent);
  background: rgba(74, 78, 138, 0.03);
  padding: 1rem 1.5rem;
  border-radius: 0 4px 4px 0;
}

/* ============================================================
   THEME: NOSTALGIA
   ============================================================ */
.theme-nostalgia {
  --bg: #f8f6f4;
  --accent: #8B3A2A;
  --text: #1a1a1a;
  --text-sec: #6b6560;
  --border: #e8e0d5;
  background-color: var(--bg);
  background-image: none;
}

.theme-nostalgia .article-nav {
  background: rgba(248, 246, 244, 0.88);
}

.theme-nostalgia ::selection {
  background: rgba(193, 64, 61, 0.1);
}

.theme-nostalgia .dissolving-clock {
  position: fixed;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
  color: var(--text);
  transition: opacity 3s ease;
}

.theme-nostalgia .dissolving-clock path {
  opacity: 0.22;
}

.theme-nostalgia .article-body aside {
  border-left: none;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--accent);
  opacity: 0.8;
  max-width: 520px;
  margin: 3rem auto;
  padding: 1.5rem 2rem;
  background: rgba(193, 64, 61, 0.03);
  border-radius: 8px;
}

/* ============================================================
   THEME: TRUISMS
   ============================================================ */
.theme-truisms {
  --bg: #fafafa;
  --accent: #1a1a1a;
  --text: #1a1a1a;
  --text-sec: #666666;
  --border: #eeeeee;
  background-color: var(--bg);
  background-image: none;
}

.theme-truisms .article-nav {
  background: rgba(250, 250, 250, 0.88);
}

.theme-truisms .article-subtitle {
  max-width: 34rem;
  color: var(--text-sec);
  opacity: 0.6;
}

.theme-truisms .article-body p:first-of-type::first-letter {
  font-size: inherit;
  float: none;
  line-height: inherit;
  margin: 0;
  padding: 0;
}

/* ============================================================
   THEME: KALPANA  (Deutsch × Shukl)
   ============================================================ */
.theme-kalpana {
  --bg: #f4ede2;
  --accent: #3a4860;
  --text: #2a2a2a;
  --text-sec: #6f6a60;
  --border: #e2dccf;
  background-color: var(--bg);
  background-image: none;
}

.theme-kalpana .article-nav {
  background: rgba(244, 237, 226, 0.9);
}

.theme-kalpana ::selection {
  background: rgba(58, 72, 96, 0.18);
}

.theme-kalpana .article-category {
  color: var(--accent);
  letter-spacing: 0.22em;
}

.theme-kalpana .kalpana-heading {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 0.9rem;
  letter-spacing: 0.005em;
}

.theme-kalpana .article-final {
  font-style: italic;
  color: var(--accent);
  border-left: 2px solid rgba(58, 72, 96, 0.25);
  padding-left: 1.1rem;
  margin-top: 2rem;
}

.theme-kalpana .article-container {
  position: relative;
  z-index: 1;
}

.theme-kalpana .window-watermark {
  position: fixed;
  top: 50%;
  right: 6%;
  transform: translateY(-50%);
  opacity: 0.18;
  color: var(--accent);
  pointer-events: none;
  z-index: 0;
  animation: kalpanaBreathe 16s ease-in-out infinite;
}

.theme-kalpana .window-watermark .window-depth {
  transform-origin: 160px 160px;
  animation: windowRecede 18s ease-in-out infinite;
}

@keyframes kalpanaBreathe {
  0%, 100% { opacity: 0.14; }
  50% { opacity: 0.22; }
}

@keyframes windowRecede {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-kalpana .window-watermark,
  .theme-kalpana .window-watermark .window-depth {
    animation: none;
  }
}

/* ============================================================
   THEME: COMMUNICATION
   ============================================================ */
.theme-communication {
  --bg: #fafafa;
  --accent: #7a6b5e;
  --text: #1a1a1a;
  --text-sec: #6b6b60;
  --border: #e0ddd8;
  background-color: var(--bg);
  background-image: none;
}

.theme-communication .article-nav {
  background: rgba(250, 250, 250, 0.88);
}

.theme-communication .communication-compression {
  position: fixed;
  top: 13vh;
  right: clamp(1.5rem, 8vw, 8rem);
  width: min(520px, 48vw);
  color: var(--sumi);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.theme-communication .article-container {
  position: relative;
  z-index: 1;
}

.theme-truisms .article-container {
  max-width: 720px;
  position: relative;
  z-index: 1;
}

.theme-truisms .article-body {
  margin-top: 3.2rem;
}

.theme-truisms .fading-stack {
  position: fixed;
  bottom: 0;
  right: 5%;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  animation: ouroborosBreathe 18s ease-in-out infinite;
}

.theme-truisms .fading-stack .ouroboros-group {
  animation: ouroborosTurn 240s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes ouroborosBreathe {
  0%, 100% { opacity: 0.06; }
  50% { opacity: 0.11; }
}

@keyframes ouroborosTurn {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .theme-truisms .fading-stack,
  .theme-truisms .fading-stack .ouroboros-group {
    animation: none;
  }
}

.theme-truisms .truism {
  display: grid;
  grid-template-columns: 3.7rem minmax(0, 1fr);
  column-gap: 1.45rem;
  margin: 0;
  padding: 2.35rem 0;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
  position: relative;
}

.theme-truisms .truism:first-of-type {
  border-top: none;
  padding-top: 0.2rem;
}

.theme-truisms .truism h3 {
  grid-row: 1 / span 3;
  align-self: start;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
  opacity: 0.42;
  margin: 0.35rem 0 0;
  transition: opacity 0.3s, transform 0.3s;
}

.theme-truisms .truism h3::after {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  margin-top: 0.85rem;
  background: var(--accent);
  opacity: 0.18;
}

.theme-truisms .truism:hover h3 {
  opacity: 0.72;
  transform: translateX(0.12rem);
}

.theme-truisms .truism p {
  grid-column: 2;
  max-width: 590px;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.82;
  color: var(--text-sec);
  letter-spacing: 0.002em;
}

.theme-truisms .truism p:first-of-type {
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.52;
  color: var(--text);
  margin-bottom: 0.95rem;
  letter-spacing: 0.004em;
}

.theme-truisms .truism p + p {
  padding-top: 0.1rem;
}

.theme-truisms .article-body aside {
  max-width: 590px;
  margin: 3.1rem 0 3.3rem 5.15rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.65;
  color: var(--text);
  padding: 1.6rem 0;
  border-left: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.theme-truisms .article-body aside:hover {
  padding-left: 0;
  border-left: none;
}

@media (max-width: 768px) {
  .theme-truisms .article-body {
    margin-top: 2.6rem;
  }

  .theme-truisms .truism {
    grid-template-columns: 1fr;
    row-gap: 0.65rem;
    padding: 2rem 0;
  }

  .theme-truisms .truism h3,
  .theme-truisms .truism p {
    grid-column: 1;
  }

  .theme-truisms .truism h3 {
    margin-top: 0;
  }

  .theme-truisms .truism h3::after {
    width: 18px;
    margin-top: 0.55rem;
  }

  .theme-truisms .truism p:first-of-type {
    font-size: 1.18rem;
    line-height: 1.58;
  }

  .theme-truisms .article-body aside {
    margin-left: 0;
    font-size: 1.12rem;
    line-height: 1.7;
  }

  .theme-truisms .fading-stack {
    width: 220px;
    height: 220px;
    right: -2rem;
    opacity: 0.045;
  }
}

/* ============================================================
   THEME: HEART (<3.)
   ============================================================ */
.theme-heart {
  --bg: #fcf8f8;
  --accent: #8B3A2A;
  --text: #1a1a1a;
  --text-sec: #7a6b6b;
  --border: #f0e4e4;
  background-color: var(--bg);
}

.rose-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  display: block;
}

.theme-heart .article-nav {
  background: rgba(252, 248, 248, 0.88);
}

.theme-heart ::selection {
  background: rgba(193, 64, 61, 0.12);
}

.theme-heart .article-body {
  text-align: center;
  padding-top: 4rem;
  max-width: 760px;
  margin: 0 auto;
}

.theme-heart .article-container {
  position: relative;
  z-index: 1;
}

.theme-heart .article-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-sec);
  text-align: center;
  margin: 0.8rem 0 0;
}

/* Common sher typography — shared across all themes */
.sher {
  font-family: var(--serif);
  font-size: 1.65rem;
  line-height: 2;
  font-style: italic;
  letter-spacing: 0.01em;
  position: relative;
  z-index: 1;
  margin-bottom: 3.5rem;
  text-align: center;
  text-transform: lowercase;
}

.sher-line {
  display: block;
  /* Keep each misra on its own line, and when one is long enough to wrap,
     balance the wrapped rows to roughly equal length rather than leaving a
     short orphan. */
  text-wrap: balance;
}

.theme-heart .sher {
  color: var(--text);
}

.theme-jaun .sher {
  color: var(--text);
}

.theme-jaun .article-final {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-sec);
  margin-top: 1.5rem;
  letter-spacing: 0.01em;
  text-align: center;
}

.theme-heart .article-final {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-sec);
  margin-top: 1.5rem;
  letter-spacing: 0.01em;
  text-align: center;
}

/* Dictionary Tooltips */
.urdu-word {
  position: relative;
  cursor: help;
  outline: none;
  transition: color 0.3s ease;
  border-bottom: 1px dotted rgba(0,0,0,0.12);
  padding-bottom: 1px;
}
.urdu-word:hover, .urdu-word:active, .urdu-word:focus {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.urdu-word::after {
  content: attr(data-meaning);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(26, 26, 26, 0.92);
  color: #f7f3ee;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-family: var(--sans);
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.06em;
  border-radius: 5px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s var(--ease-out-expo), visibility 0.25s;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.urdu-word::before {
  content: '';
  position: absolute;
  bottom: 120%;
  left: 50%;
  margin-left: -5px;
  transform: translateY(12px);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(26, 26, 26, 0.92) transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s var(--ease-out-expo), visibility 0.25s;
  z-index: 20;
  pointer-events: none;
}
.urdu-word:hover::after, .urdu-word:active::after, .urdu-word:focus::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.urdu-word:hover::before, .urdu-word:active::before, .urdu-word:focus::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(6px);
}

/* Tooltip alignment overrides to prevent screen edge clipping */
.urdu-word.tooltip-left::after {
  left: 0;
  transform: translateX(0) translateY(6px);
}
.urdu-word.tooltip-left:hover::after,
.urdu-word.tooltip-left:active::after,
.urdu-word.tooltip-left:focus::after {
  transform: translateX(0) translateY(0);
}
.urdu-word.tooltip-left::before {
  left: 15px;
  margin-left: 0;
  transform: translateY(12px);
}
.urdu-word.tooltip-left:hover::before,
.urdu-word.tooltip-left:active::before,
.urdu-word.tooltip-left:focus::before {
  transform: translateY(6px);
}

.urdu-word.tooltip-right::after {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(6px);
}
.urdu-word.tooltip-right:hover::after,
.urdu-word.tooltip-right:active::after,
.urdu-word.tooltip-right:focus::after {
  transform: translateX(0) translateY(0);
}
.urdu-word.tooltip-right::before {
  left: auto;
  right: 15px;
  margin-left: 0;
  transform: translateY(12px);
}
.urdu-word.tooltip-right:hover::before,
.urdu-word.tooltip-right:active::before,
.urdu-word.tooltip-right:focus::before {
  transform: translateY(6px);
}


.theme-heart .article-body p:first-of-type::first-letter {
  font-size: inherit;
  float: none;
  line-height: inherit;
  margin-right: 0;
  margin-top: 0;
  color: inherit;
}

.theme-heart .article-footer {
  margin-top: 4rem;
}

.theme-aag .sher {
  display: inline-block;
  padding: 0.5rem 0 1.2rem;
}

.theme-aag .sher::after {
  content: '';
  display: block;
  width: 76%;
  height: 1px;
  margin: 1.25rem auto 0;
  background: linear-gradient(90deg, transparent, rgba(184,92,47,0.72), rgba(255,190,88,0.55), transparent);
  box-shadow: 0 0 18px rgba(226,129,43,0.26);
  animation: burnUnderline 8s ease-in-out infinite;
}

@keyframes burnUnderline {
  0%, 100% { opacity: 0.35; transform: scaleX(0.82); }
  45% { opacity: 0.9; transform: scaleX(1); }
  62% { opacity: 0.45; transform: scaleX(0.94); }
}

.theme-afsana .article-container {
  position: relative;
}

.story-page-shadow {
  position: fixed;
  inset: 12% 8% auto auto;
  width: min(360px, 58vw);
  height: min(520px, 70vh);
  pointer-events: none;
  z-index: 0;
  opacity: 0.16;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.35), rgba(255,255,255,0) 48%),
    linear-gradient(180deg, rgba(126,88,78,0.06), rgba(126,88,78,0.01));
  border-right: 1px solid rgba(126,88,78,0.22);
  border-bottom: 1px solid rgba(126,88,78,0.12);
  transform: rotate(2deg);
  box-shadow: -26px 22px 56px rgba(80,45,40,0.08);
}

.story-page-shadow::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: -10px;
  width: 18px;
  background: linear-gradient(90deg, rgba(126,88,78,0.11), transparent);
  clip-path: polygon(0 0, 100% 5%, 12% 12%, 100% 20%, 18% 31%, 100% 43%, 9% 57%, 100% 70%, 16% 84%, 100% 100%, 0 100%);
}

.theme-afsana .sher {
  position: relative;
}

.theme-afsana .sher::after {
  content: '';
  display: block;
  width: 46%;
  height: 1px;
  margin: 1.4rem auto 0;
  background: linear-gradient(90deg, transparent, rgba(122,84,120,0.28), transparent);
}

.theme-ocean .article-nav {
  background: rgba(7, 16, 24, 0.74);
  border-bottom-color: rgba(143, 170, 184, 0.12);
  box-shadow: 0 10px 35px rgba(0,0,0,0.18);
}

.theme-ocean .article-nav.scrolled {
  background: rgba(7, 16, 24, 0.88);
  border-bottom-color: rgba(143, 170, 184, 0.18);
}

.theme-ocean .article-nav .back-link,
.theme-ocean .article-nav .nav-logo {
  color: #9fb6c3;
}

.kalpana-window-study {
  clear: both;
  margin: 2.5rem auto 3rem;
  width: 100%;
  max-width: 640px;
  border: 1px solid rgba(58,72,96,0.12);
  background: rgba(250,243,225,0.32);
  box-shadow: 0 20px 70px rgba(58,72,96,0.06);
}

.kalpana-window-study canvas {
  display: block;
  width: 100%;
  height: clamp(220px, 42vw, 300px);
}

.kalpana-window-study figcaption {
  font-family: var(--mono, monospace);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  color: var(--text-sec);
  opacity: 0.42;
  margin-top: 0.4rem;
}

.mental-ink-diagram {
  display: block;
  width: 100%;
  margin: 2rem 0 2.4rem;
  color: var(--text);
  border: 1px solid rgba(26, 26, 26, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.26), rgba(255,255,255,0)),
    rgba(247, 246, 243, 0.36);
}

@media (prefers-reduced-motion: reduce) {
  .article-container {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .nav-logo { animation: none; }
  .scroll-line { animation: none; }
  .enso-circle { animation: none; stroke-dashoffset: 0; }
  .koi-decoration { animation: none; }
  .hanko-mark { animation: heroFadeIn 0.8s ease forwards; }
  .fade-up { opacity: 1; transform: none; transition: none; }
  .shayari-bg { animation: none; }
}

.relative { position: relative; }
.z-10 { z-index: 10; }

/* ============================================================
   UTILITIES
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body:not(.admin-mode) .writing-card.draft {
  display: none !important;
}

body.admin-mode .writing-card.draft {
  display: block !important;
  opacity: 0.5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .writing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .writing-featured {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .nav {
    padding: 1rem 1.5rem;
  }

  .nav-links {
    gap: 1.5rem;
  }

  .hero-name {
    font-size: clamp(2.2rem, 8vw, 3rem);
  }

  .timeline {
    padding-left: 0;
  }

  .timeline::before {
    display: none;
  }

  .timeline-period {
    position: static;
    width: auto;
    text-align: left;
    margin-bottom: 0.2rem;
  }

  .timeline-item {
    flex-direction: column;
  }

  .timeline-dot {
    display: none;
  }

  .timeline-content {
    padding-left: 1rem;
    border-left: 1px solid var(--border);
  }

  .timeline-item::after {
    display: none;
  }

  .writing-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .writing-featured {
    grid-column: span 1;
  }
  .writing-card {
    --offset: 0rem !important;
  }
  .writing-card-inner {
    padding: 2rem 1.6rem 1.6rem;
  }
  .writing-featured .writing-card-inner {
    padding: 2rem 1.6rem 1.6rem;
  }
  .writing-featured .writing-card-title {
    font-size: 1.55rem;
  }
  .writing-stroke {
    display: none;
  }
  .koi-decoration {
    right: 0.75rem;
    width: 64px;
    height: 112px;
  }

  .earlier-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .timeline-header {
    flex-wrap: wrap;
  }


  .contact-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .article-container {
    padding-top: 7rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .article-title {
    font-size: 2.2rem;
  }

  .article-meta {
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
  }

  .article-meta span:not(:last-child)::after {
    display: none;
  }

  .theme-ghar .article-title {
    font-size: 2.5rem;
  }

  .theme-meditation .koan {
    padding: 1.5rem 0;
  }

  .enso-container {
    width: 280px;
    height: 280px;
  }

  .breathing-enso {
    width: 220px;
    height: 220px;
  }

  .footer {
    padding: 3.5rem 0 3rem;
  }
}

/* ============================================================
   COMMENTS SECTION
   ============================================================ */
.comments-section {
  max-width: var(--article-w);
  margin: 4rem auto 6rem;
  padding: 0 1.5rem;
  animation: fadeUp 1s var(--ease-out-expo) forwards;
}

.comments-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.comments-header h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--text);
}

.comments-count {
  font-family: var(--sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-sec);
  opacity: 0.6;
}

.comment-form {
  margin-bottom: 4rem;
  background: rgba(255, 255, 255, 0.4);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: box-shadow 0.3s, border-color 0.3s;
}

.comment-form:focus-within {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border-color: var(--accent);
}

.comment-form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.7rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.3s;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent);
}

.comment-form textarea {
  min-height: 80px;
  resize: vertical;
}

.comment-submit {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.comment-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.comment-submit:active {
  transform: translateY(0);
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.comment-item {
  position: relative;
  padding-left: 1rem;
}

.comment-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 1px;
  background: var(--accent);
  opacity: 0.2;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.comment-author {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1rem;
  color: var(--text);
}

.comment-date {
  font-family: var(--sans);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-sec);
  opacity: 0.5;
}

.comment-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-sec);
}

.no-comments {
  font-family: var(--serif);
  font-style: italic;
  color: var(--text-sec);
  opacity: 0.6;
  text-align: center;
  padding: 2rem 0;
}

@media (max-width: 480px) {
  .hero-name {
    font-size: 2rem;
  }

  .hero-summary {
    max-width: 20rem;
    font-size: 1rem;
  }

  .hero-summary br {
    display: none;
  }

  .nav-links a {
    font-size: 0.6rem;
    letter-spacing: 0.09em;
  }

  .nav-links {
    gap: 0.9rem;
  }

  .nav {
    padding: 0.9rem 1.2rem;
  }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {

  .grain,
  .hero-canvas,
  .scroll-hint,
  .enso-container,
  .bell-curve,
  .dust-canvas,
  .breathing-enso,
  .window-watermark {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .nav,
  .article-nav {
    position: static;
    background: none;
  }

  .writing-section {
    background: white;
    color: black;
  }

  .essay-card {
    border: 1px solid #ccc;
    background: white;
  }
}

/* ============================================================
   THEME: OCEAN (Gehraiyan)
   ============================================================ */
.theme-ocean {
  background-color: #0b131a;
  color: #d1d8dc;
  transition: background-color 2s ease;
}

.theme-ocean .urdu-word { line-height: 1.8; }
.theme-ocean .sher-line { display: block; margin-bottom: 0.75rem; }

.theme-ocean .article-category,
.theme-ocean .article-meta,
.theme-ocean .article-nav a { opacity: 0.6; }

.theme-ocean .urdu-word::after {
  background: linear-gradient(135deg, rgba(30,144,255,0.8), rgba(0,255,127,0.4));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ocean-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: color-dodge;
}

.theme-ocean .translation-line {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-style: italic;
  opacity: 0.8;
  margin-top: 1.5rem;
  color: #8faab8;
}

/* ============================================================
   THEME: JAUN (Dark/Melancholic)
   ============================================================ */
.theme-jaun {
  --bg: #121416;
  --accent: #5a6670;
  --text: #e2e8f0;
  --text-sec: #94a3b8;
  --border: #2c3238;
  background-color: var(--bg);
  color: var(--text);
}

.theme-jaun .article-nav {
  background: rgba(18, 20, 22, 0.88);
}

.theme-jaun ::selection {
  background: rgba(90, 102, 112, 0.3);
}

.theme-jaun .article-title,
.theme-jaun .article-subtitle,
.theme-jaun .urdu-word,
.theme-jaun .article-final,
.theme-jaun .article-nav a,
.theme-jaun .back-link {
  color: var(--text);
}

.theme-jaun .article-category,
.theme-jaun .article-meta,
.theme-jaun .urdu-word::before {
  color: var(--text-sec);
}

.theme-jaun .thin-rule {
  border-top-color: var(--border);
}

.theme-jaun .urdu-word:hover::after,
.theme-jaun .urdu-word:active::after,
.theme-jaun .urdu-word:focus::after {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

.theme-jaun .article-body {
  text-align: center;
}

/* ============================================================
   THEME: IF (Parchment / Book theme)
   ============================================================ */
.theme-if {
  --bg: #f6f3eb;
  --accent: #9d4f3b;
  --text: #2d2620;
  --text-sec: #706960;
  --border: rgba(45, 38, 32, 0.08);
  background-color: var(--bg);
  color: var(--text);
}

.theme-if .article-nav {
  background: rgba(246, 243, 235, 0.88);
}

.theme-if ::selection {
  background: rgba(157, 79, 59, 0.2);
}

.theme-if .article-title,
.theme-if .article-subtitle,
.theme-if .poem-stanza,
.theme-if .article-final,
.theme-if .article-nav a,
.theme-if .back-link {
  color: var(--text);
}

.theme-if .article-category,
.theme-if .article-meta,
.theme-if .poem-attr {
  color: var(--text-sec);
}

.theme-if .thin-rule {
  border-top-color: var(--border);
}

.theme-if .article-body {
  text-align: center;
}

.card-if {
  --card-accent: #9d4f3b;
}

/* ============================================================
   THEME: OZYMANDIAS (Desert / Dusk theme)
   ============================================================ */
.theme-ozymandias {
  --bg: #12100e;
  --accent: #c69c6d;
  --text: #ebdac8;
  --text-sec: #8c7e70;
  --border: rgba(235, 218, 200, 0.08);
  background-color: var(--bg);
  color: var(--text);
}

.theme-ozymandias .article-nav {
  background: rgba(18, 16, 14, 0.88);
}

.theme-ozymandias ::selection {
  background: rgba(198, 156, 109, 0.2);
}

.theme-ozymandias .article-title,
.theme-ozymandias .article-subtitle,
.theme-ozymandias .poem-stanza,
.theme-ozymandias .article-final,
.theme-ozymandias .article-nav a,
.theme-ozymandias .back-link {
  color: var(--text);
}

.theme-ozymandias .article-category,
.theme-ozymandias .article-meta,
.theme-ozymandias .poem-attr {
  color: var(--text-sec);
}

.theme-ozymandias .thin-rule {
  border-top-color: var(--border);
}

.theme-ozymandias .article-body {
  text-align: center;
}

.card-ozymandias {
  --card-accent: #c69c6d;
}

/* ============================================================
   THEME: VARDAAN (Steadfast embers / Obsidian theme)
   ============================================================ */
.theme-vardaan {
  --bg: #0d0c10;
  --accent: #d98a4e;
  --text: #ece4dd;
  --text-sec: #9a9088;
  --border: rgba(236, 228, 221, 0.08);
  background-color: var(--bg);
  color: var(--text);
}

.theme-vardaan .article-nav {
  background: rgba(13, 12, 16, 0.88);
}

.theme-vardaan ::selection {
  background: rgba(217, 138, 78, 0.2);
}

.theme-vardaan .article-title,
.theme-vardaan .article-subtitle,
.theme-vardaan .poem-stanza,
.theme-vardaan .article-final,
.theme-vardaan .article-nav a,
.theme-vardaan .back-link {
  color: var(--text);
}

.theme-vardaan .article-category,
.theme-vardaan .article-meta,
.theme-vardaan .poem-attr {
  color: var(--text-sec);
}

.theme-vardaan .thin-rule {
  border-top-color: var(--border);
}

.theme-vardaan .article-body {
  text-align: center;
}

.theme-vardaan .urdu-word { border-bottom-color: rgba(236, 228, 221, 0.16); }

/* Scroll snapping layouts for poems */
body.theme-hatasha,
body.theme-if,
body.theme-ozymandias,
body.theme-vardaan {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.poem-scroll-container {
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.poem-section {
  scroll-snap-align: start;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  padding: 4rem 2rem;
  position: relative;
  z-index: 1;
}

.card-vardaan {
  --card-accent: #d98a4e;
}

.card-sach {
  --card-accent: #7fa6c4;
}

.card-narho {
  --card-accent: #d8a24e;
}

/* ============================================================
   PAGE TRANSITIONS — the room settles into focus
   Cross-document view transitions cross-fade each navigation with
   a faint settle, echoing the hero's reveal (dark window dissolving
   into a light reading room). Browsers without support fall back to
   a normal load; reduced-motion users get an instant cut.
   ============================================================ */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: ub-page-out 0.26s var(--ease-out-quart) both;
}

::view-transition-new(root) {
  animation: ub-page-in 0.42s var(--ease-out-expo) both;
}

@keyframes ub-page-out {
  to { opacity: 0; }
}

@keyframes ub-page-in {
  from { opacity: 0; transform: scale(0.992); }
  to   { opacity: 1; transform: scale(1); }
}

/* Reduced-motion: keep the navigation instant — no cross-fade, no settle. */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
  }
}

/* ============================================================
   TOUCH TARGETS — comfortable tap areas for small text links
   Nav, back, and footer-nav links render as short uppercase text
   (~13-20px tall). An invisible ::before overlay expands each one's
   tappable zone past the 24px minimum without changing layout, the
   box model, or the hover underline (which uses ::after). The nav's
   2.5rem gaps keep the expanded zones from overlapping.
   ============================================================ */
.article-nav .back-link,
.article-footer a {
  position: relative;
}

.nav-links a::before,
.article-nav .back-link::before,
.article-footer a::before {
  content: '';
  position: absolute;
  inset: -0.7rem -0.45rem;
}
