/* Dark is the default look; the toggle switches to the light set below. */
:root {
  color-scheme: dark;
  --bg: #000000;
  --bg-alt: #000000;
  --tile: #161617;
  --tile-2: #1d1d1f;
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --ink-3: #86868b;
  --line: rgb(255 255 255 / 0.12);
  --accent: #2997ff;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --nav: rgb(22 22 23 / 0.8);
  --grad: linear-gradient(90deg, #2997ff 0%, #9b8cff 50%, #ff6fa8 100%);
  --dim: rgb(245 245 247 / 0.22);
  --h0: #232326;
  --h1: #0b3a6b;
  --h2: #0f5fb3;
  --h3: #2997ff;
  --h4: #a8d4ff;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Thai", "Inter", "Noto Sans Thai", "Helvetica Neue", sans-serif;
  --mono: "SF Mono", "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --tile: #f5f5f7;
  --tile-2: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #515154;
  --ink-3: #6e6e73;
  --line: rgb(0 0 0 / 0.12);
  --accent: #0066cc;
  --nav: rgb(250 250 252 / 0.8);
  --grad: linear-gradient(90deg, #0071e3 0%, #7d5cff 50%, #e8467c 100%);
  --dim: rgb(29 29 31 / 0.2);
  --h0: #e3e3e8;
  --h1: #b9dcff;
  --h2: #6cb6ff;
  --h3: #0071e3;
  --h4: #003e80;
}
:root[data-theme="light"] .band-alt .tile { --tile: #ffffff; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4, p { margin: 0; }

.skip {
  position: absolute;
  z-index: 40;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  color: var(--bg);
  background: var(--ink);
  border-radius: 980px;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.wrap { width: min(1260px, 100%); margin-inline: auto; padding-inline: 24px; }

/* Local navigation */
.localnav {
  position: sticky;
  z-index: 30;
  top: 0;
  background: var(--nav);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.localnav-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(1260px, 100%);
  min-height: 52px;
  margin-inline: auto;
  padding-inline: 24px;
}
.localnav-title { margin-right: auto; color: var(--ink); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.localnav-title:hover { text-decoration: none; }
.localnav-links { display: flex; gap: 4px; }
.localnav-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 10px;
  color: var(--ink-2);
  font-size: 0.75rem;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.localnav-links a:hover { color: var(--ink); text-decoration: none; }
.localnav-links a[aria-current="true"] { color: var(--ink); }
.localnav-toggle, .theme-toggle {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink-2);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.localnav-toggle:hover, .theme-toggle:hover { color: var(--ink); }
.theme-toggle svg { width: 17px; height: 17px; }
.localnav-toggle { display: none; }
.localnav-toggle .icon { transition: transform 0.3s var(--ease); }
.localnav-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }

/* Pills and links */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 22px;
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 980px;
  font-size: 1.0625rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.pill:hover { background: var(--blue-hover); border-color: var(--blue-hover); text-decoration: none; }
.pill-ghost { color: var(--accent); background: transparent; border-color: var(--accent); }
.pill-ghost:hover { color: #fff; background: var(--blue); border-color: var(--blue); }
.pill-small { position: relative; min-height: 28px; padding: 3px 12px; font-size: 0.75rem; white-space: nowrap; }
/* The small pill keeps a full-size touch target. */
.pill-small::after { content: ""; position: absolute; inset: -8px 0; }
.more { display: inline-flex; align-items: center; gap: 6px; }
.more::after { content: "›"; font-size: 1.2em; line-height: 1; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

.eyebrow { color: var(--ink-3); font-size: 1.0625rem; font-weight: 600; }
.grad { width: fit-content; color: transparent; background: var(--grad); -webkit-background-clip: text; background-clip: text; }

/* Hero */
.hero { padding-top: clamp(56px, 9vw, 104px); text-align: center; overflow: clip; }
.hero-copy { display: grid; justify-items: center; }
.hero .eyebrow { font: 500 0.9375rem var(--mono); margin-bottom: 14px; }
h1 { font-size: clamp(2.75rem, 9.2vw, 6.5rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
.hero-tagline { margin-top: 14px; color: var(--ink-2); font-size: clamp(1.35rem, 3.6vw, 2.5rem); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
.position { margin-top: 26px; color: var(--ink); font-size: 1.0625rem; line-height: 1.6; }
.role { margin-top: 6px; color: var(--ink-3); font-size: 0.9375rem; }
.hero .links { margin-top: 30px; }
.hero-social { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; margin-top: 22px; font-size: 0.9375rem; }
.hero-social .more { min-height: 44px; }

.display-stage { margin-top: clamp(36px, 6vw, 72px); padding-inline: 24px; }
.display {
  position: relative;
  width: min(1080px, 100%);
  margin-inline: auto;
  transform: scale(var(--s, 1));
  transform-origin: 50% 100%;
  will-change: transform;
}
.display-glow {
  position: absolute;
  inset: 12% 4% -6%;
  background: linear-gradient(90deg, #2997ff, #7d6bff 45%, #ff5fa2 80%, #ff9f5a);
  border-radius: 50%;
  filter: blur(72px);
  opacity: calc(0.2 + 0.4 * var(--p, 1));
}
/* The panel is a lit screen, so it stays black in both themes. */
.display-panel {
  position: relative;
  padding: clamp(10px, 2.2vw, 28px);
  background: #000;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: clamp(14px, 2.6vw, 30px);
  box-shadow: 0 0 0 clamp(3px, 0.6vw, 7px) #1d1d1f, 0 40px 80px -30px rgb(0 0 0 / 0.6);
}
.pixels {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(26, minmax(0, 1fr));
  grid-template-rows: repeat(14, auto);
  gap: clamp(2px, 0.5vw, 6px);
}
.px {
  aspect-ratio: 1;
  background: rgb(255 255 255 / 0.055);
  border-radius: 26%;
}
.px[data-l="1"] { background: hsl(var(--h) 85% 30%); }
.px[data-l="2"] { background: hsl(var(--h) 92% 46%); }
.px[data-l="3"] { background: hsl(var(--h) 100% 60%); box-shadow: 0 0 12px hsl(var(--h) 100% 60% / 0.5); }
.px[data-l="4"] { background: hsl(var(--h) 100% 78%); box-shadow: 0 0 18px hsl(var(--h) 100% 70% / 0.75); }
.display-caption { position: relative; margin-top: 26px; color: var(--ink-3); font-size: 0.875rem; }

.focus { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-block: 40px 0; padding-block: 0; list-style: none; }
.focus li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; color: var(--ink-2); background: var(--tile); border-radius: 980px; font-size: 0.875rem; }
.chip-logo { flex: none; width: 18px; height: 18px; }

/* Manifesto and headline numbers */
.manifesto { padding-block: clamp(88px, 14vw, 180px); }
.manifesto-text {
  max-width: 21em;
  margin-inline: auto;
  font-size: clamp(1.6rem, 4.3vw, 3.25rem);
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: -0.01em;
}
.manifesto-text .w { transition: color 0.35s var(--ease); }
.motion .manifesto-text.dimmed .w:not(.lit) { color: var(--dim); }

/* Numbers: a black screen whose subpixels light up under the pointer, in both themes. */
.numbers { position: relative; display: grid; align-items: center; min-height: min(100vh, 980px); padding-block: 120px; color: #f5f5f7; background: #000; text-align: center; overflow: hidden; isolation: isolate; }
/* Each 10px pixel is a wide blue subpixel beside a green one stacked on a red one. The unlit grid is a
   static tile; app.js paints only the lit subpixels on the canvas above it. */
.subpixels {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23fff' fill-opacity='.05'%3E%3Crect x='1.2' y='1' width='4.2' height='7.6' rx='1.2'/%3E%3Crect x='7.2' y='1' width='2.1' height='3.8' rx='.9'/%3E%3Crect x='7.2' y='6.1' width='2.1' height='2.6' rx='.9'/%3E%3C/svg%3E") 0 0 / 10px 10px;
}
.subpixels::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 30%, #000 92%); }
.subpixels canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.numbers h2 { margin: 0; font-size: clamp(2rem, 4.4vw, 3.25rem); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(48px, 7vw, 96px) 24px; max-width: 1040px; margin: clamp(56px, 8vw, 104px) auto 0; }
.stats > div { display: flex; flex-direction: column; align-items: center; }
.stats dt { color: #f5f5f7; font-size: 0.875rem; line-height: 1.4; }
.stats dd { margin: 4px 0 0; font-size: clamp(2.25rem, 5vw, 3.5rem); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* About: an explorer panel. The portrait is a lit subject on black in both themes. */
.about { padding-top: 0; }
.explorer { position: relative; display: grid; align-items: center; min-height: min(780px, 86vh); padding: 48px clamp(20px, 6vw, 96px); color: #f5f5f7; background: #000; border: 1px solid rgb(255 255 255 / 0.2); border-radius: 36px; overflow: hidden; isolation: isolate; }
.explorer-stage { position: absolute; z-index: 0; inset: 0; perspective: 1300px; perspective-origin: 58% 45%; overflow: hidden; }
.explorer-glow { position: absolute; inset: 6% 12% 0 30%; background: radial-gradient(ellipse at 50% 55%, rgb(60 90 255 / 0.5), rgb(150 80 255 / 0.2) 45%, transparent 70%); filter: blur(34px); transform: translate(calc(var(--ry, 0) * -1.6px), calc(var(--rx, 0) * 1.6px)); }
/* The figure tilts in 3D toward the pointer (--rx and --ry, in degrees, come from app.js). */
.explorer-figure { position: absolute; bottom: 0; left: 58%; height: 95%; aspect-ratio: 1050 / 1398; transform: translateX(-50%) rotateY(calc(var(--ry, 0) * 1deg)) rotateX(calc(var(--rx, 0) * 1deg)); transform-origin: 50% 70%; transform-style: preserve-3d; will-change: transform; touch-action: pan-y; cursor: grab; }
.explorer-figure.dragging { cursor: grabbing; }
.explorer-float { width: 100%; height: 100%; }
.motion .explorer-float { animation: figure-float 7s ease-in-out infinite alternate; }
.explorer-stage img { display: block; width: 100%; height: 100%; transform-origin: var(--origin, 50% 50%); transform: scale(var(--zoom, 1)); -webkit-user-drag: none; user-select: none; filter: drop-shadow(0 0 28px rgb(90 110 255 / 0.28)); }
.motion .explorer-stage img { transition: transform 1s cubic-bezier(0.3, 0, 0.1, 1), transform-origin 1s cubic-bezier(0.3, 0, 0.1, 1); }
.explorer-stage::after { content: ""; position: absolute; inset: auto 0 0; height: 20%; background: linear-gradient(transparent, #000); pointer-events: none; }
@keyframes figure-float { from { transform: translateY(0); } to { transform: translateY(-10px); } }
.explorer-arrows { position: absolute; z-index: 1; left: clamp(12px, 2vw, 32px); top: 50%; display: grid; gap: 22px; transform: translateY(-50%); }
.explorer .flip { transform: rotate(180deg); }
.explorer .paddle { width: 40px; height: 40px; color: #f5f5f7; background: #2a2a2d; }
.explorer-list { position: relative; z-index: 1; display: grid; justify-items: start; gap: 12px; width: min(460px, 100%); margin: 0; padding: 0; list-style: none; }
.explorer-pill { display: inline-flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 28px 8px 14px; color: #f5f5f7; background: rgb(42 42 45 / 0.9); border: 0; border-radius: 980px; font: 600 1.0625rem/1.3 var(--sans); cursor: pointer; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); transition: background-color 0.2s var(--ease); }
.explorer-pill:hover { background: rgb(58 58 62 / 0.95); }
.plus { position: relative; flex: none; width: 28px; height: 28px; border: 1.5px solid currentColor; border-radius: 50%; }
.plus::before, .plus::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 12px; height: 1.5px; background: currentColor; transform: translate(-50%, -50%); }
.plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.explorer-text { margin: 0; padding: 28px 30px; color: #f5f5f7; background: rgb(42 42 45 / 0.9); border-radius: 28px; font-size: 1.0625rem; line-height: 1.55; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.explorer-text a { color: #2997ff; }
.explorer-item.open .explorer-pill { display: none; }
.motion .explorer-item.open .explorer-text { animation: text-in 0.5s var(--ease) both; }
@keyframes text-in { from { opacity: 0; transform: scale(0.96); } }

/* Sections */
.band { padding-block: clamp(80px, 11vw, 160px); }
.band-alt { background: var(--bg-alt); }
.section-head { max-width: 900px; margin-bottom: clamp(40px, 5vw, 72px); }
.section-head.center { display: grid; justify-items: center; margin-inline: auto; text-align: center; }
h2 { margin-top: 8px; font-size: clamp(2.25rem, 6.4vw, 4.5rem); font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
h2 span { color: var(--ink-3); }
.section-lede { max-width: 44em; margin-top: 20px; color: var(--ink-2); font-size: clamp(1.0625rem, 1.7vw, 1.3125rem); font-weight: 500; line-height: 1.55; }
.section-note { color: var(--ink-3); font-size: 0.9375rem; }
.after-note { margin-top: 28px; color: var(--ink-2); }

/* Tiles */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-6 { grid-column: span 6; }
.tile { padding: clamp(24px, 3vw, 40px); background: var(--tile); border-radius: 28px; }
.tile h3 { font-size: 1.5rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.tile p { margin-top: 10px; color: var(--ink-2); line-height: 1.6; }
.tile .tags, .tags { margin-top: 18px; color: var(--ink-3); font: 400 0.8125rem/1.7 var(--mono); }
.icon.tile-icon { display: block; width: 44px; height: 44px; margin-bottom: 28px; color: var(--accent); stroke-width: 1.4; }
.span-3 { min-height: 300px; }
.span-3 .icon.tile-icon { width: 56px; height: 56px; margin-bottom: 56px; }
.span-3 h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.span-6 { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 32px; align-items: start; }
.span-6 .tile-icon { grid-row: span 3; margin-bottom: 0; }

/* Work gallery */
.gallery { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-padding-inline: max(24px, calc(50% - 606px)); }
.gallery::-webkit-scrollbar { display: none; }
.gallery-track { display: flex; gap: 20px; width: max-content; margin: 0; padding: 4px max(24px, calc(50vw - 606px)); list-style: none; }
.slide { display: flex; flex-direction: column; width: min(400px, 80vw); min-height: 440px; scroll-snap-align: start; }
.slide h3 { color: var(--ink-3); font-size: 1.0625rem; letter-spacing: 0; }
.slide .after { margin-top: 10px; color: var(--ink); font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
.slide .before { margin-top: auto; padding-top: 24px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.9375rem; }
.slide .before span { display: block; margin-bottom: 2px; font-size: 0.75rem; font-weight: 600; }
.paddles { display: flex; justify-content: flex-end; gap: 14px; margin-top: 28px; }
.paddle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink);
  background: var(--tile-2);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity 0.2s var(--ease), background-color 0.2s var(--ease);
}
:root[data-theme="light"] .paddle { background: #e8e8ed; }
.paddle:disabled { opacity: 0.35; cursor: default; }

/* Expertise */
.also { margin-top: 32px; max-width: 60em; color: var(--ink-2); }
.also strong { color: var(--ink); font-weight: 600; }
.stack { margin-top: 20px; }
.logo-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 22px 8px; margin: 32px 0 44px; padding: 0; list-style: none; }
.logo-wall li { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-2); font-size: 0.75rem; line-height: 1.3; text-align: center; }
/* Logos sit on a white app-icon tile in both themes, since many are dark or multi-colour. */
.logo-wall img { box-sizing: content-box; width: 34px; height: 34px; padding: 11px; background: #fff; border-radius: 24%; object-fit: contain; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06); transition: transform 0.3s var(--ease); }
.logo-wall li:hover img { transform: scale(1.08); }
.stack-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px 24px; }
.stack-group h4 { margin-bottom: 8px; color: var(--ink); font-size: 1.0625rem; font-weight: 600; }
.stack-group ul { margin: 0; padding: 0; list-style: none; }
.stack-group li { padding-block: 7px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 0.875rem; line-height: 1.55; }

/* Heatmap */
.segments { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.segments button {
  min-height: 36px;
  padding: 6px 16px;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 980px;
  font: 400 0.875rem var(--sans);
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.segments button:hover { color: var(--ink); border-color: var(--ink-3); }
.segments button[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }

.heat-scroll { overflow-x: auto; padding-bottom: 8px; }
.heat {
  --cell: 14px;
  --gap: 4px;
  position: relative;
  display: grid;
  grid-auto-columns: var(--cell);
  grid-template-rows: 20px repeat(7, var(--cell));
  gap: var(--gap);
  width: max-content;
  margin-inline: auto;
  padding-left: 24px;
}
.heat .cell { border-radius: 4px; background: var(--h0); }
.heat .cell:hover, .heat .cell.on { outline: 2px solid var(--ink); outline-offset: 0; }
.heat .month { grid-row: 1; color: var(--ink-3); font-size: 0.75rem; line-height: 20px; white-space: nowrap; }
.heat .dow { position: absolute; left: 0; color: var(--ink-3); font-size: 0.6875rem; line-height: var(--cell); }
.cell[data-l="FIRST_QUARTILE"], i[data-l="FIRST_QUARTILE"] { background: var(--h1); }
.cell[data-l="SECOND_QUARTILE"], i[data-l="SECOND_QUARTILE"] { background: var(--h2); }
.cell[data-l="THIRD_QUARTILE"], i[data-l="THIRD_QUARTILE"] { background: var(--h3); }
.cell[data-l="FOURTH_QUARTILE"], i[data-l="FOURTH_QUARTILE"] { background: var(--h4); }
i[data-l="NONE"] { background: var(--h0); }

.heat-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 16px; color: var(--ink-2); font-size: 0.875rem; }
.legend { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 0.8125rem; }
.legend i { width: 12px; height: 12px; border-radius: 3px; }
.legend i:first-of-type { margin-left: 5px; }
.legend i:last-of-type { margin-right: 5px; }

summary { min-height: 44px; padding-block: 10px; color: var(--accent); cursor: pointer; }
summary .icon { margin-right: 8px; }
.table-view { margin-top: 12px; font-size: 0.9375rem; }
table { width: min(340px, 100%); margin-top: 8px; border-collapse: collapse; }
th, td { padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--ink-3); font-weight: 500; }
td:last-child, th:last-child { padding-right: 0; text-align: right; font-variant-numeric: tabular-nums; }

.tip {
  position: fixed;
  z-index: 35;
  padding: 6px 12px;
  color: var(--bg);
  background: var(--ink);
  border-radius: 980px;
  font-size: 0.8125rem;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
}

/* Private */
.p-row { grid-column: span 3; display: flex; flex-direction: column; }
.p-count { margin-bottom: 14px; color: var(--ink); font-size: clamp(3rem, 5.4vw, 4.5rem); font-weight: 600; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.p-row h3.with-icon { display: flex; align-items: center; gap: 10px; font-size: 1.3125rem; }
.p-row.muted .p-count, .p-row.muted h3 { color: var(--ink-3); }

/* Public */
.card { grid-column: span 2; display: flex; flex-direction: column; }
.card h3 { font-size: 1.3125rem; overflow-wrap: anywhere; }
.card h3 a { color: var(--ink); }
.card h3 a::after { content: " ›"; color: var(--accent); }
.card p { flex: 1; }
.meta { margin-top: 20px; color: var(--ink-3); font-size: 0.8125rem; }
.motion .card { transition: transform 0.4s var(--ease); }
.motion .card.in:hover { transform: scale(1.02); transition-delay: 0s; }

.forks { margin-top: 20px; padding: 6px clamp(20px, 3vw, 32px); background: var(--tile); border-radius: 20px; }
:root[data-theme="light"] .band-alt .forks { background: #fff; }
.forks .section-note { margin-bottom: 12px; }
.forks[open] { padding-bottom: 18px; }
.rows { margin: 0; padding: 0; list-style: none; }
.rows li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 90px; gap: 4px 16px; padding-block: 10px; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.rows a { overflow-wrap: anywhere; }
.rows .desc { color: var(--ink-2); }
.rows .lang { color: var(--ink-3); font-size: 0.8125rem; text-align: right; }
.rows .own { color: var(--ink); font-weight: 600; }

/* Contact */
.contact .links { margin-top: 32px; }
.services .tile-icon { margin-bottom: 20px; }

footer { padding-block: 20px 36px; background: var(--bg-alt); border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.75rem; line-height: 1.8; }

/* Icons */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}
.icon-fill { fill: currentColor; stroke: none; }
.icon-accent { color: var(--accent); }

/* Motion: everything below applies only without a reduced-motion preference. */
.motion .reveal { opacity: 0; transform: translateY(28px) scale(0.985); }
.motion .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s var(--ease), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.motion .pixels.wait .px { opacity: 0; }
.motion .pixels.play .px { animation: px-in 0.6s var(--ease) both; animation-delay: calc(300ms + var(--c) * 34ms); }
.motion .heat.wait .cell { opacity: 0; }
.motion .heat.play .cell { animation: cell-in 0.45s ease-out both; animation-delay: calc(var(--w) * 13ms); }
@keyframes px-in { from { opacity: 0; transform: scale(0.4); } }
@keyframes cell-in { from { opacity: 0; transform: scale(0.3); } }

@media (max-width: 1020px) {
  .localnav-toggle { display: grid; }
  .localnav-links {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 6px 24px 16px;
    background: var(--tile);
    border-bottom: 1px solid var(--line);
  }
  .localnav.open .localnav-links { display: flex; }
  .localnav-links a { padding-inline: 0; border-top: 1px solid var(--line); font-size: 0.9375rem; }
  .localnav-links a:first-child { border-top: 0; }
  .stack-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .explorer { display: block; min-height: 0; padding: 0 16px 24px; border-radius: 28px; }
  .explorer-stage { position: relative; height: min(460px, 60vh); margin-inline: -16px; perspective-origin: 50% 45%; }
  .explorer-glow { inset: 6% 8% 0; }
  .explorer-figure { left: 50%; }
  .explorer-arrows { display: none; }
  .explorer-list { width: 100%; margin-top: -8px; }
  .span-2 { grid-column: span 3; }
  .bento > .span-2:last-child:nth-child(odd) { grid-column: span 6; }
  .card { grid-column: span 3; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3 { min-height: 0; }
  .span-3 .tile-icon { margin-bottom: 32px; }
  .heat { margin-inline: 0; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap, .localnav-bar { padding-inline: 16px; }
  .localnav-links { padding-inline: 16px; }
  .localnav-title { font-size: 1.0625rem; }
  .display-stage { padding-inline: 12px; }
  .bento { gap: 12px; }
  .span-2, .span-3, .span-6, .card, .p-row { grid-column: span 6; }
  .span-6 { display: block; }
  .span-6 .tile-icon { margin-bottom: 24px; }
  .tile { border-radius: 22px; }
  .gallery-track { gap: 12px; padding-inline: 16px; }
  .gallery { scroll-padding-inline: 16px; }
  .slide { min-height: 360px; }
  .stats { gap: 44px 12px; }
  .numbers { padding-block: 88px; }
  .stack-grid { grid-template-columns: minmax(0, 1fr); }
  .segments button { min-height: 44px; }
  .rows li { grid-template-columns: minmax(0, 1fr) auto; }
  .rows .desc { grid-column: 1 / -1; grid-row: 2; }
  .pill { font-size: 1rem; }
  h2 { font-size: 2rem; }
  h2 span { display: block; }
}

/* Full standing portrait: keep the person, shoes and both desk feet in frame. */
.explorer { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 24px; min-height: 0; padding: 32px 32px 32px 64px; }
.explorer-stage { position: relative; grid-column: 2; grid-row: 1; inset: auto; height: clamp(480px, 53vw, 680px); overflow: visible; perspective-origin: 50% 50%; }
.explorer-figure { left: 50%; bottom: 5%; width: 90%; height: 90%; aspect-ratio: auto; transform-origin: 50% 50%; }
.explorer-stage img { object-fit: contain; transform: none; }
.explorer-stage::after { display: none; }
.explorer-glow { inset: 12% 0; opacity: .55; }
.explorer-list { grid-column: 1; grid-row: 1; width: 100%; }
.explorer-text { padding: 24px; }
@media (max-width: 860px) {
  .explorer { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px 16px 24px; }
  .explorer-stage { grid-column: 1; grid-row: 1; width: 100%; height: auto; aspect-ratio: 1122 / 1402; max-height: 640px; margin: 0; }
  .explorer-list { grid-column: 1; grid-row: 2; margin-top: 0; }
}

/* The About figure is a canvas sprite: each cell is 3:4, drawn contain-fit on the bottom edge. */
.explorer-stage canvas { display: block; width: 100%; height: 100%; user-select: none; }
.explorer-figure { aspect-ratio: auto; }
.sprite-toggle { position: absolute; right: 12px; bottom: 12px; z-index: 2; min-height: 36px; padding: 0 14px; border: 1px solid rgb(255 255 255 / 0.2); border-radius: 999px; background: rgb(0 0 0 / 0.55); color: #f5f5f7; font: inherit; font-size: .8125rem; cursor: pointer; backdrop-filter: blur(12px); }
.sprite-toggle:hover { background: rgb(40 40 42 / 0.8); }
.sprite-toggle:focus-visible { outline: 2px solid #2997ff; outline-offset: 2px; }
@media (max-width: 860px) {
  .explorer-stage { aspect-ratio: 3 / 4; }
}
