/* =========================================================
   odder.dev — design tokens & global styles
   ========================================================= */
:root {
  --bg: #0a0c12;
  --bg-soft: #0f1220;
  --surface: rgba(20, 23, 33, 0.55);
  --surface-solid: #141721;
  --surface-2: #181c2a;
  --border: #232739;
  --border-strong: #313654;
  --text: #ecedf3;
  --text-dim: #a0a5bc;
  --text-mute: #6b7088;

  --purple: #a78bfa;
  --purple-deep: #8b6cf3;
  --purple-soft: rgba(167, 139, 250, 0.14);
  --purple-line: rgba(167, 139, 250, 0.32);
  --purple-glow: rgba(167, 139, 250, 0.45);

  --green: #4ade80;
  --green-deep: #22c55e;
  --green-soft: rgba(74, 222, 128, 0.14);
  --green-line: rgba(74, 222, 128, 0.32);
  --green-glow: rgba(74, 222, 128, 0.45);

  --maxw: 1180px;
  --maxw-narrow: 980px;
  --radius: 18px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-bounce: cubic-bezier(.34, 1.36, .64, 1);
}

@supports (font-variation-settings: normal) {
  :root { --font-sans: "Inter var", ui-sans-serif, system-ui, sans-serif; }
}

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

html {
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  font-feature-settings: "ss01", "cv11";
  background:
    radial-gradient(1400px 700px at 80% -10%, rgba(167, 139, 250, 0.10), transparent 60%),
    radial-gradient(1000px 600px at -10% 30%, rgba(74, 222, 128, 0.07), transparent 60%),
    var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
}

::selection { background: var(--purple); color: #0b0d14; }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
  border-radius: 6px;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.skip {
  position: absolute;
  top: -40px; left: 16px;
  background: var(--purple); color: #0b0d14;
  padding: 8px 12px; border-radius: 6px;
  font-weight: 600; z-index: 10;
  transition: top .2s var(--ease);
}
.skip:focus-visible { top: 16px; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: min(960px, 100dvh);
  display: grid;
  align-items: center;
  padding: clamp(28px, 6vw, 72px);
  isolation: isolate;
  overflow: hidden;
}

#bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: -3;
  display: block;
}

.hero-veil {
  position: absolute; inset: 0;
  z-index: -2; pointer-events: none;
  background:
    radial-gradient(80% 70% at 50% 45%, transparent 0%, rgba(10, 12, 18, 0.55) 80%, var(--bg) 100%),
    linear-gradient(180deg, transparent 55%, var(--bg) 100%);
}

.grain {
  position: absolute; inset: 0;
  z-index: -1; pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.hero-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  position: relative;
  animation: hero-in 1.1s var(--ease) both;
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  background: rgba(20, 23, 33, 0.55);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  margin: 0 0 36px;
}
.brand-dim { color: var(--text-mute); }
.brand-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.brand-dot--purple {
  background: var(--purple);
  box-shadow: 0 0 12px var(--purple-glow);
  animation: pulse-p 2.4s ease-in-out infinite;
}
.brand-dot--green {
  background: var(--green);
  box-shadow: 0 0 12px var(--green-glow);
  animation: pulse-g 2.4s ease-in-out infinite 1.2s;
}
@keyframes pulse-p {
  0%, 100% { box-shadow: 0 0 8px var(--purple-glow); }
  50%      { box-shadow: 0 0 18px var(--purple-glow); }
}
@keyframes pulse-g {
  0%, 100% { box-shadow: 0 0 8px var(--green-glow); }
  50%      { box-shadow: 0 0 18px var(--green-glow); }
}

.display {
  font-size: clamp(44px, 8.5vw, 110px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 600;
  margin: 0 0 32px;
  color: var(--text);
  font-feature-settings: "ss01", "cv11";
}

/* word cycler — rotating italic word in the hero headline */
.cycler {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
  line-height: 1;
  transition: width .5s var(--ease);
}
/* Invisible in-flow anchor so the cycler has a real text baseline matching
   the parent "I make". Without it, an empty inline-block's baseline is its
   bottom margin — which pushes everything ~0.2em too high. */
.cycler::before {
  content: 'x';
  visibility: hidden;
  font-style: italic;
  font-weight: 500;
}
.cycler-word {
  position: absolute;
  left: 0;
  top: 0;              /* align word top with ::before top → same font → same baseline */
  white-space: nowrap;
  font-style: italic;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8%) scale(0.9);
  transform-origin: left center;
  transition: opacity .55s var(--ease), transform .65s var(--ease);
  pointer-events: none;
}
.cycler-word.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.cycler-word.is-leaving {
  opacity: 0;
  transform: translateY(-8%) scale(0.9);
}
.cycler-word[data-color="purple"] {
  color: var(--purple);
  text-shadow: 0 0 32px rgba(167, 139, 250, 0.35);
}
.cycler-word[data-color="green"] {
  color: var(--green);
  text-shadow: 0 0 32px rgba(74, 222, 128, 0.35);
}

.sub {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--text-dim);
  max-width: 56ch;
  margin: 0 0 40px;
  line-height: 1.6;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 14px 24px;
  background: linear-gradient(180deg, rgba(167,139,250,0.18), rgba(74,222,128,0.10));
  border: 1px solid var(--purple-line);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.cta:hover {
  transform: translateY(-2px);
  border-color: var(--green-line);
  box-shadow: 0 8px 24px -8px rgba(167, 139, 250, 0.4);
}
.cta svg { transition: transform .35s var(--ease-bounce); }
.cta:hover svg { transform: translateY(3px); }

.cta-aside {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green-glow);
  animation: pulse-g 2s ease-in-out infinite;
}

/* =========================================================
   PROJECTS
   ========================================================= */
.projects {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 140px) clamp(20px, 5vw, 56px) clamp(64px, 8vw, 100px);
  position: relative;
}

.section-head {
  margin-bottom: clamp(40px, 6vw, 72px);
  max-width: 720px;
}
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  margin: 0 0 20px;
}
.section-tag .bar {
  display: inline-block;
  width: 28px; height: 1.5px;
  background: var(--purple);
}
.section-title {
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin: 0 0 16px;
}
.section-sub {
  color: var(--text-dim);
  font-size: 17px;
  margin: 0;
}

.project-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 32px);
}

/* Card base */
.project {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 30%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow: hidden;
  isolation: isolate;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color .35s var(--ease), transform .45s var(--ease);
}

.project::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px 280px at 100% 0%, var(--accent-soft, transparent), transparent 70%);
  opacity: 0.6;
  z-index: -1;
  transition: opacity .4s var(--ease);
}
.project:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.project:hover::before { opacity: 1; }

.project[data-accent="purple"] {
  --accent: var(--purple);
  --accent-deep: var(--purple-deep);
  --accent-soft: var(--purple-soft);
  --accent-line: var(--purple-line);
  --accent-glow: var(--purple-glow);
}
.project[data-accent="green"] {
  --accent: var(--green);
  --accent-deep: var(--green-deep);
  --accent-soft: var(--green-soft);
  --accent-line: var(--green-line);
  --accent-glow: var(--green-glow);
}

.project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.project-meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-mute);
}
.proj-num::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 10px;
  vertical-align: middle;
  transform: translateY(-1.5px);
  box-shadow: 0 0 10px var(--accent-glow);
}
.proj-domain {
  color: var(--text-dim);
  transition: color .2s var(--ease);
}
.proj-domain .arr {
  display: inline-block;
  transition: transform .25s var(--ease-bounce);
}
.proj-domain:hover {
  color: var(--accent);
}
.proj-domain:hover .arr {
  transform: translate(2px, -2px);
}
.proj-domain--static { color: var(--text-mute); cursor: default; }

.tags {
  display: flex; flex-wrap: wrap;
  gap: 6px;
  list-style: none; margin: 0; padding: 0;
}
.tags li {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.02);
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 3vw, 40px);
  align-items: center;
}

.project-text { display: flex; flex-direction: column; gap: 16px; }
.proj-title {
  font-size: clamp(22px, 2.5vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.proj-title--lg {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.proj-body {
  margin: 0;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.6;
  max-width: 56ch;
}
.proj-body--lg {
  font-size: 18px;
}
.proj-body em {
  color: var(--text);
  font-style: normal;
  border-bottom: 1px dashed var(--border-strong);
}

/* =========================================================
   DEMOS (project cards' interactive panels)
   ========================================================= */
.project-demo {
  position: relative;
  background:
    radial-gradient(140% 100% at 0% 0%, rgba(167,139,250,0.04), transparent 60%),
    radial-gradient(140% 100% at 100% 100%, rgba(74,222,128,0.04), transparent 60%),
    rgba(8, 10, 16, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 11;
  isolation: isolate;
}
.project-demo canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

/* sphere demos get a deeper, "celestial" backdrop */
.project-demo--sphere {
  background:
    radial-gradient(70% 60% at 50% 45%, rgba(167, 139, 250, 0.08), transparent 70%),
    radial-gradient(50% 40% at 80% 80%, rgba(74, 222, 128, 0.06), transparent 70%),
    #07090f;
}

/* video demo */
.project-demo--video video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #07090f;
}

/* ──── WIP section differentiation ──── */
.section-head--wip {
  margin-top: clamp(64px, 8vw, 120px);
}
.bar--wip {
  background: #f59e0b !important;   /* amber */
}
.section-head--wip .section-title {
  font-size: clamp(28px, 3.8vw, 44px);
}

.project[data-status="wip"] {
  /* subtly more muted — the image itself is desaturated via .project-demo--shot */
}
.wip-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  margin-left: auto;
}
/* rearrange project-head so wip-badge sits at the far right */
.project[data-status="wip"] .project-head {
  align-items: center;
}
.project[data-status="wip"] .tags {
  margin-left: auto;
}
.project[data-status="wip"] .wip-badge {
  margin-left: 12px;
}
@media (max-width: 720px) {
  .project[data-status="wip"] .wip-badge {
    margin-left: 0;
    order: 3;
  }
}

/* screenshot demo (tpg) — clickable, lifts on hover */
a.project-demo--shot {
  display: block;
  background: #07090f;
  cursor: pointer;
}
.project-demo--shot picture,
.project-demo--shot img {
  width: 100%;
  height: 100%;
  display: block;
}
.project-demo--shot img {
  object-fit: cover;
  object-position: center;
  transition: transform .6s var(--ease), filter .4s var(--ease);
  filter: saturate(0.92);
}
.project-demo--shot:hover img,
.project-demo--shot:focus-visible img {
  transform: scale(1.03);
  filter: saturate(1.05);
}
.project-demo--shot .demo-caption {
  background: linear-gradient(to top, rgba(8,10,16,0.85), rgba(8,10,16,0) 100%);
  padding: 20px 12px 10px;
  left: 0; right: 0; bottom: 0;
  pointer-events: none;
}

.demo-caption {
  position: absolute;
  bottom: 10px; left: 12px; right: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(0,0,0,0.6);
}
.demo-pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 8px var(--purple-glow);
  animation: pulse-p 2s ease-in-out infinite;
}
.demo-pulse--green {
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
  animation-name: pulse-g;
}

/* feature card layout (the @delusional hero card) */
.project--feature .feature-body {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.project-demo--full {
  aspect-ratio: 21 / 9;
  width: 100%;
}
.demo-caption--feature {
  display: block;              /* override `.demo-caption { display:flex }` — we have prose here, not a pulse+label pair */
  position: relative;
  bottom: auto; left: auto; right: auto;
  margin: 14px 2px 0;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.55;
  text-shadow: none;
}
.demo-caption--feature code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text);
  white-space: nowrap;   /* keep package identifiers together */
}

@media (max-width: 720px) {
  /* Drop the pill chrome on mobile — the monospace font is enough visual
     distinction, and the pill styling fought the line-wrap. */
  .demo-caption--feature code {
    background: transparent;
    border: 0;
    padding: 0;
    white-space: normal;
    overflow-wrap: break-word;
    color: var(--purple);
    font-size: 11.5px;
  }
}

.demo-overlay {
  position: absolute;
  top: 14px; left: 14px; right: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
  flex-wrap: wrap;
}
.demo-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(8, 10, 16, 0.65);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 12px;
  border-radius: 10px;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-value--accent { color: var(--green); }

.demo-controls {
  display: flex;
  gap: 4px;
  background: rgba(8, 10, 16, 0.7);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px;
  border-radius: 999px;
  pointer-events: auto;
}
.demo-controls button {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  transition: background .2s var(--ease), color .2s var(--ease);
  white-space: nowrap;
}
.demo-controls button:hover { color: var(--text); }
.demo-controls button.is-active {
  background: var(--green-soft);
  color: var(--green);
}

.demo-controls-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  pointer-events: none;
}
#del-mode button.is-active {
  background: var(--purple-soft);
  color: var(--purple);
}

.demo-hint {
  color: var(--text-mute);
  font-style: italic;
  margin-left: 6px;
}

/* sub-packages */
.subpkgs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.subpkgs > li {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  background:
    linear-gradient(180deg, var(--accent-soft), transparent 50%),
    rgba(8, 10, 16, 0.4);
  transition: border-color .3s var(--ease);
}
.subpkgs > li:hover {
  border-color: var(--accent-line);
  border-style: solid;
}
.subpkg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.subpkg-head code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
}
.subpkg-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--accent-line);
  padding: 2px 8px;
  border-radius: 999px;
}
.subpkgs p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.5;
}
.num {
  font-family: var(--font-mono);
  color: var(--accent);
}

/* =========================================================
   CSS 3D Cube (DSF demo)
   ========================================================= */
.project-demo--cube {
  display: grid;
  place-items: center;
  background:
    radial-gradient(60% 60% at 50% 50%, rgba(167,139,250,0.08), transparent 70%),
    rgba(8, 10, 16, 0.6);
}
.cube-stage {
  width: min(220px, 70%);
  aspect-ratio: 1 / 1;
  perspective: 900px;
}
.cube {
  --size: 100%;
  --half: 50%;
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: cube-spin 22s linear infinite;
  transform: rotateX(-22deg) rotateY(0);
}
@keyframes cube-spin {
  from { transform: rotateX(-22deg) rotateY(0deg); }
  to   { transform: rotateX(-22deg) rotateY(360deg); }
}
.cube-face {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: #0a0c12;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  padding: 5px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 24px rgba(167, 139, 250, 0.10);
  backface-visibility: visible;
}
.sticker {
  background: var(--c, #444);
  border-radius: 5px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.cube-face--front  { transform: translateZ(calc(var(--depth, 110px))); }
.cube-face--back   { transform: translateZ(calc(-1 * var(--depth, 110px))) rotateY(180deg); }
.cube-face--right  { transform: translateX(var(--depth, 110px)) rotateY(90deg); }
.cube-face--left   { transform: translateX(calc(-1 * var(--depth, 110px))) rotateY(-90deg); }
.cube-face--top    { transform: translateY(calc(-1 * var(--depth, 110px))) rotateX(90deg); }
.cube-face--bottom { transform: translateY(var(--depth, 110px)) rotateX(-90deg); }

/* =========================================================
   FOOTER
   ========================================================= */
.foot {
  border-top: 1px solid var(--border);
  margin-top: clamp(40px, 6vw, 80px);
  padding: clamp(40px, 5vw, 64px) clamp(20px, 5vw, 56px) clamp(48px, 6vw, 80px);
}
.foot-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.foot-mono {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 14px;
  margin: 0;
}
.foot-link {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 14px;
  transition: color .2s var(--ease);
}
.foot-link:hover { color: var(--text); }
.foot-link:hover .foot-arr { transform: translate(2px, -2px); }
.foot-arr {
  display: inline-block;
  transition: transform .25s var(--ease-bounce);
}

/* =========================================================
   REVEAL ANIMATIONS
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity .85s var(--ease),
    transform .85s var(--ease);
  transition-delay: var(--delay, 0ms);
  will-change: transform, opacity;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 880px) {
  .project-grid { grid-template-columns: 1fr; }
  .subpkgs { grid-template-columns: 1fr; }
  .project-demo { aspect-ratio: 16 / 9; }
  .display br { display: none; }
}

/* Narrow screens (~phones): the delusional HUD overlay can't share the canvas
   with a sphere that's only ~360px wide. Move the HUD below the canvas,
   stack stats in a 2×2 grid, and let the controls wrap naturally. */
@media (max-width: 720px) {
  .project-demo--full {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
  }
  .project-demo--full canvas {
    aspect-ratio: 1 / 1;     /* square on mobile — best for a sphere */
    height: auto;
    touch-action: pan-y;     /* let vertical scroll through; tap/drag to interact */
  }

  .project-demo--full .demo-overlay {
    position: static;
    flex-direction: column;
    gap: 10px;
    padding: 12px 12px 2px;
    background: rgba(8, 10, 16, 0.35);
    border-top: 1px solid var(--border);
  }

  .project-demo--full .demo-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    flex: none;
  }
  .project-demo--full .stat {
    flex-direction: column;
    align-items: flex-start;
    padding: 6px 10px;
  }
  .project-demo--full .stat-value {
    font-size: 14px;
  }

  .project-demo--full .demo-controls-stack {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    pointer-events: auto;
  }
  .project-demo--full .demo-controls {
    justify-content: space-between;
  }
  .project-demo--full .demo-controls button {
    flex: 1;
    padding: 8px 10px;
    font-size: 12.5px;
  }

  /* No wheel on touch — drop the zoom hint, we expose pinch instead */
  .project-demo--full .demo-hint { display: none; }
}

@media (max-width: 560px) {
  .hero { min-height: 88dvh; padding: 24px; }
  .display { font-size: clamp(40px, 12vw, 60px); }
  .foot-inner { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   A11Y
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .cube { animation: none; transform: rotateX(-22deg) rotateY(20deg); }
}
