/* Design tokens and component styles adapted from cali.so (MIT, see
   THIRD_PARTY_NOTICES.md). Edit colors here; components only use tokens. */

/* Two inks on white paper: black (default) and blue (.blue). Every gray
   step is just ink mixed into the sheet, so changing --ink re-themes all. */
:root {
  --ink: oklch(0.22 0 0);
  --sheet: oklch(1 0 0);

  --gray-1: var(--sheet);
  --gray-2: color-mix(in oklab, var(--ink) 3%, var(--sheet));
  --gray-3: color-mix(in oklab, var(--ink) 6%, var(--sheet));
  --gray-4: color-mix(in oklab, var(--ink) 18%, var(--sheet));
  --gray-5: color-mix(in oklab, var(--ink) 28%, var(--sheet));
  --gray-6: color-mix(in oklab, var(--ink) 40%, var(--sheet));
  --gray-7: color-mix(in oklab, var(--ink) 52%, var(--sheet));
  --gray-8: color-mix(in oklab, var(--ink) 64%, var(--sheet));
  --gray-9: color-mix(in oklab, var(--ink) 74%, var(--sheet));
  --gray-10: color-mix(in oklab, var(--ink) 84%, var(--sheet));
  --gray-11: color-mix(in oklab, var(--ink) 93%, var(--sheet));
  --gray-12: var(--ink);

  --background: var(--gray-1);
  --foreground: var(--gray-12);
  --body: var(--gray-10);
  --muted-foreground: var(--gray-8);
  --muted: var(--gray-3);
  --border: var(--gray-4);
  --popover: var(--gray-1);
  --selection: color-mix(in oklab, var(--ink) 16%, transparent);


  /* the one lit pixel; redline red is reserved for tracked changes */
  --signal: var(--ink);
  --redline: oklch(0.58 0.2 27);

  --paper: oklch(1 0 0);
  --paper-ink: var(--ink);

  --ease-swift: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow-medium: 0 8px 30px rgb(0 0 0 / 0.12);
  --shadow-tooltip: 0 4px 8px rgb(0 0 0 / 0.04), 0 1px 1px rgb(0 0 0 / 0.02);
  --border-hairline: 1px;
  --z-nav: 100;

  /* SF Pro on Apple devices (it can't be hosted on the web, so the system
     font stack asks for it); each device's own system font elsewhere */
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-italic: var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  color-scheme: light;
}

@media only screen and (min-resolution: 192dpi) {
  :root {
    --border-hairline: 0.5px;
  }
}

/* a deep fountain-pen blue; secondary text steps up one level so it
   still clears 4.5:1 on white */
:root.blue {
  --ink: oklch(0.4 0.2 264);
  --muted-foreground: var(--gray-9);
}

/* Christmas: holly-red ink, evergreen for the red marks, snow and a hat */
:root.xmas {
  --ink: oklch(0.44 0.17 25);
  --redline: oklch(0.47 0.12 150);
  --muted-foreground: var(--gray-9);
}

@media (prefers-contrast: more) {
  :root {
    --body: var(--gray-12);
    --muted-foreground: var(--gray-11);
    --border: var(--gray-7);
  }
}

/* ── Base ─────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* keep section titles clear of the fixed top bar */
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--background);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--selection);
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 1px solid var(--gray-9);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* disable every transition while the theme flips */
.theme-switching * {
  transition: none !important;
}

/* ── Page ─────────────────────────────────────────────────────────── */

.page {
  /* wide sheet (1120px content, as on stympaul.com); text-heavy blocks
     sit in a narrower centred measure so lines stay readable */
  --measure: 44rem;
  width: 100%;
  max-width: 73rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 9rem;
}

.section .list,
.section > p,
.nav-cards,
.page > .eyebrow,
.page > .page-lede,
.page > .list,
.page > .back-link,
.page > article {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

.page > .back-link {
  display: block;
}

/* ── Top bar: Contents left, Contact and LinkedIn right ────────────── */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.5rem 1rem;
  background: color-mix(in oklab, var(--background) 92%, transparent);
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.topbar-start,
.topbar-end {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* plain text links: the underline draws in from the left on hover
   (skiper40) and an open menu keeps it */
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.5rem;
  border: 0;
  background: none;
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.pill::after {
  content: '';
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.5rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.pill:hover::after,
.pill:focus-visible::after,
.pill[aria-expanded='true']::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.pill-icon::after {
  display: none;
}

.pill-icon svg {
  width: 1.0625rem;
  height: 1.0625rem;
}

.topbar-mark {
  margin-right: 0.5rem;
  font-size: 1.5rem;
}

.menu {
  position: relative;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 15rem;
  margin: 0;
  padding: 0.5rem;
  border-radius: 0.875rem;
  background: var(--background);
  box-shadow: 0 0 0 1px var(--border), var(--shadow-medium);
  list-style: none;
  transform-origin: top left;
  animation: menu-in 160ms var(--ease-swift);
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
}

.menu-panel[hidden] {
  display: none;
}

.contents-menu a {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1.2;
}

.contents-menu a:hover,
.contents-menu a:focus-visible {
  background: var(--gray-3);
}

/* the greeting pill: a fixed width so it doesn't jump as words change */
.pill-greeting {
  min-width: 7rem;
}

.pill-greeting [data-greeting] {
  display: inline-block;
  transition: opacity 220ms ease, transform 220ms var(--ease-swift);
}

.pill-greeting [data-greeting][data-out] {
  opacity: 0;
  transform: translateY(-4px);
}

.languages-menu {
  min-width: 17rem;
  padding: 0.875rem 1rem 0.75rem;
}

.languages-title {
  color: var(--muted-foreground);
  font-family: var(--font-italic);
  font-size: 0.9375rem;
  font-style: italic;
}

.languages-menu ul {
  margin: 0.375rem 0 0;
  padding: 0;
  list-style: none;
}

.languages-menu li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4375rem 0;
  border-top: var(--border-hairline) solid var(--border);
}

.languages-menu li:first-child {
  border-top: 0;
}

.lang-native {
  color: var(--foreground);
  font-family: var(--font-display), 'Kannada Sangam MN', 'Noto Sans Kannada', 'Devanagari Sangam MN', 'Noto Sans Devanagari', serif;
  font-size: 1.375rem;
  line-height: 1.2;
}

.lang-name {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  white-space: nowrap;
}

.lang-name em {
  font-family: var(--font-italic);
}

.languages-note {
  margin-top: 0.5rem;
  padding-top: 0.625rem;
  border-top: var(--border-hairline) dashed var(--border);
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  line-height: 1.45;
  max-width: 15rem;
}

.contents-index {
  min-width: 2.25rem;
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 39.99rem) {
  .topbar {
    padding: 0.25rem 0.5rem;
  }

  .pill {
    font-size: 1.0625rem;
    padding: 0 0.375rem;
  }

  .topbar-start,
  .topbar-end {
    gap: 0;
  }

  .pill-greeting {
    min-width: 5.75rem;
  }

  /* keep the panels on screen on a phone: the languages panel hangs from
     the left edge of the bar, not from its own pill */
  .topbar-start {
    position: relative;
  }

  .languages {
    position: static;
  }

  .languages-menu {
    min-width: min(17rem, calc(100vw - 1.5rem));
  }
}

/* ── Opening: text left of centre, portrait pinned top right ─────────── */

/* the opening breaks out of the narrow reading column to the page width */
.masthead {
  --hero: calc(100vw - 2rem);
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  width: var(--hero);
  margin-left: calc((100% - var(--hero)) / 2);
  padding-top: 1.5rem;
}

@media (min-width: 40rem) {
  .masthead {
    display: grid;
    grid-template-columns: 26.5fr minmax(20rem, 31.7fr) minmax(1.5rem, 2.3fr) minmax(11rem, 12.4fr) 27.1fr;
    align-items: start;
    gap: 0;
    min-height: min(40rem, 80vh);
    padding-top: 0;
  }

  .masthead .intro {
    grid-column: 2;
    padding-top: 3.5rem;
  }

  .masthead .portrait {
    grid-column: 4;
  }
}

/* narrow tablets: drop the outer gutters so both columns fit */
@media (min-width: 40rem) and (max-width: 55.99rem) {
  .masthead {
    grid-template-columns: 0 minmax(0, 1fr) 2rem 12.5rem 0;
  }
}

.intro {
  max-width: 33rem;
}

.name {
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: clamp(2rem, 2.2vw, 2.5rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.intro-copy {
  font-size: clamp(1rem, 1.6vw, 1.1875rem);
  line-height: 1.75;
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

/* "lawyer": a bold word that opens a one-line note */
.reveal {
  padding: 0;
  border: 0;
  background: none;
  color: var(--foreground);
  font: inherit;
  font-weight: 700;
  text-decoration: underline dotted;
  text-decoration-color: var(--gray-6);
  text-underline-offset: 4px;
  cursor: pointer;
  transition: text-decoration-color 150ms ease;
}

.reveal:hover,
.reveal[aria-expanded='true'] {
  text-decoration-color: var(--foreground);
}

.reveal-note {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 300ms var(--ease-swift), opacity 200ms ease;
}

.reveal-note > span {
  overflow: hidden;
  color: var(--foreground);
  font-family: var(--font-italic);
  font-size: 1.0625rem;
  font-style: italic;
  line-height: 1.4;
}

.reveal-note[data-open] {
  grid-template-rows: 1fr;
  opacity: 1;
}

.reveal-note[data-open] > span {
  padding-top: 0.375rem;
}

/* the typed list: each item is written out, then struck through in red */
.typed-item {
  position: relative;
  white-space: nowrap;
}

.typed-item::after {
  content: '';
  position: absolute;
  left: -1px;
  right: -1px;
  top: 58%;
  height: 3px;
  border-radius: 3px;
  background: color-mix(in oklab, var(--redline) 55%, transparent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 260ms var(--ease-swift);
}

.typed-item[data-struck]::after {
  transform: scaleX(1);
}

.typed-caret {
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 1px;
  vertical-align: -0.12em;
  background: var(--foreground);
  animation: caret 900ms steps(1) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

.typed-end {
  font-family: var(--font-display);
  font-size: 1.4em;
  font-style: italic;
  line-height: 1;
  color: var(--foreground);
}

.intro-copy a {
  color: var(--foreground);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--gray-5);
  text-underline-offset: 3px;
  transition: text-decoration-color 150ms ease;
}

.intro-copy a:hover {
  text-decoration-color: var(--foreground);
}

.ext::after {
  content: '↗';
  display: inline-block;
  margin-left: 0.125rem;
  font-size: 0.75em;
  color: var(--muted-foreground);
  text-decoration: none;
}

.portrait {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: 12rem;
  aspect-ratio: 1;
}

@media (min-width: 40rem) {
  .portrait {
    width: 100%;
  }
}

.halftone-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 600ms var(--ease-swift);
}

.portrait[data-ready] .halftone-canvas {
  opacity: 1;
}

/* ── Nav cards ────────────────────────────────────────────────────── */

.nav-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 3.5rem;
  border-top: var(--border-hairline) solid var(--border);
  border-bottom: var(--border-hairline) solid var(--border);
}

.nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1.5rem 0.75rem 1.25rem;
  min-width: 0;
}

.nav-card + .nav-card {
  border-left: var(--border-hairline) solid var(--border);
}

.nav-card:active {
  transform: scale(0.985);
}

.nav-card-title {
  color: var(--foreground);
  font-weight: 500;
}

.nav-card-meta {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.nc-vignette {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 3.5rem;
  margin-bottom: 0.375rem;
}

/* manuscript sheets */
.nc-sheets span {
  position: absolute;
  width: 2.375rem;
  height: 2.875rem;
  background:
    repeating-linear-gradient(
        to bottom,
        transparent 0 7px,
        color-mix(in oklab, var(--paper-ink) 35%, transparent) 7px 7.5px
      )
      50% 60% / 70% 60% no-repeat,
    var(--paper);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.12);
  transition: transform 300ms var(--ease-spring);
}

.nc-sheets span:nth-child(1) { transform: rotate(-7deg) translateX(-9px); }
.nc-sheets span:nth-child(2) { transform: rotate(4deg) translateX(9px); }
.nc-sheets span:nth-child(3) { transform: rotate(-1deg) translateY(-2px); }

/* project mark: a rounded tile on construction lines */
.nc-tile {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border: var(--border-hairline) solid color-mix(in oklab, var(--foreground) 20%, var(--border));
  border-radius: 0.75rem;
  background: color-mix(in oklab, var(--foreground) 4%, var(--background));
  color: var(--foreground);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 4px 10px rgb(0 0 0 / 0.05);
  transition: transform 300ms var(--ease-spring);
}

.nc-tile svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* envelope */
.nc-envelope {
  position: absolute;
  width: 3.25rem;
  height: 2.25rem;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08), 0 1px 3px rgb(0 0 0 / 0.14);
  transform: rotate(-3deg);
  transition: transform 300ms var(--ease-spring);
  overflow: hidden;
}

.nc-envelope::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
      to bottom right,
      transparent calc(50% - 0.5px),
      color-mix(in oklab, var(--paper-ink) 40%, transparent) 50%,
      transparent calc(50% + 0.5px)
    ) 0 0 / 50% 60% no-repeat,
    linear-gradient(
      to bottom left,
      transparent calc(50% - 0.5px),
      color-mix(in oklab, var(--paper-ink) 40%, transparent) 50%,
      transparent calc(50% + 0.5px)
    ) 100% 0 / 50% 60% no-repeat;
}

.nc-envelope::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  background: var(--signal);
}

@media (hover: hover) and (pointer: fine) {
  .nav-card:hover .nc-sheets span:nth-child(1) { transform: rotate(-13deg) translateX(-16px) translateY(-2px); }
  .nav-card:hover .nc-sheets span:nth-child(2) { transform: rotate(9deg) translateX(16px) translateY(-1px); }
  .nav-card:hover .nc-sheets span:nth-child(3) { transform: rotate(-2deg) translateY(-5px); }
  .nav-card:hover .nc-tile { transform: rotate(-6deg) scale(1.06); }
  .nav-card:hover .nc-envelope { transform: rotate(4deg) translateY(-4px); }
}

@media (max-width: 39.99rem) {
  .nav-card {
    padding: 1.25rem 0.375rem 1rem;
  }
}

/* ── Sections ─────────────────────────────────────────────────────── */

.section {
  margin-top: clamp(5rem, 12vh, 9rem);
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.section > .section-tag {
  display: flex;
  justify-content: center;
}

.section-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 4.9vw, 4.4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.section-tag-index {
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.view-all {
  color: var(--muted-foreground);
  transition: color 150ms ease;
}

.view-all:hover {
  color: var(--foreground);
}

.list {
  margin-top: 1rem;
}

.hairline-top {
  border-top: var(--border-hairline) solid var(--border);
}

.print-pile {
  position: relative;
  flex: none;
  width: 4rem;
  height: 2.75rem;
}

.print-pile-sheet,
.print-thumb {
  position: absolute;
  inset: 1px;
  border-radius: 3px;
  background: var(--paper);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--paper-ink) 22%, transparent);
  transition: transform 300ms var(--ease-spring);
}

.print-pile-sheet:nth-child(1) { transform: rotate(-4deg); }
.print-pile-sheet:nth-child(2) { transform: rotate(3deg); }

.print-thumb {
  inset: 0;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border);
  background:
    radial-gradient(circle, color-mix(in oklab, var(--foreground) 22%, transparent) 0.7px, transparent 0.8px) 0 0 / 3px 3px,
    var(--muted);
}

.print-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.1);
}

/* hovering a row defocuses its siblings */
@media (hover: hover) and (pointer: fine) {
  .focus-list > li {
    transition: opacity 180ms var(--ease-swift);
  }

  .focus-list:hover > li:not(:hover):not(:focus-within) {
    opacity: 0.44;
  }
}

/* ── The Film Roll: negatives that unspool on scroll and develop when
      scratched, with a viewer for the whole roll ──────────────────── */

.film-sub {
  margin-top: -0.75rem;
  text-align: center;
}

.film-hint {
  margin-top: 0.25rem;
  color: var(--muted-foreground);
  font-family: var(--font-italic);
  font-size: 0.9375rem;
  font-style: italic;
  text-align: center;
  transition: opacity 400ms ease;
}

/* fades once someone has started scratching */
.film-hint[data-gone] {
  opacity: 0;
}

.roll {
  --film-top: oklch(0.56 0.12 52);
  --film-bottom: oklch(0.48 0.11 48);
  --film-print: oklch(0.92 0.06 70 / 0.75);
  max-width: 70rem;
  margin: 3.5rem auto 0;
}

.roll + .roll {
  margin-top: 6rem;
}

/* the photo list in the HTML is only data; the strips are built from it */
.roll > img {
  display: none;
}

.roll-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.875rem;
  margin: 0 0 1.125rem 0.875rem;
}

.roll-title {
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
}

.roll-meta {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

.develop-all {
  margin-left: auto;
  min-height: 2.25rem;
  padding: 0 1.125rem;
  border: 1.5px solid var(--foreground);
  border-radius: 50% / 60%;
  background: none;
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  cursor: pointer;
  transition: border-color 200ms ease, transform 200ms ease;
}

.develop-all:hover {
  border-color: var(--redline);
  transform: rotate(-2deg);
}

.develop-all[hidden] {
  display: none;
}

@media (pointer: coarse) {
  .develop-all {
    min-height: 2.75rem;
  }
}

/* a strip of five frames; sprocket holes and edge print top and bottom.
   --unspool (0 to 1, set from the scroll position) wipes it in from the left */
.strip {
  --unspool: 1;
  position: relative;
  display: flex;
  gap: 0.4375rem;
  margin: 0 auto 1.25rem;
  padding: 2.625rem 1rem;
  border-radius: 3px;
  background: linear-gradient(var(--film-top), var(--film-bottom));
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 8px 18px -8px rgb(0 0 0 / 0.3);
  clip-path: inset(0 calc((1 - var(--unspool)) * 100%) 0 0);
  transform: translateX(calc((var(--unspool) - 1) * 70px)) rotate(var(--tilt, 0deg));
  will-change: clip-path, transform;
}

.strip::before,
.strip::after,
.viewer-strip::before,
.viewer-strip::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 0.875rem;
  background: var(--background);
  /* rounded sprocket holes, repeated along the edge */
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='14'><rect x='5' y='2' width='12' height='10' rx='2.5'/></svg>") repeat-x;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='14'><rect x='5' y='2' width='12' height='10' rx='2.5'/></svg>") repeat-x;
  pointer-events: none;
}

.strip::before,
.viewer-strip::before {
  top: 0.625rem;
}

.strip::after,
.viewer-strip::after {
  bottom: 0.625rem;
}

.strip-edge {
  position: absolute;
  top: 1.6875rem;
  left: 1.125rem;
  right: 1.125rem;
  overflow: hidden;
  color: var(--film-print);
  font-family: var(--font-sans);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
  white-space: pre;
  pointer-events: none;
}

.frame {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  background: oklch(0.24 0.05 45);
  cursor: crosshair;
  touch-action: pan-y;
}

/* leader at the start of the roll, unexposed frames at the end */
.frame-leader {
  background: none;
  cursor: default;
}

.frame-empty {
  background: oklch(0.42 0.1 47);
  cursor: default;
}

.frame img,
.frame canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* the negative: the photo drawn into the canvas, then inverted and pushed
   through the orange of the film base */
.frame canvas {
  filter: invert(1) sepia(1) saturate(3) hue-rotate(-18deg) brightness(0.72) contrast(1.15);
  transition: opacity 900ms ease;
}

.frame[data-developed] canvas {
  opacity: 0;
}

.frame[data-developed] {
  cursor: zoom-in;
}

.frame:focus-visible {
  outline: 2px solid var(--redline);
  outline-offset: 2px;
}

.frame-no {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0.125rem;
  color: var(--film-print);
  font-family: var(--font-sans);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

@media (max-width: 43.75rem) {
  .strip {
    gap: 0.25rem;
    padding: 2.125rem 0.5rem;
  }

  .strip-edge,
  .frame-no {
    font-size: 0.4375rem;
  }

  .strip-edge {
    top: 1.375rem;
  }
}

/* the viewer: one large frame of the roll, still scratchable */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 1.125rem;
  background: rgb(20 12 6 / 0.62);
}

.viewer[hidden] {
  display: none;
}

.viewer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  color: oklch(0.985 0.004 90);
}

.viewer-count {
  font-family: var(--font-italic);
  font-size: 1.125rem;
  font-style: italic;
}

.viewer-row {
  display: flex;
  align-items: center;
  gap: 1.125rem;
}

.viewer-strip {
  position: relative;
  padding: 2.75rem 1.125rem;
  border-radius: 3px;
  background: linear-gradient(rgb(255 255 255 / 0.07), rgb(0 0 0 / 0.12)), oklch(0.53 0.12 50);
}

.viewer-strip .frame {
  flex: none;
  width: min(56vw, calc(105svh - 315px), 686px);
}

.viewer-caption {
  min-height: 1.2em;
  color: oklch(0.9 0.02 70);
  font-size: 0.875rem;
}

.viewer-nav,
.viewer-button {
  border: 1.5px solid currentColor;
  border-radius: 50% / 60%;
  background: none;
  color: inherit;
  font-family: var(--font-display);
  cursor: pointer;
  transition: border-color 200ms ease;
}

.viewer-nav {
  width: 3rem;
  height: 3.625rem;
  font-size: 1.6rem;
  line-height: 1;
}

.viewer-button {
  min-height: 2.75rem;
  padding: 0 1.25rem;
  font-size: 1.0625rem;
}

.viewer-nav:hover,
.viewer-button:hover {
  border-color: oklch(0.9 0.1 85);
}

.viewer-nav:disabled {
  opacity: 0.25;
  pointer-events: none;
}

.viewer-button[hidden] {
  display: none;
}

@media (max-width: 43.75rem) {
  .viewer-row {
    gap: 0.5rem;
  }

  .viewer-strip {
    padding: 2.25rem 0.625rem;
  }

  .viewer-strip .frame {
    width: 70vw;
  }

  .viewer-nav {
    width: 2.5rem;
    height: 3rem;
  }
}

/* ── Legal marks: tracked changes, footnotes, section signs ───────── */

del.redline {
  color: var(--muted-foreground);
  text-decoration: line-through;
  text-decoration-color: var(--redline);
  text-decoration-thickness: 1.5px;
}

ins.redline {
  color: var(--foreground);
  text-decoration: underline double;
  text-decoration-color: var(--redline);
  text-underline-offset: 3px;
}

.fn-ref {
  margin-left: 1px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 0;
}

.fn-ref a {
  color: var(--muted-foreground);
  text-decoration: none !important;
}

.footnotes {
  margin-top: 1.25rem;
  padding-top: 0.625rem;
  border-top: var(--border-hairline) dashed var(--border);
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.5;
}

.footnotes sup {
  margin-right: 0.25rem;
  font-family: var(--font-mono);
}

/* ── Footer: a signature block ────────────────────────────────────── */

.footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: end;
  gap: 1.5rem;
  margin-top: 5rem;
  padding-top: 1.25rem;
  border-top: var(--border-hairline) solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.signature {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 15rem;
}

.signature-line {
  height: 1.75rem;
  border-bottom: 1px solid var(--foreground);
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.75rem;
}

.footer a {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
}

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

/* small text links get a 44px tap area on touch screens */
@media (pointer: coarse) {
  .footer a,
  .view-all {
    min-height: 2.75rem;
  }

  .view-all {
    display: inline-flex;
    align-items: center;
  }
}

.fn-ref a {
  position: relative;
}

.fn-ref a::after {
  content: '';
  position: absolute;
  inset: -0.75rem -0.5rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.disclaimer {
  grid-column: 1 / -1;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-transform: none;
  letter-spacing: 0;
}


/* ── Inner pages ──────────────────────────────────────────────────── */

.eyebrow {
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.eyebrow::before {
  content: '§ ';
  color: var(--muted-foreground);
}

.page-lede {
  margin-top: 0.75rem;
  max-width: 28rem;
}

.project-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  background: color-mix(in oklab, var(--foreground) 4%, var(--background));
  box-shadow: 0 0 0 1px var(--border);
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.project-desc {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.5;
}

.project-year {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

/* post */
.back-link {
  color: var(--muted-foreground);
  transition: color 150ms ease;
}

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

/* ── Entrances: blocks develop into focus, they don't slide ───────── */

@keyframes enter-develop {
  from {
    opacity: 0;
    filter: blur(4px);
  }
}

@keyframes enter-swing {
  from {
    opacity: 0;
    transform: translateY(12px) rotate(-2deg);
    filter: blur(2px);
  }
}

.enter {
  animation: enter-develop 350ms var(--ease-swift) backwards;
  animation-delay: var(--d, 0ms);
}

.enter-swing {
  animation: enter-swing 400ms var(--ease-swift) backwards;
  animation-delay: var(--d, 0ms);
}

/* entrances play once per visit, not on every page */
html[data-visited] .enter,
html[data-visited] .enter-swing {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── Version one: legal document meets code ───────────────────────── */

/* a line of "code" under the intro */
.spec {
  margin-top: 1.25rem;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.spec-key {
  color: var(--foreground);
}

.spec-op {
  margin-right: 0.5ch;
}

/* blanks waiting for content are marked so they're easy to spot */
.spec-blank,
[class] > .blank {
  color: var(--redline);
}

/* section heads: a code-style path above a large serif title */
.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

.section-code {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.section-code span {
  opacity: 0.6;
}

.section-title {
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 4.9vw, 4.4rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
}

/* ── § 06 Places: a dotted world map ────────────────────────────────── */

.world {
  position: relative;
  max-width: 70rem;
  margin: 2.5rem auto 0;
}

/* ── Text roll on the top tabs (skiper58): letters roll up on hover,
      from the centre outwards ─────────────────────────────────────── */

.roll-text {
  position: relative;
  display: inline-block;
  overflow: hidden;
  line-height: 1;
  vertical-align: bottom;
}

.roll-text .roll-row {
  display: block;
  white-space: pre;
}

.roll-text .roll-row + .roll-row {
  position: absolute;
  top: 100%;
  left: 0;
}

.roll-text .roll-char {
  display: inline-block;
  transition: transform 380ms cubic-bezier(0.45, 0, 0.2, 1);
  transition-delay: var(--delay, 0ms);
}

@media (hover: hover) and (pointer: fine) {
  .pill:hover .roll-char {
    transform: translateY(-100%);
  }
}

/* ── Ink toggle: the new ink wipes across the page on a diagonal ────── */

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  animation: ink-wipe 700ms cubic-bezier(0.65, 0, 0.35, 1);
}

@keyframes ink-wipe {
  from {
    clip-path: polygon(0 0, 0 0, -30% 100%, -30% 100%);
  }

  to {
    clip-path: polygon(0 0, 130% 0, 100% 100%, -30% 100%);
  }
}

/* Lenis drives scrolling, so the browser's own smooth scroll steps aside */
html.has-lenis {
  scroll-behavior: auto;
}

/* ── Opening: the name spreads flat around the portrait ────────────── */

.opening {
  /* full width of the window, and tucked up under the top bar */
  width: 100vw;
  margin-top: -4rem;
  margin-left: calc(50% - 50vw);
}

.opening-stage {
  position: relative;
  height: 100svh;
  min-height: 32rem;
  overflow: hidden;
}

/* without the script, the name simply sits stacked in the middle */
.opening-name {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: clamp(3rem, 13.5vw, 9.5rem);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.02em;
  pointer-events: none;
}

.opening.is-live .opening-word {
  visibility: hidden;
}

.opening-letter {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  color: var(--foreground);
  font-family: var(--font-display);
  line-height: 1;
  transform-origin: 50% 60%;
  will-change: transform;
  pointer-events: none;
}

.opening .opening-portrait {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: var(--seal-size, 18rem);
  height: var(--seal-size, 18rem);
  margin: calc(var(--seal-size, 18rem) / -2) 0 0 calc(var(--seal-size, 18rem) / -2);
  clip-path: circle(50%);
  transform: scale(var(--grow, 1));
  will-change: transform;
}

.intro-more {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80svh;
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.75;
}

/* the next screen: the tagline large, then the typewriter paragraph */
.intro-lead {
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.intro-lead .reveal {
  font-family: inherit;
  font-weight: inherit;
  font-style: italic;
}

.intro-more .typed {
  margin-top: 2rem;
}

/* "I am…." starts a new line */
.typed-close::before {
  content: '\A';
  white-space: pre;
}

.typed-close + .typed-end,
.typed-end {
  font-family: var(--font-display);
  font-size: 2.2em;
  font-style: italic;
  color: var(--foreground);
}

/* tagline and typed paragraph share one left edge */
.intro-more > * {
  width: 100%;
}

.intro-more .typed {
  font-size: clamp(1.1875rem, 2vw, 1.5rem);
  line-height: 1.6;
}

/* ── Christmas extras: only drawn in the Christmas theme ───────────── */

.xmas-only {
  display: none;
}

:root.xmas .xmas-only {
  display: block;
}

/* the hat sits on the N of PRADYUN and travels with it */
.santa-hat {
  position: absolute;
  left: -0.12em;
  top: -0.5em;
  width: 0.95em;
  transform: rotate(-14deg);
  overflow: visible;
}

.santa-hat .hat-red {
  fill: oklch(0.52 0.2 27);
}

.santa-hat .hat-white {
  fill: #fff;
  stroke: oklch(0.85 0 0);
  stroke-width: 1;
}


.xtree-svg .tree {
  fill: oklch(0.47 0.12 150);
}

.xtree-svg .trunk {
  fill: oklch(0.42 0.06 55);
}

.xtree-svg .star {
  fill: oklch(0.8 0.15 85);
}

.xtree-svg .light {
  animation: twinkle 1.6s ease-in-out infinite;
}

.xtree-svg .light:nth-of-type(2n) {
  animation-delay: 0.5s;
}

.xtree-svg .light:nth-of-type(3n) {
  animation-delay: 1s;
}

@keyframes twinkle {
  50% {
    opacity: 0.25;
  }
}

/* falling snow over the page, never in the way of clicks */
.snow {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}


.ts-dot {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  transition: transform 200ms var(--ease-swift);
}

.ts-mono {
  background: oklch(0.22 0 0);
}

.ts-blue {
  background: oklch(0.4 0.2 264);
}

/* Christmas: holly red and evergreen, split down the middle */
.ts-xmas {
  background: linear-gradient(90deg, oklch(0.44 0.17 25) 50%, oklch(0.47 0.12 150) 50%);
}

/* Kannada and Devanagari sit taller than Latin letters; give the rolling
   greeting room so their tops aren't clipped */
.pill-greeting .roll-text {
  line-height: 1.35;
}

/* ── SF Pro type: headings are semibold and tight, nothing is italic ── */

.name,
.opening-name,
.opening-letter,
.intro-lead,
.section-title,
.section-tag,
.eyebrow,
.post-title,
.prose h2,
.roll-title,
.build-title,
.tool-title {
  font-weight: 600;
  letter-spacing: -0.025em;
}

.pill {
  font-size: 1rem;
  font-weight: 500;
}

html * {
  font-style: normal !important;
}

/* ── § 01 Projects: tiles that come alive on hover ─────────────────── */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(20px, 4vw, 56px); row-gap: 56px; align-items: start; }
.tiles > li:nth-child(even) { margin-top: 140px; }
.tile { display: flex; flex-direction: column; gap: 12px; color: var(--ink); text-decoration: none; }
.tile-head { display: flex; flex-direction: column; gap: 2px; }
.tile-name { font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.tile-desc { font-size: 0.95rem; color: color-mix(in oklch, var(--ink) 65%, var(--sheet)); }
.tile-cover { position: relative; display: block; aspect-ratio: var(--ar, 5 / 4); border-radius: 18px; overflow: hidden; background: var(--bg, #f1efeb); isolation: isolate;
  filter: saturate(0.15) brightness(0.97); transition: filter .6s ease, transform .6s cubic-bezier(.2,.8,.2,1), box-shadow .6s ease; }
/* a soft light that follows the pointer */
.tile-cover::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .4s ease;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 40%), rgb(255 255 255 / 0.32), transparent 65%); mix-blend-mode: soft-light; }
.tile:hover .tile-cover, .tile:focus-visible .tile-cover, .tile.is-live .tile-cover { filter: none; transform: translateY(-4px); box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.35); }
.tile:hover .tile-cover::after, .tile.is-live .tile-cover::after { opacity: 1; }
.tile-window { position: absolute; left: 9%; right: 9%; top: 12%; bottom: -2%; overflow: hidden; border-radius: 12px 12px 0 0; background: #fff; box-shadow: 0 18px 40px -12px rgb(0 0 0 / 0.35); }
.tile-window iframe { position: absolute; left: 0; top: 0; width: 820px; height: calc(100% / var(--s, 0.5)); border: 0; transform: scale(var(--s, 0.5)); transform-origin: 0 0; pointer-events: none; }
.tile-foot { display: flex; justify-content: space-between; font: 500 12px/1 var(--font-mono); letter-spacing: 0.06em; color: color-mix(in oklch, var(--ink) 60%, var(--sheet)); }
.tile-cta i { display: inline-block; transition: transform .3s ease; }
.tile:hover .tile-cta { color: var(--ink); }
.tile:hover .tile-cta i { transform: translate(2px, -2px); }
.tile-more .tile-cover { background: color-mix(in oklch, var(--ink) 5%, var(--sheet)); border: 1px solid color-mix(in oklch, var(--ink) 12%, var(--sheet)); display: grid; place-items: center; filter: none; }
.tile-more .tile-cover::after { mix-blend-mode: normal; background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 40%), color-mix(in oklch, var(--ink) 8%, transparent), transparent 65%); }
.tile-hello { font-size: clamp(1.2rem, 2vw, 1.6rem); font-weight: 600; letter-spacing: -0.02em; padding: 12px 26px; border: 1px solid var(--ink); border-radius: 999px; transition: background .3s, color .3s; }
.tile-more:hover .tile-hello { background: var(--ink); color: var(--sheet); }
@media (max-width: 760px) {
  .tiles { grid-template-columns: 1fr; row-gap: 40px; }
  .tiles > li:nth-child(even) { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .tile-cover { transition: none; } .tile:hover .tile-cover { transform: none; } }

/* ── project pages (work/*.html) ─────────────────────────────────────── */
.work-page { max-width: 1100px; }
.work-back { display: inline-block; margin-bottom: 36px; color: color-mix(in oklch, var(--ink) 65%, var(--sheet)); text-decoration: none; font-size: 0.95rem; }
.work-back:hover { color: var(--ink); }
.work-title { margin: 0 0 14px; font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 600; letter-spacing: -0.04em; line-height: 0.95; color: var(--ink); }
.work-lede { margin: 0 0 8px; max-width: 42rem; font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.5; color: var(--ink); }
.work-note { margin: 0 0 36px; font-size: 0.9rem; color: color-mix(in oklch, var(--ink) 60%, var(--sheet)); }
.work-demo { padding: clamp(16px, 4vw, 48px); border-radius: 24px; background: var(--bg); }
.work-demo iframe { display: block; width: 100%; height: min(820px, 85vh); border: 0; border-radius: 14px; background: #fff; box-shadow: 0 30px 70px -30px rgb(0 0 0 / 0.45); }
.work-how { margin-top: 64px; max-width: 46rem; }
.work-h2 { margin: 0 0 10px; font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; }
.work-intro { margin: 0 0 20px; font-size: 1.05rem; line-height: 1.6; }
.work-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 24px; }
.flow-step { padding: 6px 12px; border-radius: 999px; border: 1px solid color-mix(in oklch, var(--ink) 15%, var(--sheet)); font-size: 0.9rem; }
.flow-step.is-out { border-color: var(--ink); }
.work-flow i { font-style: normal; color: color-mix(in oklch, var(--ink) 45%, var(--sheet)); }
.work-steps { margin: 0; padding-left: 1.2rem; line-height: 1.7; }
.work-steps li + li { margin-top: 8px; }
.work-next { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 72px 0 24px; padding-top: 20px; border-top: 1px solid color-mix(in oklch, var(--ink) 15%, var(--sheet)); color: var(--ink); text-decoration: none; }
.work-next span { color: color-mix(in oklch, var(--ink) 60%, var(--sheet)); }
.work-next b { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -0.02em; }
.work-next:hover b { text-decoration: underline; text-underline-offset: 6px; }

html.lenis-stopped { overflow: hidden; }
.intro-more { min-height: 100vh; min-height: 100svh; box-sizing: border-box; }
.section-title .word, .section-title > div { white-space: nowrap; }

/* tiles, take two: one project per row, a big demo you can read and click */
.tiles { grid-template-columns: 1fr; row-gap: clamp(64px, 9vw, 120px); }
.tiles > li:nth-child(even) { margin-top: 0; }
.tiles > li { width: min(100%, 1120px); }
.tiles > li:nth-child(odd) { margin-right: auto; }
.tiles > li:nth-child(even) { margin-left: auto; }
.tiles .tile-cover { aspect-ratio: 16 / 10; cursor: pointer; }
.tiles .tile-window { left: 5%; right: 5%; top: 7%; bottom: 0; cursor: auto; }
.tiles .tile-window iframe { width: calc(100% / var(--s, 1)); height: calc(100% / var(--s, 1)); transform: scale(var(--s, 1)); pointer-events: auto; }
.tile-name { color: inherit; text-decoration: none; }
.tile-name:hover { text-decoration: underline; text-underline-offset: 5px; }
.tile-cta { color: inherit; text-decoration: none; }
.tiles .tile-more .tile-cover { aspect-ratio: 16 / 6; }
.tiles > li:last-child { width: min(100%, 720px); }
@media (max-width: 700px) {
  .tiles .tile-cover { aspect-ratio: 4 / 5; }
  .tiles .tile-window { left: 4%; right: 4%; top: 5%; }
  .tiles .tile-more .tile-cover { aspect-ratio: 5 / 3; }
}

/* tiles, clean column: every tile the same width, aligned */
.tiles > li, .tiles > li:nth-child(odd), .tiles > li:nth-child(even), .tiles > li:last-child { width: 100%; margin-left: 0; margin-right: 0; }
.tiles { max-width: 1120px; margin-inline: auto; row-gap: clamp(56px, 7vw, 96px); }
.tiles .tile-more .tile-cover { aspect-ratio: 16 / 5; }

/* the demo is shielded from the wheel until clicked, so scrolling stays smooth */
.tiles .tile-window iframe { pointer-events: none; }
.tile.is-using .tile-window iframe { pointer-events: auto; }
.tile-shield { position: absolute; inset: 0; z-index: 3; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 18px; border: 0; background: transparent; cursor: pointer; font: inherit; }
.tile-shield span { padding: 8px 16px; border-radius: 999px; background: rgb(22 23 26 / 0.82); color: #fff; font-size: 13px; font-weight: 500; opacity: 0; transform: translateY(6px); transition: opacity .3s ease, transform .3s ease; }
.tile:hover .tile-shield span, .tile-shield:focus-visible span { opacity: 1; transform: none; }
.tile.is-using .tile-shield { display: none; }
@media (hover: none) { .tile-shield span { opacity: 1; transform: none; } }

/* tiles, three across: all projects side by side in one row */
.tiles { max-width: 1240px; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 32px); row-gap: 40px; }
.tiles .tile-cover { aspect-ratio: 4 / 3; }
.tiles .tile-window { left: 6%; right: 6%; top: 9%; }
.tile-name { font-size: clamp(1.2rem, 1.8vw, 1.6rem); }
.tile-desc { font-size: 0.9rem; }
.tiles > li:last-child { grid-column: 1 / -1; }
.tiles .tile-more .tile-cover { aspect-ratio: auto; min-height: 140px; }
.tiles .tile-more { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px 32px; }
.tiles .tile-more .tile-cover { grid-row: span 2; min-width: min(420px, 100%); }
.tiles .tile-more .tile-foot { display: none; }
@media (max-width: 900px) {
  .tiles { grid-template-columns: 1fr; row-gap: 48px; }
  .tiles .tile-cover { aspect-ratio: 4 / 3; }
  .tiles .tile-more { grid-template-columns: 1fr; }
  .tiles .tile-more .tile-cover { min-width: 0; }
}

/* tiles, one row: the hovered card widens to about two thirds */
.tiles { max-width: 1280px; display: flex; flex-wrap: wrap; gap: 16px; row-gap: 40px; }
.tiles > li { flex: 1 1 0; min-width: 0; width: auto; transition: flex-grow .7s cubic-bezier(.2,.8,.2,1); }
.tiles > li.is-wide { flex-grow: 3.2; }
.tiles > li:last-child { flex: 1 0 100%; }
.tiles .tile-cover { aspect-ratio: auto; height: clamp(380px, 58vh, 600px); }
.tiles .tile-window { left: 6%; right: auto; width: var(--open, 88%); top: 8%; }
.tiles .tile-window iframe { width: var(--w, 900px); height: calc(100% / var(--s, 1)); }
.tiles > li .tile-window { width: calc((100% / 1) * 0.88); }
.tiles > li:not(.is-wide) .tile-window { width: calc(var(--w, 900px) * var(--s, 1)); }
.tiles > li.is-wide .tile-window { width: calc(var(--w, 900px) * var(--s, 1)); }
.tiles .tile-head { min-height: 3.2em; }
.tiles .tile-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .4s; }
.tiles > li:not(.is-wide) .tile-desc { opacity: 0; }
.tiles > li:not(.is-wide) .tile-cover { filter: saturate(0.15) brightness(0.97); }
.tiles > li:not(.is-wide) .tile-foot .tile-cta { opacity: 0; }
@media (max-width: 900px) {
  .tiles { flex-direction: column; flex-wrap: nowrap; }
  .tiles > li, .tiles > li.is-wide { flex: none; width: 100%; }
  .tiles .tile-cover { height: auto; aspect-ratio: 4 / 5; }
  .tiles .tile-window, .tiles > li .tile-window, .tiles > li:not(.is-wide) .tile-window, .tiles > li.is-wide .tile-window { left: 5%; right: 5%; width: auto; }
  .tiles .tile-window iframe { width: calc(100% / var(--s, 1)); }
  .tiles > li:not(.is-wide) .tile-desc { opacity: 1; }
  .tiles > li:not(.is-wide) .tile-cover { filter: saturate(0.15) brightness(0.97); }
}
@media (min-width: 901px) { .tiles > li.is-wide .tile-cover { filter: none; } }

/* tile windows: one size for every card, a Mac-style title bar, a clean bottom edge */
.tiles .tile-window, .tiles > li .tile-window, .tiles > li:not(.is-wide) .tile-window, .tiles > li.is-wide .tile-window {
  top: 12%; bottom: auto; height: 76%; left: 6%; right: auto; width: calc(var(--w, 900px) * var(--s, 1));
  border-radius: 12px; display: block; }
.tiles .tile-window iframe { top: 30px; height: calc((100% - 30px) / var(--s, 1)); }
@media (max-width: 900px) {
  .tiles .tile-window, .tiles > li .tile-window, .tiles > li:not(.is-wide) .tile-window, .tiles > li.is-wide .tile-window { left: 5%; right: 5%; width: auto; top: 9%; height: 82%; }
}

/* tile windows, bigger and without a title bar */
.tiles .tile-window, .tiles > li .tile-window, .tiles > li:not(.is-wide) .tile-window, .tiles > li.is-wide .tile-window { top: 7%; height: 86%; left: 5%; }
.tiles .tile-window iframe { top: 0; height: calc(100% / var(--s, 1)); }
@media (max-width: 900px) {
  .tiles .tile-window, .tiles > li .tile-window, .tiles > li:not(.is-wide) .tile-window, .tiles > li.is-wide .tile-window { left: 4%; right: 4%; width: auto; top: 6%; height: 88%; }
}
/* phones have no hover: show every tile in colour with its link */
@media (max-width: 900px), (hover: none) {
  .tiles > li .tile-cover, .tiles > li:not(.is-wide) .tile-cover { filter: none; }
  .tiles > li:not(.is-wide) .tile-foot .tile-cta { opacity: 1; }
}

/* phones: a shorter window that fits the demo, and the card in view lights up */
@media (max-width: 900px), (hover: none) {
  .tiles .tile-cover { aspect-ratio: 6 / 5; height: auto; }
  .tiles .tile-window, .tiles > li .tile-window, .tiles > li:not(.is-wide) .tile-window, .tiles > li.is-wide .tile-window { left: 4%; right: 4%; width: auto; top: 6%; height: 94%; border-radius: 12px 12px 0 0; }
  .tiles > li .tile-cover, .tiles > li:not(.is-wide) .tile-cover, .tiles > li.is-wide .tile-cover { filter: saturate(0.15) brightness(0.97); transform: none; box-shadow: none; }
  .tiles > li .tile.is-live .tile-cover { filter: none; transform: translateY(-4px); box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.35); }
  .tiles > li .tile.is-live .tile-cover::after { opacity: 1; }
  .tile-shield span { opacity: 0; }
  .tile.is-live .tile-shield span { opacity: 1; transform: none; }
}
/* phones: the window closes at the bottom too, sitting fully inside the card */
@media (max-width: 900px), (hover: none) {
  .tiles .tile-cover { aspect-ratio: 1 / 1; }
  .tiles .tile-window, .tiles > li .tile-window, .tiles > li:not(.is-wide) .tile-window, .tiles > li.is-wide .tile-window { top: 5%; bottom: 5%; height: auto; left: 5%; right: 5%; border-radius: 12px; }
}

/* "…and a lot more": one calm full-width panel under the projects */
.tiles > li.more-li { flex: 1 0 100%; width: 100%; }
.more-panel { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; padding: clamp(28px, 4vw, 48px) clamp(24px, 4vw, 56px); border-radius: 22px; background: color-mix(in oklch, var(--ink) 4%, var(--sheet)); color: var(--ink); text-decoration: none; overflow: hidden; isolation: isolate; transition: background .4s ease; }
.more-panel::after { content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s; background: radial-gradient(420px circle at var(--mx, 70%) var(--my, 50%), color-mix(in oklch, var(--ink) 7%, transparent), transparent 70%); }
.more-panel:hover::after { opacity: 1; }
.more-text { display: flex; flex-direction: column; gap: 8px; max-width: 40rem; }
.more-title { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; }
.more-sub { font-size: clamp(1rem, 1.4vw, 1.15rem); line-height: 1.5; color: color-mix(in oklch, var(--ink) 65%, var(--sheet)); }
.more-cta { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 28px; border-radius: 999px; background: var(--ink); color: var(--sheet); font-size: 1.05rem; font-weight: 500; white-space: nowrap; transition: transform .3s ease; }
.more-cta i { display: inline-block; transition: transform .3s ease; }
.more-panel:hover .more-cta i { transform: translate(2px, -2px); }
.more-panel:active .more-cta { transform: scale(.98); }
.more-text { max-width: 48rem; }

/* ── § 03 Experience and education: a calm ledger that lights up on hover ── */
.ledger { list-style: none; margin: 0 auto; padding: 0; max-width: 1040px; display: grid; gap: 40px; }
.ledger-row { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 4px 20px; align-items: start; padding: 18px 16px; border-bottom: 1px solid color-mix(in oklch, var(--ink) 10%, var(--sheet)); border-radius: 16px; isolation: isolate; transition: opacity .35s ease, transform .45s cubic-bezier(.2,.8,.2,1), background .35s ease, border-color .35s ease; }
/* the soft light that follows the pointer, as on the project cards */
.ledger-row::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: 0; transition: opacity .35s ease; background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), color-mix(in oklch, var(--ink) 7%, transparent), transparent 70%); }
.ledger-logo { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--c); color: #fff; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; filter: saturate(0) brightness(1.15) contrast(0.85); transition: filter .5s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
.ledger-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ledger-org { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.ledger-role { font-size: 0.98rem; color: color-mix(in oklch, var(--ink) 80%, var(--sheet)); }
.ledger-line { margin-top: 6px; max-width: 46rem; font-size: 0.93rem; line-height: 1.55; color: color-mix(in oklch, var(--ink) 62%, var(--sheet)); }
.ledger-line a { color: inherit; text-underline-offset: 3px; }
.ledger-line a:hover { color: var(--ink); }
.ledger-meta { padding-top: 4px; font-size: 0.9rem; color: color-mix(in oklch, var(--ink) 60%, var(--sheet)); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
@media (hover: hover) {
  .ledger:hover .ledger-row { opacity: 0.38; }
  .ledger .ledger-row:hover { opacity: 1; transform: translateX(6px); border-color: transparent; }
  .ledger-row:hover::before { opacity: 1; }
  .ledger-row:hover .ledger-logo { filter: none; transform: scale(1.04); }
}
@media (hover: none) { .ledger-logo { filter: none; } }
@media (max-width: 640px) {
  .ledger-row { grid-template-columns: 40px minmax(0, 1fr); padding: 16px 8px; }
  .ledger-logo { width: 40px; height: 40px; border-radius: 10px; font-size: 12px; }
  .ledger-meta { grid-column: 2; grid-row: 2; text-align: left; padding-top: 0; white-space: normal; }
  .ledger-main { grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) { .ledger-row, .ledger-logo { transition: none; } .ledger .ledger-row:hover { transform: none; } }

/* ── Film viewer: a quiet, Photos-style lightbox ───────────────────── */
.viewer { padding: 16px; background: rgb(10 10 12 / 0.78); -webkit-backdrop-filter: blur(20px) saturate(1.2); backdrop-filter: blur(20px) saturate(1.2); }
.viewer-inner { gap: 18px; width: min(100%, 980px); color: #f5f5f7; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; }
.viewer-top { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.viewer-count { margin: 0; font-family: inherit; font-style: normal; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; color: rgb(245 245 247 / 0.72); font-variant-numeric: tabular-nums; }
.viewer-close, .viewer-nav { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.12); color: #f5f5f7; cursor: pointer; transition: background .2s ease, transform .15s ease, opacity .2s ease; }
.viewer-close:hover, .viewer-nav:hover { background: rgb(255 255 255 / 0.22); border-color: transparent; }
.viewer-close:active, .viewer-nav:active { transform: scale(0.94); }
.viewer-nav:disabled { opacity: 0.25; }
.viewer-close:focus-visible, .viewer-nav:focus-visible, .viewer-button:focus-visible { outline: 2px solid #0a84ff; outline-offset: 3px; }
.viewer-row { gap: 20px; }
.viewer-strip { border-radius: 10px; box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.7); }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 44px; }
.viewer-caption { margin: 0; font-size: 14px; line-height: 1.4; color: rgb(245 245 247 / 0.72); }
.viewer-button { min-height: 40px; padding: 0 20px; border: 0; border-radius: 999px; background: #f5f5f7; color: #1d1d1f; font-family: inherit; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; transition: background .2s ease, transform .15s ease; margin-left: auto; }
.viewer-button:hover { background: #fff; border-color: transparent; }
.viewer-button:active { transform: scale(0.97); }
@media (max-width: 43.75rem) {
  .viewer-row { gap: 8px; }
  .viewer-close, .viewer-nav { width: 40px; height: 40px; }
  .viewer-bar { flex-direction: column; align-items: stretch; text-align: center; }
  .viewer-button { margin-left: 0; min-height: 44px; }
}

/* credit line under the film roll */
.film-credit { margin: 28px auto 0; max-width: 40rem; text-align: center; font-size: 13px; line-height: 1.5; color: color-mix(in oklch, var(--ink) 55%, var(--sheet)); }
.film-credit a { color: inherit; text-underline-offset: 3px; }
.film-credit a:hover { color: var(--ink); }

/* Develop all: one prominent capsule button, Apple-style */
.develop-all { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--foreground); color: var(--background); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; transition: opacity .2s ease, transform .15s ease; }
.develop-all:hover { border-color: transparent; transform: none; opacity: 0.86; }
.develop-all:active { transform: scale(0.97); }
.develop-all:focus-visible { outline: 2px solid #0a84ff; outline-offset: 3px; }
@media (pointer: coarse) { .develop-all { min-height: 44px; } }

/* "curious and creative": underlined words with a note beneath */
.typed-end .reveal { font-weight: inherit; font-size: inherit; letter-spacing: inherit; }
.am-note > span { font-family: var(--font-sans); font-style: normal; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: color-mix(in oklch, var(--ink) 70%, var(--sheet)); }
/* the note sits beside the full stop, fading in from the left */
.typed-end { position: relative; }
.typed-end .am-note { position: absolute; left: calc(100% + 0.5em); bottom: 0.32em; display: block; width: max-content; max-width: 22rem; opacity: 0; transform: translateX(-8px); transition: opacity .3s ease, transform .4s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.typed-end .am-note > span { display: block; padding: 0; overflow: visible; font-size: clamp(0.95rem, 1.4vw, 1.15rem); line-height: 1.3; }
.typed-end .am-note[data-open] { opacity: 1; transform: none; }
.typed-end .am-note[data-open] > span { padding: 0; }
/* narrow screens: no room beside it, so the line drops beneath */
@media (max-width: 900px) {
  .typed-end .am-note { position: static; display: block; width: auto; max-width: none; margin-top: 0.4rem; transform: translateY(-4px); }
  .typed-end .am-note[data-open] { transform: none; }
}

/* ── Theme menu in the top bar (replaces the bottom dock) ─────────── */
.theme-menu { position: relative; }
.theme-pill { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: inherit; }
.theme-swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--foreground); box-shadow: 0 0 0 1px color-mix(in oklch, var(--foreground) 30%, transparent); }
.theme-pill[data-theme='xmas'] .theme-swatch { background: linear-gradient(90deg, oklch(0.47 0.17 25) 50%, oklch(0.47 0.12 150) 50%); }
.theme-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 80; min-width: 200px; padding: 6px; border-radius: 14px; background: color-mix(in oklch, var(--background) 92%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); box-shadow: 0 0 0 0.5px rgb(0 0 0 / 0.12), 0 12px 32px -8px rgb(0 0 0 / 0.25); transform-origin: top right; animation: themePop .18s cubic-bezier(.2,.8,.2,1); }
.theme-pop[hidden] { display: none; }
@keyframes themePop { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.theme-pop button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--foreground); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
.theme-pop button:hover, .theme-pop button:focus-visible { background: color-mix(in oklch, var(--foreground) 8%, transparent); outline: none; }
.theme-pop .ts-dot { flex: none; width: 14px; height: 14px; }
.theme-check { width: 16px; height: 16px; margin-left: auto; opacity: 0; }
.theme-pop [aria-checked='true'] .theme-check { opacity: 1; }
@media (pointer: coarse) { .theme-pop button { min-height: 44px; } }
@media (max-width: 520px) { .theme-pill-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .theme-pill { padding-inline: 12px; } }
@media (prefers-reduced-motion: reduce) { .theme-pop { animation: none; } }
/* each note sits directly beneath its own word */
.typed-end .am-note, .typed-end .am-note[data-open] { position: absolute; left: var(--nx, 0); top: var(--ny, 100%); bottom: auto; margin-top: 0.15em; width: max-content; max-width: min(22rem, 80vw); }
.typed-end .am-note { transform: translateY(-4px); }
.typed-end .am-note[data-open] { transform: none; }
/* an invisible bridge across the gap, so hovering down into a menu doesn't close it */
.topbar .menu, .topbar .theme-menu { position: relative; }
.topbar .menu::after, .topbar .theme-menu::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }

/* ── § 02 Experience and education: year rail, big names, floating card ── */
.tl-tabs { position: relative; display: flex; justify-content: center; gap: 32px; max-width: 1040px; margin: 0 auto 28px; border-bottom: 1px solid color-mix(in oklch, var(--ink) 10%, var(--sheet)); }
.tl-tabs [role='tab'] { padding: 10px 0 12px; border: 0; background: none; font: inherit; font-size: 1.05rem; font-weight: 500; color: color-mix(in oklch, var(--ink) 45%, var(--sheet)); cursor: pointer; transition: color .25s ease; min-height: 44px; }
.tl-tabs [role='tab'][aria-selected='true'] { color: var(--ink); }
.tl-tabs [role='tab']:hover { color: var(--ink); }
.tl-ind { position: absolute; left: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .4s cubic-bezier(.2,.8,.2,1), width .4s cubic-bezier(.2,.8,.2,1); }
.tl { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 28px; max-width: 1040px; margin: 0 auto; }
.tl-rail { position: sticky; top: 120px; align-self: start; height: 320px; }
.tl-line { position: absolute; left: 44px; top: 0; bottom: 0; width: 2px; border-radius: 2px; background: color-mix(in oklch, var(--ink) 10%, var(--sheet)); }
.tl-span { position: absolute; left: 43px; top: var(--a, 0%); height: var(--b, 10%); width: 4px; border-radius: 3px; background: var(--ink); transition: top .55s cubic-bezier(.2,.8,.2,1), height .55s cubic-bezier(.2,.8,.2,1); }
.tl-year { position: absolute; left: 0; top: var(--p); transform: translateY(-50%); font-size: 12px; color: color-mix(in oklch, var(--ink) 55%, var(--sheet)); font-variant-numeric: tabular-nums; }
.tl-lists { position: relative; padding-bottom: 40px; }
.tl-list { list-style: none; margin: 0; padding: 0; }
.tl-row { position: relative; padding: 14px 0; }
.tl-name { display: inline-block; max-width: 52%; font-size: clamp(1.9rem, 4vw, 3.2rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; color: color-mix(in oklch, var(--ink) 28%, var(--sheet)); text-decoration: none; transition: color .35s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
.tl-ext { display: inline-block; margin-left: 0.25em; font-size: 0.5em; vertical-align: 0.6em; opacity: 0; transform: translate(-4px, 4px); transition: opacity .3s ease, transform .3s ease; }
.tl-sub { display: block; max-width: 52%; margin-top: 4px; font-size: 0.95rem; color: color-mix(in oklch, var(--ink) 40%, var(--sheet)); transition: color .35s ease; }
.tl-row.is-on .tl-name { color: var(--ink); transform: translateX(6px); }
.tl-row.is-on .tl-sub { color: color-mix(in oklch, var(--ink) 65%, var(--sheet)); }
.tl-name:hover .tl-ext, .tl-name:focus-visible .tl-ext { opacity: 1; transform: none; }
.tl-name:focus-visible { outline: 2px solid #0a84ff; outline-offset: 4px; border-radius: 6px; }
.tl-card { position: absolute; right: 0; top: 0; width: 44%; transition: top .5s cubic-bezier(.2,.8,.2,1); }
.tl-card-inner { padding: 20px; border-radius: 18px; background: color-mix(in oklch, var(--ink) 4%, var(--sheet)); animation: tlIn .4s cubic-bezier(.2,.8,.2,1); }
@keyframes tlIn { from { opacity: 0; transform: translateY(8px); } }
.tl-logo { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 12px; border-radius: 11px; color: #fff; font-size: 13px; font-weight: 600; }
.tl-role { margin: 0; font-size: 1.1rem; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.tl-meta { margin: 2px 0 10px; font-size: 0.9rem; color: color-mix(in oklch, var(--ink) 60%, var(--sheet)); }
.tl-desc { margin: 0; font-size: 0.95rem; line-height: 1.55; color: color-mix(in oklch, var(--ink) 80%, var(--sheet)); }
@media (max-width: 760px) {
  .tl { grid-template-columns: 1fr; gap: 12px; }
  .tl-rail { position: relative; top: 0; height: 28px; }
  .tl-line { left: 0; right: 0; top: 20px; bottom: auto; width: auto; height: 2px; }
  .tl-span { left: var(--a, 0%); top: 19px; width: var(--b, 10%); height: 4px; transition: left .55s cubic-bezier(.2,.8,.2,1), width .55s cubic-bezier(.2,.8,.2,1); }
  .tl-year { top: 0; left: var(--p); transform: translateX(-50%); font-size: 11px; }
  .tl-year:first-of-type { transform: none; }
  .tl-name, .tl-sub { max-width: none; }
  .tl-card { position: static; width: auto; margin-top: 12px; }
  .tl-tabs { gap: 24px; }
}
@media (prefers-reduced-motion: reduce) { .tl-name, .tl-span, .tl-card, .tl-card-inner { transition: none; animation: none; } }

/* § 03 Awards and publications, with a little aside */
#awards .section-head { position: relative; }
#awards .section-head { text-align: center; }
a.ledger-row { color: inherit; text-decoration: none; }
a.ledger-row:hover .tl-ext, a.ledger-row:focus-visible .tl-ext { opacity: 1; transform: none; }
a.ledger-row:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }
.aw-list { margin-top: 32px; }
@media (max-width: 760px) { .tl-rail { margin: 0 14px; } }
/* small phones: the top bar holds PK, Contents, the greeting, Theme, Contact and LinkedIn */
@media (max-width: 420px) {
  .topbar .pill { padding-inline: 9px; }
  .theme-pill { padding-inline: 10px; }
}
@media (max-width: 420px) {
  .topbar { padding-inline: 0.5rem; }
  .topbar-start, .topbar-end { gap: 0.15rem; }
  .topbar .pill { font-size: 1.05rem; padding-inline: 0.4rem; min-width: 2.5rem; }
  .theme-pill { padding-inline: 0.55rem; }
}
/* a quiet aside under the Awards heading */
.author-note { margin: 12px 0 0; text-align: center; font-size: 1.05rem; line-height: 1.5; color: color-mix(in oklch, var(--ink) 60%, var(--sheet)); }
.author-note a { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in oklch, var(--ink) 25%, var(--sheet)); text-underline-offset: 4px; transition: text-decoration-color .25s ease; white-space: nowrap; }
.author-note a:hover { text-decoration-color: var(--ink); }
.author-note a span { display: inline-block; transition: transform .25s ease; }
.author-note a:hover span { transform: translate(2px, -2px); }
.author-note a:focus-visible { outline: 2px solid #0a84ff; outline-offset: 3px; border-radius: 4px; }

/* ── Phone fixes ─────────────────────────────────────────────────── */
@media (max-width: 760px) {
  /* "curious and creative" wraps on phones, so the note sits under the whole line */
  .typed-end .am-note, .typed-end .am-note[data-open] { position: static; display: block; width: auto; max-width: none; margin-top: 0.5rem; }
  .typed-end .am-note:not([data-open]) { height: 0; margin: 0; overflow: hidden; }

  /* Awards rows: logo on the left, text beside it, date underneath */
  a.ledger-row, .ledger-row { grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; }
  .ledger-row .ledger-logo { grid-column: 1; grid-row: 1 / span 2; }
  .ledger-row .ledger-main { grid-column: 2; grid-row: 1; }
  .ledger-row .ledger-meta { grid-column: 2; grid-row: 2; text-align: left; padding-top: 6px; white-space: normal; }
}

/* the photo viewer fits a phone: smaller arrows, frame sized to the screen */
@media (max-width: 43.75rem) {
  .viewer { padding: 12px; }
  .viewer-inner { width: 100%; max-width: 100%; box-sizing: border-box; }
  .viewer-row { width: 100%; justify-content: center; gap: 6px; }
  .viewer-nav { flex: none; width: 36px; height: 36px; }
  .viewer-strip { padding: 1.75rem 0.5rem; min-width: 0; }
  .viewer-strip .frame { width: calc(100vw - 24px - 2 * 36px - 2 * 6px - 1rem); }
  .viewer-bar { width: 100%; }
}

/* ── § 05 Places: the Atlas list and the map that folds into a globe ── */
.places-sub { margin: 10px 0 0; text-align: center; font-size: 1.05rem; color: color-mix(in oklch, var(--ink) 60%, var(--sheet)); }
.atlas { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; max-width: 1180px; margin: 36px auto 0; align-items: start; }
.atlas-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 28px; }
.atlas-group:first-child { grid-row: span 3; }
.atlas-label { margin: 0 0 8px; font: 500 12px/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: color-mix(in oklch, var(--ink) 55%, var(--sheet)); }
.atlas-label span { margin-left: 4px; color: color-mix(in oklch, var(--ink) 35%, var(--sheet)); }
.atlas-group ul { list-style: none; margin: 0; padding: 0; }
.atlas-place { display: flex; align-items: baseline; gap: 6px; width: 100%; min-height: 32px; padding: 3px 0; border: 0; background: none; font: inherit; font-size: 1.05rem; font-weight: 500; letter-spacing: -0.015em; text-align: left; color: color-mix(in oklch, var(--ink) 45%, var(--sheet)); cursor: pointer; transition: color .25s ease, transform .4s cubic-bezier(.2,.8,.2,1); }
.atlas-place span { font-size: 0.8rem; font-weight: 400; color: color-mix(in oklch, var(--ink) 50%, var(--sheet)); }
.atlas-place:hover, .atlas-place.is-on, .atlas-place:focus-visible { color: var(--ink); transform: translateX(5px); outline: none; }
.atlas-map { position: sticky; top: 110px; margin: 0; padding: 18px; border-radius: 22px; background: color-mix(in oklch, var(--ink) 3%, var(--sheet)); }
.atlas-map svg { display: block; width: 100%; height: auto; overflow: visible; color: var(--ink); }
.atlas-sphere { fill: color-mix(in oklch, var(--ink) 3%, transparent); stroke: color-mix(in oklch, var(--ink) 12%, transparent); stroke-width: 0.8; }
.atlas-land path { fill: currentColor; fill-opacity: 0.1; stroke: var(--sheet); stroke-width: 0.4; transition: fill-opacity .3s ease; }
.atlas-land path.is-visited { fill-opacity: 0.5; }
.atlas-land path.is-home { fill-opacity: 0.92; }
.atlas-land path.is-active { fill-opacity: 1; }
.atlas-ring { fill: none; stroke: currentColor; stroke-opacity: 0.75; stroke-width: 1.4; transition: opacity .2s ease; }
.atlas-ring.is-active { fill: currentColor; stroke-opacity: 1; }
.atlas-caption { display: flex; align-items: baseline; justify-content: center; gap: 10px; min-height: 2.2rem; margin-top: 12px; }
.atlas-caption b { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; color: var(--ink); }
.atlas-caption span { font-size: 0.95rem; color: color-mix(in oklch, var(--ink) 60%, var(--sheet)); }
@media (max-width: 860px) {
  .atlas { grid-template-columns: 1fr; gap: 20px; }
  .atlas-map { order: -1; position: sticky; top: 64px; z-index: 2; padding: 12px; }
  .atlas-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
  .atlas-group:first-child { grid-row: auto; grid-column: 1 / -1; columns: 2; column-gap: 16px; }
  .atlas-group:first-child .atlas-label { column-span: all; }
  .atlas-place { font-size: 1rem; min-height: 36px; }
}
/* bigger map, no frames: it sits straight on the page */
.atlas { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); max-width: 1320px; gap: 48px; }
.atlas-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 24px; }
.atlas-map { padding: 0; background: none; border-radius: 0; }
.atlas-map svg { overflow: hidden; }
.atlas-sphere { fill: none; stroke: none; }
.atlas.is-folded .atlas-sphere { fill: color-mix(in oklch, var(--ink) 4%, transparent); }
.atlas-sphere { transition: fill .4s ease; }
@media (max-width: 860px) { .atlas-map { padding: 8px 0; background: var(--sheet); } }
/* the globe can be dragged; countries can be clicked */
.atlas.is-folded .atlas-map svg { cursor: grab; touch-action: none; }
.atlas.is-folded .atlas-map svg:active { cursor: grabbing; }
.atlas.is-folded .atlas-land path { cursor: pointer; }
.atlas-land path:not(.is-visited):not(.is-home).is-active { fill-opacity: 0.35; }
.atlas-flat { display: block; margin: 6px auto 0; min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: color-mix(in oklch, var(--ink) 7%, var(--sheet)); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .3s ease, background .2s ease; }
.atlas.is-folded .atlas-flat { opacity: 1; pointer-events: auto; }
.atlas-flat:hover { background: color-mix(in oklch, var(--ink) 12%, var(--sheet)); }
.atlas-flat:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }
/* names are buttons that open the details, not links */
button.tl-name { padding: 0; border: 0; background: none; font-family: inherit; text-align: left; cursor: pointer; }
/* film tip: plain on desktop, a clear little pill on phones */
.film-hint { font-family: var(--font-sans); font-style: normal; }
@media (hover: none) {
  .film-hint { display: table; margin: 10px auto 0; padding: 8px 14px; border-radius: 999px; background: color-mix(in oklch, var(--ink) 6%, var(--sheet)); color: var(--ink); font-size: 0.9rem; }
}
/* phones: big globe on top, the countries below (these come last so they win) */
@media (max-width: 760px) {
  .atlas { grid-template-columns: 1fr; gap: 12px; margin-top: 20px; }
  .atlas-map { order: -1; position: static; padding: 0; background: none; }
  .atlas-map svg { width: 100%; max-width: 520px; margin: 0 auto; }
  .atlas-flat { display: none; }
  .atlas-caption { margin-top: 4px; }
  .atlas-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
  .atlas-group:first-child { grid-row: auto; grid-column: 1 / -1; columns: 2; column-gap: 16px; }
  .atlas-group:first-child .atlas-label { column-span: all; }
  .atlas-place { font-size: 1rem; min-height: 40px; }
  .places-sub { font-size: 0.95rem; }
}
@media (max-width: 760px) {
  .atlas-flat { display: block; }
  .atlas:not(.is-folded) .atlas-flat { display: none; }
}
.project-kind { margin: 0 0 8px; font: 500 12px/1.2 var(--font-mono); color: color-mix(in oklch, var(--ink) 65%, var(--sheet)); }

/* ── Christmas: the hat on my head, trees with elves behind them ─────── */
.portrait-hat.santa-hat { left: 27%; top: -1%; width: 48%; z-index: 3; transform: rotate(-14deg); pointer-events: none; filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.18)); }

.xmas-forest { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
:root.xmas .xmas-forest { display: block; }
.xtree { position: absolute; width: clamp(3.6rem, 7vw, 6.5rem); padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; }
.xtree { left: 0; top: 0; visibility: hidden; }
.xtree-c { width: clamp(2.8rem, 5vw, 4.6rem); }
.xtree-svg { position: relative; z-index: 2; display: block; width: 100%; overflow: visible; transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.xtree:hover .xtree-svg { transform: rotate(-3deg); }
.xtree:active .xtree-svg { transform: scale(.95); }
.xtree:focus-visible { outline: 2px solid #0a84ff; outline-offset: 4px; border-radius: 12px; }

/* the elf waits behind the tree, peeks out on the first tap */
.xelf { position: absolute; z-index: 1; left: 22%; bottom: 6%; width: 58%; overflow: visible; transform: translate(0, 0) rotate(0); transition: transform .55s cubic-bezier(.34,1.56,.64,1), opacity .2s ease; }
.xtree[data-state='peek'] .xelf { transform: translate(-70%, -6%) rotate(-14deg); }
.xtree[data-state='running'] .xelf { opacity: 0; transition: none; }
.xelf .elf-hat, .xelf .elf-body { fill: oklch(0.5 0.14 150); }
.xelf .elf-band, .xelf .elf-leg { fill: oklch(0.55 0.2 27); }
.xelf .elf-pom { fill: #fff; }
.xelf .elf-face, .xelf .elf-ear { fill: #f2c7a2; }
.xelf .elf-eye { fill: #222; }
.xelf .elf-cheek { fill: #f09a92; opacity: .7; }
.xelf .elf-smile { fill: none; stroke: #7a3d22; stroke-width: 1.6; stroke-linecap: round; }
.xelf .elf-belt { fill: #2a2a2a; }

/* the runner: a copy of the elf that dashes across the screen */
.xelf-runner { position: absolute; z-index: 4; pointer-events: none; animation: elfBob .26s ease-in-out infinite alternate; transition: none; }
.xelf-runner.is-left { scale: -1 1; }
.xelf-runner .elf-leg { transform-box: fill-box; transform-origin: 50% 0; animation: elfStep .18s ease-in-out infinite alternate; }
.xelf-runner .elf-leg-r { animation-delay: -.18s; }
@keyframes elfStep { from { transform: rotate(28deg); } to { transform: rotate(-28deg); } }
@keyframes elfBob { from { margin-top: 0; } to { margin-top: -5px; } }

@media (prefers-reduced-motion: reduce) { .xelf, .xtree-svg { transition: none; } .xelf-runner, .xelf-runner .elf-leg { animation: none; } }
