/* ═══════════════════════════════════════════════════════════════
   KINSHUKACHARYA.COM — "EDITORIAL EXECUTIVE" design system
   Swiss grid · oversized display type · graphite + bone + one signal-orange
   Type roles: Space Grotesk = display, Inter = prose, JetBrains Mono = data
   ═══════════════════════════════════════════════════════════════ */

/* ───────────── Theme tokens ───────────── */
:root {
  /* three faces, three jobs — never mix them up:
     display = headlines · sans = prose · mono = data, labels, timestamps */
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --maxw: 1100px;
  --measure: 68ch;    /* prose never runs wider — 65-75ch is the readable band */

  /* type scale — 16px base */
  --fs-micro: 11px;   /* tag chips */
  --fs-label: 12px;   /* eyebrows · section numbers · mono captions */
  --fs-sm:    14px;   /* links, fine print, captions */
  --fs-body:  16px;   /* ALL prose */
  --fs-title: 18px;   /* card / stop titles */
  --lh-body:  1.65;
  --track-label: 0.16em; /* one tracking for all uppercase mono labels */

  /* heading sizes (fluid) */
  --fs-h-xl: clamp(44px, 8.5vw, 92px);  /* the name — oversized, the anchor */
  --fs-h-md: clamp(26px, 3.8vw, 38px);  /* section titles */

  /* editorial grid */
  --col-label: 190px;  /* left rail that holds section numbers + titles */
  --gutter: clamp(24px, 4vw, 56px);

  /* radii — HUD panels stay crisp; pills for chips */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* vertical rhythm */
  --space-section: clamp(48px, 8vw, 84px);
  --space-title: 26px;
}

html[data-theme="dark"] {
  --bg: #0d0806;                       /* warm near-black — red-tinted, not blue */
  --bg-soft: #150e0b;
  --card: rgba(32, 21, 17, 0.55);
  --card-solid: #1a110d;
  --card-border: rgba(255, 122, 89, 0.13);
  --text: #f6ece8;
  --text-dim: #b3a29c;
  --text-faint: #877672;   /* 4.6:1 on --bg */

  --hud: #ff4d2e;                      /* the single electric accent */
  --hud2: #ff9f1c;
  --hud-soft: rgba(255, 77, 46, 0.10);
  --hud-line: rgba(255, 77, 46, 0.28);

  --accent: #3ddc97;
  --accent-soft: rgba(61, 220, 151, 0.12);
  --busy: #ff9f1c;
  --away: #4cc3ff;
  --sleep: #a78bfa;
  --offline: #6f625e;

  --ring: rgba(246, 236, 232, 0.07);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  --glass-blur: 18px;
  --grid-line: rgba(255, 77, 46, 0.07);
  --grid-dot: rgba(246, 236, 232, 0.04);
  --glow-a: rgba(255, 77, 46, 0.13);
  --glow-b: rgba(255, 159, 28, 0.07);
  --glow-c: rgba(246, 236, 232, 0.04);
  --star: 255, 226, 214;

  /* Guadalajara scene — dusk: warm sky, near-black silhouettes */
  --sky-top: #100a07;
  --sky-horizon: #3d1c10;
  --city-far: #2a1710;
  --city-mid: #170d09;
  --city-near: #080504;
}

html[data-theme="light"] {
  --bg: #e9e3d9;                       /* warm stone, from the logartis family */
  --bg-soft: #ded7ca;
  --card: rgba(255, 253, 250, 0.7);
  --card-solid: #fffdfa;
  --card-border: rgba(40, 26, 20, 0.14);
  --text: #17100c;
  --text-dim: #4e423c;
  --text-faint: #6d5f58;

  --hud: #d63a16;
  --hud2: #b26a00;
  --hud-soft: rgba(214, 58, 22, 0.09);
  --hud-line: rgba(214, 58, 22, 0.3);

  --accent: #0f9d70;
  --accent-soft: rgba(15, 157, 112, 0.1);
  --busy: #b45309;
  --away: #0369a1;
  --sleep: #7c3aed;
  --offline: #948b82;

  --ring: rgba(23, 16, 12, 0.09);
  --shadow: 0 20px 60px rgba(60, 40, 25, 0.14);
  --glass-blur: 18px;
  --grid-line: rgba(214, 58, 22, 0.09);
  --grid-dot: rgba(23, 16, 12, 0.06);
  --glow-a: rgba(214, 58, 22, 0.1);
  --glow-b: rgba(178, 106, 0, 0.07);
  --glow-c: rgba(23, 16, 12, 0.04);
  --star: 120, 70, 45;

  /* Guadalajara scene — daylight haze on warm stone */
  --sky-top: #f3ede2;
  --sky-horizon: #f7d9bd;
  --city-far: #c9bdae;
  --city-mid: #9c8d7d;
  --city-near: #4a3d33;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  transition: background 0.35s ease;
  overflow-x: clip;      /* guard: a stray wide child must never scroll the page.
                            `clip` not `hidden` — hidden would break sticky rails. */
}
body {
  margin: 0;
  background: transparent; /* the .bg-fx layers (z-index:-1) show through */
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: color 0.35s ease;
}

a { color: inherit; }
/* one visible focus ring for every interactive element (never removed) */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--hud);
  outline-offset: 3px;
  border-radius: 3px;
}
::selection { background: var(--hud); color: var(--bg); }

/* ───────────── Top bar — minimal, right-aligned ───────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 44px);
  mix-blend-mode: difference;          /* stays legible over any scene */
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.sys {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 1);
}
.sys::before { content: ""; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.lang { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; }
.lang-btn {
  background: none; border: none; cursor: pointer; font: inherit;
  letter-spacing: inherit; color: rgba(255, 255, 255, 0.55);
  min-height: 44px; min-width: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.2s ease;
}
.lang-btn:hover { color: rgba(255, 255, 255, 1); }
.lang-btn.is-active { color: rgba(255, 255, 255, 1); }
.lang-sep { color: rgba(255, 255, 255, 0.4); }
.theme-toggle {
  font-family: var(--mono); font-size: 13px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: none; color: rgba(255, 255, 255, 1);
  cursor: pointer; display: grid; place-items: center;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.theme-toggle:hover { transform: rotate(-15deg); border-color: rgba(255, 255, 255, 1); }
html[data-theme="dark"] .theme-toggle .t-light { display: none; }
html[data-theme="light"] .theme-toggle .t-dark { display: none; }

/* scroll progress runs the full width, under everything */
.scroll-progress {
  position: fixed; left: 0; right: 0; top: 0;
  height: 2px; z-index: 31;
  background: var(--hud);
  transform: scaleX(0); transform-origin: 0 50%;
  will-change: transform;
}

/* ── MATRIX: a field of glyph cells; the cursor is a light source ──
   Density comes from ~360 small elements, each cheap to animate. Only
   transform/opacity/color move, so it stays on the compositor. */
.matrix {
  display: grid;
  grid-auto-rows: 1fr;
  gap: 0;
  margin-top: clamp(20px, 4vh, 40px);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  user-select: none;
  line-height: 1;
}
.mx {
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
  color: var(--text-faint);
  opacity: calc(0.18 + var(--e, 0) * 0.82);
  transform: scale(calc(0.82 + var(--e, 0) * 0.9));
  will-change: transform, opacity;
  transition: color 0.4s ease;
}
.mx.hot { color: var(--hud); }

/* ── generative card thumbnails: procedural "art" where we have no images ── */
.card-thumb {
  display: block;
  width: 100%;
  height: 104px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--ring);
}

@media (prefers-reduced-motion: reduce) {
  .mx { opacity: 0.3; transform: none; }
}

/* ── custom cursor: ring lags the dot; difference blend keeps it legible ── */
.cur { position: fixed; inset: 0; pointer-events: none; z-index: 60; mix-blend-mode: difference; }
.cur span { position: absolute; top: 0; left: 0; border-radius: 50%; will-change: transform; }
.cur-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: rgba(255,255,255,1); }
.cur-ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid rgba(255,255,255,0.6);
  transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease, opacity 0.25s ease;
}
.cur.hot .cur-ring { width: 58px; height: 58px; margin: -29px 0 0 -29px; }
/* the OS cursor stays available on touch and for reduced motion */
@media (hover: none), (prefers-reduced-motion: reduce) { .cur { display: none; } }

/* ── GUADALAJARA scene: authored SVG, layers parallax on scroll ──
   All fills are theme tokens so it re-colours with the site. --px is set by
   the shared scroll handler; each layer multiplies it differently. */
.scene {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  margin-block: var(--space-section) 0;
  overflow: hidden;
  line-height: 0;
  border-top: 1px solid var(--ring);
  --sky-a: var(--sky-top);
  --sky-b: var(--sky-horizon);
  --sun: var(--hud);
}
.scene-svg { display: block; width: 100%; height: clamp(190px, 30vh, 320px); }

.sun-core { fill: var(--hud); opacity: 0.9; }
.sk-back  { fill: var(--city-far); transform: translate3d(0, calc(var(--px, 0) * 0.10 * 1px), 0); }
.sk-back .far rect { fill: var(--city-far); }
.sk-mid   { fill: var(--city-mid);  transform: translate3d(0, calc(var(--px, 0) * 0.22 * 1px), 0); }
.sk-front { fill: var(--city-near); transform: translate3d(0, calc(var(--px, 0) * 0.4 * 1px), 0); }
.sk-front .palm path { stroke: var(--city-near); }
.sk-front .birds path { stroke: var(--hud); opacity: 0.75; }
.cathedral .lit { fill: var(--hud2); }
.sk { will-change: transform; }

/* the cathedral windows glow faintly, like the city is awake */
.cathedral .lit { animation: cityLit 3.6s ease-in-out infinite alternate; }
.cathedral .lit:nth-of-type(2) { animation-delay: 1.2s; }
@keyframes cityLit { from { opacity: 0.35; } to { opacity: 1; } }
.birds path { animation: birdFly 9s ease-in-out infinite; }
.birds path:nth-child(2) { animation-delay: 1.5s; }
.birds path:nth-child(3) { animation-delay: 3s; }
@keyframes birdFly {
  0%   { transform: translate(0,0); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.8; }
  100% { transform: translate(260px, -34px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sk { transform: none !important; }
  .cathedral .lit, .birds path { animation: none; }
  .birds path { opacity: 0.7; }
}

/* ── full-bleed type band: horizontal rhythm between stages ── */
.band {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  overflow: hidden;                /* full-bleed without ever scrolling the page */
  border-block: 1px solid var(--ring);
  padding: clamp(14px, 2.4vh, 26px) 0;
  margin-block: var(--space-section);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.band-track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  font-family: var(--display);
  font-size: clamp(30px, 6vw, 74px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--text-faint);
}
.band-track b { font-weight: 700; padding-inline: 0.32em; }
.band-track b.on { color: var(--hud); -webkit-text-stroke: 1px var(--hud); }

/* ── scroll-scrubbed section entrance: the rail drifts against the body ── */
.block-head { will-change: transform; }

/* ───────────── Layout ───────────── */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 48px);
}

/* ───────────── Hero — a full-viewport stage, not a document block ───────── */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* MUST be minmax(0,…): an implicit
      `auto` column sizes to the widest child's min-content, and .carrier's
      nowrap bit-string is ~1580px wide — that caused page-wide h-scroll. */
  grid-template-rows: 1fr auto;
  align-items: center;
  padding: clamp(90px, 14vh, 150px) 0 0;
}
.hero-copy { min-width: 0; align-self: center; }

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--hud);
  margin: 0 0 24px;
  display: flex; align-items: center; gap: 12px;
}
.hero-eyebrow::before { content: ""; width: 40px; height: 1px; background: var(--hud); flex: none; }

/* the stage the name sits on — nothing boxed, everything full-bleed */
.hero-stage { position: relative; width: 100%; }

/* ── TELEMETRY RIBBON — the live data, as a transmission readout ──
   Replaces the old status card entirely: one full-width mono strip, ruled
   top and bottom, that reads as instrumentation rather than a widget. */
.telemetry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 1px;
  background: var(--ring);
  border-block: 1px solid var(--ring);
  margin-top: clamp(32px, 6vh, 64px);
  max-width: 100%;
  font-family: var(--mono);
}
.tele-cell {
  background: var(--bg);
  padding: 14px 16px 15px;
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
}
.tele-k {
  font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-faint);
}
.tele-v {
  font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tele-cell.is-live .tele-v { color: var(--hud); }
.tele-cell.is-live .tele-k::after {
  content: "";
  display: inline-block;
  width: 5px; height: 5px; margin-left: 7px;
  border-radius: 50%; background: var(--accent);
  animation: pulse 2s infinite;
  vertical-align: middle;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
/* the binary carrier — a quiet data stream under the ribbon */
.carrier {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.32em;
  color: var(--text-faint);
  opacity: 0.5;
  margin-top: 14px;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
  min-width: 0;          /* never let the bit-string set the layout width */
  max-width: 100%;
}

/* ── live status — holographic glass panel ── */
.now-card--legacy-unused {
  width: 100%;
  /* headroom so the sticky header never clips the panel */
  margin-top: clamp(40px, 7vh, 60px);
  position: relative;
  z-index: 1;
  border-radius: var(--r-lg);
  padding: 15px 18px 13px;
  color: var(--text);
  text-align: left;
  background: linear-gradient(160deg,
              color-mix(in srgb, var(--card) 92%, var(--hud) 8%),
              var(--card) 45%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  isolation: isolate;
}
/* luminous rim — bright HUD sweep top-left fading out bottom-right */
.now-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, var(--hud) 0%, var(--hud-line) 30%, transparent 60%, var(--hud-line) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.8;
}
/* state-tinted holo wash from the sensor corner */
.now-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(75% 55% at 18% 4%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.now-card > * { position: relative; z-index: 1; }

/* sensor strip — camera cluster + LEDs on a raised glass island */
.now-plateau {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  border: 1px solid var(--ring);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.now-cams { display: flex; align-items: center; gap: 6px; }
.now-lens {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%,
              color-mix(in srgb, var(--hud) 24%, var(--card-solid)), var(--bg) 74%);
  box-shadow: inset 0 0 0 1px var(--hud-line), inset 0 1px 2px rgba(0, 0, 0, 0.5);
}
.now-lens.main {
  width: 24px; height: 24px;
  font-size: 12px; line-height: 1;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.4),
    inset 0 0 0 3px color-mix(in srgb, var(--accent) 60%, var(--card-solid)),
    0 0 10px color-mix(in srgb, var(--accent) 40%, transparent);
}
/* sensor LEDs (live pulse + amber flash) */
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-left: 2px;
  background: var(--accent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 70%, transparent);
  animation: pulse 2s infinite;
}
.led-flash {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fde68a, #92400e);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
  opacity: 0.85;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.now-state {
  margin-left: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--hud);
  opacity: 0.85;
}

/* state-driven accent (lens ring, LED, wash) */
.now-card[data-state="busy"]    { --accent: var(--busy); }
.now-card[data-state="away"]    { --accent: var(--away); }
.now-card[data-state="sleeping"]{ --accent: var(--sleep); }
.now-card[data-state="offline"] { --accent: var(--offline); }
.now-card[data-state="offline"] .dot { animation: none; opacity: .6; }

.now-activity {
  font-family: var(--mono);
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 3px;
  color: var(--text);
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 30%, transparent);
}
.now-detail {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  line-height: 1.35;
}
.now-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
}
.now-playing::before { content: "♫ "; color: var(--accent); }
.now-speed::before   { content: "SPD "; color: var(--text-faint); }
.hidden { display: none; }

/* live feed: GDL clock + rotating markets (data readout on the glass) */
.now-feed {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--ring);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
}
.feed-clock {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.feed-sep { opacity: 0.4; color: var(--hud); }
.feed-mkt {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-mkt .feed-k { color: var(--text-faint); }
.feed-mkt .feed-chg.up   { color: #34d399; }
.feed-mkt .feed-chg.down { color: #f87171; }
.feed-mkt .muted { opacity: 0.5; }
.feed-in { animation: feedIn 0.45s ease; }
@keyframes feedIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* ── identity ── */
/* ── identity ── */
.identity { min-width: 0; }

/* the anchor of the page: oversized, tight, left-aligned */
.name {
  font-family: var(--display);
  font-size: var(--fs-h-xl);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.94;
  margin: 0 0 18px;
  color: var(--text);
  text-wrap: balance;
}
/* the period after the surname carries the one accent */
.name .name-dot { color: var(--hud); }

.role {
  font-family: var(--mono);
  color: var(--hud);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  margin: 0 0 20px;
}
.role::before { content: "> "; opacity: 0.55; }
.caret { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.subrole {
  color: var(--text-dim);
  margin: 0 0 22px;
  font-size: var(--fs-sm);
  max-width: var(--measure);
  line-height: 1.6;
}

.nickname {
  display: inline-block;
  margin-left: 14px;
  font-family: var(--mono);
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 500;
  color: var(--hud);
  background: var(--hud-soft);
  border: 1px solid var(--hud-line);
  border-radius: var(--r-sm);
  padding: 3px 10px;
  letter-spacing: 0.06em;
  vertical-align: middle;
  transform: translateY(-0.35em);
}

/* the wry setup — a quiet aside above the payoff */
.tagline {
  color: var(--text-faint);
  font-size: var(--fs-sm);
  line-height: 1.65;
  max-width: var(--measure);
  margin: 0 0 16px;
  text-wrap: pretty;
}
/* the line that actually leads */
.bio {
  color: var(--text-dim);
  font-size: var(--fs-body);
  line-height: 1.65;
  max-width: var(--measure);
  margin: 0 0 30px;
  text-wrap: pretty;
}
.bio .pay { color: var(--text); font-weight: 500; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.links a {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--card-border);
  border-radius: var(--r-pill);
  color: var(--text-dim);
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.links a:hover {
  border-color: var(--hud);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 0 18px var(--hud-soft);
}

/* ───────────── Ticker ───────────── */
.ticker-wrap { margin: 0 0 var(--space-section); }
.ticker-label {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ticker-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ring);
}
.ticker {
  position: relative;
  overflow: hidden;
  padding: 4px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.ticker-track {
  display: inline-flex;
  align-items: stretch;
  gap: 16px;
  white-space: nowrap;
  will-change: transform;
  animation: scroll 64s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item {
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text-dim);
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  white-space: normal;
  width: 340px;
  padding: 18px 20px;
  border-left: 2px solid var(--card-border);
  background: var(--bg-soft);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.ticker-item:hover {
  color: var(--text);
  border-left-color: var(--hud);
  background: var(--card-solid);
}
.ticker-item.muted { color: var(--text-faint); border: none; background: none; width: auto; }
.ticker-item .li-mark {
  color: #fff;
  background: #0a66c2; /* LinkedIn blue */
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-weight: 700;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
  letter-spacing: -0.02em;
}
.ticker-item .li-top { display: flex; align-items: center; gap: 9px; }
.ticker-item .li-date {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: var(--fs-label);
  white-space: nowrap;          /* never let a date break across lines */
}
.ticker-item .li-text { display: block; }

/* ───────────── By the numbers — a data row, not a card grid ───────────── */
.stats-band { margin: 0 0 var(--space-section); }
.stats-label {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stats-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ring);
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;                        /* the gap IS the rule between figures */
  background: var(--ring);
  border-block: 1px solid var(--ring);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 20px 20px;
  background: var(--bg);
  transition: background 0.25s ease;
}
.stat:hover { background: var(--bg-soft); }
.stat-n {
  font-family: var(--display);
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat:hover .stat-n { color: var(--hud); }
.stat-label {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.03em;
  color: var(--text-faint);
}

/* ───────────── Content blocks — Swiss label rail + content ───────────── */
.block {
  padding: var(--space-section) 0;
  border-top: 1px solid var(--ring);
  display: grid;
  grid-template-columns: var(--col-label) minmax(0, 1fr);
  gap: var(--gutter);
  align-items: start;
}
/* the rail sticks while its section scrolls past */
.block-head { position: sticky; top: 92px; }
.block-num {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--track-label);
  color: var(--hud);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.block-title {
  font-family: var(--display);
  font-size: var(--fs-h-md);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
.block-body { min-width: 0; }

@media (max-width: 900px) {
  .block { grid-template-columns: 1fr; gap: 26px; }
  .block-head { position: static; }
}

.cards { display: grid; gap: 1px; background: var(--ring); border-block: 1px solid var(--ring); }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); } }
.card {
  background: var(--bg);
  padding: 24px 22px;
  transition: background 0.25s ease;
}
.card:hover { background: var(--bg-soft); }
.card .tags {
  display: flex; gap: 8px; align-items: center;
  font-family: var(--mono); font-size: var(--fs-micro); color: var(--text-faint);
  margin-bottom: 16px; text-transform: lowercase;
}
.badge {
  padding: 2px 8px; border-radius: var(--r-pill);
  border: 1px solid var(--card-border); color: var(--text-dim);
}
.badge.live { color: var(--hud); border-color: var(--hud-line); }
.card h4 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: var(--fs-title);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.card p { margin: 0 0 18px; color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.65; }
.card .cta {
  font-family: var(--mono); font-size: var(--fs-label);
  color: var(--hud); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.card a.cta:hover { border-bottom-color: var(--hud); }

/* ───────────── Journey: India ↔ Mexico flight path ───────────── */
.flight-legend {
  font-family: var(--mono);
  font-size: var(--fs-label);
  color: var(--text-faint);
  letter-spacing: 0.04em;
  margin: -14px 0 20px;
}
.flight-legend .legend-arrow { color: var(--hud); }

.flightmap { position: relative; width: 100%; }

.flight-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
.flight-route {
  stroke: var(--hud-line);
  stroke-width: 2;
  stroke-dasharray: 2 8;       /* dotted airline-route look */
  stroke-linecap: round;
}
.flight-trail {
  stroke: var(--hud);
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--hud) 70%, transparent));
  transition: stroke-dashoffset 0.08s linear;
}

.flight-plane {
  position: absolute;
  top: 0; left: 0;
  width: 26px; height: 26px;
  z-index: 2;
  color: var(--hud2);
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--hud2) 60%, transparent));
  transition: transform 0.08s linear;
  will-change: transform;
}
.flight-plane svg { width: 100%; height: 100%; fill: currentColor; }

.stops { position: relative; z-index: 1; }
.stop {
  position: relative;
  min-height: 168px;
  display: flex;
  align-items: center;
}
.stop-card {
  width: min(330px, 40%);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow);
}
.stop-left  { justify-content: flex-start; }
.stop-right { justify-content: flex-end; }

/* waypoint dots sit in two "lanes" so the path weaves between countries */
.stop-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--hud);
  box-shadow: 0 0 0 4px var(--hud-soft), 0 0 14px var(--hud-soft);
  z-index: 2;
}
.stop-left  .stop-dot { left: 40%; }
.stop-right .stop-dot { left: 60%; }

.stop-era {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--hud);
  margin-bottom: 10px;
}
.stop-move {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--fs-micro);
  color: var(--text);
  background: var(--hud-soft);
  border: 1px solid var(--hud-line);
  border-radius: var(--r-pill);
  padding: 2px 9px;
  margin-bottom: 10px;
}
.stop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.stop-loc  { font-family: var(--mono); font-size: var(--fs-label); color: var(--text-dim); }
.stop-year { font-family: var(--mono); font-size: var(--fs-label); color: var(--text-faint); }
.stop-card h5 { margin: 2px 0 6px; font-size: var(--fs-title); letter-spacing: -0.01em; }
.stop-card p  { margin: 0; color: var(--text-dim); font-size: var(--fs-body); line-height: 1.6; }

/* one column on small screens: path runs down the left, cards on the right */
@media (max-width: 640px) {
  .stop { min-height: 0; margin-bottom: 22px; }
  .stop-left, .stop-right { justify-content: flex-end; }
  .stop-card { width: calc(100% - 44px); }
  .stop-left .stop-dot, .stop-right .stop-dot { left: 12px; }
}

/* ───────────── Connect ───────────── */
.connect-line {
  color: var(--text-dim);
  max-width: var(--measure);
  font-size: var(--fs-body);
  line-height: 1.65;
  margin: 0 0 26px;
}
.email-big {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--display);
  font-size: clamp(20px, 3.2vw, 34px);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-decoration: none;
  margin: 0 0 28px;
  color: var(--text);
  border-bottom: 2px solid var(--hud);
  padding-bottom: 4px;
  transition: color 0.2s ease;
}
.email-big:hover { color: var(--hud); }

.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px clamp(18px, 5vw, 48px) 60px;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.02em;
  color: var(--text-faint);
  border-top: 1px solid var(--ring);
}

@media (max-width: 560px) {
  .now-card--legacy-unused { padding: 26px 20px 22px; }
}

/* ───────────── Scroll-reveal (JS adds body.js + .in) ─────────────
   Gated behind body.js so crawlers / no-JS readers see full content. */
body.js .rv {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
body.js .rv.in { opacity: 1; transform: none; }
/* repeated items wave in behind their section — 60ms apart (stagger preset).
   Targets the items themselves, never a nested .rv, so opacity never compounds. */
body.js .rv.in .stat,
body.js .rv.in .card { animation: riseIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
body.js .rv.in .stat:nth-child(2), body.js .rv.in .card:nth-child(2) { animation-delay: 0.06s; }
body.js .rv.in .stat:nth-child(3), body.js .rv.in .card:nth-child(3) { animation-delay: 0.12s; }
body.js .rv.in .stat:nth-child(4), body.js .rv.in .card:nth-child(4) { animation-delay: 0.18s; }
body.js .rv.in .stat:nth-child(5), body.js .rv.in .card:nth-child(5) { animation-delay: 0.24s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } }

/* ───────────── Background: two layers only — starfield + cursor glow ───── */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
#fxCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* fine dot grid — barely-there texture so the canvas isn't flat */
.bg-fx::before {
  content: "";
  position: absolute;
  inset: -2px;
  background-image: radial-gradient(circle at 1px 1px, var(--grid-dot) 1px, transparent 0);
  background-size: 30px 30px;
  -webkit-mask: radial-gradient(120% 120% at 50% 40%, #000 35%, transparent 100%);
  mask: radial-gradient(120% 120% at 50% 40%, #000 35%, transparent 100%);
  opacity: 0.5;
}

/* the glow blob — positioned via CSS vars set from JS (spring-chases cursor) */
.bg-glow {
  position: absolute;
  top: 0; left: 0;
  width: 60vmax; height: 60vmax;
  border-radius: 50%;
  transform: translate(calc(var(--gx, 50vw) - 30vmax), calc(var(--gy, 40vh) - 30vmax));
  background: radial-gradient(circle at center,
              var(--glow-a) 0%, var(--glow-b) 35%, transparent 70%);
  filter: blur(50px);
  opacity: 0.55;
  transition: opacity 0.6s ease;
  will-change: transform;
}
.bg-glow.alt {
  width: 42vmax; height: 42vmax;
  transform: translate(calc(var(--gx2, 50vw) - 21vmax), calc(var(--gy2, 40vh) - 21vmax));
  background: radial-gradient(circle at center,
              var(--glow-c) 0%, transparent 65%);
  filter: blur(70px);
  opacity: 0.4;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
  body.js .rise { opacity: 1; transform: none; transition: none; }
  .hero-stage { translate: none; }
  .bg-glow { transition: none; }
  .ticker-track { animation: none; }
  .dot { animation: none; }
  .now-card::after, .now-card .scan::before { animation: none; }
  .feed-in { animation: none; }
  .name { animation: none; }
  .topbar::after { animation: none; }
  body.js .rv { opacity: 1; transform: none; transition: none; }
  body.js .rv.in .stat,
  body.js .rv.in .card { animation: none; }
}

/* ── Panel gadgets: radar · vital line · battery cell · serial etch ── */
.now-radar {
  position: relative;
  width: 18px; height: 18px;
  border-radius: 50%;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  box-shadow: inset 0 0 0 1px var(--hud-line);
}
.now-radar::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 52%, var(--hud-line) 53%, transparent 58%),
    linear-gradient(var(--hud-line) 0 0) center / 100% 1px no-repeat,
    linear-gradient(var(--hud-line) 0 0) center / 1px 100% no-repeat;
  opacity: 0.6;
}
.radar-sweep {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, color-mix(in srgb, var(--accent) 55%, transparent), transparent 80deg);
  animation: radarSpin 3.2s linear infinite;
}
.radar-blip {
  position: absolute;
  width: 2.5px; height: 2.5px;
  border-radius: 50%;
  background: var(--accent);
  animation: blipPing 3.2s ease-out infinite;
}
.radar-blip.b1 { top: 4px; left: 11px; }
.radar-blip.b2 { top: 11px; left: 5px; animation-delay: 1.6s; }
@keyframes radarSpin { to { transform: rotate(360deg); } }
@keyframes blipPing { 0%, 18% { opacity: 0; } 28% { opacity: 1; } 70% { opacity: 0.25; } 100% { opacity: 0; } }

/* patience meter — Frida's remaining tolerance; drains as you pet her */
.pet-meter {
  position: relative;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  background: none;
  border: none;
  padding: 2px 4px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.pet-meter .ph {
  color: var(--hud);
  opacity: 0.22;
  transform: scale(1);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pet-meter .ph.on {
  opacity: 1;
  transform: scale(1.18);
  text-shadow: 0 0 8px var(--hud-soft);
}
.pet-meter:hover .ph { opacity: 0.45; }
.pet-meter:hover .ph.on { opacity: 1; }
.pet-meter:focus-visible { outline: 2px solid var(--hud); outline-offset: 3px; border-radius: 6px; }
/* invisible 44px-tall hit area — the strip stays compact, the target doesn't */
.pet-meter::after {
  content: "";
  position: absolute;
  inset: -15px -10px;
}
.pet-meter.spent .ph { animation: heartDrain 0.5s ease-in-out 1; }
@keyframes heartDrain { 0% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* segmented battery cell — fill level via --lvl, colour by charge band */
.now-battery { display: inline-flex; align-items: center; gap: 5px; }
.batt {
  position: relative;
  width: 25px; height: 11px;
  border: 1px solid var(--text-faint);
  border-radius: 3px;
  display: inline-block;
}
.batt::after {
  content: "";
  position: absolute;
  left: 100%; top: 2.5px;
  width: 2.5px; height: 5px;
  margin-left: 1px;
  border-radius: 0 1.5px 1.5px 0;
  background: var(--text-faint);
}
.batt i {
  position: absolute; top: 1.5px; left: 1.5px; bottom: 1.5px;
  width: calc((100% - 3px) * var(--lvl, 0) / 100);
  border-radius: 1.5px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-soft);
}
.batt.low i  { background: var(--busy); box-shadow: none; }
.batt.crit i { background: #f87171; box-shadow: none; animation: blink 1.2s steps(1) infinite; }

/* serial number etched along the glass edge */
.etch {
  position: absolute;
  top: 50%; right: 5px;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  opacity: 0.55;
  pointer-events: none;
}

@media (max-width: 400px) {
  .pet-meter { font-size: 10px; gap: 2px; }
}

/* @END-COMPONENT-CSS — test.js scans everything ABOVE this line for hardcoded
   hex. Character/mascot art colours live BELOW it and are exempt by design.
   Do not remove or reword this sentinel. */

/* ───────────── FRIDA — the grey Persian who owns this site ─────────────
   Fixed to the viewport so she roams the whole page. app.js drives her
   position, facing and pose; everything here is the rig + poses.
   She is aria-hidden; #catHit is the accessible "pet" control. */
.cat {
  position: fixed;
  left: 0;
  top: 0;                 /* JS positions her in viewport coords via transform */
  width: clamp(74px, 8vw, 112px);
  z-index: 25;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
.cat-svg { display: block; width: 100%; height: auto; overflow: visible; }
/* she faces her direction of travel */
.cat[data-facing="left"] .cat-svg { transform: scaleX(-1); }

/* the only clickable part — sized to her body, follows her automatically */
.cat-hit {
  position: absolute;
  left: 12%; top: 18%; width: 76%; height: 74%;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  border-radius: 50%;
}
.cat-hit:focus-visible { outline: 2px solid var(--hud); outline-offset: 2px; }

/* her opinions, delivered occasionally */
.cat-bubble {
  position: absolute;
  bottom: 88%;
  left: 50%;
  transform: translate(-50%, 6px) scale(0.92);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text);
  background: var(--card-solid);
  border: 1px solid var(--card-border);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow);
}
.cat-bubble.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

.frida-shadow { fill: #000; opacity: 0.26; }

/* her dossier — granted, not taken */
.cat-dossier {
  position: absolute;
  bottom: 96%;
  left: 50%;
  transform: translate(-50%, 8px) scale(0.94);
  display: grid;
  gap: 2px;
  width: max-content;
  max-width: 260px;
  padding: 10px 14px;
  background: var(--card-solid);
  border: 1px solid var(--hud-line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-dim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}
.cat-dossier.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.cat-dossier b { color: var(--hud); letter-spacing: 0.16em; font-size: 11px; }
.cat-dossier em { color: var(--text-faint); font-style: italic; margin-top: 4px; }
.debris circle { fill: #8d8579; opacity: 0; }
.tongue { opacity: 0; transform-box: fill-box; transform-origin: 50% 0; }

/* the claw marks she leaves on this website, which is hers */
.claw-marks {
  position: fixed;
  inset: 0;                 /* she works at any height she can reach */
  pointer-events: none;
  z-index: 24;
}
.claw {
  position: absolute;
  width: 26px; height: 34px;
  opacity: 0;
  animation: clawIn 0.45s ease-out forwards;
}
.claw i {
  position: absolute;
  top: 0;
  width: 2px; height: 100%;
  background: linear-gradient(to bottom, transparent, var(--text-faint) 30%, transparent);
  transform-origin: top center;
  opacity: 0.55;
}
.claw i:nth-child(1) { left: 3px;  transform: rotate(-11deg); height: 78%; }
.claw i:nth-child(2) { left: 11px; transform: rotate(-3deg); }
.claw i:nth-child(3) { left: 19px; transform: rotate(6deg);  height: 84%; }
/* she has been at this one a while */
.claw.deep i { width: 3px; opacity: 0.8; }
@keyframes clawIn { from { opacity: 0; transform: translateY(-4px) scaleY(0.6); } to { opacity: 1; transform: none; } }
.leg, .frida-sitpaws ellipse { fill: #7e8794; }
.toes path { stroke: #5f6772; stroke-width: 1.1; stroke-linecap: round; }
.slit { fill: #1b1408; }
.lid { stroke: #b9c1cd; display: none; }
.purr path { stroke: var(--hud2); opacity: 0; }
.zzz text { fill: var(--hud2); opacity: 0; }

/* transform boxes */
.frida, .frida-head, .frida-tail, .ear, .eye, .pupilwrap,
.leg, .frida-legs, .frida-sitpaws, .purr, .zzz {
  transform-box: fill-box;
  transform-origin: center;
}
.frida { transform-origin: 50% 95%; }
.frida-head { transform-origin: 30% 85%; }
.frida-tail { transform-origin: 92% 88%; }
.ear-l { transform-origin: 70% 100%; }
.ear-r { transform-origin: 30% 100%; }

/* ── ambient life: breathing, tail, ears, blinking ── */
.cat .frida      { animation: fridaBreathe 3.4s ease-in-out infinite; }
.cat .frida-tail { animation: fridaTailIdle 4.2s ease-in-out infinite; }
.cat .ear-l     { animation: fridaEarL 6.1s ease-in-out infinite; }
.cat .ear-r     { animation: fridaEarR 7.3s ease-in-out infinite; }
.cat .eye       { animation: fridaBlink 6.4s ease-in-out infinite; }

@keyframes fridaBreathe  { 0%,100% { transform: scale(1,1); } 50% { transform: scale(1.012,0.988); } }
@keyframes fridaTailIdle { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(7deg); } }
@keyframes fridaEarL     { 0%,90%,100% { transform: rotate(0deg); } 95% { transform: rotate(-14deg); } }
@keyframes fridaEarR     { 0%,86%,100% { transform: rotate(0deg); } 92% { transform: rotate(13deg); } }
@keyframes fridaBlink    { 0%,93%,100% { transform: scaleY(1); } 96% { transform: scaleY(0.06); } }

/* ═══ POSES ═══ */

/* walking — body bobs, legs alternate, tail counter-swings */
.cat[data-pose="walk"] .frida      { animation: fridaWalkBob 0.34s ease-in-out infinite; }
.cat[data-pose="walk"] .frida-tail { animation: fridaTailWalk 0.92s ease-in-out infinite; }
.cat[data-pose="walk"] .frida-sitpaws { opacity: 0; }
.cat[data-pose="walk"] .leg-f { animation: fridaStep 0.34s ease-in-out infinite; }
.cat[data-pose="walk"] .leg-b { animation: fridaStep 0.34s ease-in-out infinite 0.17s; }
@keyframes fridaWalkBob  { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-2.4px) rotate(-0.7deg); } }
@keyframes fridaStep     { 0%,100% { transform: translate(0,0); } 50% { transform: translate(5px,-4px); } }
@keyframes fridaTailWalk { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(12deg); } }

/* sitting — legs tucked, front paws together, tail curled and flicking */
.cat[data-pose="sit"] .frida-legs { opacity: 0; }
.cat[data-pose="sit"] .frida-tail { animation: fridaTailFlick 3.6s ease-in-out infinite; }
@keyframes fridaTailFlick { 0%,72%,100% { transform: rotate(-3deg); } 80% { transform: rotate(16deg); } 88% { transform: rotate(-6deg); } }

/* grooming — head dips to the paw, quick licking nods */
.cat[data-pose="groom"] .frida-legs { opacity: 0; }
.cat[data-pose="groom"] .frida-head { animation: fridaGroom 0.95s ease-in-out infinite; }
.cat[data-pose="groom"] .tongue { opacity: 1; animation: fridaLick 0.95s ease-in-out infinite; }
.cat[data-pose="groom"] .frida-sitpaws { animation: fridaPawUp 0.95s ease-in-out infinite; }
@keyframes fridaLick  { 0%,100% { opacity: 0; transform: scaleY(0.3); } 45%,65% { opacity: 1; transform: scaleY(1); } }
@keyframes fridaPawUp { 0%,100% { transform: translate(0,0); } 50% { transform: translate(3px,-7px); } }
.cat[data-pose="groom"] .eye { animation: none; }
.cat[data-pose="groom"] .lid { display: block; }
.cat[data-pose="groom"] .pupilwrap, .cat[data-pose="groom"] .eye > ellipse { opacity: 0; }
@keyframes fridaGroom { 0%,100% { transform: rotate(0deg) translateY(0); } 50% { transform: rotate(-16deg) translateY(7px); } }

/* loafing / asleep — flattened into a floof pile, eyes shut, Zzz */
.cat[data-pose="sleep"] .frida-legs { opacity: 0; }
.cat[data-pose="sleep"] .frida { animation: fridaSleepBreathe 4.6s ease-in-out infinite; transform: scale(1.06, 0.82) translateY(9px); }
.cat[data-pose="sleep"] .frida-head { transform: translateY(13px) rotate(-6deg); }
.cat[data-pose="sleep"] .frida-tail { animation: fridaTailIdle 7s ease-in-out infinite; }
.cat[data-pose="sleep"] .eye { animation: none; }
.cat[data-pose="sleep"] .lid { display: block; }
.cat[data-pose="sleep"] .pupilwrap, .cat[data-pose="sleep"] .eye > ellipse { opacity: 0; }
.cat[data-pose="sleep"] .zzz text { opacity: 1; animation: fridaZzz 3.4s ease-in-out infinite; }
@keyframes fridaSleepBreathe { 0%,100% { transform: scale(1.06,0.82) translateY(9px); } 50% { transform: scale(1.075,0.8) translateY(9px); } }
@keyframes fridaZzz { 0% { opacity: 0; transform: translate(0,3px) scale(0.8); } 35% { opacity: 1; } 100% { opacity: 0; transform: translate(6px,-9px) scale(1.15); } }

/* stretch — the full downward-cat */
.cat[data-pose="stretch"] .frida { animation: fridaStretch 1.5s ease-in-out 1; }
.cat[data-pose="stretch"] .frida-tail { animation: fridaTailWalk 1.5s ease-in-out 1; }
@keyframes fridaStretch {
  0%,100% { transform: scale(1,1) translateY(0); }
  40% { transform: scale(1.16,0.84) translateY(6px) rotate(-3deg); }
  70% { transform: scale(0.96,1.08) translateY(-3px); }
}

/* ── rolling: she flops over, wriggles on her back, and purrs about it ── */
.cat[data-pose="roll"] .frida-sitpaws { opacity: 0; }
.cat[data-pose="roll"] .frida-legs { opacity: 1; }
.cat[data-pose="roll"] .frida { animation: fridaRoll 2.6s ease-in-out infinite; }
.cat[data-pose="roll"] .leg { animation: fridaPaddle 1.3s ease-in-out infinite; }
.cat[data-pose="roll"] .leg-br, .cat[data-pose="roll"] .leg-fr { animation-delay: 0.32s; }
.cat[data-pose="roll"] .frida-tail { animation: fridaTailIdle 2.2s ease-in-out infinite; }
.cat[data-pose="roll"] .eye { animation: none; transform: scaleY(0.4); }
.cat[data-pose="roll"] .purr path { opacity: 1; animation: fridaZzz 1.6s ease-in-out infinite; }
.cat[data-pose="roll"] .purr path:nth-child(2) { animation-delay: 0.5s; }
/* a flop onto her side with a wriggle — not a full barrel roll, so she still
   reads as lying ON the surface rather than falling off it */
@keyframes fridaRoll {
  0%,100% { transform: rotate(0deg) translate(0,0); }
  22%     { transform: rotate(-34deg) translate(-3px,4px); }
  50%     { transform: rotate(-48deg) translate(-5px,6px); }
  72%     { transform: rotate(-38deg) translate(-4px,5px); }
}
@keyframes fridaPaddle { 0%,100% { transform: translate(0,0) rotate(0deg); } 50% { transform: translate(-3px,-5px) rotate(-14deg); } }

/* ── scratching: she rakes whatever is nearest and does not apologise ── */
.cat[data-pose="scratch"] .frida-legs { opacity: 0; }
.cat[data-pose="scratch"] .frida { animation: fridaScratch 0.26s ease-in-out infinite; }
.cat[data-pose="scratch"] .frida-sitpaws { animation: fridaRake 0.26s ease-in-out infinite; }
.cat[data-pose="scratch"] .frida-tail { animation: fridaLash 0.5s ease-in-out infinite; }
.cat[data-pose="scratch"] .ear-l { animation: none; transform: rotate(-20deg); }
.cat[data-pose="scratch"] .ear-r { animation: none; transform: rotate(20deg); }
.cat[data-pose="scratch"] .debris circle { opacity: 1; animation: fridaFleck 0.7s linear infinite; }
.cat[data-pose="scratch"] .debris circle:nth-child(2) { animation-delay: 0.18s; }
.cat[data-pose="scratch"] .debris circle:nth-child(3) { animation-delay: 0.34s; }
.cat[data-pose="scratch"] .debris circle:nth-child(4) { animation-delay: 0.5s; }
@keyframes fridaScratch { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-2px) rotate(1.4deg); } }
@keyframes fridaRake    { 0%,100% { transform: translate(0,0); } 50% { transform: translate(7px,-5px); } }
@keyframes fridaFleck   { 0% { opacity: 0.9; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(11px,-13px) scale(0.5); } }

/* ── bolting: she is leaving and you cannot stop her ── */
.cat[data-pose="bolt"] .frida { animation: fridaBolt 0.2s ease-in-out infinite; }
.cat[data-pose="bolt"] .frida-legs { opacity: 1; }
.cat[data-pose="bolt"] .frida-sitpaws { opacity: 0; }
.cat[data-pose="bolt"] .frida-tail { animation: none; transform: rotate(-24deg); }
.cat[data-pose="bolt"] .ear-l { animation: none; transform: rotate(-26deg); }
.cat[data-pose="bolt"] .ear-r { animation: none; transform: rotate(26deg); }
.cat[data-pose="bolt"] .leg { animation: fridaStep 0.16s ease-in-out infinite; }
@keyframes fridaBolt { 0%,100% { transform: scale(1.07,0.93) translateY(1px); } 50% { transform: scale(1.02,1.02) translateY(-3px); } }

/* gone. she will return when it suits her. */
.cat[data-gone="yes"] { visibility: hidden; }

/* ── she noticed you ── */
.cat[data-pose="alert"] .frida-legs { opacity: 0; }
.cat[data-pose="alert"] .ear-l { animation: none; transform: rotate(-7deg); }
.cat[data-pose="alert"] .ear-r { animation: none; transform: rotate(7deg); }
.cat[data-pose="alert"] .slit { rx: 4.2; }
.cat[data-pose="alert"] .frida-tail { animation: fridaTailFlick 1.5s ease-in-out infinite; }

/* ── being petted: squint, purr marks, slow happy sway ── */
.cat[data-petting="yes"] .frida-legs { opacity: 0; }
.cat[data-petting="yes"] .eye { animation: none; transform: scaleY(0.42); }
.cat[data-petting="yes"] .frida { animation: fridaPurr 0.9s ease-in-out infinite; }
.cat[data-petting="yes"] .purr path { opacity: 1; animation: fridaZzz 1.5s ease-in-out infinite; }
.cat[data-petting="yes"] .frida-tail { animation: fridaTailIdle 2.2s ease-in-out infinite; }
@keyframes fridaPurr { 0%,100% { transform: scale(1,1); } 50% { transform: scale(1.03,0.975); } }

/* ── offended: ears flat, tail lashing, then she leaves ── */
.cat[data-pose="annoyed"] .ear-l { animation: none; transform: rotate(-34deg) translateY(3px); }
.cat[data-pose="annoyed"] .ear-r { animation: none; transform: rotate(34deg) translateY(3px); }
.cat[data-pose="annoyed"] .frida-tail { animation: fridaLash 0.4s ease-in-out infinite; }
.cat[data-pose="annoyed"] .slit { rx: 1.4; }
.cat[data-pose="annoyed"] .frida-legs { opacity: 0; }
@keyframes fridaLash { 0%,100% { transform: rotate(-16deg); } 50% { transform: rotate(20deg); } }

@media (prefers-reduced-motion: reduce) {
  .cat, .cat * { animation: none !important; }
  .cat-bubble { transition: none; }
}
/* she is a luxury; small screens keep the content */
@media (max-width: 560px) {
  .cat { width: 68px; }
}
