/* ═══════════════════════════════════════════════════
   SHARED STYLES — rutvikthakkar.com
   Base system, nav, page headers, accessibility,
   cursor, micro-interactions, polish
   v22 — comprehensive prefers-reduced-motion support
   ═══════════════════════════════════════════════════ */

/* ─── BASE RESET ─── */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}

/* ─── DESIGN TOKENS ─── */
:root {
  --void: #08080d;
  --surface: #131318;
  --surface2: #1a1a20;
  --border: rgba(255,255,255,0.06);
  --border-h: rgba(232,113,58,0.3);
  --sun: #e8713a;
  --gold: #f4a44a;
  --deep: #c44a28;
  --text: #f0ece4;
  --dim: #9a9590;       /* bumped from #7a756e for WCAG AA (5.0:1 vs --void) */
  --faint: #6d6761;     /* tuned up for better low-contrast readability */
  --focus-ring: rgba(232,113,58,0.72);
  --focus-glow: rgba(232,113,58,0.2);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Sora', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --display: 'Syne', system-ui, sans-serif;
  --ease: cubic-bezier(.23,1,.32,1);
  --readable-micro: clamp(0.66rem, 0.94vw, 0.78rem);
  --readable-label: clamp(0.72rem, 1.02vw, 0.84rem);
  --readable-small: clamp(0.86rem, 1.12vw, 0.98rem);
}

/* ─── GLOBAL BASE ─── */
html { scroll-behavior: smooth; }
body {
  background: var(--void);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(232,113,58,0.3); color: #fff; }

/* ─── ACCESSIBILITY: SKIP TO CONTENT ─── */
.skip-link {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100001;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  color: var(--void);
  background: var(--sun);
  padding: 9px 22px;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-glow);
}

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

/* ─── ACCESSIBILITY: FOCUS STYLES ─── */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 6px;
}
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  box-shadow: 0 0 0 3px var(--focus-glow);
}
/* Remove default focus ring for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ─── TYPOGRAPHY POLISH ─── */
h1, h2, h3 {
  text-rendering: geometricPrecision;
}

/* ─── READABILITY FLOOR (micro text) ─── */
.essay-meta,
.essay-tag,
.essay-soon,
.sidebar-label,
.feed-date,
.feed-loading,
.feed-rt,
.city-dates,
.city-tag,
.postcard-cap,
.ledger-label,
.kpi-l,
.ledger-meta,
.region-count,
.state-chip,
.scrub-label,
.scrub-current,
.scrub-year,
.scrub-city,
.filter,
.v-cat,
.v-creator,
.v-link,
.vault-count,
.vault-search-input,
.vault-search-clear,
.vault-empty-sub,
.mixtape-hint,
.mixtape-fab,
.mixtape-sub,
.mixtape-empty-sub,
.mixtape-item-meta,
.mixtape-item-btn,
.mixtape-action,
.mixtape-status,
.pg-updated,
.now-meta,
.stat-lab,
.tag,
.now-toc-label,
.now-toc-pill,
.live-status .status-city,
.pts-card-label,
.pts-stat-l,
.suggest-label,
.suggest-cat,
.suggest-msg,
.spot-status,
.intro-skip,
.chat-eyebrow,
.status-text,
.msg-label,
.starter,
.chat-meta,
.maxims-count,
.maxim-n,
.maxim-break,
.rand-tx-label,
.rand-freq,
.rand-num,
.rand-copy,
.closer-sub,
.lost-code,
.lost-explore-label,
.lost-pill,
.brain-float-text {
  font-size: var(--readable-micro) !important;
}

.chat-sub,
.room-d,
.love p,
.v-note,
.now-desc,
.sidebar-desc,
.bucket-text,
.sh p {
  font-size: var(--readable-small) !important;
}

.hero-eyebrow,
.ch-num,
.room-n,
.peek-label,
.peek-meta,
.vault-tag,
.love-hint,
.ask-cta-text {
  font-size: var(--readable-label) !important;
}

/* ─── NAV ─── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 48px;
  background: rgba(8,8,13,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-home {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  opacity: 0.8;
  transition: all 0.3s;
}
.nav-home:hover { opacity: 1; color: var(--sun); }

@keyframes spin-liquid {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spin-liquid-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.nav-r { display: flex; align-items: center; gap: 10px; }
.nav-r a {
  position: relative;
  display: inline-flex;
  padding: 2px;
  border-radius: 9999px;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212,212,216,0.06);
}
.nav-r a::before {
  content: "";
  position: absolute;
  inset: -200%;
  z-index: 0;
  pointer-events: none;
  background: conic-gradient(from 0deg, #d4d4d8, #d97736, #71717a, #fb923c, #a1a1aa, #d97736, #f4f4f5, #d97736, #71717a);
  opacity: 0.82;
  transition: opacity 0.4s ease;
  animation: spin-liquid 8s linear infinite;
}
.nav-r a::after {
  content: "";
  position: absolute;
  inset: -200%;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  background: conic-gradient(from 0deg, rgba(251,146,60,0.5), rgba(212,212,216,0.22), rgba(217,119,54,0.52), rgba(161,161,170,0.18), rgba(251,146,60,0.5));
  opacity: 0.46;
  transition: opacity 0.4s ease;
  animation: spin-liquid-reverse 12s linear infinite;
}
.nav-r a:hover,
.nav-r a:focus-visible {
  transform: scale(1.05);
}
.nav-r a:active {
  transform: scale(0.95);
}
.nav-r a:hover::before,
.nav-r a:focus-visible::before { opacity: 1; }
.nav-r a:hover::after,
.nav-r a:focus-visible::after { opacity: 0.8; }
.nav-r a:focus-visible {
  outline: none;
}
.nav-button-inner {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 9999px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(217,119,54,0.22) 0%, rgba(10,6,4,0.84) 28%, rgba(10,6,4,0.84) 72%, rgba(217,119,54,0.16) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2), inset 0 -2px 4px rgba(0, 0, 0, 0.8), inset 0 0 18px rgba(217,119,54,0.08);
  color: rgba(255, 240, 230, 0.8);
  font-family: monospace;
  letter-spacing: 0.15em;
  font-size: 11px;
  text-transform: uppercase;
}
.nav-r a:hover .nav-button-inner,
.nav-r a:focus-visible .nav-button-inner,
.nav-r a.active .nav-button-inner {
  color: #ffffff;
}
.nav-button-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: 9999px;
  mix-blend-mode: screen;
  background: radial-gradient(circle at 50% 0%, rgba(217,119,54,0.15) 0%, transparent 70%);
  transition: background 0.2s ease;
}
.nav-r a:hover .nav-button-inner::before,
.nav-r a:focus-visible .nav-button-inner::before {
  background: radial-gradient(circle at calc(var(--x, 50) * 1%) calc(var(--y, 50) * 1%), rgba(217,119,54,0.4) 0%, transparent 60%);
}
.nav-button-inner > * {
  position: relative;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}
.nav-link-plane {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-link-label {
  display: inline-flex;
  align-items: center;
}
.nav-button-inner svg {
  width: 12px;
  height: 12px;
  color: rgba(217, 119, 54, 0.7);
  transition: color 0.3s ease;
}
.nav-r a:hover .nav-button-inner svg,
.nav-r a:focus-visible .nav-button-inner svg,
.nav-r a.active .nav-button-inner svg {
  color: rgba(217, 119, 54, 1);
}

/* ─── NAV ASK LINK ─── */
.nav-ask .nav-button-inner {
  color: rgba(255, 232, 205, 0.92);
}
.nav-ask .nav-link-label::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74,222,128,0.3);
  animation: askNavPulse 2s ease-in-out infinite;
  margin-left: 6px;
  flex-shrink: 0;
}
@keyframes askNavPulse {
  0%,100% { opacity:1; box-shadow:0 0 0 0 rgba(74,222,128,0.3) }
  50% { opacity:0.6; box-shadow:0 0 0 3px rgba(74,222,128,0) }
}
.nav-ask:hover,
.nav-ask:focus-visible { color: #ffe7cd !important; }

/* ─── PAGE HEADERS (shared across sub-pages) ─── */
.pg-hd {
  padding: 160px 48px 28px;
  max-width: 1100px;
  margin: 0 auto;
}
.pg-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sun);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.pg-label::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--sun);
}
.pg-title {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 12px;
}
.pg-sub {
  font-family: var(--serif);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-style: italic;
  color: var(--dim);
  line-height: 1.6;
  max-width: 640px;
}
.pg-sub em { color: var(--sun); }

/* Page layout utilities (phase 1 consolidation) */
.pg-hd-800 { max-width: 800px; margin: 0 auto; padding-bottom: 80px; }
.pg-hd-900 { max-width: 900px; margin: 0 auto; padding-bottom: 80px; }
.pg-hd-900-tight { max-width: 900px; margin: 0 auto; padding-bottom: 40px; }
.pg-hd-pad-80 { padding-bottom: 80px; }
.pg-sub-520 { max-width: 520px; }
.pg-sub-560 { max-width: 560px; }
.pg-sub-600 { max-width: 600px; }
.page-content {
  padding: 0 48px 120px;
  margin: 0 auto;
}
.page-content-800 { max-width: 800px; }
.page-content-900 { max-width: 900px; }
.gutter-x {
  padding-left: 48px;
  padding-right: 48px;
}
.wrap-800,
.wrap-900,
.wrap-960,
.wrap-1100 {
  margin: 0 auto;
  padding-left: 48px;
  padding-right: 48px;
}
.wrap-800 { max-width: 800px; }
.wrap-900 { max-width: 900px; }
.wrap-960 { max-width: 960px; }
.wrap-1100 { max-width: 1100px; }

/* ─── SHARED SECTION HEADERS ─── */
.sec-hd {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sec-dot {
  width: 6px;
  height: 6px;
  background: var(--sun);
  border-radius: 1px;
  transform: rotate(45deg);
  flex-shrink: 0;
}
.sec-title {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.sec-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── SHARED PILL/CHIP PRIMITIVES ─── */
.ui-pill,
.now-toc-pill,
.lost-pill,
.starter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  color: var(--faint);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.3s var(--ease);
}
.ui-pill:hover,
.now-toc-pill:hover,
.lost-pill:hover,
.starter:hover {
  color: var(--sun);
  border-color: var(--sun);
  background: rgba(232,113,58,0.06);
  transform: translateY(-1px);
}
.ui-pill-dot,
.now-toc-pill .pill-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── SHARED COPPER TAGS ─── */
.copper-chip,
.tag,
.essay-tag {
  display: inline-block;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sun);
  background: rgba(232,113,58,0.08);
  border: 1px solid rgba(232,113,58,0.15);
  border-radius: 100px;
}

/* ─── FULL-HEIGHT PAGE SHELL ─── */
.page-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ─── SCROLL REVEAL ─── */
.rv {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.rv.in {
  opacity: 1;
  transform: translateY(0);
}
.rv-instant{opacity:1;transform:none}

/* ─── FILM GRAIN (subtle cinematic warmth) ─── */
body::after {
  content: '';
  position: fixed;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 99998;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  mix-blend-mode: overlay;
  animation: grainDrift 8s steps(10) infinite;
}
@keyframes grainDrift {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  30% { transform: translate(3%, -15%); }
  50% { transform: translate(12%, 9%); }
  70% { transform: translate(9%, 4%); }
  90% { transform: translate(-1%, 7%); }
}
@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
}

/* ─── CUSTOM CURSOR (Paper Plane) ─── */
@media (hover: hover) and (pointer: fine) {
  *, *::before, *::after { cursor: none !important; }
  input, textarea, select, [contenteditable] { cursor: text !important; }
  
  .cursor-plane {
    position: fixed;
    top: 0; left: 0;
    width: 24px; height: 24px;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%) rotate(-30deg);
    opacity: 0.7;
    filter: drop-shadow(0 0 3px rgba(232,113,58,0.2));
    transition: opacity 0.25s, filter 0.25s;
  }
  .cursor-plane svg {
    width: 100%; height: 100%;
    transition: transform 0.2s ease-out;
  }
  
  .cursor-plane.hover {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(232,113,58,0.35));
  }
  .cursor-plane.hover svg {
    transform: scale(1.3);
  }
  
  .cursor-plane.hidden {
    opacity: 0;
  }
}

/* ─── LOADING SCREEN ─── */
.loader {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--void);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 1s var(--ease), visibility 1s;
}
.loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-stage {
  position: relative;
  width: 580px;
  height: 380px;
  perspective: 1200px;
  isolation: isolate;
  overflow: hidden;
}
.loader-stage::before{
  content:'';
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:radial-gradient(ellipse at center,rgba(8,8,13,0) 34%,rgba(8,8,13,0.18) 62%,var(--void) 97%);
}
.loader-stage::after{
  content:'';
  position:absolute;
  inset:0;
  z-index:4;
  pointer-events:none;
  background:radial-gradient(ellipse at center,rgba(8,8,13,0) 48%,rgba(8,8,13,0.46) 76%,var(--void) 97%);
}
.loader-bp, .loader-pp {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index:2;
  transform-style: preserve-3d;
}
.loader-bp {
  opacity: 0;
  transform: scale(0.9) rotateY(0deg);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.loader-bp.show { opacity: 1; transform: scale(1) rotateY(0deg); }
.loader-bp.fold { opacity: 1; transform: scale(0.85) rotateY(85deg); transition: opacity 0.8s cubic-bezier(.4,0,.2,1), transform 0.8s cubic-bezier(.4,0,.2,1); }
.loader-bp.gone { opacity: 0; transform: scale(0.8) rotateY(90deg); transition: opacity 0.15s ease-in, transform 0.15s ease-in; }
.loader-pp {
  opacity: 0;
  transform: scale(0.7) rotateY(-85deg);
  transition: opacity 0.1s, transform 0.1s;
}
.loader-pp.unfold { opacity: 1; transform: scale(0.85) rotateY(-5deg) rotateX(2deg); transition: opacity 0.6s var(--ease), transform 0.8s var(--ease); }
.loader-bp img, .loader-pp img { max-width: 100%; max-height: 100%; object-fit: contain; display:block; }
.loader-bp img{
  filter:contrast(1.02) brightness(1.01);
}
.loader-pp img{
  filter:contrast(1.04) brightness(1.02) saturate(1.01);
}


.loader-sub {
  margin-top: 24px;
  font-family: var(--serif);
  font-size: clamp(0.6rem, 1.3vw, 0.82rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.1em;
  color: var(--dim);
  opacity: 0;
  transition: opacity 0.6s ease-out;
}
.loader-sub.show { opacity: 1; }
@media(max-width:640px) {
  .loader-stage { width: 320px; height: 210px; }
}
/* Sub-page simple loader */
.loader-name {
  font-family: var(--serif);
  font-size: clamp(0.6rem, 1.3vw, 0.8rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  font-style: italic;
  color: rgba(232,113,58,0);
  transition: color 0.8s;
}
.loader-name.show { color: rgba(232,113,58,1); }
.loader-line {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e8713a, transparent);
  margin-top: 16px;
  transition: width 0.8s var(--ease);
}
.loader-line.show { width: 120px; }

/* ─── COPPER GLOW MOMENTS ─── */
.copper-text {
  background: linear-gradient(135deg, #e8713a, #f4a44a, #e8713a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hr-l {
  background: linear-gradient(90deg, transparent, rgba(232,113,58,0.15), transparent) !important;
}
.hr-ico {
  box-shadow: 0 0 12px rgba(232,113,58,0.15);
}

/* ─── MICRO-INTERACTIONS ─── */

/* 3D card tilt */
.tilt-card {
  transition: transform 0.4s var(--ease), box-shadow 0.4s;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Button press effect */
a[class*="cta"]:active,
button:active,
.suggest-btn:active {
  transform: scale(0.96) !important;
}

/* Magnetic hover for nav links */
@media (hover: hover) {
  nav .nav-home {
    transition: color 0.3s, transform 0.3s var(--ease) !important;
  }
  nav .nav-home:hover {
    transform: translateY(-1px);
  }

  /* Body text links */
  p a, .now-desc a, .city-body a, .ft-def a, .ft-sub a {
    color: #e8713a;
    text-decoration: none;
    background-image: linear-gradient(rgba(232,113,58,0.3), rgba(232,113,58,0.3));
    background-size: 100% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s var(--ease), color 0.3s;
  }
  p a:hover, .now-desc a:hover, .city-body a:hover, .ft-def a:hover, .ft-sub a:hover {
    background-size: 100% 100%;
    color: #fff;
  }

  /* CTA buttons — unified glow hover */
  a[class*="cta"], .suggest-btn, .sidebar-cta, .pts-cta {
    position: relative;
    transition: all 0.35s var(--ease) !important;
  }
  a[class*="cta"]:hover, .suggest-btn:hover, .sidebar-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 24px rgba(232,113,58,0.12), 0 4px 16px rgba(0,0,0,0.2);
  }

  /* Footer word — subtle glow */
  .ft-w { transition: text-shadow 0.3s; }
  .ft-w:hover { text-shadow: 0 0 20px rgba(232,113,58,0.15); }

  /* Footer social links use pill-border hover from footer section */

  /* Filter pills (vault page) */
  .filter {
    transition: all 0.3s var(--ease) !important;
  }
  .filter:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  }

  /* Vault cards — link indicator */
  .v-card[href] { cursor: pointer; }
  .v-card[href]:hover .v-link { transform: translateX(3px); }
  .v-link { transition: color 0.3s, transform 0.3s var(--ease); }

  /* Feed items (words page) */
  .feed-item {
    transition: all 0.3s var(--ease) !important;
  }
  .feed-item:hover {
    transform: translateX(4px);
    border-color: rgba(232,113,58,0.2) !important;
  }

  /* Bucket list items (loves page) */
  .bucket-item { transition: transform 0.3s var(--ease); }
  .bucket-item:hover { transform: translateX(4px); }
  .bucket-item:hover .bucket-check {
    border-color: rgba(232,113,58,0.4);
    box-shadow: 0 0 8px rgba(232,113,58,0.1);
  }
}

/* ─── SCROLL PROGRESS BAR ─── */
.scroll-prog {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, #e8713a, #f4a44a);
  z-index: 10001;
  width: 0%;
  transition: none;
  box-shadow: 0 0 8px rgba(232,113,58,0.3);
}
.scroll-prog-plane {
  position: absolute;
  right: -8px;
  top: -5px;
  width: 12px;
  height: 12px;
  opacity: 0.85;
  filter: drop-shadow(0 0 4px rgba(232,113,58,0.5));
  transform: rotate(-20deg);
}
.scroll-prog-plane svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ─── FOOTER ─── */
footer {
  padding: 44px 42px 28px !important;
  text-align: left;
  border-top: 1px solid rgba(232,113,58,0.18) !important;
  border-bottom: 1px solid rgba(232,113,58,0.18) !important;
  border-left: none !important;
  border-right: none !important;
  border-radius: 0;
  background: rgba(11,14,22,0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: none !important;
  margin: 0 !important;
  width: 100%;
  min-height: 380px;
  position: relative;
  overflow: hidden;
}
footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -18%;
  width: 24%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(232,113,58,0.16), transparent);
  animation: ftSweep 7s linear infinite;
  pointer-events: none;
}
@keyframes ftSweep { to { transform: translateX(760%); } }

.ft-top {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 22px 34px;
  align-items: stretch;
}
.ft-left {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
}
.ft-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
}

.ft-status {
  font-family: var(--mono);
  font-size: var(--readable-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232,113,58,0.72);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.ft-status-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(74,222,128,0.6);
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%,100% { opacity:1; box-shadow:0 0 0 0 rgba(74,222,128,0.3) }
  50% { opacity:0.7; box-shadow:0 0 0 4px rgba(74,222,128,0) }
}

.ft-d { margin: 14px 0 0; }
.ft-kicker {
  color: var(--sun);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.64rem;
  margin-top: 4px;
}
.ft-headline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.45rem, 2.45vw, 2.45rem);
  line-height: 1.05;
  color: var(--text);
}
.ft-sub {
  font-family: var(--sans);
  font-size: clamp(0.92rem, 1.16vw, 1.08rem);
  font-weight: 300;
  color: var(--dim);
  line-height: 1.58;
  max-width: 54ch;
}
.ft-w { font-family: var(--display); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; }
.ft-ph { font-family: var(--serif); font-size: 0.76rem; font-style: italic; color: var(--dim); margin-left: 5px; }
.ft-pos { font-family: var(--serif); font-size: 0.68rem; font-style: italic; color: var(--sun); margin-left: 3px; }
.ft-def { font-family: var(--sans); font-size: var(--readable-small); font-weight: 300; color: var(--dim); line-height: 1.58; margin-top: 5px; max-width: 42ch; }

.ft-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.ft-social a {
  border: 1px solid rgba(232,113,58,0.2);
  border-radius: 999px;
  min-height: 36px;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: var(--readable-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.62);
  text-decoration: none;
  transition: color 0.3s, transform 0.3s, border-color 0.3s, background 0.3s;
}
.ft-social a:hover {
  color: #e8713a;
  border-color: rgba(232,113,58,0.5);
  background: rgba(232,113,58,0.08);
  transform: translateY(-2px);
}

.ft-monitor {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 11px;
  background: rgba(7,10,15,0.66);
}
.ft-monitor-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.58rem;
  color: var(--faint);
  margin-bottom: 9px;
}
.ft-bars {
  height: 58px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.ft-bars span {
  flex: 1;
  border-radius: 4px 4px 1px 1px;
  background: linear-gradient(180deg, rgba(244,164,74,0.95), rgba(232,113,58,0.34));
  height: 26%;
  transform-origin: bottom;
  animation: ftBars 1.7s ease-in-out infinite;
}
.ft-bars span:nth-child(1) { animation-delay: .1s; }
.ft-bars span:nth-child(2) { animation-delay: .28s; }
.ft-bars span:nth-child(3) { animation-delay: .45s; }
.ft-bars span:nth-child(4) { animation-delay: .22s; }
.ft-bars span:nth-child(5) { animation-delay: .55s; }
.ft-bars span:nth-child(6) { animation-delay: .36s; }
.ft-bars span:nth-child(7) { animation-delay: .14s; }
.ft-bars span:nth-child(8) { animation-delay: .41s; }
.ft-bars span:nth-child(9) { animation-delay: .25s; }
.ft-bars span:nth-child(10) { animation-delay: .57s; }
.ft-bars span:nth-child(11) { animation-delay: .19s; }
.ft-bars span:nth-child(12) { animation-delay: .49s; }
@keyframes ftBars {
  0%, 100% { transform: scaleY(0.34); opacity: 0.58; }
  45% { transform: scaleY(1); opacity: 1; }
}

.ft-ticker-wrap {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 16px;
  overflow: hidden;
}
.ft-ticker {
  display: flex;
  gap: 26px;
  align-items: center;
  white-space: nowrap;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.68rem;
  font-weight: 400;
  color: rgba(240,236,228,0.82);
  padding: 10px 0;
  animation: ticker 15s linear infinite;
  will-change: transform;
}
.ft-ticker span {
  padding-left: 26px;
  position: relative;
}
.ft-ticker span::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(232,113,58,0.82);
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}
@keyframes ticker { to { transform: translateX(calc(-1 * var(--ticker-shift, 50%))); } }

.ft-copy {
  font-family: var(--mono);
  font-size: var(--readable-micro);
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.28);
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

/* Dark/Darker mode toggle */
.mode-toggle {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.2);
  font-size: 0.66rem;
  cursor: pointer;
  transition: all 0.4s;
  display: flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1;
}
.mode-toggle:hover { border-color: rgba(232,113,58,0.3); color: rgba(232,113,58,0.6); }
body.darker-mode .mode-toggle { background: rgba(232,113,58,0.1); border-color: rgba(232,113,58,0.3); color: #e8713a; }

/* Darker (OLED) mode overrides */
body.darker-mode { background: #000 !important; }
body.darker-mode nav { background: rgba(0,0,0,0.92) !important; }
body.darker-mode .room,
body.darker-mode .love-exp,
body.darker-mode .v-card,
body.darker-mode .bucket-item { background: #0a0a0a; border-color: rgba(255,255,255,0.04); }
body.darker-mode footer {
  border-top-color: rgba(232,113,58,0.1) !important;
  border-bottom-color: rgba(232,113,58,0.1) !important;
  background: rgba(0,0,0,0.92);
}
body, nav, .room, footer { transition: background 0.5s ease, border-color 0.5s ease; }

/* ─── SKELETON SHIMMER (loading states) ─── */
.skel{background:var(--surface);border-radius:4px;position:relative;overflow:hidden}
.skel::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,0.03),transparent);animation:shimmer 1.8s ease-in-out infinite}
@keyframes shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}
.skel-line{height:14px;margin-bottom:12px}
.skel-line:last-child{width:60%;margin-bottom:0}
.skel-line-sm{height:10px;margin-top:6px;width:40%}

/* ─── PAGE TRANSITIONS (gravity well) ─── */
.rt-grav-overlay{
  position:fixed;
  inset:0;
  z-index:95;
  pointer-events:none;
  overflow:hidden;
}
.rt-grav-layer{
  position:absolute;
  inset:0;
  background:var(--void);
  will-change:opacity;
}
.rt-grav-void{
  position:absolute;
  inset:0;
  background:var(--void);
}
.rt-grav-accretion{
  position:absolute;
  border-radius:50%;
  pointer-events:none;
  will-change:transform, opacity;
  opacity:0;
  background:
    radial-gradient(circle,
      transparent 20%,
      rgba(232,113,58,0.0) 30%,
      rgba(232,113,58,0.6) 42%,
      rgba(244,164,74,0.8) 50%,
      rgba(232,113,58,0.6) 58%,
      rgba(232,113,58,0.0) 70%,
      transparent 80%
    );
  filter:blur(4px);
}
.rt-grav-flash{
  position:absolute;
  border-radius:50%;
  pointer-events:none;
  will-change:transform, opacity;
  opacity:0;
  background:radial-gradient(circle, rgba(244,164,74,1) 0%, rgba(232,113,58,0.8) 30%, transparent 70%);
  filter:blur(3px);
}
.rt-grav-particle{
  position:absolute;
  border-radius:50%;
  will-change:transform, opacity;
  opacity:0;
  pointer-events:none;
}
body.rt-grav-lock{overflow:hidden}
html.rt-wave-pending body > :not(nav):not(.skip-link):not(.rt-grav-overlay){
  opacity:0 !important;
}
html.rt-wave-pending body{
  overflow:hidden;
}

/* ─── FLOATING BRAIN CTA (all pages except /ask) ─── */
.brain-float{
  position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(80px);
  z-index:150;
  display:flex;align-items:center;gap:8px;
  background:rgba(19,19,24,0.92);
  backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:100px;padding:10px 12px 10px 16px;
  text-decoration:none;
  transition:all 0.5s var(--ease);
  opacity:0;pointer-events:none;
  box-shadow:0 8px 32px rgba(0,0,0,0.5);
}
.brain-float.show{opacity:1;transform:translateX(-50%) translateY(0);pointer-events:all}
.brain-float:hover{border-color:rgba(232,113,58,0.3);transform:translateX(-50%) translateY(-2px);box-shadow:0 12px 40px rgba(0,0,0,0.6)}
.brain-float-dot{width:6px;height:6px;border-radius:50%;background:#4ade80;flex-shrink:0;animation:askNavPulse 2s ease-in-out infinite}
.brain-float-text{font-family:var(--mono);font-size:var(--readable-micro);letter-spacing:0.04em;color:rgba(240,236,228,0.74);transition:color 0.3s;white-space:nowrap}
.brain-float:hover .brain-float-text{color:var(--text)}
.brain-float-arrow{font-size:0.7rem;color:var(--sun);opacity:0;transform:translateX(-3px);transition:all 0.3s}
.brain-float:hover .brain-float-arrow{opacity:1;transform:translateX(0)}
.brain-float-close{
  display:inline-flex;align-items:center;justify-content:center;
  width:20px;height:20px;border-radius:50%;
  padding:0;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.02);
  color:rgba(255,255,255,0.42);
  font-family:var(--mono);font-size:0.56rem;line-height:1;
  cursor:pointer;
  transition:all 0.3s;
}
.brain-float-close:hover{color:var(--sun);border-color:rgba(232,113,58,0.45);background:rgba(232,113,58,0.1)}
.brain-float-close:focus-visible{outline:none;box-shadow:0 0 0 2px rgba(232,113,58,0.28)}

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  :root {
    --readable-micro: clamp(0.64rem, 2.6vw, 0.74rem);
    --readable-label: clamp(0.68rem, 2.9vw, 0.8rem);
    --readable-small: clamp(0.82rem, 3.2vw, 0.94rem);
  }

  .cursor-plane { display: none !important; }

  /* Nav */
  nav { padding: 16px 20px !important; }
  nav.docked { padding: 12px 20px !important; }
  .nav-r {
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(to right, transparent 0%, black 8px, black calc(100% - 16px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8px, black calc(100% - 16px), transparent 100%);
    padding-right: 16px;
  }
  .nav-r::-webkit-scrollbar { display: none; }
  .nav-r a {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .nav-button-inner {
    gap: 6px;
    padding: 6px 12px;
    font-size: 10px;
  }
  .nav-button-inner svg {
    width: 10px;
    height: 10px;
  }

  /* Page headers */
  .pg-hd { padding: 120px 20px 20px; }
  .pg-hd-800,
  .pg-hd-900,
  .pg-hd-pad-80 { padding-bottom: 56px; }
  .pg-hd-900-tight { padding-bottom: 32px; }
  .page-content { padding: 0 20px 80px; }
  .gutter-x {
    padding-left: 20px;
    padding-right: 20px;
  }
  .wrap-800,
  .wrap-900,
  .wrap-960,
  .wrap-1100 {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Footer */
  footer {
    padding: 28px 16px 18px !important;
    border-left: none !important;
    border-right: none !important;
    border-radius: 0;
    min-height: 0;
  }
  .ft-top { grid-template-columns: 1fr; gap: 12px; }
  .ft-right { gap: 10px; }
  .ft-social { justify-content: flex-start; gap: 8px; }
  .ft-social a { font-size: 0.58rem; min-height: 34px; padding: 7px 9px; }
  .ft-monitor-head { font-size: 0.52rem; }
  .ft-bars { height: 48px; }
  .ft-kicker { margin-top: 2px; }
  .ft-headline { font-size: clamp(1.28rem, 7vw, 1.78rem); }
  .ft-sub { font-size: 0.9rem; max-width: 100%; }
  .ft-status {
    font-size: 0.62rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    row-gap: 4px;
  }
  .ft-d { margin-top: 8px; }
  .ft-ticker { animation-duration: 20s; font-size: 0.64rem; letter-spacing: 0.08em; }
  .ft-copy { gap: 8px 12px; justify-content: flex-start; }

  /* Floating brain CTA */
  .brain-float { bottom: 16px; padding: 8px 10px 8px 12px; }
  .brain-float-text { font-size: 0.56rem; }
  .brain-float-close { width: 18px; height: 18px; font-size: 0.54rem; }
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  /* Hide motion-dependent UI */
  .cursor-plane, .scroll-prog { display: none !important; }

  /* Disable scroll reveal transitions — show content immediately */
  .rv { transition: none; opacity: 1; transform: none; }

  /* Kill all keyframe animations globally */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Disable tilt transforms */
  .tilt-card { transform: none !important; }

  /* Footer ticker: show static, no scroll */
  .ft-ticker-wrap { animation: none !important; overflow: hidden; }

  /* Loader: skip animations, show immediately */
  .loader { transition: none; }
  .loader-bp, .loader-pp { transition: none; }

  /* Hero parallax: flatten */
  .hero-video, .hero-img { transition: none !important; }
}
