/* aaradhyjani.com — v3
   Editorial. No boxes, no pills, no template smell.
   Typography-first; motion is restrained but alive. */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600&family=Tiro+Gujarati:ital@0;1&family=Tiro+Devanagari+Hindi:ital@0;1&family=Hind+Vadodara:wght@500;600&display=swap');

/* ------------- Tokens ------------- */
:root {
  --bg: #faf7f2;
  --bg-elev: #ffffff;
  --fg: #1a1614;
  --fg-soft: #3d3a36;
  --fg-muted: #6b6862;
  --border: #e8e2d8;
  --border-strong: #d4ccc0;
  --accent: #c2410c;
  --accent-soft: #fef3e7;
  --accent-glow: rgba(255, 165, 100, 0.18);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.75;
  letter-spacing: 0.005em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--fg); color: var(--bg); }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  letter-spacing: -0.025em;
  font-weight: 500;
  line-height: 1.08;
  color: var(--fg);
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
em { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-weight: 500; }

body.menu-open { overflow: hidden; }

/* ------------- Header ------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(250, 247, 242, 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease);
}
.header.scrolled { border-bottom-color: var(--border); }
@media (min-width: 640px) { .header { padding: 1.5rem 2rem; } }
@media (min-width: 768px) { .header { padding: 1.75rem 3rem; } }

.brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: opacity 0.25s var(--ease);
}
.brand:hover { opacity: 0.7; }

.nav-desktop { display: none; gap: 2.25rem; align-items: center; }
@media (min-width: 768px) { .nav-desktop { display: flex; } }

.nav-link {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color 0.25s var(--ease);
  position: relative;
  padding: 0.25rem 0;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s var(--ease);
}
.nav-link:hover { color: var(--fg); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active { color: var(--fg); font-weight: 600; }
.nav-link.active::after { transform: scaleX(1); }

/* ------------- Mobile nav ------------- */
.nav-toggle, .nav-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--fg);
  transition: opacity 0.25s var(--ease);
}
.nav-toggle { margin-right: -0.5rem; }
.nav-toggle:hover, .nav-close:hover { opacity: 0.7; }
@media (min-width: 768px) { .nav-toggle { display: none; } }

.nav-mobile {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(85%, 360px);
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  padding: 4.5rem 2rem 2rem;
  transform: translateX(100%);
  transition: transform 0.45s var(--ease);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.nav-mobile[data-open="true"] { transform: translateX(0); }
.nav-mobile .brand-mobile {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
}
.nav-mobile .nav-link { font-size: 1.05rem; color: var(--fg); }
.nav-close { position: absolute; top: 1.5rem; right: 1.25rem; }

.nav-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 16, 12, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
  z-index: 40;
}
.nav-overlay[data-open="true"] { opacity: 1; pointer-events: auto; }

/* ------------- Layout ------------- */
.container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}
@media (min-width: 640px) { .container { padding: 0 2rem; } }

main { flex: 1; width: 100%; position: relative; }

.section { padding: 4.5rem 0 6rem; }
@media (min-width: 768px) { .section { padding: 7rem 0 9rem; } }

/* ------------- Reveal animations (scroll-triggered) ------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ------------- Eyebrow ------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.eyebrow::before {
  content: '';
  width: 1.75rem;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

/* ------------- Ambient ticker layer (home page only, desktop only) ------------- */
/* Single-word identity signals that fade in/out at random anchor points.
   Each ticker is a fragment; the constellation tells the visitor who I am. */
.tickers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  display: none;
}
@media (min-width: 1024px) {
  .tickers { display: block; }
}

.ticker {
  position: absolute;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 400ms ease-out;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ticker-color, #b45309);
  user-select: none;
  /* avoid the font shifting layout when content swaps */
  font-variant-numeric: tabular-nums;
}
.ticker[data-visible="true"] { opacity: 0.85; }

.ticker::before {
  content: attr(data-arrow);
  font-size: 0.85em;
  opacity: 0.7;
  display: inline-block;
}

.ticker[data-cat="place"]  { --ticker-color: #b45309; }   /* amber */
.ticker[data-cat="work"]   { --ticker-color: var(--accent); }  /* saffron */
.ticker[data-cat="market"] { --ticker-color: #15803d; }   /* terminal green */
.ticker[data-cat="mind"]   { --ticker-color: #4338ca; }   /* dusty indigo */

@media (prefers-reduced-motion: reduce) {
  .tickers { display: none; }
}

/* ------------- Home / Hero ------------- */
.home-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 200px);
  position: relative;
}

/* Soft radial bloom behind the hero, with subtle parallax via JS */
.home-main::before {
  content: '';
  position: absolute;
  top: 5%;
  left: -8%;
  width: 75%;
  height: 70%;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  filter: blur(20px);
  transform: translateY(var(--bloom-y, 0px));
  transition: transform 0.4s linear;
}

.home-main > * { position: relative; z-index: 1; }

.hero-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(3.5rem, 13vw, 9rem);
  font-weight: 600;          /* heavier so it reads as the dominant element */
  margin-bottom: 1.5rem;
  text-wrap: balance;
  line-height: 0.96;
  letter-spacing: -0.04em;
  display: block;            /* simpler than flex; HTML whitespace gives word gap */
}

/* Each word is an interactive button. Click to flip script. */
.hero-name .word {
  /* button reset (with !important to override iOS user-agent button styling) */
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: 1em !important;       /* full inheritance from .hero-name */
  font-weight: inherit !important;
  font-style: inherit !important;
  color: inherit !important;
  letter-spacing: inherit !important;
  line-height: inherit !important;
  display: inline-block;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  transform-origin: center bottom;

  /* entrance animation */
  opacity: 0;
  transform: translateY(0.5em);
  animation: wordIn 1.1s var(--word-delay, 0.12s) var(--ease) forwards;

  transition: color 0.45s var(--ease);
}
.hero-name .word:nth-of-type(1) { --word-delay: 0.12s; }
.hero-name .word:nth-of-type(2) { --word-delay: 0.28s; }

.hero-name .word::after {
  /* a thin saffron underline that draws in on hover, hinting clickability */
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0.06em;
  height: 0.04em;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s var(--ease);
  opacity: 0.7;
}
.hero-name .word:hover { color: var(--accent); }
.hero-name .word:hover::after { transform: scaleX(1); }

.hero-name .word:focus { outline: none; }
.hero-name .word:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 4px;
}

/* Hindi (Devanagari) and Gujarati states — robust fallback chains so devices
   render proper Indic glyphs even if the Google Font hasn't loaded.
   Includes iOS native (Kohinoor / Sangam MN), Windows (Mangal / Shruti), and
   Android (Noto) fonts before falling through to a serif. */
.hero-name .word[data-state="hi"] {
  font-family:
    'Tiro Devanagari Hindi',
    'Noto Sans Devanagari',
    'Noto Serif Devanagari',
    'Kohinoor Devanagari',
    'Devanagari Sangam MN',
    'Mangal',
    serif !important;
  font-style: normal !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}
.hero-name .word[data-state="gu"] {
  font-family:
    'Tiro Gujarati',
    'Noto Sans Gujarati',
    'Hind Vadodara',
    'Gujarati Sangam MN',
    'Gujarati MT',
    'Shruti',
    serif !important;
  font-style: normal !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}

/* Flip animation when content swaps */
.hero-name .word.is-flipping {
  animation: wordFlip 0.55s var(--ease);
}
@keyframes wordIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes wordFlip {
  0%   { opacity: 1; transform: translateY(0)         rotateX(0); }
  42%  { opacity: 0; transform: translateY(-0.18em)   rotateX(-25deg); }
  58%  { opacity: 0; transform: translateY(0.18em)    rotateX(25deg); }
  100% { opacity: 1; transform: translateY(0)         rotateX(0); }
}

/* Saras Che reveal — appears when both words are in Gujarati */
.saras-reveal {
  margin-top: 2.5rem;
  font-family:
    'Tiro Gujarati',
    'Noto Sans Gujarati',
    'Hind Vadodara',
    'Gujarati Sangam MN',
    'Gujarati MT',
    'Shruti',
    serif;
  font-size: 1.4rem;
  color: var(--accent);
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.8s var(--ease) 0.2s,
    transform 0.8s var(--ease) 0.2s;
  pointer-events: none;
  letter-spacing: 0.005em;
  line-height: 1.5;
}
.saras-reveal .gloss {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-left: 0.55rem;
  font-weight: 400;
  letter-spacing: 0;
}
body.saras-revealed .saras-reveal {
  opacity: 1;
  transform: translateY(0);
}

.hero-tagline {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  color: var(--fg-soft);
  font-weight: 400;
  margin-bottom: 2.25rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  /* CSS-only fade-up so it always appears, no JS dependency */
  animation: heroFadeUp 0.9s 0.55s var(--ease) both;
}

.hero-body {
  max-width: 38rem;
  animation: heroFadeUp 0.9s 0.7s var(--ease) both;
}
.hero-body p {
  font-size: 1.1rem;
  color: var(--fg-soft);
  line-height: 1.8;
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-body p + p { margin-top: 1rem; }
@media (min-width: 768px) { .hero-body p { font-size: 1.2rem; } }

/* ------------- Subpage headers ------------- */
.page-header { margin-bottom: 4rem; }
@media (min-width: 768px) { .page-header { margin-bottom: 5rem; } }

.page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-top: 0.5rem;
  text-wrap: balance;
}

.page-subtitle {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--fg-muted);
  margin-top: 0.85rem;
}

/* ------------- About ------------- */
.about-section + .about-section { margin-top: 3.5rem; }

.about-section p {
  font-size: 1.1rem;
  color: var(--fg-soft);
  line-height: 1.85;
}
.about-section p + p { margin-top: 1.25rem; }
@media (min-width: 768px) { .about-section p { font-size: 1.15rem; } }

.section-h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

/* Inline thinker buttons in About prose */
.thinker {
  /* button reset */
  background: none;
  border: 0;
  padding: 0 0 0.05em;
  margin: 0;
  font: inherit;
  color: var(--fg);
  cursor: pointer;
  letter-spacing: inherit;
  border-bottom: 1px dashed var(--accent);
  transition: color 0.3s var(--ease), border-bottom 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.thinker:hover { color: var(--accent); }
.thinker[aria-expanded="true"] {
  color: var(--accent);
  border-bottom: 1.5px solid var(--accent);
}
.thinker:focus { outline: none; }
.thinker:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.takeaways {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1.5rem 0 0;
}

.takeaway {
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  padding: 0 1.25rem;
  transition:
    max-height 0.55s var(--ease),
    opacity 0.4s var(--ease) 0.05s,
    transform 0.4s var(--ease),
    padding 0.4s var(--ease),
    margin 0.4s var(--ease);
  margin: 0;
}
.takeaway.is-open {
  max-height: 240px;
  opacity: 1;
  transform: translateY(0);
  padding: 1rem 1.25rem;
}
.takeaway h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.4rem;
  line-height: 1.4;
}
.takeaway p {
  font-family: 'DM Sans', sans-serif;
  font-style: normal;
  font-size: 1rem;
  color: var(--fg-soft);
  line-height: 1.7;
  margin: 0;
  letter-spacing: 0;
}

/* Influences marquee — edge-faded, slow scroll */
.influences {
  margin: 2.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.6rem 0;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
          mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
.influences-track {
  display: flex;
  gap: 3.5rem;
  animation: marquee 32s linear infinite;
  width: max-content;
  white-space: nowrap;
}
.influences-track span {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--fg-soft);
  display: inline-flex;
  align-items: center;
  gap: 3.5rem;
}
.influences-track span::after {
  content: '·';
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ------------- Work — editorial, no boxes ------------- */
.work-list {
  display: flex;
  flex-direction: column;
  list-style: none;
  border-top: 1px solid var(--border);
}

.work-entry {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

@media (min-width: 768px) {
  .work-entry {
    grid-template-columns: 13rem 1fr;
    gap: 4rem;
    padding: 3.75rem 0;
  }
}

.work-meta {
  /* button reset */
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--fg-muted);
  letter-spacing: 0.18em;
  -webkit-tap-highlight-color: transparent;
  /* visual */
  font-size: 0.74rem;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1.7;
  transition: color 0.35s var(--ease);
}
.work-meta:hover { color: var(--accent); }
.work-meta:focus { outline: none; }
.work-meta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 3px;
}
.work-entry.is-focused .work-meta { color: var(--accent); }

.work-meta .work-num {
  display: inline-block;
  margin-right: 1rem;
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 768px) {
  .work-meta { padding-top: 0.6rem; }
  .work-meta .work-num {
    display: block;
    margin-right: 0;
    margin-bottom: 0.4rem;
    font-size: 0.78rem;
  }
}

/* Work focus mode — click a meta button to focus, others dim */
.work-list .work-entry { transition: opacity 0.5s var(--ease); position: relative; }
.work-list[data-has-focus="true"] .work-entry:not(.is-focused) {
  opacity: 0.3;
}
@media (min-width: 768px) {
  .work-entry::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 3.5rem;
    bottom: 3.5rem;
    width: 2px;
    background: var(--accent);
    border-radius: 2px;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.55s var(--ease);
  }
  .work-entry.is-focused::before { transform: scaleY(1); }
}

.work-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.65rem, 4vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 0.5rem 0 1.1rem;
  line-height: 1.05;
  text-wrap: balance;
}

.work-body p {
  font-size: 1.05rem;
  color: var(--fg-soft);
  line-height: 1.85;
  max-width: 40rem;
}
.work-body p + p { margin-top: 1rem; }

/* ------------- Now — each item expands on click ------------- */
.now-list {
  display: flex;
  flex-direction: column;
  counter-reset: now-counter;
}

.now-item { border-bottom: 1px solid var(--border); }
.now-item:last-child { border-bottom: none; }

.now-toggle {
  /* button reset */
  background: none;
  border: 0;
  padding: 1.4rem 0;
  margin: 0;
  text-align: left;
  width: 100%;
  cursor: pointer;
  font: inherit;
  color: var(--fg);
  letter-spacing: -0.02em;
  -webkit-tap-highlight-color: transparent;
  /* layout */
  display: grid;
  grid-template-columns: 2.25rem 1fr 1.4rem;
  gap: 0.85rem;
  align-items: baseline;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.4;
  text-wrap: balance;
  transition: color 0.3s var(--ease);
}
.now-toggle::before {
  content: counter(now-counter, decimal-leading-zero);
  counter-increment: now-counter;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  padding-top: 0.55rem;
}
.now-toggle:hover { color: var(--accent); }
.now-toggle:focus { outline: none; }
.now-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}

.now-plus {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--fg-muted);
  transition: transform 0.45s var(--ease), color 0.3s var(--ease);
  padding-top: 0.35rem;
  display: inline-block;
  line-height: 1;
}
.now-toggle[aria-expanded="true"] .now-plus {
  transform: rotate(45deg);
  color: var(--accent);
}
.now-toggle[aria-expanded="true"] { color: var(--accent); }

.now-detail {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.55s var(--ease),
    opacity 0.4s var(--ease) 0.05s,
    padding 0.45s var(--ease);
  padding: 0 0 0 3.1rem;
}
.now-detail.is-open {
  max-height: 360px;
  opacity: 1;
  padding: 0.5rem 0 1.75rem 3.1rem;
}
.now-detail p {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-style: normal;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--fg-soft);
  line-height: 1.75;
  max-width: 36rem;
  letter-spacing: 0.005em;
}
.now-detail p em {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 500;
}

@media (min-width: 768px) {
  .now-toggle {
    font-size: 1.85rem;
    grid-template-columns: 3rem 1fr 1.5rem;
    padding: 1.75rem 0;
  }
  .now-detail { padding-left: 3.85rem; }
  .now-detail.is-open { padding: 0 0 1.75rem 3.85rem; }
}

.now-meta {
  margin-top: 3.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem;
  background: var(--accent-soft);
  border-radius: 999px;
}
.now-meta::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
.now-meta p {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.now-counter { font-style: normal; font-weight: 600; }
.now-counter:not(:empty)::before {
  content: ' \00b7 ';
  opacity: 0.6;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.35); }
}

/* ------------- Writing index ------------- */
.writing-list {
  display: flex;
  flex-direction: column;
  list-style: none;
  border-top: 1px solid var(--border);
}
.writing-entry { border-bottom: 1px solid var(--border); }
.writing-entry a {
  display: block;
  padding: 2rem 0;
  transition: padding 0.4s var(--ease), color 0.3s var(--ease);
  color: var(--fg);
}
.writing-entry a:hover { padding-left: 0.6rem; }
.writing-entry time {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fg-muted);
  font-weight: 500;
}
.writing-entry h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 0.5rem 0 0.55rem;
  line-height: 1.2;
  transition: color 0.3s var(--ease);
}
.writing-entry a:hover h2 { color: var(--accent); }
.writing-entry p {
  font-size: 1.02rem;
  color: var(--fg-soft);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.6;
  max-width: 38rem;
  margin: 0;
}

/* ------------- Post page ------------- */
.post-header {
  margin-bottom: 3rem;
  text-align: center;
}
.post-back {
  display: inline-block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fg-muted);
  margin-bottom: 2.5rem;
  transition: color 0.3s var(--ease);
}
.post-back:hover { color: var(--accent); }
.post-header time {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
}
.post-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 0 auto;
  max-width: 36rem;
  line-height: 1.1;
  text-wrap: balance;
}
.post-dek {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  font-weight: 400;
  color: var(--fg-muted);
  margin: 1rem auto 0;
  max-width: 32rem;
  line-height: 1.45;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.post-content {
  max-width: 36rem;
  margin: 3rem auto 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  color: var(--fg-soft);
  line-height: 1.85;
}
.post-content p { margin-bottom: 1.4rem; }

.post-content p:first-of-type::first-letter {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3.2rem;
  font-weight: 500;
  float: left;
  line-height: 0.86;
  margin: 0.12em 0.12em -0.05em 0;
  color: var(--accent);
}

.post-content h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 2.75rem 0 1rem;
  color: var(--fg);
}
.post-content h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.75rem;
}
.post-content a {
  color: var(--fg);
  border-bottom: 1px solid var(--accent);
  transition: color 0.3s var(--ease);
}
.post-content a:hover { color: var(--accent); }
.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.4rem;
  margin: 1.75rem 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.18rem;
  color: var(--fg);
  line-height: 1.6;
}
.post-content em {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 500;
}
.post-content strong { font-weight: 600; color: var(--fg); }
.post-content code {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 0.92em;
  background: var(--accent-soft);
  padding: 0.12em 0.45em;
  border-radius: 4px;
  color: var(--fg);
}
.post-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem auto;
  width: 30%;
}
.post-content ul {
  list-style: none;
  padding-left: 0;
  margin: 1.5rem 0;
}
.post-content ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.55rem;
  line-height: 1.7;
}
.post-content ul li::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 0.85em;
  width: 0.55rem;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
}
.post-content ol {
  padding-left: 1.5rem;
  margin: 1.5rem 0;
}
.post-content ol li {
  margin-bottom: 0.55rem;
  padding-left: 0.4rem;
  line-height: 1.7;
}
.post-content ol li::marker {
  color: var(--accent);
  font-weight: 600;
}

/* ------------- Easter egg — Founder's Dictionary past the footer ------------- */
.easter-egg {
  /* Min height of a full viewport so users have to scroll deliberately past
     the footer to find it; padding-top adds buffer space before content. */
  padding: 12rem 1.5rem 10rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  background: var(--bg);
  min-height: 100vh;
  border-top: 1px solid var(--border);
}
.egg-prompt {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--fg-muted);
  letter-spacing: 0;
  margin-bottom: 1.25rem;
}
.egg-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin-bottom: 2.75rem;
  text-wrap: balance;
  max-width: 28rem;
}
.egg-glossary {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 2rem;
  row-gap: 0.85rem;
  max-width: 30rem;
  margin: 0 auto;
  text-align: left;
}
.egg-glossary > div {
  display: contents;
}
.egg-glossary > div > dt,
.egg-glossary > div > dd {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  /* Per-entry stagger driven by the inline --i custom property on the parent div */
  transition-delay: calc(var(--i, 1) * 0.04s + 0.05s);
}
.easter-egg.is-revealed .egg-glossary > div > dt,
.easter-egg.is-revealed .egg-glossary > div > dd {
  opacity: 1;
  transform: translateY(0);
}

.egg-glossary dt {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  align-self: baseline;
  padding-top: 0.18em;
}
.egg-glossary dd {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--fg);
  margin: 0;
  line-height: 1.4;
}

/* Final entry: "Me / building." — flips the cynical glossary into a sincere closer */
.egg-final {
  margin-top: 3rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 2rem;
  align-items: baseline;
  max-width: 30rem;
  width: 100%;
  text-align: left;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s var(--ease) 1.45s, transform 0.8s var(--ease) 1.45s;
}
.easter-egg.is-revealed .egg-final {
  opacity: 1;
  transform: translateY(0);
}
.egg-final-key {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  align-self: baseline;
  padding-top: 0.18em;
}
.egg-final-val {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.4rem;
  color: var(--fg);
  line-height: 1.4;
  font-weight: 500;
}

@media (max-width: 640px) {
  .easter-egg { padding: 8rem 1.25rem 6rem; min-height: 90vh; }
  .egg-title { margin-bottom: 2rem; font-size: 1.55rem; }
  .egg-glossary { column-gap: 1.25rem; row-gap: 0.7rem; max-width: 22rem; }
  .egg-glossary dt { font-size: 0.7rem; letter-spacing: 0.14em; }
  .egg-glossary dd { font-size: 1rem; }
  .egg-final { margin-top: 2.5rem; padding-top: 1.75rem; column-gap: 1.25rem; max-width: 22rem; }
  .egg-final-val { font-size: 1.2rem; }
  .egg-final-key { font-size: 0.7rem; letter-spacing: 0.14em; }
}
@media (max-width: 420px) {
  .egg-glossary {
    grid-template-columns: 1fr;
    row-gap: 1rem;
  }
  .egg-glossary > div { display: block; }
  .egg-glossary dt { display: block; margin-bottom: 0.2rem; }
}

/* Mobile adjustments for writing/post/easter-egg */
@media (max-width: 640px) {
  .writing-entry h2 { font-size: 1.35rem; }
  .writing-entry p { font-size: 0.95rem; }
  .post-content { font-size: 1rem; line-height: 1.8; }
  .post-content p:first-of-type::first-letter { font-size: 2.6rem; }
  .post-content blockquote { font-size: 1.05rem; padding-left: 1.1rem; }
  .post-title { letter-spacing: -0.018em; }
  .post-dek { font-size: 1rem; margin-top: 0.85rem; }
  .post-header { margin-bottom: 2.25rem; }
}

/* ------------- 404 ------------- */
.notfound {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  text-align: center;
}
.notfound h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(4.5rem, 14vw, 8rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.045em;
  color: var(--accent);
  line-height: 1;
}
.notfound p { margin-bottom: 2rem; font-size: 1.1rem; color: var(--fg-muted); }
.notfound a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--fg);
  color: var(--bg);
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.3s var(--ease), opacity 0.25s var(--ease);
}
.notfound a:hover { transform: translateY(-1px); opacity: 0.9; }

/* ------------- Footer ------------- */
.footer {
  width: 100%;
  padding: 3rem 1.5rem;
  display: flex;
  justify-content: center;
  margin-top: auto;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}
.footer p {
  font-size: 0.85rem;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer p .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.footer .copy {
  font-size: 0.74rem;
  color: var(--fg-muted);
  opacity: 0.7;
}

/* ------------- Mobile fine-tuning ------------- */
@media (max-width: 640px) {
  .container {
    padding-left:  max(1.75rem, env(safe-area-inset-left));
    padding-right: max(1.75rem, env(safe-area-inset-right));
  }
  .section { padding: 3rem 0 4.5rem; }

  .header {
    padding-top: 1rem;
    padding-bottom: 1rem;
    padding-left:  max(1.75rem, env(safe-area-inset-left));
    padding-right: max(1.75rem, env(safe-area-inset-right));
  }
  .footer {
    padding-left:  max(1.75rem, env(safe-area-inset-left));
    padding-right: max(1.75rem, env(safe-area-inset-right));
  }
  .brand { font-size: 1.2rem; }

  /* Drop the forced min-height so content sizes itself naturally on phones */
  .home-main { min-height: auto; padding-top: 4rem; padding-bottom: 4rem; }

  /* Hero: bolder + bigger floor + softer tracking so it doesn't bleed left */
  .hero-name {
    font-size: clamp(3rem, 14vw, 5.5rem) !important;
    letter-spacing: -0.018em !important;
    line-height: 1 !important;
    font-weight: 600 !important;
    margin-bottom: 1.25rem;
    display: block;
  }
  .hero-name .word {
    font-size: 1em !important;
    font-weight: 600 !important;
    line-height: 1 !important;
  }

  /* Caption visibly below the name, clearly secondary in scale */
  .hero-tagline {
    font-size: 1.3rem !important;
    margin-bottom: 1.5rem;
    line-height: 1.35;
  }
  .hero-body p { font-size: 1rem; line-height: 1.7; }

  .saras-reveal { font-size: 1.1rem; margin-top: 1.75rem; }
  .saras-reveal .gloss {
    display: block;
    margin-left: 0;
    margin-top: 0.25rem;
    font-size: 0.85rem;
  }
  .hero-name .word:focus-visible { outline-offset: 4px; }

  .page-header { margin-bottom: 3rem; }
  .page-title { font-size: clamp(1.85rem, 6.5vw, 2.75rem); letter-spacing: -0.018em; }
  .page-subtitle { font-size: 0.95rem; margin-top: 0.65rem; }

  .eyebrow { font-size: 0.72rem; letter-spacing: 0.18em; margin-bottom: 1.1rem; }
  .eyebrow::before { width: 1.25rem; }

  .section-h2 { font-size: 1.4rem; }

  .about-section + .about-section { margin-top: 2.5rem; }
  .about-section p { font-size: 1.02rem; line-height: 1.75; }

  /* Influences marquee — smaller text, tighter gaps so it feels alive but not overpowering */
  .influences { margin: 2rem 0; padding: 1.25rem 0; }
  .influences-track { gap: 2.25rem; animation-duration: 24s; }
  .influences-track span { font-size: 1.15rem; gap: 2.25rem; }

  /* Work entries — tight, readable, num/role on one line */
  .work-entry { padding: 2.25rem 0; gap: 0.5rem; }
  .work-meta { font-size: 0.7rem; line-height: 1.5; }
  .work-meta .work-num { margin-right: 0.75rem; font-size: 0.72rem; }
  .work-name {
    font-size: 1.55rem;
    margin: 0.4rem 0 0.85rem;
    letter-spacing: -0.02em;
  }
  .work-body p { font-size: 1rem; line-height: 1.7; }

  /* Now list — toggle buttons sized for thumb reach */
  .now-toggle {
    font-size: 1.2rem;
    grid-template-columns: 1.85rem 1fr 1.25rem;
    gap: 0.75rem;
    padding: 1.25rem 0;
    line-height: 1.4;
    letter-spacing: -0.015em;
  }
  .now-toggle::before { font-size: 0.68rem; padding-top: 0.4rem; }
  .now-plus { font-size: 1.1rem; }
  .now-detail { padding-left: 2.6rem; }
  .now-detail.is-open { padding: 0.4rem 0 1.4rem 2.6rem; }
  .now-detail p { font-size: 1rem; line-height: 1.7; }
  .now-meta { margin-top: 2.5rem; }
  .now-meta p { font-size: 0.72rem; }

  .footer { padding: 2.25rem 1.25rem; }
  .footer p { font-size: 0.8rem; gap: 0.5rem; }
  .footer .copy { font-size: 0.7rem; }

  .notfound h1 { font-size: clamp(4rem, 16vw, 6rem); }
  .notfound p { font-size: 1rem; }
}

@media (max-width: 380px) {
  .container {
    padding-left:  max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }
  .header {
    padding-left:  max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }
  .hero-name {
    font-size: 2.85rem !important;
    letter-spacing: -0.012em !important;
    font-weight: 600 !important;
  }
  .hero-tagline { font-size: 1.2rem !important; }
  .hero-body p { font-size: 0.95rem; }
  .page-title { font-size: 1.75rem; letter-spacing: -0.012em; }
  .work-name { font-size: 1.35rem; letter-spacing: -0.012em; }
  .now-toggle { font-size: 1.1rem; }
}

/* ------------- Reduced motion ------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .hero-name .word { opacity: 1; transform: none; animation: none; }
  .home-main::before { transform: none; }
}
