:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #6b6b6b;
  --line: #ececec;
  --card: #ffffff;
  /* Brand colour: the taupe of the sweater in the hero photo (sampled ~#72625d).
     --shirt is the accent itself; --accent fills solid buttons (white text);
     --accent-ink is text on a light shirt tint. Dark mode lightens them. */
  --shirt: #72625d;
  --accent: #72625d;
  --accent-ink: #4f423e;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --sans: "Poppins", system-ui, -apple-system, sans-serif;
  --serif: "Prata", Georgia, serif;
  /* Fonts for the sections below the hero (Projects → footer). The nav and
     hero keep Poppins. --section-serif is the section-title font. */
  --section-sans: "Inter", system-ui, -apple-system, sans-serif;
  --section-serif: "Inter Tight", "Inter", system-ui, sans-serif;
  --section-title-weight: 700;
}

/* Dark theme. The inline script in <head> sets data-theme from the saved
   choice, or from the system setting when nothing is saved. */
:root[data-theme="dark"] {
  --bg: #0e0e10;
  --text: #f2f2f2;
  --muted: #a0a0a6;
  --line: #26262a;
  --card: #18181b;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shirt: #b5a39c;
  --accent: #7d6b65;
  --accent-ink: #dccfc9;
  color-scheme: dark;
}
[data-theme="dark"] .badge { filter: invert(1); }
[data-theme="dark"] .arrow { background: rgba(255, 255, 255, 0.12); }
[data-theme="dark"] .arrow img { filter: none; }   /* icon file is white */
body { transition: background-color .3s, color .3s; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
/* Touch: no grey rectangle flashing over rounded buttons and links when tapped;
   each control shows its own pressed state instead. */
a, button { -webkit-tap-highlight-color: transparent; }
.btn:active, .gh:active, .menu-toggle:active, .theme-toggle:active { opacity: .75; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-avatar { flex-shrink: 0; }
.nav-avatar img { height: 36px; width: auto; }
.nav nav { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.theme-toggle {
  margin-left: auto; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  transition: transform .2s, background-color .3s;
}
.theme-toggle:hover { transform: rotate(-15deg) scale(1.05); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
.nav nav a {
  text-decoration: none; font-weight: 500; font-size: 14px; white-space: nowrap;
  padding: 12px 0; /* 45px tall tap target */
  transition: opacity .2s;
}
.nav nav a:hover { opacity: .6; }

/* Menu button (phones only): three lines that turn into an X when open */
.menu-toggle {
  display: none; flex-shrink: 0; position: relative;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
.menu-toggle span {
  position: absolute; left: 13px; width: 16px; height: 2px; border-radius: 2px;
  background: currentColor; transition: transform .3s ease, opacity .2s ease;
}
.menu-toggle span:nth-child(1) { top: 15px; }
.menu-toggle span:nth-child(2) { top: 20.5px; }
.menu-toggle span:nth-child(3) { top: 26px; }
.nav.open .menu-toggle span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav.open .menu-toggle span:nth-child(2) { opacity: 0; }
.nav.open .menu-toggle span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Hero */
/* bottom padding = a section's padding, so the gap into Projects matches the gaps between sections */
.hero { max-width: 1200px; margin: 0 auto; padding: 16px 16px 48px; text-align: center; }
.hero-photo {
  /* Full width on phones and iPad. The height is a share of the width so a wide
     frame still has room for the head; the hero script in script.js places the
     eyes on the top third line without cutting off the hair. */
  width: 100%; height: min(60vh, 600px, calc((100vw - 32px) * 0.8));
  object-fit: cover; object-position: 50% 38%;
  border-radius: 20px;
  /* quiet hairline edge; a shadow ring doesn't change the photo's size */
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent);
}
.hero-copy { margin-top: 24px; font-weight: 600; letter-spacing: -0.04em; }
.hero-line { font-size: clamp(18px, 2.4vw, 24px); font-weight: 600; line-height: 1.3; }
.hero-line strong { font-weight: 700; }
.hero h1 { font-size: clamp(44px, 7vw, 72px); line-height: 1.1; font-weight: 700; }
/* "animations" wordmark (components/animations-word.js) + the line under it */
/* The top ~half of the wordmark is empty sky for the ball's arc. Pull the word up
   into it (0.19 x its width) so the letters sit close to the line above; the ball
   then flies over that text, drawn on top of it. */
.hero-word {
  --w: min(385px, calc((100vw - 32px) * 0.88));
  width: var(--w); margin: calc(var(--w) * -0.19) auto 0;
  position: relative; z-index: 1; pointer-events: none;
  color: var(--text);
  --animations-accent: var(--shirt);   /* colour the ball and the "t" turn mid-loop */
}

/* Desktop (photo and intro side by side): left-aligned intro.
   iPad and phones, where the intro sits under the photo, stay centered. */
@media (min-width: 1000px) {
  .hero-text { text-align: left; }
  .hero-text .hero-word { margin-left: calc(var(--w) * -0.007); } /* cancel the "a"'s side bearing */
  .hero-text .cta-row { justify-content: flex-start; }
}
/* Same size as the other hero lines ("plus a keen passion for micro"), and the
   same visual gap below "animations" as between those lines (~0.52em from one
   line's baseline to the next line's ascenders). The 3px offsets the empty
   strip under the wordmark's letters. */
.hero-sub {
  font-size: clamp(18px, 2.4vw, 24px); font-weight: 600; letter-spacing: -0.04em;
  line-height: 1.3; margin-top: calc(0.3em - 3px);
}

/* Wide screens: photo and text side by side so the intro and the
   Email button fit in the first screen */
@media (min-width: 1000px) {
  .hero {
    display: grid; grid-template-columns: 1.1fr 1fr; align-items: center;
    column-gap: 48px; padding-top: 24px;
  }
  .hero-photo { height: min(calc(100vh - 120px), 640px, 60vw); }
  .hero-copy { margin-top: 0; }
  .hero-word { --w: 347px; }
  }

/* Buttons: one primary (filled purple) and one secondary (outline) style */
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.hero .cta-row { margin-top: 32px; } /* breathing room under the wordmark */
.btn, .gh {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 24px; border-radius: 12px;
  font: 600 15px/1.2 var(--sans); text-decoration: none;
  transition: transform .15s, filter .15s, background-color .2s, color .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary, .gh { background: var(--accent); color: #fff; }
.btn-primary:hover, .gh:hover { transform: translateY(-1px); filter: brightness(1.1); }
/* Hero Email button: a light tint of the shirt colour with deeper shirt-toned
   text and border (both themes follow the --shirt / --accent-ink tokens). */
.hero .btn-primary {
  background: color-mix(in srgb, var(--shirt) 14%, var(--card));
  color: var(--accent-ink);
  border: 1.5px solid color-mix(in srgb, var(--shirt) 45%, var(--card));
}
.hero .btn-primary:hover { background: color-mix(in srgb, var(--shirt) 22%, var(--card)); filter: none; }

/* Sections */
/* Section rhythm: 48px above and below each section, so sections sit 96px apart
   (36px from a title to its content); phones use 36px, i.e. 72px apart. The hero
   and footer use the same values so every gap on the page matches. */
.section { max-width: 1000px; margin: 0 auto; padding: 48px 16px; text-align: center; }
/* Section titles: all caps, bold, evenly tracked (Inter at 700; capitals
   need wide letter-spacing to read cleanly at this size) */
.section h2 {
  font-family: var(--sans); font-weight: 700;
  font-size: 20px; line-height: 1.2; margin-bottom: 36px;
  text-transform: uppercase; letter-spacing: .26em;
  margin-right: -.26em;   /* cancel the trailing letter-space so it stays centred */
}

/* Carousel */
.carousel { position: relative; }
.track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; outline: none;
}
.track::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 100%; scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 0 56px;
}
.slide h3 { font-size: 32px; font-weight: 700; }
.slide p { color: var(--text); max-width: 36ch; text-wrap: balance; }   /* card text is all the primary colour */
.badge { width: 120px; }
.gh img { width: 18px; height: 18px; }

.device { position: relative; margin-top: 10px; }
.device .frame { position: relative; z-index: 1; width: 100%; pointer-events: none; }
.device .screen { position: absolute; object-fit: cover; }
.phone { width: min(300px, 70vw); }
.device .frame { height: 100%; object-fit: contain; }
.phone .screen { left: 5.2%; top: 2.4%; width: 89.6%; height: 95.2%; border-radius: 13% / 6%; }
.watch { width: min(300px, 70vw); }
.watch .screen { left: 14%; top: 21.5%; width: 72%; height: 56.5%; border-radius: 16%; }
/* iPad: the recording is 3:4 and the screen a little taller, so the video is
   fitted to the width from the top and the strip left below is filled with the
   app's own background colour, rather than cropping the sides. */
.ipad .screen {
  /* a few pixels larger than the frame's screen opening on every side, so the
     bezel's soft inner edge lands on the video and no light hairline shows
     round a dark frame; the strip below the video is always off the card */
  left: 5.2%; top: 3.9%; width: 89.6%; height: 92.2%; border-radius: 4.4% / 3.1%;
  object-fit: contain; object-position: top; background: #000;
}

.arrow {
  position: absolute; top: 50%; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0, 0, 0, 0.08); display: grid; place-items: center;
  transition: background .2s;
}
.arrow:hover { background: rgba(0, 0, 0, 0.16); }
/* The icon file is mostly padding (a 40px box around a small chevron), so it's
   shown at full size to give a ~15px chevron. White file -> dark in light mode. */
.arrow img { width: 40px; filter: invert(1); }
.prev { left: 0; }
.next { right: 0; }

/* Page dots: quiet, no backing pill. The active dot takes the colour of the
   card on screen (--dot is set from that card's --tint in script.js). */
.dots {
  display: inline-flex; margin-top: 16px;
}
/* 24×32px tap area around a 6px dot */
.dots button {
  width: 24px; height: 32px; border: none; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.dots button::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--text); opacity: .18; transition: opacity .15s, transform .15s, background-color .15s;
}
.dots button[aria-selected="true"]::before { background: var(--dot, var(--text)); opacity: 1; transform: scale(1.25); }

.slide-text { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* Snap wrappers only matter in the phone/iPad carousel; on desktop the cards
   are the grid items themselves. */
.snap { display: contents; }

/* Phones and iPad: the carousel shows the same tinted cards as the desktop
   grid. Each card is a little narrower than the screen so the previous and
   next cards peek in at the sides. Swiping snaps one card at a time; the side
   cards are slightly smaller and blurred, and scale up and sharpen as they
   slide into the centre. --ap (distance from the centre: 0 centred, 1 one card
   away) is set in script.js. */
@media (max-width: 899px) {
  .carousel { --cw: min(84vw, 540px); }
  .track {
    position: relative; gap: 8px; margin: 0 -16px; scroll-snap-type: x mandatory;
    padding: 4px calc(50vw - var(--cw) / 2) 8px;
  }
  /* Each card sits in a plain wrapper that does the snapping: browsers measure
     snap points from the transformed box, so the 3D card itself can't be the
     snap target or swipes would land off-centre. */
  .track .snap {
    flex: 0 0 var(--cw); min-width: 0; display: flex;
    scroll-snap-align: center; scroll-snap-stop: always;   /* one project per swipe */
  }
  .track .slide {
    flex: 1; min-width: 0; position: relative; overflow: hidden; scroll-snap-align: none;
    /* side cards sit a little smaller and grow to full size as they reach the centre */
    transform: scale(calc(1 - var(--ap, 0) * .05));
    filter: blur(calc(var(--ap, 0) * 5px));
    opacity: calc(1 - var(--ap, 0) * .25);
    will-change: transform, filter;
    padding: 28px 20px 0; border-radius: 24px; gap: 14px;
    background: color-mix(in srgb, var(--tint) 12%, var(--card));
    border: 1px solid color-mix(in srgb, var(--tint) 18%, transparent);
  }
  .track .slide h3 { font-size: 23px; }
  /* the device runs off the bottom of the card, like on desktop */
  /* devices scale with the card; percentages here are of the card's width */
  .track .phone { width: min(250px, 84%); margin: 4px auto -46%; }
  .track .watch { width: min(250px, 84%); margin: 4px auto -14%; }
  /* pinned to the bottom edge, low enough that the strip under the 3:4 video
     (bottom ~16% of the iPad's width) runs off the card */
  .track .ipad { width: min(320px, 100%); margin: auto auto -18%; }
  /* iPad arrows sit over the peeking cards, so give them a solid chip */
  .arrow { background: var(--card); box-shadow: 0 2px 10px rgba(0, 0, 0, .14); }
  .arrow:hover, [data-theme="dark"] .arrow { background: var(--card); }

  /* "GitHub ↗" takes its card's colour: a stronger tint of the card
     with deep text in that hue (light mode) or light text (dark mode), the
     same recipe as the hero's Email button. The GitHub mark is redrawn in
     the text colour via a mask, since the icon file itself is white. */
  .track .gh {
    background: color-mix(in srgb, var(--tint) 24%, var(--card));
    color: color-mix(in srgb, var(--tint) 50%, #000);
    border: 1.5px solid color-mix(in srgb, var(--tint) 45%, var(--card));
  }
  [data-theme="dark"] .track .gh {
    background: color-mix(in srgb, var(--tint) 26%, var(--card));
    color: color-mix(in srgb, var(--tint) 45%, #fff);
    border-color: color-mix(in srgb, var(--tint) 50%, var(--card));
  }
  .track .gh:hover { filter: brightness(.97); }
  .track .gh > img { display: none; }
  .track .gh::before {
    content: ""; width: 18px; height: 18px; flex-shrink: 0; background: currentColor;
    -webkit-mask: url("assets/github.svg") center / contain no-repeat;
            mask: url("assets/github.svg") center / contain no-repeat;
  }
}

/* iPad (tablet) carousel: every card has the same layout. Text top-left, a
   compact "GitHub ↗" button pinned top-right, and the device centred, larger
   than on desktop, with its top at the same height on every card (172px down,
   where the phones sit) and running off the bottom edge. */
@media (min-width: 601px) and (max-width: 899px) {
  .track .slide {
    --pw: 256px;   /* phone width on iPad (228px on desktop) */
    height: 620px; padding: 28px 28px 0; gap: 0;
    text-align: left; align-items: stretch;
  }
  .track .slide-text { align-items: flex-start; gap: 8px; padding-right: 110px; }   /* clear of the button */
  .track .slide h3 { font-size: 24px; line-height: 1.2; }
  /* label → title gap matches title → description: ~19px from the bottom of
     the brain icon to the title's capitals, as from the title's baseline to
     the description's capitals */
  .track.bento .slide-text .made + h3 { margin-top: 6px; }   /* beats the desktop rule further down */
  .track .slide p { font-size: 15px; max-width: 36ch; text-wrap: pretty; }
  /* compact button in the top-right corner: its top lines up with the top of
     the label group, and it sits the same 28px in from the side */
  .track .slide > .gh {
    position: absolute; top: 28px; right: 28px; z-index: 2; margin: 0;
    min-height: 40px; padding: 8px 14px; font-size: 14px; gap: 6px;
  }
  /* devices centred, all starting at the same height */
  .track .device { position: absolute; top: 172px; left: 50%; margin: 0; transform: translateX(-50%); }
  .track .phone { width: var(--pw); }
  .track .watch { width: auto; height: 480px; aspect-ratio: 600 / 940; }
  .track .ipad { width: 380px; }   /* wide enough that the strip under the video falls below the card */
}


/* Desktop: bento grid of project cards instead of the carousel */
@media (min-width: 900px) {
  #projects { max-width: 1200px; }
  .track.bento {
    display: grid; overflow: visible; gap: 16px;
    /* Six columns so the first row can split like the hero: Color Theory ends
       where the hero photo ends (the hero is 1.1fr / 1fr with a 48px gap). The
       third row splits the same way. The middle pair is uneven, so the cards in
       the other rows still get equal thirds. */
    grid-template-columns: 1fr 1fr 1.061fr .939fr 1fr 1fr;
    grid-auto-rows: 250px;
    grid-template-areas:
      "ct ct ct ko ko ko"
      "ct ct ct ko ko ko"
      "tt tt tt tt wa wa"
      "tt tt tt tt wa wa"
      "ly ly ly cr cr cr"
      "ly ly ly cr cr cr";
  }
  .b-ct { grid-area: ct; } .b-ly { grid-area: ly; }
  .b-wa { grid-area: wa; }
  .b-ko { grid-area: ko; } .b-tt { grid-area: tt; } .b-cr { grid-area: cr; }

  /* Each card sets --tint; the hover glow is a little softer in dark mode */
  .bento { --glow-peak: 34%; }
  [data-theme="dark"] .bento { --glow-peak: 24%; }

  .bento .slide {
    position: relative; overflow: hidden; padding: 28px 28px 0; margin: 0;
    border-radius: 24px; text-align: left; align-items: stretch; gap: 0;
    background: color-mix(in srgb, var(--tint) 12%, var(--card));
    border: 1px solid color-mix(in srgb, var(--tint) 18%, transparent);
    transition: transform .25s ease, box-shadow .25s ease;
  }
  .bento .slide:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

  /* Cursor glow: script.js eases --mx / --my toward the pointer. Many stops
     give a long, gradual falloff instead of a hard-edged spotlight. */
  .bento .slide::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(
      560px circle at var(--mx, 50%) var(--my, 50%),
      color-mix(in srgb, var(--tint) var(--glow-peak), transparent) 0%,
      color-mix(in srgb, var(--tint) calc(var(--glow-peak) * 0.7), transparent) 15%,
      color-mix(in srgb, var(--tint) calc(var(--glow-peak) * 0.42), transparent) 32%,
      color-mix(in srgb, var(--tint) calc(var(--glow-peak) * 0.2), transparent) 50%,
      color-mix(in srgb, var(--tint) calc(var(--glow-peak) * 0.07), transparent) 68%,
      transparent 85%);
    opacity: 0; transition: opacity .6s ease;
  }
  /* a soft rim that follows the cursor along the card's edge */
  .bento .slide::after {
    content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    border-radius: inherit; padding: 1.5px;
    background: radial-gradient(
      320px circle at var(--mx, 50%) var(--my, 50%),
      color-mix(in srgb, var(--tint) 75%, white) 0%,
      color-mix(in srgb, var(--tint) 35%, transparent) 40%,
      transparent 80%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity .6s ease;
  }
  .bento .slide:hover::before, .bento .slide:hover::after { opacity: 1; }
  .bento .slide-text, .bento .device { position: relative; z-index: 1; }
  .bento .slide-text { align-items: flex-start; gap: 8px; }
  .bento .slide h3 { font-size: 22px; line-height: 1.2; }
  .bento .slide p { font-size: 14.5px; max-width: 32ch; text-wrap: pretty; }
  .bento .gh { margin-top: 6px; min-height: 40px; padding: 8px 18px; font-size: 14px; }
  .bento .badge { width: 120px; margin-top: 12px; }   /* a little more air above the WWDC art */

  /* Phones peek up from the bottom edge of the card */
  .bento .device { transition: transform .35s ease; }
  .bento .slide:hover .device { transform: translateY(-8px); }
  /* phones peek up from the bottom edge; top of each device sits ~165px down,
     clear of the label + title + description */
  .bento .phone { width: 228px; margin: auto auto -124px; }

  /* Wide cards: text on the left, device on the right */
  .bento .b-ct, .bento .b-ko, .bento .b-ly, .bento .b-cr { flex-direction: row; gap: 40px; }
  .b-ct .slide-text, .b-ko .slide-text, .b-ly .slide-text, .b-cr .slide-text { flex: 1; min-width: 0; padding-bottom: 28px; }
  /* First and third rows: large phones beside the text, up to 300px but never
     more than 54% of the card. Each phone's top sits level with the label, like
     the iPad, and the rest runs off the bottom edge (the card clips it). */
  .bento .b-ct, .bento .b-ko, .bento .b-ly, .bento .b-cr { gap: 32px; }
  .b-ct .phone, .b-ko .phone, .b-ly .phone, .b-cr .phone {
    width: min(300px, 54%); flex-shrink: 0; align-self: flex-start;
    margin: 0 16px 0 0;
  }
  /* Narrower desktop windows (900–1199px): there isn't room for a phone big
     enough to reach the bottom edge beside the text, so these four cards stack
     like the others: text on top, a 228px phone below, running off the edge.
     The WWDC21 badge moves up next to the label, as on iPad and phones. */
  @media (max-width: 1199px) {
    .bento .b-ct, .bento .b-ko, .bento .b-ly, .bento .b-cr { flex-direction: column; gap: 0; }
    .b-ct .slide-text, .b-ko .slide-text, .b-ly .slide-text, .b-cr .slide-text { flex: none; padding-bottom: 0; }
    .b-ct .phone, .b-ko .phone, .b-ly .phone, .b-cr .phone { width: 228px; align-self: center; margin: auto auto -124px; }
    .track.bento .b-ct .slide-text { flex-flow: row wrap; align-items: center; gap: 8px 10px; }
    .track.bento .b-ct .slide-text > :not(.made):not(.badge) { flex-basis: 100%; order: 2; }
    .track.bento .b-ct .badge { order: 1; width: auto; height: 26px; margin: -4.5px 0; }
  }
  .b-ct h3, .b-ko h3, .b-ly h3, .b-cr h3, .b-tt h3 { font-size: 32px; }
  .b-ct p, .b-ko p, .b-ly p, .b-cr p, .b-tt p { font-size: 16px; }
  /* Tic-Tac-Toe: two-thirds of its row (the watch takes the last
     third), iPad on the right with only the strip under the 3:4 video running
     off the bottom edge. The iPad keeps 400px where the card is wide enough
     and gives the text at least 240px otherwise. */
  .bento .b-tt { flex-direction: row; gap: 32px; }
  .b-tt .slide-text { flex: 1; min-width: 240px; padding-bottom: 28px; }
  .b-tt .ipad {
    width: min(400px, 100% - 240px - 32px - 24px); flex-shrink: 0; align-self: flex-end;
    margin: 0 24px -76px 0;
  }
  /* Narrower desktop windows (900–1199px): too tight for the iPad beside the
     text, so stack like the first-row cards: text on top, iPad below running
     off the bottom edge. */
  @media (max-width: 1199px) {
    .bento .b-tt { flex-direction: column; gap: 0; }
    .b-tt .slide-text { flex: none; min-width: 0; padding-bottom: 0; }
    .b-tt .ipad { width: min(380px, 100%); align-self: center; margin: 24px auto -300px; }
  }

  /* Watch card: tall, whole watch shown below the text, beside Tic-Tac-Toe */
  .bento .b-wa { padding-bottom: 0; } /* watch runs off the bottom edge, like the phones */
  /* height-driven so it shrinks to whatever space the text leaves */
  .b-wa .watch {
    width: auto; height: 400px; aspect-ratio: 600 / 940;
    flex: 0 1 auto; min-height: 0; margin: auto auto -58px; /* top lines up with the phones beside it; strap runs off the edge */
  }
  .bento .b-wa:hover .watch { transform: scale(1.04); }

  .arrow, .dots { display: none; }
}

/* Experience: the journey as an Apple Maps route. A street map with the three
   stops (ASU, IQVIA, Salesforce) on street corners; as you scroll, the title and
   map stay pinned for 1.5 extra screens: the route draws along the streets over
   the first screen (each stop pops in), and the finished route holds for half a screen. Pins and cards are placed by script.js. */
/* stage = section title (about 60px with its gap) + map, pinned as one */
.xp-scroll { --map-h: 720px; --stage-h: calc(var(--map-h) + 60px); height: calc(var(--stage-h) + 150vh); }
.xp-stage { position: sticky; top: max(16px, calc((100vh - var(--stage-h)) / 2)); }
.xp-map {
  --land: #eef0ea; --block: #e6e8e1; --road: #ffffff; --road-edge: #dcdfd7; --avenue: #fdf6dc;
  --park: #d3ead0; --water: #cce1f5; --label: #8a8f86;
  --route: #0a84ff; --route-edge: #0763c4; --ahead: #7fb2ef;
  position: relative; max-width: 760px; height: 720px; margin: 0 auto; border-radius: 28px; overflow: hidden;
  background: var(--land); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: left;
}
[data-theme="dark"] .xp-map {
  --land: #1c2023; --block: #22272b; --road: #353b40; --road-edge: #2a2f33; --avenue: #4a4535;
  --park: #1f3326; --water: #1a2d3f; --label: #7d858c;
  --route: #3a96ff; --route-edge: #1d6cd0; --ahead: #2c5b92;
}
.xp-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.xp-streets .xp-block { fill: var(--block); }
.xp-streets .xp-park { fill: var(--park); }
.xp-streets .xp-water { fill: var(--water); }
.xp-streets .xp-edge { stroke: var(--road-edge); fill: none; stroke-linecap: square; }
.xp-streets .xp-road { stroke: var(--road); fill: none; stroke-linecap: square; }
.xp-streets .xp-avenue { stroke: var(--avenue); }
.xp-streets text { font: 600 8.5px/1 Inter, sans-serif; letter-spacing: .1em; text-transform: uppercase; fill: var(--label); }

.xp-route { z-index: 1; pointer-events: none; }
.xp-route .xp-ahead { fill: none; stroke: var(--ahead); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1 11; opacity: .9; }
.xp-route .xp-edge { fill: none; stroke: var(--route-edge); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.xp-route .xp-line { fill: none; stroke: var(--route); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }

/* directions header, like the top of a Maps route */
.xp-directions {
  position: absolute; z-index: 4; top: 14px; left: 14px; right: 14px; padding: 12px 18px; border-radius: 18px;
  background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 6px 20px -10px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font: 500 15px/1.3 Inter, system-ui, sans-serif;
}
/* two legs, each a dot + text on one line; a dotted connector joins the dots */
.xp-legs { list-style: none; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.xp-legs li { position: relative; padding-left: 22px; line-height: 22px; }   /* plain text, so a long name wraps naturally */
.xp-leg-dot { position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%; }   /* centred on the first line */
.xp-leg-dot.xp-start { background: #34c759; }
.xp-leg-dot.xp-end { background: var(--route); }
/* dotted connector from the first dot down to the second */
.xp-legs li:first-child::after {
  content: ""; position: absolute; left: 4px; top: 19px; bottom: -11px;   /* from below this dot to just above the next */
  border-left: 2px dotted color-mix(in srgb, var(--text) 35%, transparent);
}
.xp-directions .xp-muted { color: var(--muted); }
/* the work figure, labelled so it doesn't read as the length of the whole route */
.xp-eta { flex: 0 0 auto; text-align: right; font: 700 26px/1 Poppins, sans-serif; letter-spacing: -0.03em; }
.xp-eta small { display: block; margin-top: 5px; font: 500 12px/1.2 Inter, system-ui, sans-serif; letter-spacing: 0; color: var(--muted); }

/* pins and place cards are positioned by the script, on the street corners */
.xp-pin {
  position: absolute; z-index: 3; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%;
  display: grid; place-items: center; background: var(--card); border: 3px solid var(--route);
  box-shadow: 0 3px 8px rgba(0,0,0,.22); font: 700 13px/1 Inter, sans-serif; color: var(--route);
  transform: scale(.55); opacity: .55; transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), opacity .3s;
}
.xp-pin.xp-start { border-color: #34c759; color: #34c759; }
.xp-pin.xp-here { background: var(--route); border-color: #fff; color: #fff; }
.is-reached.xp-pin { transform: none; opacity: 1; }
.xp-pin.xp-here.is-reached::after {
  content: ""; position: absolute; inset: -12px; border-radius: 50%; background: var(--route); z-index: -1;
  animation: xp-pulse 2s ease-out infinite;
}
@keyframes xp-pulse { from { transform: scale(.55); opacity: .45; } to { transform: scale(1.5); opacity: 0; } }

.xp-place {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 14px;
  padding: 10px 18px 10px 10px; border-radius: 20px; background: var(--card);   /* tight around the logo tile */
  box-shadow: 0 8px 22px -8px rgba(0,0,0,.3);
  transform: translateY(10px); opacity: 0; transition: transform .5s cubic-bezier(.22, 1, .36, 1), opacity .4s;
}
.xp-place.is-reached { transform: none; opacity: 1; }
/* square white tile; the logo spans its width (5px inset) and the white tile
   fills the rest, so it reads as one white logo block */
.xp-logo { flex: 0 0 auto; width: 72px; height: 72px; border-radius: 13px; background: #fff; border: 1px solid #ececec; display: grid; place-items: center; padding: 5px; overflow: hidden; }
.xp-logo img { width: 100%; height: 100%; object-fit: contain; }
.xp-place-text { min-width: 0; }
.xp-place h3 { font: 600 16.5px/1.3 Inter, system-ui, sans-serif; letter-spacing: -0.01em; }
.xp-place .xp-org { margin-top: 3px; font: 14px/1.35 Inter, system-ui, sans-serif; color: var(--muted); }
.xp-place .xp-when { margin-top: 2px; font: 500 14px/1.35 Inter, system-ui, sans-serif; }
.xp-tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font: 600 11px/1.5 Inter, sans-serif; color: #fff; background: var(--route); vertical-align: 2px; }

@media (max-width: 600px) {
  .xp-scroll { --map-h: 700px; }
  .xp-map { height: 700px; border-radius: 24px; }
  .xp-directions { padding: 10px 14px; font-size: 13.5px; }
  .xp-eta { font-size: 22px; }
  .xp-place { gap: 12px; padding: 8px 14px 8px 8px; border-radius: 18px; }
  .xp-logo { width: 58px; height: 58px; border-radius: 11px; padding: 4px; }
  .xp-place h3 { font-size: 15px; }
  .xp-place .xp-org, .xp-place .xp-when { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .xp-pin, .xp-place { transition: none; }
  .xp-pin.xp-here.is-reached::after { animation: none; }
}

/* Certifications: framed certificates hanging on the wall, one below the
   other. Each hangs by a wire from a nail and sits slightly crooked; the whole
   thing pivots about the nail, so hovering lets it swing level. */
.certs { display: flex; flex-direction: column; align-items: center; gap: 56px; }
.hang {
  position: relative; width: min(440px, 100%); padding-top: 44px;
  transform-origin: 50% 7px;   /* the nail */
  transform: rotate(var(--tilt));
  /* The swing is a transition, not a keyframe animation, so it plays in both
     directions: hovering swings the frame level, and moving away lets it swing
     back to crooked instead of snapping. The easing is a damped pendulum
     (overshoots and settles); browsers without linear() get a single overshoot. */
  transition: transform 1.2s cubic-bezier(.3, 1.7, .5, 1);
  transition: transform 1.6s linear(0, 0.151, 0.348, 0.564, 0.774, 0.96, 1.111, 1.22, 1.286, 1.312, 1.304, 1.269, 1.217, 1.156, 1.094, 1.036, 0.987, 0.95, 0.925, 0.912, 0.91, 0.916, 0.929, 0.946, 0.964, 0.982, 0.997, 1.01, 1.019, 1.024, 1.026, 1.025, 1.022, 1.018, 1.013, 1.008, 1.003, 0.999, 0.996, 0.994, 0.993, 0.992, 0.993, 0.994, 1);
}
@media (hover: hover) { .hang:hover { transform: rotate(0deg); } }
.nail {
  position: absolute; top: 0; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 30%, #f4f4f5 0%, #b9b9be 38%, #6f6f76 100%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .35), 3px 5px 5px rgba(0, 0, 0, .12);
}
.wire { position: absolute; top: 7px; left: 0; width: 100%; height: 38px; overflow: visible; }
.wire path { fill: none; stroke: color-mix(in srgb, var(--text) 55%, transparent); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linecap: round; }
/* (named cert-frame: plain "frame" is the phone/watch bezel image in the project cards) */
.cert-frame {
  padding: 12px; border-radius: 4px;
  background: linear-gradient(145deg, #40372f, #211b17);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 2px 3px rgba(0, 0, 0, .2), 0 26px 44px -18px rgba(0, 0, 0, .5);
}
[data-theme="dark"] .cert-frame { background: linear-gradient(145deg, #6a5a4d, #3b3028); }   /* lighter wood so it reads on the dark wall */
.mat { padding: 16px; background: #f4f1ea; box-shadow: inset 0 1px 4px rgba(0, 0, 0, .25); }
[data-theme="dark"] .mat { background: #d9d3c8; }

/* the certificate itself: cream paper, double rule, serif type */
.paper {
  --paper: #fbf8f1; --ink: #2b2623; --rule: color-mix(in srgb, #72625d 55%, var(--paper));
  aspect-ratio: 1.24; padding: 9px; color: var(--ink); background: var(--paper);
  display: flex;   /* so the inner border always fills the sheet and the footer sits at the bottom */
  border: 1px solid var(--rule);
  font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
}
.paper-in {
  flex: 1; min-width: 0; border: 1px solid var(--rule); outline: 1px solid var(--rule); outline-offset: -5px;
  border-radius: 3px; padding: 22px 22px 18px; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.p-kicker { font: 600 10px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: #4f423e; }
.p-title {
  margin-top: 12px; font-size: clamp(17px, 4.8vw, 23px); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; max-width: 24ch;
  /* always two lines tall (a one-line title sits centred in it), so every certificate lays out the same */
  min-height: 2.4em; display: flex; align-items: center; justify-content: center;
}
.p-to { margin-top: 10px; font-style: italic; font-size: 13px; opacity: .7; }
.p-name { margin-top: 2px; font-size: 20px; font-style: italic; }
/* footer, identical on every certificate: on the left the issuer's seal
   stamped over a signature line with "Issued by" under it; on the right a
   Verify button shaped like the hero buttons */
.p-foot { margin-top: auto; width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 6px; }
.p-sign { display: flex; flex-direction: column; align-items: center; font: 500 11px/1.2 var(--sans); }
.p-sign .seal { margin-bottom: 5px; }   /* the stamp sits clear above the line */
.p-line { width: 124px; max-width: 100%; height: 1px; background: var(--rule); }
.p-small { margin-top: 6px; opacity: .8; white-space: nowrap; }
.p-verify {
  /* same shape as the hero's Email / Connect buttons: 44px tall, 12px corners */
  display: inline-flex; align-items: center; height: 44px; padding: 0 24px; border-radius: 12px;
  border: 1.5px solid #4f423e; color: #4f423e; font: 600 15px/1 var(--sans);
  text-decoration: none; white-space: nowrap; transition: background-color .2s, color .2s;
  -webkit-tap-highlight-color: transparent;   /* no grey box flashing over the pill on touch */
}
/* fill on hover only where there is a real pointer; on touch the "hover" would
   stick after a tap, so a light pressed tint shows while the finger is down */
@media (hover: hover) { .p-verify:hover { background: #4f423e; color: var(--paper); } }
.p-verify:active { background: color-mix(in srgb, #4f423e 14%, transparent); }
/* issuer logo in a scalloped seal; a foil sheen sweeps across it on hover */
.seal { position: relative; width: 52px; height: 52px; display: grid; place-items: center; }
.seal svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: color-mix(in srgb, #72625d 30%, var(--paper)); stroke: var(--rule); stroke-width: 1.5; }
.seal img { position: relative; width: 30px; height: 30px; border-radius: 7px; }
.seal::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .75) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%; background-position: 130% 0; mix-blend-mode: soft-light; transition: background-position .9s ease;
}
.hang:hover .seal::after { background-position: -30% 0; }
/* phones: a slightly taller sheet, the same shape for every certificate */
@media (max-width: 480px) {
  .paper { aspect-ratio: 1.08; }
  .mat { padding: 12px; }
  .paper-in { padding: 18px 12px 16px; }
  .p-foot { padding: 0 2px; }
  .seal { width: 44px; height: 44px; }
  .seal img { width: 25px; height: 25px; border-radius: 6px; }
  .p-line { width: 104px; }
  .p-sign { font-size: 10.5px; }
}

/* Interests: an iPhone-style Dock. Five app icons (rounded squares with a
   gradient each, holding an animated line-art glyph) on a frosted,
   rounded shelf. Names sit under the shelf, since the icons alone don't say
   what they are yet. */
.dock-wrap { display: flex; justify-content: center; }
.dock {
  --icon: clamp(52px, 14vw, 104px);   /* phones stay ~52px so five fit; desktop and iPad get 104px */
  --gap: clamp(10px, 2.8vw, 24px);
  list-style: none; display: flex; gap: var(--gap);
  padding: calc(var(--gap) * .9); border-radius: calc(var(--icon) * .5);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .25);
}
.dock-app { position: relative; display: flex; flex-direction: column; align-items: center; }
.app-icon {
  display: grid; place-items: center; width: var(--icon); height: var(--icon);
  border-radius: 22.5%;   /* iOS icon corner */
  overflow: hidden;       /* the glyphs run off the edges (launch, sunrise, tumbleweed) */
  background: var(--app-bg);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .25), 0 2px 6px rgba(0, 0, 0, .18);
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
@media (hover: hover) {
  .dock-app:hover .app-icon { transform: translateY(-6px) scale(1.06); }
  /* The hover zone is the icon's resting box, not the icon as it moves, and not
     its label (reaching the label crosses a gap, which flicked the hover on and
     off). Once hovered it's a little larger, so a cursor lingering on the edge
     can't flick it either; it stays short of the neighbouring icons. */
  .app-icon, .app-name { pointer-events: none; }
  .dock-app::before { content: ""; position: absolute; inset: 0; }
  .dock-app:hover::before { inset: calc(var(--gap) * -.42); }
}
@media (hover: none) { .dock-app:active .app-icon { transform: scale(.94); } }   /* pressed, like an app icon */
/* label below the shelf, centred under its icon */
.app-name {
  position: absolute; top: calc(100% + var(--gap) * .9 + 10px); left: 50%; transform: translateX(-50%);
  width: calc(var(--icon) + var(--gap)); text-align: center; text-wrap: balance;
  font-size: clamp(9.5px, 2.55vw, 14px); line-height: 1.25; font-weight: 500; color: var(--muted);
}
.dock-wrap { padding-bottom: clamp(48px, 7.3vw, 56px); }   /* room for the labels (up to two lines) */

/* each app's colours */
.app-percussion  { --app-bg: linear-gradient(160deg, #ff8a4c, #e2412f); }
.app-photography { --app-bg: linear-gradient(160deg, #5b5b63, #1f1f24); }
.app-design      { --app-bg: linear-gradient(160deg, #5ab8ff, #2f6bff); }
.app-parks       { --app-bg: linear-gradient(160deg, #5fbf7a, #1f7a4d); }
/* Sunsets: a mesh-style sky (indigo top-left, lavender, pink, rose, a warm
   orange glow where the sun meets the horizon at y 40 of 64), easing into blue
   water that carries a soft reflection of the glow. */
.app-sunsets {
  --app-bg:
    radial-gradient(34% 16% at 50% 66%, rgba(255, 176, 120, .75), transparent 75%),
    radial-gradient(58% 34% at 50% 60%, rgba(255, 158, 98, .9), transparent 72%),
    radial-gradient(60% 40% at 88% 44%, rgba(238, 122, 172, .95), transparent 72%),
    radial-gradient(55% 40% at 8% 50%, rgba(226, 108, 142, .85), transparent 72%),
    radial-gradient(75% 48% at 82% 6%, rgba(184, 146, 232, .95), transparent 72%),
    radial-gradient(70% 50% at 0% 0%, rgba(86, 92, 184, .95), transparent 72%),
    linear-gradient(180deg, #9a86dc 0%, #c98fd6 30%, #ea8aa6 52%, #e98a8a 60%, #5f74cc 70%, #34509f 86%, #243b86 100%);
}

/* Dock icons: white line art on each tile, 64x64 viewBox. They sit still until
   hovered (mouse) or tapped (touch). The keyframes are CSS, but the animations
   stay paused and script.js moves them along; it also draws the camera's
   blades/shutter and the tumbleweed's hops. Names are scoped to .app-icon and keyframes are
   prefixed di- so nothing collides with the rest of the site. */
.app-icon svg { width: 100%; height: 100%; display: block; overflow: hidden; }
/* ---------- Shared line-art style ---------- */
.app-icon .ln { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.app-icon .thin { stroke-width: 1.5; }
.app-icon .anim, .app-icon .anim * { transform-box: fill-box; transform-origin: center; }

/* ---------- Percussion: drum kit from the front; a fill, then crash + kick ---------- */
.app-icon .kit .drum, .app-icon .kit .bass, .app-icon .kit .glow, .app-icon .kit .cymbal, .app-icon .kit .spark { animation-duration: 3s; animation-iteration-count: infinite; animation-fill-mode: both; }
.app-icon .kit .drum { transform-origin: 50% 100%; animation-name: di-bump; animation-timing-function: ease-out; }
.app-icon .kit .snare, .app-icon .kit .snare .glow { animation-name: di-bump2; }
.app-icon .kit .glow { fill: #fff; stroke: none; opacity: 0; animation-name: di-glow; }
.app-icon .kit .snare .glow { animation-name: di-glow2; }
.app-icon .kit .cymbal { transform-origin: 50% 100%; animation-name: di-wobble; }
.app-icon .kit .bass { transform-origin: center; animation-name: di-kick; }
.app-icon .kit .spark { opacity: 0; animation-name: di-spark; }
@keyframes di-bump { 0% { transform: none; } 2% { transform: translateY(1px) scale(1.05, .9); } 9%, 100% { transform: none; } }
@keyframes di-bump2 { 0% { transform: none; } 2% { transform: translateY(1px) scale(1.05, .9); } 6% { transform: none; } 8.7% { transform: translateY(1px) scale(1.05, .9); } 14%, 100% { transform: none; } }
@keyframes di-glow { 0% { opacity: 0; } 1.5% { opacity: .6; } 12%, 100% { opacity: 0; } }
@keyframes di-glow2 { 0% { opacity: 0; } 1.5% { opacity: .6; } 6% { opacity: .1; } 8.2% { opacity: .6; } 18%, 100% { opacity: 0; } }
@keyframes di-kick { 0% { transform: scale(1); } 2% { transform: scale(1.08); } 12%, 100% { transform: scale(1); } }
@keyframes di-wobble { 0% { transform: rotate(0); } 2% { transform: rotate(-14deg); } 10% { transform: rotate(9deg); } 18% { transform: rotate(-5deg); } 27% { transform: rotate(2deg); } 36%, 100% { transform: rotate(0); } }
@keyframes di-spark { 0% { opacity: 0; transform: scale(.6); } 2% { opacity: 1; } 16%, 100% { opacity: 0; transform: scale(1.35); } }

/* ---------- Graphic design: pen tool draws a triangle, it fills and launches ---------- */
.app-icon .pen-tool, .app-icon .tri, .app-icon .tri-move, .app-icon .anchor { animation-duration: 3.2s; animation-iteration-count: infinite; animation-fill-mode: both; }
.app-icon .pen-tool { animation-name: di-pen-move; animation-timing-function: cubic-bezier(.45,0,.25,1); transform-box: view-box; transform-origin: 0 0; }
.app-icon .tri { stroke-dasharray: 100; animation-name: di-tri-draw, di-tri-fill; animation-timing-function: cubic-bezier(.45,0,.25,1); fill: #fff; }
.app-icon .tri-move { animation-name: di-tri-launch; transform-box: view-box; transform-origin: 0 0; }
.app-icon .anchor { fill: #4a90ff; stroke: #fff; stroke-width: 1.4; }
.app-icon .anchor.a { animation-name: di-anc-a; }
.app-icon .anchor.b { animation-name: di-anc-b; }
.app-icon .anchor.c { animation-name: di-anc-c; }
@keyframes di-pen-move {
  0%, 6%    { transform: translate(32px, 15px); }
  22%, 26%  { transform: translate(47px, 43px); }
  42%, 46%  { transform: translate(17px, 43px); }
  62%, 100% { transform: translate(32px, 15px); }
}
@keyframes di-tri-draw {
  0%, 6%    { stroke-dashoffset: 100; }
  22%, 26%  { stroke-dashoffset: 66.1; }
  42%, 46%  { stroke-dashoffset: 33.9; }
  62%, 100% { stroke-dashoffset: 0; }
}
@keyframes di-tri-fill { 0%, 63% { fill-opacity: 0; } 70%, 100% { fill-opacity: 1; } }
@keyframes di-tri-launch {
  /* Still out of frame when the loop restarts; it only moves back down at 4%,
     once the outline and fill have already been cleared, so it can't flash
     in the middle (the move and the clear may land on different frames). */
  0%, 4% { transform: translateY(-70px); }
  4.1% { transform: translateY(0); }
  70% { transform: translateY(0); animation-timing-function: ease-out; }
  73% { transform: translateY(2px); animation-timing-function: cubic-bezier(.45, 0, .7, .7); }
  92%, 100% { transform: translateY(-70px); }
}
@keyframes di-anc-a { 0% { opacity: 0; } 3%, 64% { opacity: 1; } 70%, 100% { opacity: 0; } }
@keyframes di-anc-b { 0%, 21% { opacity: 0; } 24%, 64% { opacity: 1; } 70%, 100% { opacity: 0; } }
@keyframes di-anc-c { 0%, 41% { opacity: 0; } 44%, 64% { opacity: 1; } 70%, 100% { opacity: 0; } }

/* ---------- National parks: three saguaros, a tumbleweed rolls past ---------- */
.app-icon .cactus { vector-effect: non-scaling-stroke; }
.app-icon .tw-x { transform-box: view-box; transform-origin: 0 0; animation: di-roll-x 4s linear infinite both; }
.app-icon .tw-r { animation: di-spin .9s linear infinite; }
@keyframes di-roll-x { 0% { transform: translate(-9px, 45px); } 78%, 100% { transform: translate(73px, 45px); } }

/* ---------- Sunsets: sun drops in from the top and sinks below the horizon ---------- */
.app-icon .sun { animation: di-sun-path 5s infinite both; transform-box: view-box; transform-origin: 0 0; }
.app-icon .rays { animation: di-spin 14s linear infinite; }
.app-icon .water { animation: di-shimmer 5s ease-in-out infinite both; }
@keyframes di-sun-path {
  0%   { transform: translateY(-17px); animation-timing-function: cubic-bezier(.25,.4,.45,1); }
  62%  { transform: translateY(38px); animation-timing-function: linear; }
  100% { transform: translateY(58px); }
}
@keyframes di-spin { to { transform: rotate(360deg); } }
@keyframes di-shimmer { 0%, 50% { opacity: .35; transform: scaleX(.7); } 72% { opacity: 1; transform: scaleX(1.12); } 100% { opacity: .35; transform: scaleX(.7); } }

/* Always paused: script.js sets the time while an icon is playing. The delays
   pick each icon's resting frame, which is also where its cycle starts and
   ends, so playing and stopping never jump. (Percussion rests at its start.) */
.app-icon * { animation-play-state: paused !important; }
.app-icon .pen-tool, .app-icon .tri, .app-icon .tri-move, .app-icon .anchor { animation-delay: -2.24s; }   /* filled triangle, pen at its tip */
.app-icon .tw-x { animation-delay: -1.94s; }   /* tumbleweed between two cacti */
.app-icon .sun, .app-icon .water { animation-delay: -2.6s; }   /* sun touching the horizon */
.app-icon .water.w2 { animation-delay: -2.35s; }

/* Contact */

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 48px 16px 48px; }
.footer-where { color: var(--text); font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.footer-time { font-variant-numeric: tabular-nums; }
.made-with { color: inherit; text-decoration: none; white-space: nowrap; transition: color .2s; }
.made-with:hover { color: var(--text); }
.claude-mark { width: 18px; height: 12px; vertical-align: baseline; margin: 0 2px; }   /* pixel mascot, 12x8 grid; its feet sit on the text baseline */   /* digits keep their width as the minutes tick */

@media (max-width: 600px) {
  /* Phones: no top bar. A floating circle (the menu button) sits in the
     top-right corner. Opening grows it into a rounded panel (width and height
     animate; --open-h is measured in script.js) holding the avatar, the theme
     switch and the section links, which then slide in one after another. */
  .nav {
    /* 22px in: the 48px button then shares its centre with the photo's
       top-right corner (16px page margin + 30px corner radius = 46px = 22 + 24),
       so at the top of the page it nests in the corner with an even 6px gap */
    position: fixed; top: 22px; right: 22px; left: auto; z-index: 20;
    width: 48px; height: 48px; overflow: hidden;
    display: grid; grid-template-columns: auto 1fr auto 46px;   /* last column: room for the button */
    grid-template-rows: 46px auto;
    grid-template-areas: "theme . . menu" "links avatar avatar avatar";
    align-items: center; gap: 0 4px; padding: 0;
    border: 1px solid var(--line); border-radius: 24px;
    background: var(--card);
    backdrop-filter: none; -webkit-backdrop-filter: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
    transition: width .45s cubic-bezier(.32, .72, 0, 1), height .45s cubic-bezier(.32, .72, 0, 1);
  }
  .nav.open { width: calc(100% - 44px); height: var(--open-h, 330px); }
  /* used by script.js to measure the open height */
  .nav.measuring { width: calc(100% - 44px) !important; height: auto !important; transition: none !important; }

  /* The avatar fills the space beside the links: as large as fits with 16px
     clear of the text and the panel edge, sitting on the panel's bottom edge. */
  .nav-avatar { grid-area: avatar; position: relative; align-self: stretch; margin: 6px 16px 0 4px; }   /* 4px + the links' 12px padding = 16px clear of the text */
  .nav-avatar img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; object-position: bottom center;
  }
  /* mirrors the close button: a borderless 46px button in the top-left corner,
     so both icons sit the same distance from the top and the side */
  .nav .theme-toggle {
    grid-area: theme; align-self: start; margin: 0; width: 46px; height: 46px;
    background: transparent; border: 0;
  }
  .nav .theme-toggle:hover { transform: none; }
  /* pinned to the top-right corner so it stays put while the panel grows */
  .menu-toggle {
    display: block; position: absolute; top: 0; right: 0; width: 46px; height: 46px;
    border: 0; background: transparent;
  }
  .menu-toggle span { left: 15px; }
  .menu-toggle span:nth-child(1) { top: 16px; }
  .menu-toggle span:nth-child(2) { top: 21.5px; }
  .menu-toggle span:nth-child(3) { top: 27px; }
  .nav nav {
    grid-area: links; flex-direction: column; gap: 2px; overflow: visible;
    padding: 0 8px 10px;
  }
  /* all caps, widely tracked, like the section titles */
  .nav nav a {
    font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .2em;
    padding: 14px 12px; border-radius: 12px;
    transition: background-color .2s;
  }
  .nav nav a:active { background: color-mix(in srgb, var(--text) 7%, transparent); }

  /* Avatar and theme switch fade in as the panel opens; the links follow,
     sliding down one after another once it has opened. Closing hides them
     at once so the panel shrinks back clean. */
  .nav-avatar, .nav .theme-toggle, .nav nav a {
    opacity: 0; visibility: hidden;
    transition: opacity .12s ease, transform .12s ease, visibility 0s linear .12s;
  }
  .nav nav a { transform: translateY(-8px); }
  .nav.open .nav-avatar, .nav.open .theme-toggle {
    opacity: 1; visibility: visible; transition: opacity .3s ease .2s, visibility 0s;
  }
  .nav.open nav a {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .35s ease, transform .45s cubic-bezier(.22, 1, .36, 1), visibility 0s, background-color .2s;
    transition-delay: calc(.3s + var(--i, 0) * 50ms);
  }
  .nav nav a:nth-child(2) { --i: 1; }
  .nav nav a:nth-child(3) { --i: 2; }
  .nav nav a:nth-child(4) { --i: 3; }
  .nav nav a:nth-child(5) { --i: 4; }
  .hero-photo { height: min(40vh, calc((100vw - 32px) * 1.3)); border-radius: 30px; }   /* corner concentric with the menu button */
  .arrow { display: none; }
  .section { padding: 36px 16px; }
  .hero { padding-bottom: 36px; }
  .footer { padding-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hang { transition: none; }
  .nav, .nav * { transition: none !important; }
}

/* Sections below the hero use their own font pair (set in :root). Re-pointing
   --sans/--serif here means buttons and cards inside follow along. */
.section, .footer {
  --sans: var(--section-sans);
  --serif: var(--section-serif);
  font-family: var(--sans);
}

/* Project links. Phones/tablets: the normal purple "Github" button.
   Desktop bento: the button is hidden and the link covers the whole card.
   On hover/focus only the card's text blurs out and "GitHub ↗" takes
   its place; the device stays sharp. */
.gh-hover { display: none; }
@media (min-width: 900px) {
  .bento .slide > .gh {
    position: absolute; inset: 0; z-index: 3; display: block;
    margin: 0; padding: 0; min-height: 0; border-radius: inherit;
    background: transparent; color: var(--text);
  }
  .bento .slide > .gh:hover { transform: none; filter: none; }
  .bento .slide > .gh > img, .bento .gh-label { display: none; }

  .bento .slide-text { transition: filter .35s ease, opacity .35s ease; }
  .bento .slide:hover .slide-text,
  .bento .slide:has(> .gh:focus-visible) .slide-text { filter: blur(6px); opacity: .35; }

  .bento .gh-hover {
    position: absolute; top: 28px; left: 28px;
    display: inline-flex; align-items: center; gap: 10px;
    font: 700 22px/1.2 var(--sans); letter-spacing: -0.01em; white-space: nowrap;
    opacity: 0; transform: translateY(8px);
    transition: opacity .3s ease, transform .4s cubic-bezier(.2, .8, .2, 1);
  }
  .bento .gh-hover img { width: 1em; height: 1em; filter: invert(1); }   /* icon file is white */
  [data-theme="dark"] .bento .gh-hover img { filter: none; }
  .gh-arrow { display: inline-block; transition: transform .3s ease; }

  .bento .slide:hover .gh-hover,
  .bento .slide > .gh:focus-visible .gh-hover { opacity: 1; transform: none; }
  .bento .slide:hover .gh-arrow { transform: translate(3px, -3px); }
  .bento .slide > .gh:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; }
}

/* "View all projects": a button under the grid opens a sheet with every
   project. Cards are copies of the page's slides (script.js), laid out with
   each device whole above its text. */
.pm-more { display: flex; justify-content: center; margin-top: 32px; }
.pm-open {
  background: color-mix(in srgb, var(--shirt) 14%, var(--card)); color: var(--accent-ink);
  border: 1.5px solid color-mix(in srgb, var(--shirt) 45%, var(--card)); cursor: pointer;
}
.pm-open:hover { background: color-mix(in srgb, var(--shirt) 22%, var(--card)); transform: translateY(-1px); }
.pm-count {
  font-size: 12px; font-weight: 600; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  display: inline-grid; place-items: center; background: var(--accent); color: #fff;
}

html.pm-locked { overflow: hidden; }
.pm {
  width: min(1160px, 100vw - 48px); height: calc(100dvh - 32px);
  max-width: none; max-height: none; margin: auto; padding: 0; border: 0;
  border-radius: 28px; background: var(--bg); color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28); overflow: hidden;
}
/* Like an iOS sheet: it rises and drops on no-bounce springs (damping 1;
   0.6s response in, 0.5s out), written as linear() curves. script.js reads
   these for the sheet, and the dim fades in step on the same curve. */
.pm {
  --pm-open-ms: 881; --pm-close-ms: 735;
  --pm-open-ease: linear(0.0000, 0.0229, 0.0788, 0.1531, 0.2359, 0.3206, 0.4028, 0.4800, 0.5507, 0.6144, 0.6709, 0.7205, 0.7636, 0.8008, 0.8327, 0.8600, 0.8831, 0.9026, 0.9190, 0.9328, 0.9444, 0.9540, 0.9621, 0.9687, 0.9743, 0.9789, 0.9826, 0.9858, 0.9883, 0.9905, 0.9922, 0.9936, 0.9948, 0.9958, 0.9965, 0.9972, 0.9977, 0.9981, 0.9985, 0.9988, 1);
  --pm-close-ease: linear(0.0000, 0.0229, 0.0788, 0.1531, 0.2359, 0.3206, 0.4028, 0.4800, 0.5507, 0.6144, 0.6709, 0.7205, 0.7636, 0.8008, 0.8327, 0.8600, 0.8831, 0.9026, 0.9190, 0.9328, 0.9444, 0.9540, 0.9621, 0.9687, 0.9743, 0.9789, 0.9826, 0.9858, 0.9883, 0.9905, 0.9922, 0.9936, 0.9948, 0.9958, 0.9965, 0.9972, 0.9977, 0.9981, 0.9985, 0.9988, 1);
}
.pm::backdrop { background: rgba(10, 10, 12, 0); transition: background-color 881ms var(--pm-open-ease); }
.pm.pm-shown::backdrop { background: rgba(10, 10, 12, .5); }
.pm.pm-leaving::backdrop { transition: background-color 735ms var(--pm-close-ease); }
.pm-sheet { height: 100%; display: flex; flex-direction: column; }
.pm-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 24px 18px 32px; border-bottom: 1px solid var(--line);
}
.pm-head h2 {
  font: 700 20px/1.2 var(--sans); text-transform: uppercase; letter-spacing: .26em; margin: 0;
}
.pm-sub { color: var(--muted); font: 400 14px/1.4 var(--section-sans); margin-top: 4px; }
.pm-close {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; flex-shrink: 0;
  display: grid; place-items: center; color: var(--text);
  background: color-mix(in srgb, var(--text) 7%, transparent); transition: background-color .2s;
}
.pm-close:hover { background: color-mix(in srgb, var(--text) 12%, transparent); }
.pm-close svg { width: 18px; height: 18px; }
/* a ring only for keyboard focus, not after a click or tap */
.pm-close:focus-visible, .pm-open:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.pm-grid {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: max-content; align-content: start;
  gap: 16px; padding: 24px 32px 40px;
  font-family: var(--section-sans);
}

.pm-card {
  --dh: 300px;   /* device height */
  position: relative; overflow: hidden; padding: 0 22px 22px;
  display: flex; flex-direction: column; text-align: left; border-radius: 20px;
  background: color-mix(in srgb, var(--tint) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--tint) 18%, transparent);
  transition: transform .25s ease, box-shadow .25s ease;
}
.pm-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
/* each device whole, at one height, above the text */
.pm-card .device {
  order: -1; height: var(--dh); width: auto; margin: 26px auto 22px;
  transition: transform .35s ease;
}
.pm-card:hover .device { transform: translateY(-4px); }
.pm-card .device .frame { width: auto; height: 100%; }
.pm-card .phone { aspect-ratio: 700 / 1432; }
.pm-card .ipad { aspect-ratio: 712 / 1000; }
.pm-card .watch { aspect-ratio: 600 / 940; }
.pm-card .ipad .screen { background: #f3f2f9; }   /* the app's own background under the 3:4 video */
.pm-card .slide-text { align-items: flex-start; align-content: flex-start; gap: 6px; flex-flow: row wrap; padding-top: 0; }
.pm-card .slide-text > :not(.made):not(.badge) { flex-basis: 100%; order: 2; }
.pm-card .slide-text .badge { order: 1; }
.pm-card h3 { font-size: 20px; line-height: 1.2; font-weight: 700; }
.pm-card p { font-size: 14px; line-height: 1.45; max-width: 34ch; text-wrap: pretty; }
.pm-card .badge { width: auto; height: 24px; margin: -3.5px 0 -3.5px 4px; }
/* Same button as the main section on phones and tablets: the card's tint,
   deep text in that hue, and the GitHub mark redrawn in the text colour */
.pm-card .gh {
  align-self: flex-start; margin-top: 14px;
  min-height: 40px; padding: 8px 14px; font-size: 14px; gap: 6px;
  background: color-mix(in srgb, var(--tint) 24%, var(--card));
  color: color-mix(in srgb, var(--tint) 50%, #000);
  border: 1.5px solid color-mix(in srgb, var(--tint) 45%, var(--card));
}
[data-theme="dark"] .pm-card .gh {
  background: color-mix(in srgb, var(--tint) 26%, var(--card));
  color: color-mix(in srgb, var(--tint) 45%, #fff);
  border-color: color-mix(in srgb, var(--tint) 50%, var(--card));
}
.pm-card .gh:hover { filter: brightness(.97); }
.pm-card .gh > img { display: none; }
.pm-card .gh::before {
  content: ""; width: 18px; height: 18px; flex-shrink: 0; background: currentColor;
  -webkit-mask: url("assets/github.svg") center / contain no-repeat;
          mask: url("assets/github.svg") center / contain no-repeat;
}
@media (min-width: 900px) { .pm .pm-card > .gh::before { display: none; } }

/* Desktop: same hover as the featured grid. The link covers the card, a glow
   and rim follow the cursor, the text blurs out and "GitHub ↗" takes its
   place while the device stays sharp. Phones keep the GitHub button. */
@media (min-width: 900px) {
  .pm { --glow-peak: 34%; }
  [data-theme="dark"] .pm { --glow-peak: 24%; }
  .pm .pm-card { padding-bottom: 26px; }
  .pm .pm-card:hover { transform: translateY(-4px); }
  /* the device grows down toward "GitHub ↗" */
  .pm .pm-card .device { transform-origin: 50% 0; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
  .pm .pm-card:hover .device,
  .pm .pm-card:has(> .gh:focus-visible) .device { transform: scale(1.14); }
  .pm .pm-card::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(
      560px circle at var(--mx, 50%) var(--my, 50%),
      color-mix(in srgb, var(--tint) var(--glow-peak), transparent) 0%,
      color-mix(in srgb, var(--tint) calc(var(--glow-peak) * 0.7), transparent) 15%,
      color-mix(in srgb, var(--tint) calc(var(--glow-peak) * 0.42), transparent) 32%,
      color-mix(in srgb, var(--tint) calc(var(--glow-peak) * 0.2), transparent) 50%,
      color-mix(in srgb, var(--tint) calc(var(--glow-peak) * 0.07), transparent) 68%,
      transparent 85%);
    opacity: 0; transition: opacity .6s ease;
  }
  .pm .pm-card::after {
    content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    border-radius: inherit; padding: 1.5px;
    background: radial-gradient(
      320px circle at var(--mx, 50%) var(--my, 50%),
      color-mix(in srgb, var(--tint) 75%, white) 0%,
      color-mix(in srgb, var(--tint) 35%, transparent) 40%,
      transparent 80%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity .6s ease;
  }
  .pm .pm-card:hover::before, .pm .pm-card:hover::after { opacity: 1; }
  .pm .pm-card .slide-text, .pm .pm-card .device { position: relative; z-index: 1; }

  .pm .pm-card > .gh {
    position: absolute; inset: 0; z-index: 3; display: block; align-self: stretch;   /* fill the card */
    margin: 0; padding: 0; min-height: 0; border-radius: inherit;
    background: transparent; color: var(--text); border: 0;
  }
  .pm .pm-card > .gh:hover { transform: none; filter: none; }
  .pm .pm-card > .gh > img, .pm .pm-card .gh-label { display: none; }

  .pm .pm-card .slide-text { transition: filter .35s ease, opacity .35s ease; }
  .pm .pm-card:hover .slide-text,
  .pm .pm-card:has(> .gh:focus-visible) .slide-text { filter: blur(6px); opacity: .35; }

  /* bottom-left corner, over the blurred text; the size of the grid's */
  .pm .pm-card .gh-hover {
    position: absolute; bottom: 24px; left: 22px;
    display: inline-flex; align-items: center; gap: 10px;
    font: 700 24px/1.2 var(--sans); letter-spacing: -0.01em; white-space: nowrap;
    opacity: 0; transform: translateY(8px);
    transition: opacity .3s ease, transform .4s cubic-bezier(.2, .8, .2, 1);
  }
  .pm .pm-card .gh-hover img { width: 1em; height: 1em; filter: invert(1); }
  [data-theme="dark"] .pm .pm-card .gh-hover img { filter: none; }
  .pm .pm-card:hover .gh-hover,
  .pm .pm-card > .gh:focus-visible .gh-hover { opacity: 1; transform: none; }
  .pm .pm-card:hover .gh-arrow { transform: translate(3px, -3px); }
  .pm .pm-card > .gh:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; }
}


@media (max-width: 899px) {
  .pm-grid { grid-template-columns: repeat(2, 1fr); padding: 20px 20px 32px; }
}
@media (max-width: 600px) {
  .pm { width: 100vw; height: 100dvh; border-radius: 0; }
  .pm-head { padding: 16px 16px 14px 20px; }
  .pm-head h2 { font-size: 17px; }
  .pm-grid { grid-template-columns: 1fr; padding: 16px 16px 28px; gap: 12px; }
  .pm-card .gh { min-height: 44px; padding: 10px 24px; font-size: 15px; gap: 8px; }
  /* Phones: text and button on the left, a device on the right that peeks
     up from the card's bottom edge, its base cut off a little, so more projects
     fit on screen and there's less to scroll. */
  .pm-card {
    --dh: min(232px, 62vw);          /* device height, whole; smaller on narrow phones */
    --cut: calc(var(--dh) * .14);    /* how much of it hangs below the card */
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr;
    column-gap: 14px; padding: 18px 16px 18px 18px;
  }
  .pm-card .slide-text { grid-column: 1; grid-row: 1; }
  .pm-card .gh { grid-column: 1; grid-row: 2; align-self: end; justify-self: start; padding: 10px 18px; }
  .pm-card .device {
    grid-column: 2; grid-row: 1 / 3; align-self: start;
    /* the bottom padding and the cut don't count toward the card's height */
    margin: 4px 0 calc(-18px - var(--cut));
  }
  .pm-card:hover .device { transform: none; }
  /* The wider iPad also runs off the right edge, so its text column stays as wide
     as the phones'. The watch shows whole. */
  .pm-card:has(.ipad) { --dh: min(210px, 56vw); --cut: calc(var(--dh) * .12); }
  .pm-card .ipad { margin-right: -36px; }
  .pm-card:has(.watch) { --dh: min(204px, 54vw); }
  .pm-card .gh, .pm-card .made { white-space: nowrap; }
  .pm-card .made { font-size: 9.5px; gap: 4px; }
  .pm-card .made svg { height: 14px; }
  .pm-card .badge { height: 20px; margin: -2px 0 -2px 4px; }
  .pm-card h3 { font-size: 18px; }
  .pm-card p { font-size: 13.5px; }
}

/* Device shadows. A copy of the frame image sits behind the video and casts the
   shadow, so it follows the real outline (rounded phone corners, watch strap)
   and never lands on the screen. Being a static layer, it isn't redrawn on
   every video frame.
   Desktop bento grid only; the phone/iPad carousel has no shadows. */
@media (min-width: 900px) {
  .device { isolation: isolate; }
  .device::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: center / 100% 100% no-repeat;
    filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .16)) drop-shadow(0 4px 8px rgba(0, 0, 0, .08));
    transition: filter .35s ease;
  }
  .phone::before { background-image: url("assets/iphone-frame.webp"); }
  .watch::before { background-image: url("assets/watch-frame.webp"); }
  .ipad::before { background-image: url("assets/ipad-frame.webp"); }
  .bento .slide:hover .device::before {
    filter: drop-shadow(0 28px 36px rgba(0, 0, 0, .22)) drop-shadow(0 6px 12px rgba(0, 0, 0, .10));
  }
  [data-theme="dark"] .device::before {
    filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .55)) drop-shadow(0 3px 6px rgba(0, 0, 0, .35));
  }
  [data-theme="dark"] .bento .slide:hover .device::before {
    filter: drop-shadow(0 22px 28px rgba(0, 0, 0, .65)) drop-shadow(0 4px 8px rgba(0, 0, 0, .4));
  }
}

/* Theme switching (see setTheme in script.js) */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
/* Fallback cross-fade for browsers without View Transitions */
.theme-fade, .theme-fade *, .theme-fade *::before, .theme-fade *::after {
  transition: background-color .4s ease, color .4s ease, border-color .4s ease,
              fill .4s ease, stroke .4s ease, box-shadow .4s ease, filter .4s ease !important;
}

/* "Human made" / "AI assisted" eyebrow label above each project title.
   Use class="made human" or class="made ai" on the span. */
.made {
  display: inline-flex; align-items: center; gap: 5px;
  font: 600 11px/1 var(--sans); letter-spacing: .07em; text-transform: uppercase;
  color: var(--text);
}
.made svg { height: 17.5px; width: auto; aspect-ratio: 432 / 512; flex-shrink: 0; }   /* brain icon (SVG Repo); filled, no negative margins so nothing gets clipped */
.made.ai svg { aspect-ratio: 1; }   /* sparkles icon is square */
/* The label sits as far above its title as the title sits above its
   description (about 19px of clear space on desktop and iPad, 23px on phones,
   where the type is a little larger). */
.slide-text .made + h3 { margin-top: 1px; }   /* phones */
.bento .slide-text .made + h3 { margin-top: 6px; }   /* desktop (iPad has its own rule) */

/* Hero entrance, once on page load, in two groups: the first four lines rise
   in together, then the last three (the wordmark among them). The wordmark's
   ball starts bouncing once it has landed (its delay="1600" attribute), then
   the Email button follows. The .intro class is added by the head script only when
   reduced motion is off. */
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(12px); filter: blur(3px); }
}
.intro .hero-copy > *, .intro .hero .cta-row {
  animation: hero-rise 1s cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: var(--d, 0ms);
}
.intro .hero-copy > :nth-child(n + 5) { --d: 700ms; }   /* "plus a keen…", wordmark, "and creating…" */
.intro .hero .cta-row { --d: 1500ms; }

/* Line breaks that only apply on phones (e.g. Experience card titles) */
.br-phone { display: none; }
@media (max-width: 600px) { .br-phone { display: inline; } }

/* Phones and iPad: Color Theory's WWDC21 badge sits small, on the same line as
   its "Human-made" label, so the card's text block is no taller than the others'.
   The text column wraps as a row: label + badge first, then title and blurb. */
@media (max-width: 899px) {
  .track .b-ct .slide-text { flex-flow: row wrap; align-items: center; gap: 8px 10px; }
  .track .b-ct .slide-text > :not(.made):not(.badge) { flex-basis: 100%; order: 2; }
  .track .b-ct .badge { order: 1; position: static; width: auto; height: 26px; margin: -4.5px 0; }   /* overhangs the 17px label row so the label and title stay put */
}
@media (max-width: 600px) {
  .track .b-ct .slide-text { justify-content: center; }
}

/* Desktop: Experience and Certifications use the same width as Projects, so
   the page doesn't taper section by section. The map fills the content width
   (script.js lays the streets out to whatever width it gets), and the two
   certificates hang side by side on one wall like a small gallery. */
@media (min-width: 900px) {
  #experience, #certifications { max-width: 1200px; }
  .xp-map { max-width: none; }
  .certs { flex-direction: row; justify-content: center; align-items: stretch; gap: 64px; }
  .hang { flex: 0 1 480px; width: auto; min-width: 0; display: flex; flex-direction: column; }   /* shrinks to fit on narrow desktops */
  .hang .cert-frame { flex: 1; }
}

/* Watch card: a stronger orange wash than the other cards' 12% tint */
.track.bento .b-wa { background: color-mix(in srgb, var(--tint) 18%, var(--card)); }

/* Hero: the Character Rigging head (hero-face.js) in place of the photo. The canvas
   fades in once the face has drawn. */
.hero-face { position: relative; overflow: hidden; background: none; box-shadow: none; border-radius: 0; }
.hero-face canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .4s ease; }
/* Phones and iPad: the box hugs the head (the artboard's head spans x 84-634, y 54-662
   of 720), so spacing around it is set here rather than by empty canvas. The canvas
   overflows the box by the artboard's margins, so nods and turns never clip. */
@media (max-width: 999px) {
  .hero-face {
    width: auto; aspect-ratio: 550 / 608; margin: 24px auto 0; overflow: visible;
    height: min(440px, 44vh);
  }
  .hero-face canvas { inset: -8.88% auto auto -15.27%; width: 130.91%; height: 118.42%; }
  .hero-copy { margin-top: 32px; }
}
@media (max-width: 600px) {
  .hero-face { height: min(270px, 36vh); }
  .hero-copy { margin-top: 28px; }
}
