
  :root {
    --bg: #ffffff;
    --ink: #1d1d1f;
    --soft: #6e6e73;
    --faint: #86868b;
    --card: #f5f5f7;
    --well: #ffffff;
    --line: rgba(0, 0, 0, 0.1);
    --hair: rgba(0, 0, 0, 0.045);
    --link: #0066cc;
    --pill: #1d1d1f;
    --pill-ink: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.78);
    --nav-active: rgba(0, 0, 0, 0.05);
    --nav-shadow: 0 3px 16px rgba(0, 0, 0, 0.055);
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    color-scheme: light;
  }

  [data-theme='dark'] {
    --bg: #101113;
    --ink: #f5f5f7;
    --soft: #b2b2b8;
    --faint: #9b9ba3;
    --card: #1b1c1f;
    --well: #242529;
    --line: rgba(255, 255, 255, 0.14);
    --hair: rgba(255, 255, 255, 0.06);
    --link: #2997ff;
    --pill: #f5f5f7;
    --pill-ink: #1d1d1f;
    --nav-bg: rgba(22, 22, 24, 0.78);
    --nav-active: rgba(255, 255, 255, 0.09);
    --nav-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }

  * { box-sizing: border-box; }

  html { scroll-behavior: smooth; }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background 0.4s ease, color 0.4s ease;
  }

  ::selection { background: rgba(0, 102, 204, 0.15); }

  a { color: inherit; }

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

  /* One container for everything. Inline-only properties, so section
     spacing below never loses the cascade to this class. */
  .container {
    max-width: 780px;
    margin-inline: auto;
    padding-inline: 28px;
  }

  section { padding-top: clamp(72px, 10vw, 114px); }

  /* ---------- reveal ---------- */
  .r {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  }
  .r.in { opacity: 1; transform: none; }

  /* ---------- hero ---------- */
  .hero { padding-top: clamp(64px, 9vw, 116px); }

  /* Entrance: the hero composes itself top to bottom on load */
  @keyframes hero-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
  .hr1, .hr3, .hr4 { animation: hero-in 0.9s var(--ease) both; }
  .hr1 { animation-delay: 0.05s; }
  .hr3 { animation-delay: 0.21s; }
  .hr4 { animation-delay: 0.29s; }

  .eyebrow {
    margin: 0 0 20px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.006em;
  }

  .eyebrow .dim { color: var(--soft); font-weight: 400; }

  /* the four-colour pixel chip, carried over from the original wordmark */
  .chip-px {
    width: 10px;
    height: 10px;
    display: inline-block;
    vertical-align: 0;
    margin-right: 8px;
  }

  .hero h1 {
    margin: 0;
    font-size: clamp(28px, 4.4vw, 40px);
    font-weight: 600;
    letter-spacing: -0.022em;
    line-height: 1.16;
    max-width: 19em;
  }

  .hero h1 .dim { display: block; color: var(--faint); }

  .hero-sub {
    margin: 22px 0 0;
    color: var(--soft);
    font-size: 17px;
    line-height: 1.6;
    max-width: 34em;
  }

  .hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 36px;
    flex-wrap: wrap;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    background: var(--pill);
    color: var(--pill-ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.006em;
    padding: 8px 18px;
    border-radius: 980px;
    transition: opacity 0.25s ease, background 0.25s ease;
  }

  .btn:hover { opacity: 0.85; }

  .btn-secondary {
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--hair);
    padding: 7px 17px; /* border eats the 1px so both pills match */
  }

  .btn-secondary:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--ink) 6%, var(--card));
  }

  .socials { display: flex; gap: 2px; margin-left: 8px; }

  .socials a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--faint);
    transition: color 0.25s ease;
  }

  .socials a:hover { color: var(--ink); }

  .socials svg { width: 16px; height: 16px; }

  /* ---------- bento ---------- */
  .bento {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .tile {
    background: var(--card);
    border-radius: 18px;
    padding: 22px 22px 24px;
    transition: background 0.4s ease;
  }

  .tile svg { width: 18px; height: 18px; color: var(--ink); }

  .tile h3 {
    margin: 22px 0 4px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.012em;
  }

  .tile p { margin: 0; font-size: 15px; color: var(--soft); line-height: 1.45; letter-spacing: -0.008em; }

  /* ---------- section headings ---------- */
  .sec-h {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin: 0 0 24px;
  }

  /* ---------- method cards ---------- */
  .method-title {
    margin: 0 0 8px;
    font-size: clamp(21px, 3vw, 27px);
    font-weight: 600;
    letter-spacing: -0.018em;
  }

  .method-sub {
    margin: 0 0 32px;
    color: var(--soft);
    font-size: 15px;
    line-height: 1.55;
    max-width: 42em;
  }

  .method-lead { display: block; }

  .method-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .m-card {
    background: var(--card);
    border-radius: 18px;
    padding: 12px;
    transition: background 0.4s ease;
  }

  .m-card h3 {
    margin: 20px 10px 4px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.012em;
  }

  .m-card > p { margin: 0 10px 12px; font-size: 15px; color: var(--soft); line-height: 1.45; letter-spacing: -0.008em; }

  .m-wide {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 28px;
    align-items: center;
  }

  .m-wide h3 { margin: 0 0 5px; }

  .m-wide p {
    margin: 0;
    padding-right: 12px;
    font-size: 15px;
    color: var(--soft);
    line-height: 1.55;
    letter-spacing: -0.003em;
  }

  .diagram {
    background: var(--well);
    border-radius: 12px;
    height: 184px;
    display: grid;
    place-items: center;
    overflow: hidden;
    position: relative;
    transition: background 0.4s ease;
  }

  /* ---------- method diagrams (inline SVG, drawn in code) ---------- */
  .dg { height: 150px; width: auto; max-width: 100%; color: var(--ink); overflow: visible; }
  .dg .ln { fill: none; stroke: currentColor; stroke-width: 1.25; opacity: .22; }
  .dg .st { fill: var(--well); stroke: currentColor; stroke-width: 1.5; }
  .dg .fl { fill: currentColor; }
  .dg .trk { fill: currentColor; opacity: .07; }
  .dg .bar { fill: currentColor; opacity: .78; transform-box: fill-box; transform-origin: 0 50%; }
  .dg .acc { fill: var(--link); }
  .dg .acc-st { fill: none; stroke: var(--link); stroke-width: 1.5; }
  .dg .dash { stroke-dasharray: 3 5; }
  .dg .lbl { fill: var(--faint); font-size: 9px; font-weight: 500; letter-spacing: .01em; text-anchor: middle; }

  /* 1 · parallel lanes fill at their own pace; the single lane takes its time */
  .dg .b1 { animation: dg-fill-a 4s var(--ease) infinite; }
  .dg .b2 { animation: dg-fill-b 4s var(--ease) infinite; }
  .dg .b3 { animation: dg-fill-c 4s var(--ease) infinite; }
  .dg .b4 { animation: dg-fill-b 8s var(--ease) infinite; }
  @keyframes dg-fill-a { 0% { transform: scaleX(0); } 45%, 88% { transform: scaleX(1); opacity: .78; } 100% { transform: scaleX(1); opacity: 0; } }
  @keyframes dg-fill-b { 0% { transform: scaleX(0); } 62%, 88% { transform: scaleX(1); opacity: .78; } 100% { transform: scaleX(1); opacity: 0; } }
  @keyframes dg-fill-c { 0% { transform: scaleX(0); } 34%, 88% { transform: scaleX(1); opacity: .78; } 100% { transform: scaleX(1); opacity: 0; } }

  /* 2 · spec flows to agents, agents flow to review */
  .dg .flow { animation: dg-march 1.1s linear infinite; opacity: .4; }
  @keyframes dg-march { from { stroke-dashoffset: 8; } to { stroke-dashoffset: 0; } }
  .dg .work { transform-box: fill-box; transform-origin: center; animation: dg-pulse 1.8s ease-in-out infinite; }
  .dg .work:nth-of-type(2) { animation-delay: .3s; }
  .dg .work:nth-of-type(3) { animation-delay: .6s; }
  @keyframes dg-pulse { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(.55); opacity: .35; } }
  .dg .check { stroke-dasharray: 24; animation: dg-draw 3.6s var(--ease) infinite; }
  @keyframes dg-draw { 0%, 35% { stroke-dashoffset: 24; } 55%, 90% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }

  /* 3 · tools step through the active slot around a fixed method */
  .dg .orbit { transform-box: view-box; transform-origin: 120px 75px; animation: dg-rotate 12s var(--ease) infinite; }
  @keyframes dg-rotate {
    0%, 12% { transform: rotate(0deg); }
    16.67%, 28.67% { transform: rotate(60deg); }
    33.33%, 45.33% { transform: rotate(120deg); }
    50%, 62% { transform: rotate(180deg); }
    66.67%, 78.67% { transform: rotate(240deg); }
    83.33%, 95.33% { transform: rotate(300deg); }
    100% { transform: rotate(360deg); }
  }

  /* 4 · one thread from idea to improvement, then round again */
  .dg .prog { transform-box: fill-box; transform-origin: 0 50%; animation: dg-prog 5s var(--ease) infinite; }
  @keyframes dg-prog { 0% { transform: scaleX(0); } 70%, 90% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
  .dg .runner { animation: dg-run 5s var(--ease) infinite; }
  @keyframes dg-run { 0% { transform: translateX(-184px); opacity: 0; } 6% { opacity: 1; } 70%, 90% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(0); opacity: 0; } }
  .dg .loop { animation: dg-march 1.1s linear infinite reverse; }

  /* 5 · a layout being set: cursor picks the heading, guides snap in */
  .dg .cur { transform: translate(135px, 55px); animation: dg-cursor 6s var(--ease) infinite; }
  @keyframes dg-cursor {
    0% { transform: translate(176px, 112px); }
    35%, 80% { transform: translate(135px, 55px); }
    100% { transform: translate(176px, 112px); }
  }
  .dg .sel { animation: dg-select 6s var(--ease) infinite; }
  @keyframes dg-select { 0%, 36% { opacity: 0; } 42%, 80% { opacity: 1; } 88%, 100% { opacity: 0; } }

  @media (prefers-reduced-motion: reduce) {
    .dg * { animation: none !important; }
  }

  /* ---------- selected work ---------- */
  .work-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px 12px;
  }

  .frame {
    background: var(--card);
    border: 1px solid var(--hair);
    border-radius: 12px;
    padding: 12px;
    transition: background 0.4s ease;
  }

  .frame img {
    border-radius: 6px;
    border: 1px solid var(--hair);
    width: 100%;
    height: auto;
  }

  .project-link { display: block; position: relative; text-decoration: none; }
  .project-arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--card);
    color: var(--soft);
    border: 1px solid var(--line);
    font-size: 19px;
    transition: color 0.2s ease, background 0.2s ease;
  }
  .project-link:hover .project-arrow,
  .project-link:focus-visible .project-arrow { background: var(--ink); color: var(--bg); }
  .project-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

  /* blurred shot for unreleased work */
  .shot-blur {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid var(--hair);
  }

  .shot-blur img {
    border: none;
    border-radius: 0;
    filter: blur(9px) saturate(0.85);
    transform: scale(1.06);
  }

  .blur-tag {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: -0.003em;
    color: var(--ink);
    background: var(--nav-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--hair);
    border-radius: 980px;
    padding: 6px 14px;
    white-space: nowrap;
  }

  .work-cap {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 13px 2px 0;
  }

  .work-cap h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

  .chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: var(--soft);
    background: var(--card);
    border: 1px solid var(--hair);
    border-radius: 980px;
    padding: 2.5px 9px;
    margin-left: 8px;
    vertical-align: 2px;
    white-space: nowrap;
  }

  .work-desc {
    margin: 5px 2px 0;
    color: var(--soft);
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: -0.003em;
  }

  /* open source row */
  .os-row {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 20px;
    align-items: start;
    margin-top: clamp(48px, 6vw, 72px);
  }

  .os-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--hair);
    display: grid; place-items: center;
  }
  .os-icon svg { width: 22px; height: 22px; color: var(--ink); }

  .os-row h3 { margin: 1px 0 5px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
  .os-row p { margin: 0 0 7px; color: var(--soft); font-size: 14px; line-height: 1.55; max-width: 42em; }
  .os-row a { font-size: 14px; color: var(--link); text-decoration: none; }
  .os-row a:hover { text-decoration: underline; }

  /* ---------- experience: quiet timeline ---------- */
  .xp-row {
    display: grid;
    grid-template-columns: 110px 1fr;
  }
  .xp-row .when {
    color: var(--faint);
    font-size: 14px;
    text-align: right;
    padding: 0 26px 0 0;
  }
  .xp-body {
    position: relative;
    border-left: 1px solid var(--line);
    padding: 0 0 36px 26px;
  }
  .xp-row:last-child .xp-body { padding-bottom: 2px; }
  .xp-body::before {
    content: '';
    position: absolute;
    left: -3.5px;
    top: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--faint);
    box-shadow: 0 0 0 3px var(--bg);
  }
  .xp-row.now .xp-body::before { background: var(--ink); border-color: var(--ink); }
  .xp-row h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.4; }
  .xp-row h3 a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
  .xp-row h3 a:hover { text-decoration-color: var(--soft); }
  .xp-row p { margin: 5px 0 0; color: var(--soft); font-size: 14px; line-height: 1.55; max-width: 40em; }

  /* ---------- skills ---------- */
  .chips { display: flex; flex-wrap: wrap; gap: 8px; }

  .skill {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.003em;
    color: var(--soft);
    background: var(--card);
    border: 1px solid var(--hair);
    border-radius: 980px;
    padding: 7px 14px;
  }

  .skill.featured {
    background: var(--pill);
    color: var(--pill-ink);
    border-color: transparent;
  }

  /* ---------- stack ---------- */
  .stack-row {
    display: grid;
    grid-template-columns: 128px 1fr;
    gap: 6px 28px;
    padding: 12px 0;
  }
  .stack-row .k { color: var(--faint); font-size: 14px; }
  .stack-row .v { font-size: 15px; letter-spacing: -0.006em; }
  .stack-note { margin: 20px 0 0; color: var(--faint); font-size: 13px; }

  /* ---------- contact ---------- */
  .contact-panel {
    background: radial-gradient(ellipse at 50% 20%, rgba(255, 255, 255, 0.65), transparent 70%), var(--card);
    border: 1px solid var(--hair);
    border-radius: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    align-items: center;
    gap: 24px;
    text-align: left;
    padding: 44px 36px;
    transition: border-color 0.3s ease;
  }
  [data-theme='dark'] .contact-panel {
    background: radial-gradient(ellipse at 50% 20%, rgba(255, 255, 255, 0.045), transparent 70%), var(--card);
  }
  .contact-panel:focus-within { border-color: var(--line); }
  @media (hover: hover) {
    .contact-panel:hover { border-color: var(--line); }
  }
  .contact-panel h2 {
    margin: 0 0 8px;
    font-size: clamp(21px, 3vw, 27px);
    font-weight: 600;
    letter-spacing: -0.018em;
  }
  .contact-copy > p { margin: 0 0 26px; color: var(--soft); font-size: 15px; max-width: 30em; }
  .contact-panel .where { margin: 22px auto 0; font-size: 13px; color: var(--faint); }
  .contact-art { width: 100%; height: auto; mix-blend-mode: multiply; opacity: .8; pointer-events: none; }
  [data-theme='dark'] .contact-art { filter: invert(1); mix-blend-mode: screen; opacity: .7; }
  @media (max-width: 700px) {
    .contact-panel { grid-template-columns: 1fr; padding: 36px 24px; gap: 20px; }
    .contact-art { width: min(260px, 100%); justify-self: center; }
  }

  /* ---------- footer ---------- */
  footer {
    margin-top: clamp(72px, 9vw, 110px);
    padding-bottom: 128px;
  }
  .foot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 20px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--faint);
    border-top: 1px solid var(--hair);
    padding-top: 24px;
  }
  .foot-row nav { display: flex; gap: 4px; }
  .foot-row a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--faint); text-decoration: none; transition: color 0.25s ease; }
  .foot-row a:hover { color: var(--ink); }
  .foot-row a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  .foot-row svg { width: 16px; height: 16px; }

  /* ---------- floating nav ---------- */
  .dock {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0;
    padding: 4px;
    border-radius: 980px;
    z-index: 50;
    opacity: 0;
    translate: 0 10px;
    animation: dock-in 0.9s var(--ease) 0.6s forwards;
  }
  @keyframes dock-in { to { opacity: 1; translate: 0 0; } }

  .dock {
    background: var(--nav-bg);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--hair);
    box-shadow: var(--nav-shadow);
  }

  .dock-pill {
    display: flex;
    gap: 1px;
    padding: 0;
    border-radius: 980px;
  }

  .dock-pill a {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.006em;
    color: var(--soft);
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 980px;
    transition: color 0.25s ease, background 0.25s ease;
  }

  .dock-pill a:hover { color: var(--ink); }
  .dock-pill a.on { color: var(--ink); background: var(--nav-active); }

  .dock-btn {
    border: 0;
    background: transparent;
    margin-left: 7px;
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--ink);
    cursor: pointer;
    padding: 0;
    font: inherit;
    transition: color 0.25s ease;
  }
  .dock-btn::before { content: ""; position: absolute; left: -4px; top: 8px; height: 18px; border-left: 1px solid var(--line); }
  .dock-btn:hover { color: var(--soft); }
  .dock-btn svg { width: 16px; height: 16px; }

  [data-theme='light'] .only-dark { display: none; }
  [data-theme='dark'] .only-light { display: none; }

  @media (prefers-reduced-motion: no-preference) {
    .chip-px rect { animation: pixel-settle .7s var(--ease) both; transform-box: fill-box; transform-origin: center; }
    .chip-px rect:nth-child(2) { animation-delay: .08s; }
    .chip-px rect:nth-child(3) { animation-delay: .16s; }
    .chip-px rect:nth-child(4) { animation-delay: .24s; }
    @keyframes pixel-settle { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
  }
  @media (max-width: 380px) { .dock-pill a { padding-inline: 9px; } }
  /* ---------- responsive ---------- */
  /* Grid items default to min-width auto, so wide diagram content (the
     steps pills) would otherwise force the whole grid past the viewport. */
  .bento > *, .method-grid > *, .work-grid > * { min-width: 0; }

  @media (max-width: 700px) {
    .method-lead { display: inline; }
    .hero h1 .dim { display: inline; }
    .method-grid { grid-template-columns: 1fr; }
    .m-wide { grid-template-columns: 1fr; }
    .work-grid { grid-template-columns: 1fr; }
  }

  @media (max-width: 520px) {
    .bento { grid-template-columns: 1fr; }
    .xp-row, .stack-row { grid-template-columns: 1fr; }
    .xp-row .when {
      text-align: left;
      border-left: 1px solid var(--line);
      padding: 0 0 5px 26px;
    }
    .dock-pill a { padding: 7px 11px; }
  }

  @media (max-width: 430px) {
    .container { padding-inline: 20px; }
  }

  /* ---------- reduced motion ---------- */
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .r { opacity: 1; transform: none; transition: none; }
    .dock { animation: none; opacity: 1; translate: 0 0; }
    .hr1, .hr3, .hr4 { animation: none; }
  }
