* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a {
  cursor: none; /* custom cursor (cursor.js) takes over — see 'link' state */
}

/* ============================================
   Design Tokens (fallback — tokens.js is source of truth)
   ============================================ */
:root {
  /* Colors — synced from Pencil design system */
  --color-bg:          #FFFFFF;
  --color-bg-scroll:   #FFFFFF;
  --color-text:        #111111;
  --color-muted:       #666666;
  --color-accent:      #C8FF00;
  --color-highlight:   #C8FF00;
  --color-white:       #FFFFFF;
  --color-black:       #000000;
  --color-border:      #CBCCC9;
  --color-shadow:      rgba(0, 0, 0, 0.08);
  --color-card:        #FFFFFF;
  --color-secondary:   #E7E8E5;
  --color-destructive: #FF5C33;

  /* Fonts */
  --font-display:      'Instrument Sans', sans-serif;
  --font-body:         'Instrument Sans', sans-serif;
  --font-mono:         'VCR OSD Mono', monospace;
  --font-code:         'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-xxl: 4rem;

  /* Border radius */
  --radius-none: 0;
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow:   0.6s ease;
}

/* ============================================
   Base
   ============================================ */
html {
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%; /* was none — blocked iOS text enlargement (WCAG 1.4.4) */
  line-height: 1.7;
}

/* Background overlay for scroll transitions */
#bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg-scroll);
  opacity: 0;
  z-index: -2;
  pointer-events: none;
}

/* p5.js canvas container */
#p5-container {
  position: fixed;
  /* Was `top:0; height:100%; clip-path: inset(header 0 0 0)` — clip-path
     forces its own compositing layer in Chromium, which silently breaks
     mix-blend-mode on other elements elsewhere on the page (see .hero).
     Sizing/positioning the box itself + overflow:hidden achieves the same
     "nothing shows above the header" result without that side effect. */
  top: var(--header-h, 60px);
  left: 0;
  width: 100%;
  height: calc(100% - var(--header-h, 60px));
  overflow: hidden;
  z-index: 1;
  pointer-events: auto;
}

#p5-container.faded {
  pointer-events: none;
}

#p5-container canvas {
  display: block;
  /* p5's per-frame clear() leaves the canvas transparent at the pixel
     level, which browsers can composite ambiguously under mix-blend-mode
     (see .hero). An opaque backing color removes that ambiguity — it
     sits behind whatever p5 draws, so it's invisible in practice. */
  background: #FFFFFF;
}

/* ============================================
   Accessibility (WCAG 2.2 AA)
   ============================================ */
/* Visible keyboard focus — dark ring, 3:1+ against every background here */
:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
}

/* Inside the clipped, scrolling hero strip an outer ring would be cut off */
.hero-strip__item:focus-visible {
  outline-offset: -3px;
}

/* Skip link — hidden until focused with the keyboard */
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10000;
  padding: 10px 16px;
  background: var(--color-text);
  color: var(--color-bg);
  font-family: var(--font-display);
  font-size: 15px;
}

.skip-link:focus {
  top: 16px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   Navigation
   ============================================ */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: clamp(var(--space-md), 3vw, var(--space-lg)) clamp(var(--space-md), 4vw, var(--space-xl));
  z-index: 100;
  background: transparent;
  transition: background var(--transition-normal);
}

header.scrolled {
  background: var(--color-bg-scroll-alpha);
  backdrop-filter: blur(10px);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.logo {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: clamp(0.875rem, 2vw, 1rem);
  color: var(--color-text);
  text-decoration: none; /* a link on sub-pages (about, sandbox), a div on home */
}

.nav-links {
  display: flex;
  gap: clamp(var(--space-md), 3vw, var(--space-xl));
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--color-text);
  text-decoration: none;
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  transition: opacity var(--transition-normal);
}

.nav-links a:hover {
  opacity: 0.5;
}

/* ============================================
   Hero
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(var(--space-md), 4vw, var(--space-xl));
  position: relative;
  z-index: 2;
  pointer-events: none;
  /* Blend the whole text layer, as one group, against whatever is
     painted behind .hero (the p5 canvas / page). Setting this on the
     individual text elements instead would trap the blend inside
     .hero's own (transparent) stacking context and do nothing. */
  mix-blend-mode: difference;
}

.hero-greeting {
  pointer-events: auto;
  position: relative;
  z-index: 3;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: #FFFFFF;
  font-weight: 400;
  text-align: center;
  margin-bottom: clamp(var(--space-xs), 1vw, var(--space-sm));
}

/* Title bezier effect canvas */
#title-effect-container {
  width: 90vw;
  max-width: 2000px;
  height: 1vh;
  min-height: 80px;
  pointer-events: auto;
  padding-left: 1%;
  padding-right: 1%;
}

#title-effect-container canvas {
  display: block;
}

.hero-title {
  pointer-events: auto;
  position: relative;
  z-index: 3;
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 6vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #FFFFFF;
  text-align: center;
  max-width: 60rem;
  margin: 0;
}

.hero-title .letter {
  display: inline-block;
  transform-origin: center center;
  will-change: transform;
}

.hero-subtitle {
  pointer-events: auto;
  position: relative;
  z-index: 3;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 2rem);
  color: #FFFFFF;
  margin-top: clamp(var(--space-sm), 2vw, var(--space-md));
  margin-bottom: clamp(var(--space-lg), 1vw, 3rem);
  font-weight: 400;
  text-align: center;
  max-width: 60rem;
  line-height: 1.45;
}

.hero-subtitle .keyword {
  font-style: italic;
  text-decoration: none;
  color: #FFFFFF;
  cursor: pointer;
  transition: color var(--transition-fast);
}

/* Pre-inverted so that, after this element's `difference` blend against a
   white backdrop, it displays as the actual --color-accent lime (#C8FF00).
   difference(white, source) = lime  =>  source = white - lime = #3700FF */
.hero-subtitle .keyword:hover,
.hero-subtitle .keyword:focus-visible {
  color: #3700FF;
}

/* Hero strip — mobile stand-in for the p5 floating thumbnails
   (scripts/hero_strip.js). Hidden on desktop; shown in the Mobile block. */
.hero-strip {
  display: none;
  pointer-events: auto; /* .hero itself is pointer-events: none */
  width: 100vw;
  margin-top: var(--space-lg);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* Soft fade at both edges so items drift in/out rather than clip */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.hero-strip::-webkit-scrollbar {
  display: none;
}

.hero-strip__track {
  display: flex;
  gap: 8px; /* gallery gap */
  width: max-content;
}

.hero-strip__item {
  position: relative;
  flex-shrink: 0;
  height: clamp(150px, 46vw, 220px);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-secondary);
}

.hero-strip__item img,
.hero-strip__item video {
  display: block;
  height: 100%;
  width: auto;
  max-width: 75vw;
  object-fit: cover;
}

.hero-strip__label {
  position: absolute;
  left: var(--space-sm);
  bottom: var(--space-sm);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4.6px);
  -webkit-backdrop-filter: blur(4.6px);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text);
  white-space: nowrap;
}

/* ============================================
   Projects Section
   ============================================ */
.projects-section {
  min-height: 100vh;
  padding: clamp(var(--space-xxl), 10vw, 8rem) clamp(var(--space-md), 4vw, var(--space-xl));
  padding-top: max(7rem, 10vw);
  position: relative;
  background: transparent;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.021em;
  line-height: 1;
  margin-bottom: clamp(var(--space-xl), 5vw, var(--space-xxl));
  text-align: center;
}

/* Project Grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(var(--space-md), 3vw, var(--space-xl));
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  padding: clamp(1rem, 2vw, var(--space-lg));
  border-radius: var(--radius-sm);
  background: var(--color-card);
  transition: all var(--transition-normal);
  text-decoration: none;
  color: inherit;
}

.project-card__bg,
.project-card__bg-overlay {
  position: absolute;
  inset: -8%;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.project-card__bg {
  background-image: var(--card-image, none);
  background-size: cover;
  background-position: center;
  filter: blur(8px);
}

.project-card__bg-overlay {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
}

.project-card__accent-dot {
  position: absolute;
  left: clamp(1rem, 2vw, var(--space-lg));
  bottom: clamp(1rem, 2vw, var(--space-lg));
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
  pointer-events: none;
}

.project-card__meta,
.project-card h3,
.project-card p,
.project-card__cta {
  position: relative;
  z-index: 1;
}

.project-card__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.project-card__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.tag-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-secondary);
  color: var(--color-text);
  white-space: nowrap;
}

.project-card__date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-muted);
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
}

.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.project-card p {
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: var(--space-md);
  flex-grow: 1;
}

.project-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-end;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-muted);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: none; /* custom cursor (cursor.js) takes over — see 'link' state */
  transition: color var(--transition-fast);
}

.project-card__cta-arrow {
  position: relative;
  color: var(--color-text);
  font-size: 20px;
  line-height: 1;
}

/* Hover states only where a real hover exists — on touch, :hover sticks
   after a tap and leaves the card half-transformed. */
@media (hover: hover) {
  .project-card:hover {
    border-color: transparent;
    box-shadow: var(--shadow-md);
  }

  .project-card--has-image:hover .project-card__bg,
  .project-card--has-image:hover .project-card__bg-overlay {
    opacity: 1;
  }

  .project-card--has-image:hover .project-card__accent-dot {
    opacity: 1;
    transform: scale(1);
  }

  .project-card:hover .project-card__cta {
    color: var(--color-text);
  }

  .project-card:hover .project-card__cta-arrow {
    color: transparent;
  }

  .project-card:hover .project-card__cta-arrow::after {
    content: "☞";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-text);
  }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-text);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text);
  text-decoration: none;
  cursor: none; /* custom cursor (cursor.js) takes over — see 'link' state */
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.btn:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

.btn-accent {
  border-color: var(--color-accent);
  color: var(--color-text);
}

.btn-accent:hover {
  background: var(--color-accent);
  color: var(--color-text);
}

.btn-sm {
  font-size: clamp(0.7rem, 1.2vw, 0.8rem);
  padding: var(--space-xs) var(--space-sm);
}

.btn-lg {
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  padding: var(--space-md) var(--space-lg);
}

/* ============================================
   Sandbox Section (Playdate style — playdate_style.pen)
   ============================================ */
.sandbox-section {
  --paper: #E8E4D0;
  --paper-mid: #D6D2BE;
  --paper-light: #F0EDE2;
  --ink: #1D1D1B;
  --bezel: #111111;
  --font-pixel: 'Silkscreen', monospace;
  --font-sandbox-mono: 'Space Mono', monospace;
  --color-muted: #555555; /* #666 is only ~4.3:1 on the beige "paper" — WCAG AA needs 4.5 */

  padding: clamp(var(--space-xxl), 8vw, 6rem) clamp(var(--space-md), 4vw, var(--space-xl)) 0;
}

.sandbox-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  max-width: 1320px;
  margin: 0 auto;
  padding-bottom: var(--space-xl);
}

.sandbox-kicker {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.mini-device {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--bezel);
  border-radius: 5px;
  flex-shrink: 0;
}

.mini-device__screen {
  position: absolute;
  top: 4px;
  left: 7px;
  width: 22px;
  height: 18px;
  background: var(--paper);
  border-radius: 2px;
}

.mini-device__crank {
  position: absolute;
  top: 7px;
  left: 38px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper-mid);
}

.sandbox-kicker__tag {
  font-family: var(--font-sandbox-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2.5px;
  color: var(--color-muted);
}

.sandbox-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.625rem);
  font-weight: 400;
  color: var(--color-text);
}

.sandbox-subtitle {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.5;
  color: var(--color-muted);
  max-width: 600px;
}

.sandbox-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  max-width: 1320px;
  margin: 0 auto;
}

/* Playdate device */
.playdate {
  display: flex;
  gap: 0;
  padding: 6px;
  width: 100%;
  background: var(--bezel);
  border-radius: 24px;
}

.playdate__screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 32px 24px;
  background: var(--paper);
  border-radius: 20px;
  overflow: hidden;
}

.playdate__status-bar {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--ink);
}

.playdate__menu-title {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 2vw, 1.375rem);
  font-weight: 400;
  color: var(--ink);
  margin: 0;
}

.playdate__divider {
  height: 2px;
  background: var(--ink);
}

.playdate__scroll-area {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.entry-list {
  list-style: none;
  flex: 1;
  margin: 0;
  padding: 0;
}

.entry-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 12px;
  border-radius: 4px;
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--ink);
  cursor: none;
}

.entry-row__cursor {
  width: 1em;
}

.entry-row__spacer {
  flex: 1;
  height: 1px;
}

.entry-row__date {
  font-size: 10px;
  color: var(--color-muted);
}

.entry-row--active {
  background: var(--ink);
  color: var(--paper);
}

.entry-row--active .entry-row__date {
  color: var(--paper-mid);
}

.scroll-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.sandbox-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--paper-mid);
}

.sandbox-dot--active {
  width: 6px;
  height: 6px;
  background: var(--ink);
}

.playdate__bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.playdate__controls {
  display: flex;
  gap: var(--space-lg);
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--ink);
}

.playdate__entry-count {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--color-muted);
}

.playdate__crank {
  width: 28px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.playdate__crank-body {
  width: 16px;
  height: 60px;
  border-radius: 8px;
  background: var(--paper-mid);
}

.playdate__crank-knob {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper-mid);
  outline: 2px solid var(--paper);
  outline-offset: -1px;
}

/* Dither dividers */
.dither-strip {
  height: 8px;
  background: var(--ink);
}

.dither-checker {
  height: 4px;
  background: repeating-linear-gradient(to right, var(--ink) 0 4px, #FFFFFF 4px 8px);
}

/* Experiment cards */
.experiments {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.experiments__label {
  font-family: var(--font-sandbox-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2.5px;
  color: var(--color-muted);
}

.experiments-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.experiment-card {
  padding: 4px;
  background: var(--bezel);
  border-radius: 16px;
}

.experiment-card__inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-sm);
  height: 280px;
  padding: 20px 20px 16px;
  background: var(--paper);
  border-radius: 13px;
  overflow: hidden;
}

.experiment-card__top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.experiment-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.experiment-card__badge {
  padding: 3px 8px;
  background: var(--ink);
  border-radius: 2px;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--paper);
}

.experiment-card__date {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--color-muted);
}

.experiment-card__title {
  font-family: var(--font-pixel);
  font-size: 18px;
  line-height: 23px;
  font-weight: 400;
  color: var(--ink);
  margin: 0;
}

.experiment-card__desc {
  font-family: var(--font-sandbox-mono);
  font-size: 11px;
  line-height: 17px;
  color: var(--color-muted);
}

.experiment-card__preview {
  position: relative;
  flex-shrink: 0;
  height: 56px;
  background: var(--paper-light);
  border-radius: 4px;
  overflow: hidden;
}

.experiment-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.experiment-card__readmore {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--ink);
  cursor: none;
}

.experiment-card__dots {
  display: flex;
  gap: 4px;
}

/* Preview pattern variants */
.preview-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
}

.experiment-card__preview--wave {
  background-image:
    repeating-linear-gradient(to right, var(--paper-mid) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(to bottom, var(--paper-mid) 0 1px, transparent 1px 14px);
}

.experiment-card__preview--buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
}

.preview-btn {
  width: 12%;
  height: 40px;
  border-radius: 3px;
  background: var(--paper-mid);
}

.preview-btn--active {
  background: var(--ink);
}

.experiment-card__preview--shader {
  background-image: repeating-linear-gradient(45deg, var(--ink) 0 6px, var(--paper-light) 6px 16px);
}

.preview-shader-core {
  position: absolute;
  top: 4px;
  left: 110px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--paper-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-shader-core::after {
  content: '';
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
}

.experiment-card__preview--type {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-pixel);
  font-size: 32px;
  color: var(--ink);
}

.experiment-card__preview--bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3px;
  padding: 4px 8px;
}

.preview-bar {
  flex: 1;
  background: var(--ink);
  border-radius: 1px;
}

.sandbox-footer {
  display: flex;
  justify-content: space-between;
  padding: var(--space-lg) 0;
  max-width: 1320px;
  margin: 0 auto;
  font-family: var(--font-sandbox-mono);
  font-size: 12px;
  color: var(--color-muted);
}

/* ============================================
   About Page (about.html)
   ============================================ */
/* Solid header — the fixed transparent one is designed for the home hero */
.about-page header {
  background: var(--color-bg);
}

.about {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--header-h, 80px) + var(--space-xxl)) clamp(var(--space-md), 4vw, var(--space-xl)) var(--space-xxl);
}

.about-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--color-muted);
  margin-bottom: var(--space-md);
}

.about-name {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 6vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.about-role {
  font-family: var(--font-display);
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: var(--color-muted);
  margin-top: var(--space-sm);
}

.about-bio {
  margin-top: var(--space-xl);
}

.about-bio p {
  font-size: 17px;
  line-height: 1.7;
}

.about-bio p + p {
  margin-top: var(--space-md);
}

.about-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

.about-timeline {
  margin-top: 80px;
}

/* Vertical timeline — a 1px rail on the left with a dot per entry */
.timeline {
  --rail-x: 6px;
  list-style: none;
  position: relative;
  padding-left: var(--space-xl);
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  bottom: 0.75rem;
  left: var(--rail-x);
  width: 1px;
  background: var(--color-border);
}

.timeline__year {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1;
  margin: var(--space-xl) 0 var(--space-md);
}

.timeline__year:first-child {
  margin-top: 0;
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-lg);
}

/* Rail dot — role: filled, education: outlined, project: accent, award: accent outlined */
.timeline__item::before {
  content: '';
  position: absolute;
  top: 0.35rem;
  left: calc(var(--rail-x) - var(--space-xl) - 5px);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--color-text);
  border: 1.5px solid var(--color-text);
}

.timeline__item[data-type="education"]::before {
  background: var(--color-bg);
}

.timeline__item[data-type="project"]::before {
  background: var(--color-accent);
}

.timeline__item[data-type="award"]::before {
  background: var(--color-bg);
  border-color: var(--color-text);
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.timeline__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-xs);
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--color-muted);
}

.timeline__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
}

.timeline__org {
  font-size: 15px;
  color: var(--color-muted);
  line-height: 1.6;
}

.timeline__desc {
  font-size: 15px;
  line-height: 1.6;
  margin-top: var(--space-xs);
}

.timeline__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.timeline__arrow {
  display: inline-block;
  transition: transform var(--transition-fast);
}

@media (hover: hover) {
  .timeline__link:hover .timeline__title {
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
  }

  .timeline__link:hover .timeline__arrow {
    transform: translateX(4px);
  }
}

@media (max-width: 700px) {
  .about {
    padding-top: calc(var(--header-h, 90px) + var(--space-xl));
  }

  .about-bio p {
    font-size: 14px;
    line-height: 1.65;
  }

  .about-timeline {
    margin-top: var(--space-xxl);
  }

  .timeline {
    padding-left: var(--space-lg);
  }

  .timeline__item::before {
    left: calc(var(--rail-x) - var(--space-lg) - 5px);
  }

  .timeline__desc,
  .timeline__org {
    font-size: 14px;
  }
}

/* ============================================
   Footer
   ============================================ */
footer {
  padding: clamp(var(--space-md), 3vw, var(--space-xl));
  text-align: center;
  font-size: clamp(0.75rem, 1.5vw, 0.85rem);
  color: var(--color-muted);
}

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 700px) {
  /* No p5 canvas on mobile (scripts/script.js skips it) — the strip
     below the hero text takes its place. */
  #p5-container {
    display: none;
  }

  .hero {
    min-height: 100svh;
    justify-content: center;
    padding-top: calc(var(--header-h, 90px) + var(--space-md));
    padding-bottom: var(--space-xl);
    mix-blend-mode: normal; /* the difference blend only works over the canvas */
  }

  .hero-greeting,
  .hero-title,
  .hero-subtitle,
  .hero-subtitle .keyword {
    color: var(--color-text);
  }

  .hero-subtitle {
    font-size: 17px;
    margin-bottom: 0;
  }

  /* Accent highlighter instead of the desktop hover color swap — no hover
     on touch, so the keywords need to look tappable up front */
  .hero-subtitle .keyword {
    background: linear-gradient(transparent 62%, var(--color-accent) 62%);
  }

  .hero-subtitle .keyword:hover {
    color: var(--color-text);
  }

  .hero-strip {
    display: block;
  }

  .projects-section {
    padding-top: var(--space-xxl);
  }

  nav {
    justify-content: center;
  }

  .logo {
    width: 100%;
    text-align: center;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
  }

  .hero-greeting,
  .hero-title,
  .hero-subtitle {
    padding: 0 var(--space-md);
  }

  .playdate {
    flex-direction: column;
    border-radius: 20px;
  }

  .playdate__crank {
    width: 100%;
    flex-direction: row;
    padding: 8px 0 0;
  }

  .playdate__crank-body {
    width: 60px;
    height: 16px;
  }

  .entry-row {
    font-size: 11px;
  }

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

  .sandbox-footer {
    flex-direction: column;
    gap: var(--space-xs);
    text-align: center;
  }
}
