/* ============ Reset & Base ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Dark palette (default). Swapping `data-theme="light"` on <html>
     overrides only the variables; component CSS keeps using var(...). */
  --bg: #07080d;
  --bg-elev: #0d1018;
  --bg-card: rgba(20, 24, 36, 0.55);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e7ecf3;
  --text-muted: #98a2b3;
  /* WCAG AA — #9ca3af on #07080d ≈ 8.0:1 (was #6b7280 ≈ 4.05:1, borderline). */
  --text-dim: #9ca3af;
  --accent: #4ade80;
  --accent-2: #22d3ee;
  --accent-3: #a78bfa;
  --gradient: linear-gradient(135deg, #4ade80 0%, #22d3ee 50%, #a78bfa 100%);
  --gradient-soft: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(34, 211, 238, 0.15), rgba(167, 139, 250, 0.15));
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  --radius: 16px;
  --radius-sm: 10px;
  --max-w: 1200px;
  /* Theming hooks used by a few components that need different values
     in dark vs light mode (nav glass, code-pill bg, surface tints). */
  --nav-bg: rgba(7, 8, 13, 0.7);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --surface-soft-strong: rgba(255, 255, 255, 0.08);
  --on-gradient: #07080d; /* readable text colour against the gradient */
  --bg-overlay: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.4));
  --bg-canvas-opacity: 0.55;
  --selection-bg: rgba(74, 222, 128, 0.35);
  --selection-fg: #fff;
}

html[data-theme="light"] {
  /* Light palette. Contrast notes (calculated against --bg #f8fafc):
     #0a0c14 text ≈ 17.6:1 (AAA), #4b5563 muted ≈ 8.6:1 (AAA),
     #6b7280 dim ≈ 5.7:1 (AA), #15803d accent ≈ 5.0:1 (AA),
     #0e7490 accent-2 ≈ 5.4:1 (AA), #6d28d9 accent-3 ≈ 7.4:1 (AAA). */
  --bg: #f8fafc;
  --bg-elev: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.78);
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.20);
  --text: #0a0c14;
  --text-muted: #4b5563;
  --text-dim: #6b7280;
  --accent: #15803d;
  --accent-2: #0e7490;
  --accent-3: #6d28d9;
  --gradient: linear-gradient(135deg, #15803d 0%, #0e7490 50%, #6d28d9 100%);
  --gradient-soft: linear-gradient(135deg, rgba(21, 128, 61, 0.10), rgba(14, 116, 144, 0.10), rgba(109, 40, 217, 0.10));
  --shadow-lg: 0 30px 60px -20px rgba(15, 23, 42, 0.18);
  --nav-bg: rgba(248, 250, 252, 0.78);
  --surface-soft: rgba(15, 23, 42, 0.04);
  --surface-soft-strong: rgba(15, 23, 42, 0.08);
  --on-gradient: #ffffff;
  --bg-overlay: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.06));
  --bg-canvas-opacity: 0.18;
  --selection-bg: rgba(21, 128, 61, 0.28);
  --selection-fg: #0a0c14;
}

/* Smooth, low-cost theme transition on body-level surfaces. Suppressed
   when the visitor prefers reduced motion (theme swap is instant). */
html, body { transition: background-color 0.18s ease, color 0.18s ease; }
@media (prefers-reduced-motion: reduce) {
  html, body { transition: none; }
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(800px 500px at 10% 0%, rgba(74, 222, 128, 0.1), transparent 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(34, 211, 238, 0.08), transparent 60%),
    radial-gradient(700px 500px at 50% 100%, rgba(167, 139, 250, 0.08), transparent 60%);
  pointer-events: none;
  z-index: -2;
}

/* Three.js background canvas sits behind everything */
#bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: var(--bg-canvas-opacity);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-2);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent);
}

h1,
h2,
h3,
h4 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.6em;
}

p {
  color: var(--text-muted);
  margin: 0 0 1em;
}

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

/* ============ Layout helpers ============ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 96px 0;
  position: relative;
  z-index: 1;
}

section .container > .eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  padding: 6px 12px;
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.06);
}

section h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  margin-bottom: 16px;
}

section .lede {
  max-width: 720px;
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 48px;
}

/* ============ Navigation ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  color: var(--on-gradient);
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 6px 18px rgba(74, 222, 128, 0.35);
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px !important;
  background: var(--gradient);
  color: var(--on-gradient) !important;
  border-radius: 999px;
  font-weight: 600 !important;
  box-shadow: 0 8px 24px rgba(74, 222, 128, 0.25);
}

.nav-cta:hover {
  background: var(--gradient) !important;
  color: var(--on-gradient) !important;
  filter: brightness(1.08);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ============ Published project directory ============ */
.live-projects {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 80px;
}
.live-projects-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.live-projects-heading h2 {
  font-size: 1.55rem;
  margin: 0;
}
.live-projects-count,
.live-project-current {
  color: var(--accent);
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.live-projects-note {
  font-size: 0.82rem;
  margin-bottom: 16px;
}
.live-projects-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.live-projects-list li { min-width: 0; }
.live-project-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  min-height: 60px;
  padding: 9px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  overflow-wrap: anywhere;
}
.live-project-link:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--bg-elev);
}
.live-project-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.live-project-name {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
}
.live-project-name > [aria-hidden] { color: var(--accent); }
.live-project-current { padding: 1px 6px; font-size: 0.62rem; }
.live-project-domain {
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 2px;
}
#intro { scroll-margin-top: 80px; }
@media (max-width: 900px) {
  .live-projects-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .live-projects { padding: 24px 0; }
  .live-projects-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-project-link { padding: 8px 10px; }
}

/* ============ Hero ============ */
.hero {
  padding: 80px 0 100px;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
  width: 100%;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.25);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 24px;
}

.hero-pill .dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.2);
  animation: pulse 2s infinite;
}

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

.hero h1 {
  font-size: clamp(2.5rem, 6.5vw, 4.5rem);
  margin-bottom: 18px;
}

.hero h1 .grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .subtitle {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 48px;
}

/* ---- "As seen in" press strip ----
   Renders directly under the hero subtitle. Fixed-height container avoids
   CLS when JS swaps the plain-text fallback for inline SVG wordmarks. */
.press-strip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin: 4px 0 28px;
  /* Reserve space so the async SVG wordmark render doesn't shift the
     CTAs below. 30px row + 14px padding ≈ 44px. */
  min-height: 44px;
}
.press-strip-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.press-strip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 22px;
}
.press-strip-link {
  display: inline-flex;
  align-items: center;
  height: 30px;
  /* Greyscale on idle, full colour on hover/focus — common press-strip
     pattern, signals "logo wall" without pulling visual weight from CTAs. */
  color: var(--text-dim);
  filter: grayscale(1);
  opacity: 0.75;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.18s ease, filter 0.2s ease;
  text-decoration: none;
  border-radius: 4px;
}
.press-strip-link:hover,
.press-strip-link:focus-visible {
  color: var(--text);
  opacity: 1;
  filter: grayscale(0);
  transform: translateY(-1px);
}
.press-strip-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.press-strip-link svg {
  height: 24px;
  width: auto;
  display: block;
}
.press-strip-text {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Mobile: turn the strip into a horizontal snap-scroller so all 5 logos
   stay reachable in one swipe without wrapping into a tall block.
   No marquee/auto-scroll — respects reduced motion by default. */
@media (max-width: 700px) {
  .press-strip {
    flex-wrap: nowrap;
    gap: 10px;
    margin: 2px -24px 22px;
    padding: 0 24px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .press-strip::-webkit-scrollbar { display: none; }
  .press-strip-label {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
  .press-strip-list {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 18px;
  }
  .press-strip-list li { scroll-snap-align: start; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient);
  color: var(--on-gradient);
  box-shadow: 0 12px 30px rgba(74, 222, 128, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  color: var(--on-gradient);
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-soft-strong);
  color: var(--text);
  transform: translateY(-2px);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 560px;
}

.stat {
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
}

.stat .num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat .label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ============ About ============ */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  align-items: start;
}

.profile-card {
  position: sticky;
  top: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.profile-pic {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border-strong);
}

.profile-card .name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 4px;
}

.profile-card .role {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.tag {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.about-body p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.about-body p strong {
  color: var(--text);
  font-weight: 600;
}

/* ============ Projects ============ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(8px);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(74, 222, 128, 0.35);
  box-shadow: var(--shadow-lg);
}

.project-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.project-media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- Contact CTA (newsletter + scheduler) ---- */
.contact-cta { padding-top: 80px; padding-bottom: 80px; }
.contact-cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 800px) {
  .contact-cta-grid { grid-template-columns: 1fr; }
}
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(8px);
}
.contact-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  margin: 0 0 8px;
}
.contact-card-intro {
  color: var(--text-muted);
  margin: 0 0 16px;
}
.email-capture-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.email-capture-form input[type="email"] {
  flex: 1 1 220px;
  min-width: 0;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font: inherit;
}
.email-capture-form input[type="email"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.email-capture-form button { white-space: nowrap; }
.email-capture-form button[disabled] { opacity: 0.65; cursor: progress; }
.email-capture-status {
  margin: 12px 0 0;
  font-size: 0.9rem;
  min-height: 1.2em;
  color: var(--text-muted);
}
.email-capture-status.ok { color: var(--accent); }
.email-capture-status.err { color: #fca5a5; }
.email-capture-status.pending { color: var(--text-muted); }
.scheduler-embed {
  margin-top: 4px;
  position: relative;
  width: 100%;
  min-height: 480px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}
.scheduler-embed iframe {
  width: 100%;
  height: 600px;
  border: 0;
  display: block;
  background: #fff;
}
.scheduler-fallback { white-space: nowrap; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Lite YouTube facade ---- */
.lite-yt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: #000;
  cursor: pointer;
  display: block;
  overflow: hidden;
}
.media-card .embed .lite-yt {
  position: absolute;
}
.lite-yt-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.92;
  transition: opacity 0.2s ease, transform 0.4s ease;
}
.lite-yt:hover .lite-yt-thumb,
.lite-yt:focus-visible .lite-yt-thumb {
  opacity: 1;
  transform: scale(1.03);
}
.lite-yt-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.lite-yt-play svg {
  width: 68px;
  height: 48px;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s ease;
}
.lite-yt:hover .lite-yt-play svg,
.lite-yt:focus-visible .lite-yt-play svg {
  transform: scale(1.08);
}
.lite-yt-bg { fill: #f00; opacity: 0.92; }
.lite-yt-tri { fill: #fff; }
.lite-yt:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.lite-yt-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  color: var(--text);
  background: #000;
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .lite-yt-thumb,
  .lite-yt-play svg {
    transition: none;
  }
  .lite-yt:hover .lite-yt-thumb,
  .lite-yt:focus-visible .lite-yt-thumb {
    transform: none;
  }
  .lite-yt:hover .lite-yt-play svg,
  .lite-yt:focus-visible .lite-yt-play svg {
    transform: none;
  }
}

.project-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-body .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.badge.alt {
  color: var(--accent-3);
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.3);
}

.badge.alt2 {
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.3);
}

.project-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--text);
}

.project-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  flex: 1;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
}

.link-pill:hover {
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.3);
  color: var(--accent);
}

/* ============ Experience / Education timeline ============ */
.timeline {
  display: grid;
  gap: 16px;
}

.tl-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  backdrop-filter: blur(8px);
}

.tl-item .when {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tl-item h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
  color: var(--text);
}

.tl-item p {
  margin: 0;
  font-size: 0.95rem;
}

/* ============ Media (Creative / demos) ============ */
.media-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.media-card .embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
}

.media-card .embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.media-card .meta {
  padding: 22px 24px;
}

.media-card .meta h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.media-card .meta p {
  margin: 0;
  font-size: 0.95rem;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
}

/* ============ Footer ============ */
footer.site-footer {
  position: relative;
  z-index: 1;
  background: var(--bg-overlay);
  border-top: 1px solid var(--border);
  padding: 64px 0 36px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-grid h4 {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
}

.footer-grid a {
  color: var(--text);
  display: block;
  padding: 4px 0;
  font-size: 0.95rem;
}

.footer-grid a:hover {
  color: var(--accent);
}

.footer-brand p {
  font-size: 0.95rem;
  margin-top: 12px;
  max-width: 360px;
}

.socials {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.social {
  /* 44×44 minimum touch target per WCAG 2.5.5 / Apple HIG. */
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.social:hover {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.35);
  color: var(--accent);
  transform: translateY(-2px);
}

.social svg {
  width: 18px;
  height: 18px;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-bottom a {
  color: var(--text-muted);
}

/* ============ Reveal on scroll ============
   Content is visible by default. Only when JS has hydrated the page
   (adds .js-reveal-ready to <html>) do we hide and then animate items
   into view. This guarantees the page is usable without JS too. */
.reveal {
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js-reveal-ready .reveal {
  opacity: 0;
  transform: translateY(24px);
}

.js-reveal-ready .reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal-ready .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ============ Article (blog post) ============ */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 40px;
}

.article .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.article .back-link:hover {
  color: var(--accent);
}

.article h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 12px;
}

.article .post-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.article img {
  border-radius: var(--radius);
  margin: 24px 0;
  border: 1px solid var(--border);
}

.article p {
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.4em;
  color: var(--text-muted);
}

.article h2,
.article h3 {
  margin-top: 1.6em;
  color: var(--text);
}

/* Blog index */
.blog-list {
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 24px;
  display: grid;
  gap: 20px;
}

.blog-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease;
  backdrop-filter: blur(8px);
}

.blog-card:hover {
  transform: translateY(-3px);
  border-color: rgba(74, 222, 128, 0.3);
}

.blog-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.blog-card h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
}

.blog-card .post-date {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-card p {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.blog-card .read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Legal pages */
.legal {
  max-width: 820px;
  margin: 0 auto;
  padding: 56px 24px 40px;
}

.legal h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  margin-bottom: 8px;
}

.legal .updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.legal section {
  padding: 0;
  margin-bottom: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  backdrop-filter: blur(8px);
}

.legal section h2 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.legal section h3 {
  font-size: 1.05rem;
  margin: 16px 0 8px;
  color: var(--text);
}

.legal section ul {
  padding-left: 20px;
  color: var(--text-muted);
}

.legal section li {
  margin-bottom: 6px;
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: rgba(7, 8, 13, 0.95);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .profile-card {
    position: static;
    max-width: 320px;
    margin: 0 auto;
  }

  .tl-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .blog-card {
    grid-template-columns: 1fr;
  }

  .demo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  section { padding: 64px 0; }
  .hero { padding: 48px 0 64px; min-height: auto; }
  .hero-stats { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ============================================================
   Print stylesheet — one-page resume render
   Strips canvas backgrounds, nav, scheduler iframe, demos,
   confetti, video facades, and Decode Rene game UI; reformats
   the hero + experience timeline as a clean printable resume.
   ============================================================ */
@media print {
  /* Force a light, ink-friendly palette. */
  html, body {
    background: #fff !important;
    color: #111 !important;
  }
  body::before, #bg, #confetti { display: none !important; }

  .nav, .nav-toggle, .sfx-toggle, .live-projects,
  #decode, #demos, #creative, #blog,
  .contact-cta, .scheduler-embed, .scheduler-fallback,
  .lite-yt, .lite-yt-fallback,
  .labubu-pill, .decode-section,
  .daily-quote, .hero-actions,
  iframe { display: none !important; }

  a { color: #111 !important; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.75em; color: #555; }
  a[href^="#"]::after, a[href^="mailto:"]::after { content: ""; }

  section { padding: 16px 0 !important; page-break-inside: avoid; }
  .container { max-width: none !important; padding: 0 !important; }

  .hero { min-height: auto !important; padding: 0 !important; display: block !important; }
  .hero h1 { font-size: 22pt !important; margin: 0 0 4pt; color: #111 !important; }
  .hero h1 .grad, .hero h1 button.grad-button {
    color: #111 !important; background: none !important;
    -webkit-text-fill-color: #111 !important;
    border: 0 !important; padding: 0 !important; font: inherit;
  }
  .hero .subtitle { font-size: 10pt !important; color: #333 !important; max-width: none; margin-bottom: 8pt; }
  .hero-pill { display: none !important; }
  .hero-stats { grid-template-columns: repeat(3, 1fr) !important; gap: 8pt !important; max-width: none !important; margin-bottom: 10pt; }
  .stat { background: none !important; border: 1px solid #999 !important; padding: 6pt 8pt !important; }
  .stat .num { color: #111 !important; background: none !important; -webkit-text-fill-color: #111 !important; font-size: 12pt !important; }
  .stat .label { color: #333 !important; font-size: 8pt !important; }

  /* About: keep text only, drop the sticky photo card. */
  .profile-card { display: none !important; }
  .about-grid { display: block !important; }
  .about-body p { font-size: 10pt !important; line-height: 1.4 !important; color: #222 !important; margin-bottom: 4pt; }
  section h2 { font-size: 13pt !important; margin: 8pt 0 4pt; color: #111 !important; border-bottom: 1px solid #999; padding-bottom: 2pt; }
  section .lede, section .eyebrow { font-size: 9pt !important; color: #444 !important; background: none !important; border: 0 !important; padding: 0 !important; margin: 0 0 4pt; }

  /* Timeline: collapse to single column for resume. */
  #experience .tl-item, .tl-item { grid-template-columns: 90pt 1fr !important; gap: 10pt !important; padding: 4pt 0 !important; border: 0 !important; page-break-inside: avoid; }
  .tl-item .when { font-size: 9pt !important; color: #555 !important; }
  .tl-item h3 { font-size: 10pt !important; margin: 0 0 2pt; color: #111 !important; }
  .tl-item p { font-size: 9pt !important; line-height: 1.35 !important; color: #222 !important; margin: 0; }

  /* Press / projects / podcasts: list-only, no cards. */
  .projects-grid, .demo-grid { display: block !important; }
  .project-card { background: none !important; border: 0 !important; box-shadow: none !important; padding: 4pt 0 !important; page-break-inside: avoid; }
  .project-media { display: none !important; }
  .project-body h3 { font-size: 10pt !important; margin: 0; color: #111 !important; }
  .project-body p { font-size: 9pt !important; color: #222 !important; margin: 2pt 0; }
  .badges, .badge { background: none !important; border: 0 !important; color: #555 !important; padding: 0 !important; font-size: 8pt !important; }

  footer.site-footer { background: none !important; border-top: 1px solid #999 !important; padding: 8pt 0 0 !important; }
  .footer-grid { display: block !important; margin: 0 !important; }
  .footer-grid h4 { font-size: 9pt !important; color: #444 !important; margin: 6pt 0 2pt; }
  .footer-grid a, .footer-brand p { color: #222 !important; font-size: 9pt !important; line-height: 1.3 !important; }
  .socials { display: none !important; }
  .footer-bottom { font-size: 8pt !important; color: #555 !important; border-top: 1px solid #ccc !important; }

  @page { margin: 0.5in; }
}

/* ============================================================
   Daily Quote pill (above hero pill)
   ============================================================ */
.daily-quote {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: var(--text);
  font-size: 0.85rem;
  margin-bottom: 14px;
  max-width: 560px;
}
.daily-quote .dq-text { flex: 1 1 220px; min-width: 0; }
.daily-quote .dq-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-3);
  background: rgba(167, 139, 250, 0.15);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.daily-quote .dq-text {
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ============================================================
   Floating SFX toggle
   ============================================================ */
/* Inline next to nav CTA */
.sfx-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  margin-right: 8px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.sfx-toggle:hover {
  border-color: rgba(74, 222, 128, 0.4);
  color: var(--accent);
}
.sfx-toggle.is-on { color: var(--accent); border-color: rgba(74, 222, 128, 0.5); }
.sfx-toggle .sfx-on { display: none; }
.sfx-toggle .sfx-off { display: block; }
.sfx-toggle.is-on .sfx-on { display: block; }
.sfx-toggle.is-on .sfx-off { display: none; }

/* ============================================================
   Hero stat counter pulse on update
   ============================================================ */
.stat .num.counting {
  animation: stat-pulse 0.4s ease;
}
@keyframes stat-pulse {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.4) drop-shadow(0 0 12px rgba(74,222,128,0.5)); }
  100% { filter: brightness(1); }
}

/* ============================================================
   Vibe-coder gradient text (interactive)
   ============================================================ */
.hero h1 .grad[data-decode-trigger] {
  cursor: pointer;
  transition: filter 0.2s ease;
  outline: none;
}
.hero h1 .grad[data-decode-trigger]:hover,
.hero h1 .grad[data-decode-trigger]:focus-visible {
  filter: brightness(1.15) drop-shadow(0 0 20px rgba(34, 211, 238, 0.4));
}
/* When the vibe-coder trigger is a real <button>, strip UA chrome so it
   visually matches the surrounding <h1> text. Keyboard focus still uses
   :focus-visible above. */
.hero h1 button.grad-button {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  cursor: pointer;
}
.hero h1 button.grad-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ============================================================
   Labubu pill in About profile card (clickable easter egg)
   ============================================================ */
.labubu-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.08);
  border: 1px dashed rgba(167, 139, 250, 0.4);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.labubu-pill:hover {
  background: rgba(167, 139, 250, 0.16);
  color: var(--text);
  border-color: rgba(167, 139, 250, 0.6);
}

/* About profile pic — make it feel interactive (decode trigger) */
.profile-pic[data-decode-trigger] {
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.profile-pic[data-decode-trigger]:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 30px rgba(167, 139, 250, 0.25);
}

/* ============================================================
   Speaking section subhead
   ============================================================ */
.subhead {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 32px 0 16px;
  letter-spacing: -0.01em;
}
.subhead:first-of-type { margin-top: 0; }

/* ============================================================
   Decode Rene section
   ============================================================ */
.decode-section .lede { margin-bottom: 32px; }

.decode-progress {
  margin-bottom: 28px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}
.decode-progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.decode-count-label {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}
.decode-count-label #decodeCount {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.3rem;
  margin-right: 4px;
}
.decode-reset {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.decode-reset:hover { color: var(--text); border-color: var(--border-strong); }
.decode-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  overflow: hidden;
}
.decode-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
}

/* Grid */
.decode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* Each card */
.decode-card {
  position: relative;
  padding-top: 133%; /* 3:4 aspect via padding hack — works even when grid auto-rows can't resolve aspect-ratio */
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
}
.decode-inner {
  position: absolute;
  inset: 0;
}
.decode-front,
.decode-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 18px 16px;
}

/* DEFAULT (with JS): silhouette + 3D flip on unlock. The <noscript> override
   in <head> short-circuits this so non-JS users see every back fully. */
.decode-card { perspective: 1000px; background: transparent; border: none; }
.decode-card .decode-inner {
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(.2,.7,.2,1);
}
.decode-card .decode-front,
.decode-card .decode-back {
  display: flex;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.decode-card .decode-back {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, rgba(74, 222, 128, 0.08), rgba(34, 211, 238, 0.06), rgba(167, 139, 250, 0.08));
  border-color: rgba(74, 222, 128, 0.35);
  box-shadow: inset 0 0 60px rgba(34, 211, 238, 0.06);
}
.decode-card.revealed .decode-inner { transform: rotateY(180deg); }
.decode-card.unlocking .decode-back { animation: decode-glow 0.9s ease; }
.decode-card.bonus { display: none; }
.decode-card.bonus.revealed { display: block; }
@keyframes decode-glow {
  0% { box-shadow: 0 0 0 rgba(74,222,128,0); }
  50% { box-shadow: 0 0 40px rgba(74,222,128,0.55), inset 0 0 60px rgba(34,211,238,0.2); }
  100% { box-shadow: inset 0 0 60px rgba(34, 211, 238, 0.06); }
}

/* Front (silhouette) */
.decode-silhouette {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: var(--surface-soft);
  border: 1px dashed var(--border-strong);
  color: var(--text-dim);
  margin-bottom: 12px;
}
.decode-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.4;
  max-width: 92%;
}
.decode-front .decode-locked {
  margin-top: 10px;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Back (revealed) */
.decode-emoji {
  font-size: 2.2rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}
.decode-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.decode-bio {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 8px;
}
.decode-source {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Bonus card highlight */
.gamified .decode-card.bonus .decode-back {
  border-color: rgba(167, 139, 250, 0.6);
  background: linear-gradient(160deg, rgba(167, 139, 250, 0.18), rgba(34, 211, 238, 0.08));
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.25), inset 0 0 60px rgba(167, 139, 250, 0.1);
}

/* Master profile reveal */
.decode-master {
  margin-top: 32px;
  padding: 32px;
  background: linear-gradient(160deg, rgba(74, 222, 128, 0.1), rgba(34, 211, 238, 0.06), rgba(167, 139, 250, 0.1));
  border: 1px solid rgba(74, 222, 128, 0.4);
  border-radius: var(--radius);
  text-align: center;
  animation: master-fade-in 0.8s ease;
}
.decode-master .badges {
  justify-content: center;
  margin-bottom: 14px;
}
.decode-master h3 {
  font-size: 1.6rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 12px;
}
.decode-master p {
  max-width: 720px;
  margin: 0 auto 20px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
}
@keyframes master-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

/* Share-your-decode CTA inside master reveal */
.decode-share {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px dashed rgba(74, 222, 128, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.decode-share-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.decode-share-time {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
  opacity: 0.85;
}
.decode-share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}
.decode-share-actions .btn {
  padding: 10px 16px;
  font-size: 0.9rem;
}
.decode-share-status {
  min-height: 1.2em;
  margin: 0;
  font-size: 0.85rem;
  color: var(--accent);
}

/* Confetti */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  font-size: 1.6rem;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(var(--dx, 0px), 110vh, 0) rotate(720deg); opacity: 0; }
}

/* Reduced motion: instant reveal without 3D rotation */
@media (prefers-reduced-motion: reduce) {
  .decode-card .decode-inner { transition: none; }
  .decode-card.revealed .decode-inner { transform: none; }
  .decode-card .decode-front { backface-visibility: visible; -webkit-backface-visibility: visible; }
  .decode-card .decode-back  { backface-visibility: visible; -webkit-backface-visibility: visible; transform: none; display: none; }
  .decode-card.revealed .decode-front { display: none; }
  .decode-card.revealed .decode-back { display: flex; }
  .decode-card.unlocking .decode-back { animation: none; }
  .confetti-piece { animation: none; display: none; }
  .stat .num.counting { animation: none; }
}

/* Responsive grid breakpoints for decode (desktop baseline = 3×4) */
@media (max-width: 900px) {
  .decode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .decode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decode-master { padding: 24px 20px; }
  .decode-master h3 { font-size: 1.3rem; }
  .daily-quote { font-size: 0.78rem; }
  .daily-quote .dq-label { font-size: 0.62rem; }
}
@media (max-width: 560px) {
  .decode-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Decode Rene — public stats page (decode-stats.html) + personal-best pill
   ========================================================================== */
.decode-stats-meta {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.decode-stats-section { padding-top: 24px; }
.decode-stats-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.decode-stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.decode-stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.decode-stat-value {
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(120deg, #4ade80, #22d3ee, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.decode-stat-sub { font-size: 0.85rem; color: var(--muted); }

.decode-leaderboard {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.decode-leaderboard-row {
  display: grid;
  grid-template-columns: 36px 28px 1fr 180px 60px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}
.decode-lb-rank { font-weight: 700; color: var(--muted); font-size: 0.9rem; }
.decode-lb-emoji { font-size: 1.2rem; }
.decode-lb-title { font-weight: 600; }
.decode-lb-bar {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.decode-lb-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4ade80, #22d3ee, #a78bfa);
  border-radius: 999px;
}
.decode-lb-count { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.decode-stats-empty {
  margin-top: 16px;
  padding: 28px 24px;
  text-align: center;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 16px;
}
.decode-stats-empty h3 { margin: 0 0 8px; }
.decode-stats-empty p { margin: 0; color: var(--muted); }

.decode-stats-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 32px;
}

/* "See live community stats →" link inside the share block */
.decode-share-stats-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.decode-share-stats-link:hover { text-decoration: underline; }

/* Personal-best pill */
.decode-share-pb {
  margin: 4px 0 0;
  padding: 8px 14px;
  font-size: 0.88rem;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.10);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: var(--text);
  max-width: 100%;
  text-align: center;
}

/* "See live stats →" link in the Decode section header */
.decode-section .decode-stats-header-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.decode-section .decode-stats-header-link:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .decode-stats-summary { grid-template-columns: 1fr; }
  .decode-leaderboard-row {
    grid-template-columns: 28px 24px 1fr 60px;
    grid-template-rows: auto auto;
  }
  .decode-lb-bar { grid-column: 1 / -1; }
}

/* ============ Case study pages ============ */
.case-hero {
  padding: 64px 0 24px;
  position: relative;
}
.case-hero .container { max-width: 880px; }
.case-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 18px;
}
.case-back:hover { color: var(--accent); }
.case-eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  padding: 5px 11px;
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.06);
}
.case-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}
.case-pitch {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 0 28px;
}
.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.case-meta .badge { font-size: 0.74rem; }
.case-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }

.case-media {
  margin: 28px auto 0;
  max-width: 880px;
  padding: 0 24px;
}
.case-media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  overflow: hidden;
}
.case-media-frame > iframe,
.case-media-frame > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

.case-body {
  padding: 48px 0 80px;
}
.case-body .container { max-width: 760px; }
.case-section { margin-bottom: 44px; }
.case-section h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.case-section h2::before {
  content: "";
  width: 4px;
  height: 22px;
  background: var(--gradient);
  border-radius: 3px;
  display: inline-block;
}
.case-section p { font-size: 1rem; line-height: 1.75; color: var(--text-muted); margin: 0 0 14px; }
.case-section ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.case-section ul li {
  position: relative;
  padding: 10px 0 10px 24px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
}
.case-section ul li:last-child { border-bottom: 0; }
.case-section ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 10px;
  color: var(--accent);
  font-weight: 700;
}
.case-section ul li strong { color: var(--text); }

.case-press-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.case-press-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.case-press-list a:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.case-press-list .case-press-outlet {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  flex: 0 0 auto;
}

.case-cta-card {
  margin-top: 56px;
  padding: 28px;
  background: var(--gradient-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
}
.case-cta-card h3 { margin: 0 0 8px; font-size: 1.25rem; }
.case-cta-card p { margin: 0 0 16px; }

@media (max-width: 720px) {
  .case-hero { padding-top: 40px; }
  .case-body { padding-top: 32px; }
  .case-press-list a { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ============================================================
   Theme toggle (sun/moon swap, lives in nav next to SFX toggle)
   ============================================================ */
.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  margin-right: 8px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}
.theme-toggle:hover {
  border-color: rgba(74, 222, 128, 0.4);
  color: var(--accent);
  transform: translateY(-1px);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
/* Show the icon for the *target* theme: dark → show sun (click to lighten),
   light → show moon (click to darken). Default state is dark, hide both
   until JS sets data-theme to avoid a brief double-icon flash. */
.theme-toggle .theme-sun,
.theme-toggle .theme-moon { display: none; }
html[data-theme="dark"]  .theme-toggle .theme-sun  { display: block; }
html[data-theme="light"] .theme-toggle .theme-moon { display: block; }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-toggle:hover { transition: none; transform: none; }
}

/* Light-mode polish: Three.js canvas already dims via --bg-canvas-opacity.
   Soften the body radial-gradient overlays so the page reads as light. */
html[data-theme="light"] body::before {
  background:
    radial-gradient(800px 500px at 10% 0%, rgba(21, 128, 61, 0.06), transparent 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(14, 116, 144, 0.05), transparent 60%),
    radial-gradient(700px 500px at 50% 100%, rgba(109, 40, 217, 0.05), transparent 60%);
}
/* Light-mode glass cards need a stronger backdrop or they read flat
   over the brightened canvas. */
html[data-theme="light"] .stat,
html[data-theme="light"] .profile-card,
html[data-theme="light"] .project-card,
html[data-theme="light"] .decode-card .decode-front,
html[data-theme="light"] .decode-card .decode-back {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -16px rgba(15, 23, 42, 0.18);
}
