/* ============================================
   WrongOrbit — Design tokens
   ============================================ */
:root {
  /* Typography — families (single family; weight + size + tracking carry hierarchy) */
  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-body: 'Outfit', system-ui, -apple-system, sans-serif;

  /* Typography — fluid scale (rem-based, ≥1.25 ratio, clamp max ≤ 2.5× min) */
  --text-xs: 0.75rem;    /* 12 — captions, labels */
  --text-sm: 0.875rem;   /* 14 — secondary UI, metadata */
  --text-base: 1rem;     /* 16 — body */
  --text-lg: 1.125rem;   /* 18 — lead, intro prose */
  --text-xl: 1.25rem;    /* 20 — large body */
  --text-h4: clamp(1.25rem, 1.13rem + 0.6vw, 1.5rem);   /* 20 → 24 */
  --text-h3: clamp(1.5rem, 1.21rem + 1.43vw, 2rem);     /* 24 → 32 */
  --text-h2: clamp(1.875rem, 1.30rem + 2.86vw, 3rem);   /* 30 → 48 */
  --text-h1: clamp(2.5rem, 1.41rem + 5.45vw, 4.25rem);  /* 40 → 68 */
  --text-display: clamp(2.75rem, 1.55rem + 6vw, 4.5rem);/* about-h2 accent */

  /* Typography — leading & tracking */
  --leading-tight: 1.05;
  --leading-snug: 1.15;
  --leading-body: 1.6;     /* extra breathing room for light-on-dark */
  --tracking-display: -0.025em;
  --tracking-tight: -0.02em;
  --tracking-body: 0.01em; /* light type on dark reads as lighter; nudge open */
  --tracking-label: 0.08em;

  /* Color */
  --c-primary: #A855F7;
  --c-primary-light: #C084FC;
  --c-primary-dark: #7E22CE;

  --c-bg: #080808;
  --c-surface: #111111;
  --c-surface-hover: #1A1A1A;

  --c-text: #FFFFFF;
  --c-text-secondary: #A1A1AA;
  --c-text-muted: #71717A;

  --c-accent-pink: #EC4899;
  --c-accent-blue: #60A5FA;
  --c-signal-green: #34D399;

  /* Semantic state colors, drawn from the committed brand palette so success
     and error read as part of the same world (not bolted-on red/green). */
  --c-success: var(--c-signal-green);
  --c-error: var(--c-accent-pink);

  /* Primary (A855F7) alpha overlays — explicit so they survive CSS minification
     and render identically across browsers (color-mix in the bundled stylesheet
     is unreliable). Single source of truth for interactive purple tints. */
  --c-primary-wash: rgba(168, 85, 247, 0.10);
  --c-primary-wash-hover: rgba(168, 85, 247, 0.06);
  --c-primary-line: rgba(168, 85, 247, 0.55);
  --c-primary-line-soft: rgba(168, 85, 247, 0.40);

  --c-border: rgba(255, 255, 255, 0.08);

  /* Radius */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-btn: 14px;
  --r-pill: 999px;

  /* Shadow */
  --shadow-glow: 0 0 30px rgba(168, 85, 247, 0.4);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.35);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);   /* snappy settle */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);     /* confident entrance */
  --dur-fast: 200ms;
  --dur-mid: 300ms;

  /* Layout */
  --max-w: 1280px;
  --content-w: 1200px;

  /* Aliases for component use */
  --color-primary: var(--c-primary);
  --color-primary-dark: var(--c-primary-dark);
  --color-bg: var(--c-bg);
  --color-surface: var(--c-surface);
  --color-surface-hover: var(--c-surface-hover);
  --color-text: var(--c-text);
  --color-secondary: var(--c-text-secondary);
  --color-muted: var(--c-text-muted);
  --color-border: var(--c-border);
  --color-success: var(--c-success);
  --color-error: var(--c-error);
}

/* ============================================
   Reset
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font: inherit; }

/* ============================================
   Base
   ============================================ */
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  color: var(--c-text);
  background-color: var(--c-bg);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ensure content sits above background fx layers */
.site-header, main, .site-footer { position: relative; z-index: 1; }

/* ============================================
   Background FX — Stars / Comets / Orbits
   ============================================ */
#starfield, #shooting-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* Stars: dim, subtle, distant */
.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  animation: star-twinkle ease-in-out infinite alternate;
}
@keyframes star-twinkle {
  from { opacity: 0.05; }
  to   { opacity: var(--peak, 0.35); }
}

/* Comets: rare, bright head + tapered tail */
.shooting-star {
  position: absolute;
  width: 2.5px; height: 2.5px;
  background: #fff;
  border-radius: 50%;
  box-shadow:
    0 0 4px 1px rgba(255, 255, 255, 0.9),
    0 0 12px 3px rgba(200, 170, 255, 0.5);
  animation: comet-path linear infinite;
  opacity: 0;
  will-change: transform, opacity;
}
.shooting-star::before {
  content: "";
  position: absolute;
  top: 50%; right: 0;
  width: 140px; height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(
    to left,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(200, 170, 255, 0.4) 40%,
    transparent 100%
  );
  border-radius: 999px;
  filter: blur(0.4px);
}
@keyframes comet-path {
  0%   { translate: 0 0; opacity: 0; }
  2%   { opacity: 1; }
  60%  { opacity: 0.9; }
  80%  { translate: var(--dx, 70vw) var(--dy, 35vw); opacity: 0; }
  100% { translate: var(--dx, 70vw) var(--dy, 35vw); opacity: 0; }
}

/* Cat-comet easter egg: ~1 in 20 comets carries a tumbling astronaut cat */
.shooting-star.cat-comet {
  width: 14px;
  height: 12px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 14' fill='%23ffffff'><polygon points='2,1.5 4,5 6,3.5'/><polygon points='10,3.5 12,5 14,1.5'/><ellipse cx='8' cy='9' rx='5' ry='4.5'/></svg>") center/contain no-repeat;
  border-radius: 0;
  box-shadow: none;
  filter:
    drop-shadow(0 0 4px rgba(255, 255, 255, 0.7))
    drop-shadow(0 0 12px rgba(200, 170, 255, 0.5));
}
.shooting-star.cat-comet::before {
  width: 90px;
  background: linear-gradient(
    to left,
    rgba(255, 255, 255, 0.75) 0%,
    rgba(200, 170, 255, 0.35) 40%,
    transparent 100%
  );
}

/* Orbital rings inside hero (scroll with content) */
.hero-orbits {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.orbital-ring {
  position: absolute;
  border-radius: 50%;
  animation: orbit-spin linear infinite;
  top: 50%; left: 60%;
}
@keyframes orbit-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
.orbital-ring--1 {
  width: 100vw; height: 45vw;
  border: 1px solid rgba(168, 85, 247, 0.10);
  animation-duration: 90s;
}
.orbital-ring--2 {
  width: 70vw; height: 32vw;
  border: 1px solid rgba(236, 72, 153, 0.08);
  animation-duration: 140s;
  animation-direction: reverse;
}

@media (prefers-reduced-motion: reduce) {
  .star, .shooting-star, .orbital-ring { animation: none; }
  .star { opacity: 0.2; }
  .shooting-star { display: none; }
}

/* ============================================
   Layout
   ============================================ */
.container {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 1024px) { .container { padding: 0 24px; } }
@media (max-width: 640px)  { .container { padding: 0 16px; } }

section { padding: 64px 0; }
@media (max-width: 768px) { section { padding: 40px 0; } }

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 700;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
h1 {
  font-size: var(--text-h1);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}
h2 { font-size: var(--text-h2); font-weight: 700; }
h3 { font-size: var(--text-h3); font-weight: 700; }
h4 { font-size: var(--text-h4); font-weight: 600; line-height: var(--leading-snug); }

.body-lg { font-size: var(--text-xl); line-height: 1.55; }
.small   { font-size: var(--text-sm); }
.caption {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.muted     { color: var(--c-text-muted); }
.secondary { color: var(--c-text-secondary); }

/* Long-form prose stays in the comfortable measure and de-orphans */
.about-content p, .hero p.lead { text-wrap: pretty; }

.text-purple {
  background: linear-gradient(135deg, var(--c-primary-light), var(--c-primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--r-btn);
  font-weight: 600;
  font-size: 15px;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: scale(1.02); }
.btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}
/* Keyboard focus ring — the primary buttons had none, falling back to
   the inconsistent UA default. Match the .pc-link / .pc-install rings. */
.btn:focus-visible {
  outline: 2px solid var(--c-primary-light);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: white;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.35);
}
.btn-primary:hover { box-shadow: var(--shadow-glow); }

.btn-secondary {
  background: transparent;
  color: var(--c-text);
  border: 1px solid var(--c-border);
}
.btn-secondary:hover { background: var(--c-surface-hover); }

.btn-sm { padding: 10px 18px; font-size: 14px; }

/* "Add to Chrome" — a tactile press for the page's primary action.
   The + leans in on hover and squashes on press while the button
   sinks a hair, so the click feels physical rather than flat. */
.btn-install { gap: 7px; }
.btn-install__plus {
  display: inline-block;
  font-size: 1.15em;
  transition: transform var(--dur-fast) cubic-bezier(0.34, 1.3, 0.64, 1);
}
.btn-install:hover .btn-install__plus {
  transform: rotate(12deg) scale(1.18);
}
.btn-install:active {
  transform: translateY(1px) scale(0.985);
}
.btn-install:active .btn-install__plus {
  transform: scale(0.82);
}
@media (prefers-reduced-motion: reduce) {
  .btn-install__plus { transition: none; }
  .btn-install:hover .btn-install__plus { transform: none; }
}

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(5, 1, 15, 0.6);
  border-bottom: 1px solid var(--c-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  display: flex;
  align-items: center;
}
.logo img { height: 48px; width: auto; }

.nav { display: flex; align-items: center; gap: 32px; }
.nav a {
  color: var(--c-text-secondary);
  font-size: 15px;
  transition: color var(--dur-fast) var(--ease);
}
.nav a:hover { color: var(--c-text); }

@media (max-width: 768px) {
  .nav { display: none; }
}

/* ============================================
   Hero
   ============================================ */
.hero { padding: 80px 0 0; overflow: hidden; position: relative; }
.hero .container { position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: end;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .tag-row { justify-content: center; } }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--c-text-secondary);
  text-transform: uppercase;
}
.tag-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-primary);
  box-shadow: 0 0 8px var(--c-primary);
}

.hero h1 { margin-bottom: 24px; }
.hero p.lead {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--c-text-secondary);
  margin-bottom: 32px;
  max-width: 46ch;
}
@media (max-width: 900px) { .hero p.lead { margin-left: auto; margin-right: auto; } }

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
@media (max-width: 900px) { .hero-actions { justify-content: center; } }


.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: -1px; /* flush with section base; planet is cropped at the bottom */
}
.hero-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 55%, rgba(168, 85, 247, 0.4), transparent 60%);
  filter: blur(50px);
  z-index: -1;
}
/* Orbital ring */
.hero-art::after {
  content: "";
  position: absolute;
  width: 110%;
  aspect-ratio: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -45%) rotate(-18deg);
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: 50%;
  border-right-color: transparent;
  border-bottom-color: transparent;
  z-index: -1;
  filter: blur(0.5px);
}
.hero-art img {
  width: 100%;
  max-width: 680px;
  display: block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 20px 60px rgba(168, 85, 247, 0.35));
  top: 11px;
}

/* ============================================
   Mission strip (Experiment / Launch / Explore / Repeat)
   ============================================ */
.mission {
  display: grid;
  grid-template-columns: repeat(var(--mission-cols, 4), 1fr);
  gap: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
@media (max-width: 768px)  { .mission { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .mission { grid-template-columns: 1fr; } }

.mission-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 24px;
  border-right: 1px solid var(--c-border);
}
.mission-item:last-child { border-right: none; }
@media (max-width: 768px) {
  .mission-item:nth-child(2) { border-right: none; }
  .mission-item:nth-child(-n+2) { border-bottom: 1px solid var(--c-border); }
}
@media (max-width: 480px) {
  .mission-item { border-right: none; border-bottom: 1px solid var(--c-border); }
  .mission-item:last-child { border-bottom: none; }
}
.mission-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.2);
  display: grid; place-items: center;
  margin-bottom: 4px;
  color: var(--c-primary-light);
  transition:
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}
.mission-icon svg {
  width: 18px; height: 18px;
  stroke-width: 1.75;
  transform-origin: 50% 50%;
}
.mission-item:hover .mission-icon {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.32);
}

/* Each mission icon animates to match its verb on hover */
@keyframes mission-zap {
  0%, 100% { transform: scale(1); }
  35%      { transform: scale(1.18); filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.7)); }
  65%      { transform: scale(0.94); }
}
.mission-item[data-mission="experiment"]:hover .mission-icon svg {
  animation: mission-zap 650ms cubic-bezier(0.25, 1, 0.5, 1) both;
}

@keyframes mission-launch {
  0%   { transform: translateY(0); }
  35%  { transform: translateY(-9px); }
  60%  { transform: translateY(2px); }
  100% { transform: translateY(0); }
}
.mission-item[data-mission="launch"]:hover .mission-icon svg {
  animation: mission-launch 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes mission-scan {
  0%   { transform: rotate(0deg) translateX(0); }
  30%  { transform: rotate(-14deg) translateX(-1px); }
  70%  { transform: rotate(14deg) translateX(1px); }
  100% { transform: rotate(0deg) translateX(0); }
}
.mission-item[data-mission="explore"]:hover .mission-icon svg {
  animation: mission-scan 900ms cubic-bezier(0.25, 1, 0.5, 1) both;
  transform-origin: 50% 70%;
}

@keyframes mission-repeat {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.mission-item[data-mission="repeat"]:hover .mission-icon svg {
  animation: mission-repeat 800ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── Project feature icons: animate to match the icon's verb ──────
   Same mechanism as the mission strip, but keyed to the lucide icon
   name carried in [data-feat], so a project's features animate
   without bespoke markup. The loop extension's repeat icon loops —
   that's the point. */
.mission-item[data-feat="repeat"]:hover .mission-icon svg,
.mission-item[data-feat="repeat-2"]:hover .mission-icon svg,
.mission-item[data-feat="refresh-cw"]:hover .mission-icon svg,
.mission-item[data-feat="rotate-cw"]:hover .mission-icon svg {
  animation: mission-repeat 900ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes feat-snip {
  0%, 100% { transform: rotate(0deg); }
  30%      { transform: rotate(-11deg); }
  60%      { transform: rotate(9deg); }
}
.mission-item[data-feat="scissors"]:hover .mission-icon svg {
  animation: feat-snip 600ms cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

@keyframes feat-rewind {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}
.mission-item[data-feat="history"]:hover .mission-icon svg,
.mission-item[data-feat="rewind"]:hover .mission-icon svg,
.mission-item[data-feat="undo"]:hover .mission-icon svg,
.mission-item[data-feat="clock"]:hover .mission-icon svg {
  animation: feat-rewind 850ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes feat-sweep {
  0%   { transform: rotate(-14deg); }
  55%  { transform: rotate(15deg); }
  100% { transform: rotate(0deg); }
}
.mission-item[data-feat="gauge"]:hover .mission-icon svg,
.mission-item[data-feat="activity"]:hover .mission-icon svg {
  animation: feat-sweep 700ms cubic-bezier(0.25, 1, 0.5, 1) both;
  transform-origin: 50% 75%;
}

/* Fallback for any other feature icon: a quick, confident pop. */
@keyframes feat-pop {
  0%, 100% { transform: scale(1); }
  40%      { transform: scale(1.18); }
  70%      { transform: scale(0.95); }
}
.mission-item[data-feat]:not([data-feat="repeat"]):not([data-feat="repeat-2"]):not([data-feat="refresh-cw"]):not([data-feat="rotate-cw"]):not([data-feat="scissors"]):not([data-feat="history"]):not([data-feat="rewind"]):not([data-feat="undo"]):not([data-feat="clock"]):not([data-feat="gauge"]):not([data-feat="activity"]):hover .mission-icon svg {
  animation: feat-pop 520ms cubic-bezier(0.34, 1.1, 0.64, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .mission-item[data-mission] .mission-icon svg,
  .mission-item[data-feat] .mission-icon svg {
    animation: none !important;
  }
}
.mission-item :is(h3, h4) { font-size: 18px; }
.mission-item p {
  font-size: 14px;
  /* secondary, not muted: muted (#71717A) is 3.91:1 on the surface —
     below AA. Secondary (#A1A1AA) clears it and matches the cross-promo
     card descriptions, so the same element reads the same everywhere. */
  color: var(--c-text-secondary);
  line-height: 1.5;
}

/* ============================================
   Projects
   ============================================ */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}
.section-head a {
  color: var(--c-primary-light);
  font-size: 14px;
  font-weight: 500;
}
.section-head a:hover { color: var(--c-primary); }

.projects {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1024px) { .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .projects { grid-template-columns: 1fr; } }

/* Projects grid variants */
.projects-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.projects-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.projects-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1024px) {
  .projects-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .projects-2, .projects-3 { grid-template-columns: 1fr; }
  .projects-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .projects-4 { grid-template-columns: 1fr; }
}

/* Category label */
.projects-category-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}
.projects-category-label svg { width: 14px; height: 14px; }
/* Generous, consistent separation between category groups (the
   first label after the section heading keeps its tighter default). */
.projects + .projects-category-label { margin-top: clamp(44px, 5vw, 64px); }

/* ── Project card ──────────────────────────── */
.project-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  transition: transform var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(168, 85, 247, 0.28);
  background: var(--c-surface-hover);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* "In development" card: dimmed, no hover lift */
.project-card.is-dev {
  opacity: 0.55;
  border-style: dashed;
}
.project-card.is-dev:hover {
  transform: none;
  opacity: 0.7;
  box-shadow: none;
}

/* ── Featured cards (Mobile / Web): horizontal layout ────────
   The 2-up grids hold projects with richer copy, so they earn a
   wider treatment that USES the horizontal space — icon to the
   left, content beside it — instead of a column stack stranded in
   a 560px card. No markup change: `.pc-head` becomes `display:
   contents` so the icon + badge drop into the card's own grid. */
.projects-2 .project-card {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  grid-template-areas:
    "icon body badge"
    "icon foot foot";
  align-items: start;
  column-gap: 20px;
  row-gap: 16px;
  padding: 24px;
}
.projects-2 .pc-head { display: contents; }
.projects-2 .pc-icon,
.projects-2 .pc-icon-placeholder {
  grid-area: icon;
  width: 64px; height: 64px;
}
.projects-2 .pc-badge {
  grid-area: badge;
  justify-self: end;
}
.projects-2 .pc-body {
  grid-area: body;
  margin-bottom: 0;
}
.projects-2 .pc-foot { grid-area: foot; }
/* Single CTA no longer balloons full-width; it sits at its natural
   size on the left, with secondary links trailing it. */
.projects-2 .pc-install {
  flex: 0 0 auto;
  padding-inline: 22px;
}

@media (max-width: 480px) {
  .projects-2 .project-card {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "icon badge"
      "body body"
      "foot foot";
    row-gap: 14px;
  }
  .projects-2 .pc-install { flex: 1; }
}

/* Card head: icon + badge aligned to edges */
.pc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Status badge (top-right) */
.pc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.pc-badge::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 5px currentColor;
}
.pc-badge.live {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: #34D399;
}
.pc-badge.dev {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.22);
  color: #FCD34D;
}

/* Card body: name + description — flex-grows to push footer down */
.pc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.pc-body :is(h3, h4) {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--c-text);
}
.pc-body p {
  font-size: 0.8125rem; /* 13 */
  /* dust-gray (not shadow-gray): sustained body copy needs ≥4.5:1.
     #71717A on the #111 surface is only ~3.9:1 — below the floor. */
  color: var(--c-text-secondary);
  line-height: 1.55;
  text-wrap: pretty;
}

/* Card footer: separated by top border */
.pc-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--c-border);
  padding-top: 16px;
}

/* Primary install CTA — fills available space */
.pc-install {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.22);
  border-radius: var(--r-btn);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--c-primary-light);
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.pc-install {
  min-height: 40px;
}
.pc-install:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.45);
  color: #fff;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.25);
}
.pc-install:active {
  background: rgba(168, 85, 247, 0.28);
  box-shadow: none;
}
.pc-install:focus-visible {
  outline: 2px solid var(--c-primary-light);
  outline-offset: 2px;
}

/* Secondary links: muted text, right side */
.pc-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.pc-link {
  font-size: 12px;
  font-weight: 500;
  /* dust-gray at rest so 12px text clears 4.5:1; brightens on hover. */
  color: var(--c-text-secondary);
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
  border-bottom: 1px solid transparent;
}
.pc-link:hover {
  color: var(--c-text);
  border-bottom-color: var(--c-text-secondary);
}
.pc-link:focus-visible {
  outline: 2px solid var(--c-primary-light);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Icon: image */
.pc-icon {
  width: 52px; height: 52px;
  border-radius: var(--r-md);
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  background: #1c1c1e;
  border: 1px solid var(--c-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  padding: 4px;
  transition: transform var(--dur-fast) var(--ease-out-quint),
              box-shadow var(--dur-fast) var(--ease);
}
/* Icon rises a touch with its card and catches a faint violet light */
.project-card:hover .pc-icon {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45),
              0 0 14px rgba(168, 85, 247, 0.18);
}

/* Icon: placeholder */
.pc-icon-placeholder {
  width: 52px; height: 52px;
  border-radius: var(--r-md);
  background: #1c1c1e;
  border: 1px solid var(--c-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  display: grid; place-items: center;
  color: var(--c-text-muted);
  flex-shrink: 0;
}
.pc-icon-placeholder svg { width: 22px; height: 22px; stroke-width: 1.5; }

/* Touch: enlarge footer tap targets to the 44px floor on coarse pointers */
@media (pointer: coarse) {
  .pc-install { min-height: 44px; }
  .pc-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* Reduced motion: keep the colour/border feedback, drop the hover lift */
@media (prefers-reduced-motion: reduce) {
  .project-card {
    transition: border-color var(--dur-fast) var(--ease),
                background var(--dur-fast) var(--ease);
  }
  .project-card:hover { transform: none; }
}

/* Legacy selectors kept for backward compat */
.project-icon-img  { display: none; }
.project-icon-placeholder { display: none; }
.project-footer    { display: none; }

/* ============================================
   About
   ============================================ */
.about-section { position: relative; }
.about-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: -5%;
  width: 55%;
  height: 100%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.18), transparent 65%);
  filter: blur(60px);
  pointer-events: none;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .about-content p { margin-inline: auto; }
}
.about-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.about-art img {
  max-width: 540px;
  width: 100%;
  filter: drop-shadow(0 16px 56px rgba(168, 85, 247, 0.45));
  position: relative;
  z-index: 1;
}
.about-content { position: relative; }
.about-content .caption { color: var(--c-primary-light); margin-bottom: 20px; }
.about-content h2 { margin-bottom: 24px; font-size: var(--text-display); }
.about-content p {
  color: var(--c-text-secondary);
  margin-bottom: 32px;
  font-size: var(--text-lg);
  line-height: 1.7;
  max-width: 56ch;
}

/* ============================================
   Newsletter band
   ============================================ */
.newsletter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 32px 40px;
  background:
    radial-gradient(circle at 0% 50%, rgba(168, 85, 247, 0.25), transparent 50%),
    radial-gradient(circle at 100% 50%, rgba(236, 72, 153, 0.15), transparent 50%),
    var(--c-surface);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--r-lg);
}
@media (max-width: 768px) {
  .newsletter { grid-template-columns: 1fr; text-align: center; }
}
.newsletter h3 { font-size: 22px; margin-bottom: 4px; }
.newsletter p  { color: var(--c-text-muted); font-size: 14px; }
.newsletter-form { display: flex; gap: 8px; }
@media (max-width: 768px) { .newsletter-form { justify-content: center; } }
.newsletter-form input {
  padding: 14px 18px;
  border-radius: var(--r-btn);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  min-width: 240px;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease);
}
.newsletter-form input:focus { border-color: var(--c-primary); }
.newsletter-form input::placeholder { color: var(--c-text-muted); }

/* ============================================
   Footer
   ============================================ */
.site-footer {
  padding: 48px 0 32px;
  border-top: 1px solid var(--c-border);
  margin-top: 64px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-nav { display: flex; gap: 24px; }
.footer-nav a {
  color: var(--c-text-muted);
  font-size: 14px;
  transition: color var(--dur-fast) var(--ease);
}
.footer-nav a:hover { color: var(--c-text); }
.footer-copy { color: var(--c-text-muted); font-size: 13px; }
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text-secondary);
  transition: all var(--dur-fast) var(--ease);
}
.footer-social a:hover {
  background: var(--c-surface-hover);
  color: var(--c-primary-light);
  border-color: rgba(168, 85, 247, 0.3);
}

/* ============================================
   Animations
   ============================================ */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
.float { animation: float 6s ease-in-out infinite; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fade-up 700ms var(--ease) both; }

/* ============================================
   Entrance choreography
   --------------------------------------------
   Two distinct moments, never the uniform "fade
   every section in" reflex:
     1. Hero — a page-load sequence (tags → h1 →
        lead → CTA), then the cat-planet settles
        in and floats.
     2. Lists/grids — sibling stagger on scroll,
        fired once. JS-gated (.js-reveal on <html>)
        so no-JS, crawlers, and prerenders always
        see content; reduced-motion users too.
   ============================================ */
@keyframes enter-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes enter-art {
  from { opacity: 0; transform: translateY(34px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@media (prefers-reduced-motion: no-preference) {
  /* ── Hero load sequence ─────────────────────────
     Gated on .js-reveal (added only when the tab is
     visible at load) so hidden/headless/prerender
     renders — where animations are paused — show the
     hero immediately instead of stuck at opacity 0. */
  .js-reveal .hero .tag-row .tag,
  .js-reveal .hero h1,
  .js-reveal .hero .lead,
  .js-reveal .hero .hero-actions {
    opacity: 0;
    animation: enter-up 760ms var(--ease-out-expo) both;
  }
  .js-reveal .hero .tag-row .tag:nth-child(1) { animation-delay: 120ms; }
  .js-reveal .hero .tag-row .tag:nth-child(2) { animation-delay: 200ms; }
  .js-reveal .hero .tag-row .tag:nth-child(3) { animation-delay: 280ms; }
  .js-reveal .hero h1            { animation-delay: 360ms; }
  .js-reveal .hero .lead         { animation-delay: 500ms; }
  .js-reveal .hero .hero-actions { animation-delay: 620ms; }

  .js-reveal .hero-art {
    opacity: 0;
    animation: enter-art 1100ms var(--ease-out-expo) 240ms both;
  }
  /* The cat drifts gently in orbit (perpetual; not gated —
     it's a visible element that simply bobs). */
  .hero-art img,
  .about-art img {
    animation: float 7s ease-in-out 1.3s infinite;
  }

  /* ── Scroll-reveal for lists/grids ──────────── */
  .js-reveal [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    will-change: opacity, transform;
  }
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 640ms var(--ease-out-quint),
              transform 640ms var(--ease-out-quint);
  transition-delay: calc(var(--reveal-i, 0) * 75ms);
}
