  :root {
    --paper: #f6f1e7;
    --paper-deep: #e8dcc6;
    --card: #fffdf8;
    --ink: #22201c;
    --ink-soft: #625b50;
    --line: #d9cdb8;
    --accent: #e4572e;
    --blue: #7ea7e6;
    --yellow: #f5cd55;
    --pink: #f2a7b5;
    --green: #78ad74;
    --green-2: #5d9561;
    --terracotta: #c9714a;
    --steel: #cfd3d8;
    --screen: #2d3542;
    --coffee: #5b3a26;
    --sw1: #2bb3a3; --sw2: #e2473f; --sw3: #8b6fd6; --sw4: #f29a38; --sw5: #3f74d9;
    --gutter: 24px;
    --max: 1120px;
    color-scheme: light;
  }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0; background: var(--paper); color: var(--ink);
    font: 400 17px/1.6 Inter, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
  }
  /* faint dot grid, like a notebook */
  body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image: radial-gradient(color-mix(in oklab, var(--ink) 14%, transparent) 1px, transparent 1.4px);
    background-size: 22px 22px;
  }
  a { color: inherit; }
  .wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
  .hand { font-family: Caveat, cursive; }
  h1, h2, h3 { font-family: "Bricolage Grotesque", Inter, sans-serif; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }

  /* ── nav ── */
  nav { position: sticky; top: 0; z-index: 10; background: color-mix(in oklab, var(--paper) 88%, transparent); backdrop-filter: blur(6px); }
  nav .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
  .logo { font: 700 30px/1 Caveat, cursive; text-decoration: none; }
  .logo span { color: var(--accent); }
  .links { display: flex; gap: 20px; margin-left: auto; }
  .links a { text-decoration: none; font-weight: 500; font-size: 15px; }
  .links a:hover { color: var(--accent); }

  /* ── hero ── */
  .hero { display: grid; grid-template-columns: 0.85fr 1.5fr; gap: 24px; align-items: center; padding-block: 40px 64px; max-width: 1360px; }
  .hello { font-size: 28px; color: var(--accent); transform: rotate(-3deg); display: inline-block; margin-bottom: 8px; }
  .hero h1 { font-size: clamp(34px, 4.2vw, 56px); font-weight: 700; }
  .hero p { color: var(--ink-soft); font-size: 18px; max-width: 30em; margin: 20px 0 28px; }
  .ctas { display: flex; flex-wrap: wrap; gap: 12px; }
  .btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 15px; padding: 13px 20px; border: 2px solid var(--ink); background: var(--card); transition: transform .15s, box-shadow .15s; }
  .btn.primary { background: var(--ink); color: var(--paper); }
  .scene-wrap { position: relative; }
  .scene-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
  .psst { position: absolute; right: 4%; bottom: -8px; font-size: 22px; color: var(--ink-soft); transform: rotate(-4deg); }

  /* ── iso svg shared ── */
  svg .scene polygon, svg .scene path, svg .scene ellipse, svg .scene line {
    stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round;
  }
  .f-t { fill: var(--c); }
  .f-l { fill: color-mix(in oklab, var(--c) 84%, var(--ink)); }
  .f-r { fill: color-mix(in oklab, var(--c) 70%, var(--ink)); }
  .hatch { fill: url(#hatch); }
  svg .scene { filter: url(#wobble); }
  svg .nofill { fill: none; }
  svg .thin { stroke-width: 1.1 !important; }
  svg .dash { stroke-dasharray: 2 7; fill: none; }
  svg text.lbl { font: 700 22px Caveat, cursive; fill: var(--ink); stroke: none; }
  svg text.num { font: 700 26px Caveat, cursive; fill: var(--ink); stroke: none; }
  svg .arrow { fill: none; marker-end: url(#arrowhead); stroke-width: 1.4 !important; }
  .hot { cursor: pointer; }
  .hot > g, .hot > polygon, .hot > path, .hot > ellipse, .hot > text { transition: transform .2s ease; }
  .hot:hover > *, .hot:focus-visible > * { transform: translateY(-6px); }
  .hot:hover text.lbl, .hot:focus-visible text.lbl { fill: var(--accent); }
  .hot:focus { outline: none; }
  .steam { fill: none; stroke-width: 1.4 !important; animation: steam 2.6s ease-in-out infinite; }
  .steam:nth-of-type(2) { animation-delay: .9s; }
  .steam:nth-of-type(3) { animation-delay: 1.7s; }
  @keyframes steam { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-14px); } }

  /* ── sections ── */
  section { padding: 72px 0; }
  .eyebrow { font-size: 26px; color: var(--accent); display: block; transform: rotate(-2deg); margin-bottom: 4px; }
  .sec-title { font-size: clamp(32px, 4vw, 46px); margin-bottom: 40px; }

  .case { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 36px; border: 2px solid var(--ink); background: var(--card); overflow: hidden; transition: transform .2s, box-shadow .2s; text-decoration: none; }
  .case:nth-of-type(even) .case-art { order: 2; }
  .case-art { background: var(--paper-deep); display: grid; place-items: center; padding: 36px 28px; min-height: 320px; }
  .case-art svg { width: 100%; max-width: 440px; height: auto; overflow: visible; }
  .case-body { padding: 40px 40px 36px; display: flex; flex-direction: column; gap: 14px; }
  .case-body h3 { font-size: 30px; }
  .case-body p { margin: 0; color: var(--ink-soft); }
  .tags { display: flex; flex-wrap: wrap; gap: 8px; }
  .tag { font-size: 13px; font-weight: 500; padding: 4px 10px; border: 1.5px solid var(--ink); border-radius: 999px; }
  .read { font-weight: 600; margin-top: auto; padding-top: 4px; }
  .case:hover .read { color: var(--accent); }

  /* the process illustration carries the eight phases on its own */
  .process-art { max-width: 1040px; margin: 0 auto; position: relative; }
  /* hover a tile: it lifts, and a card for that phase appears beside it */
  .pr-tile { cursor: pointer; }
  .pr-tile > g, .pr-tile > text { transition: transform .18s ease; }
  .pr-tile:hover > g, .pr-tile:hover > text,
  .pr-tile.on > g, .pr-tile.on > text,
  .pr-tile:focus-visible > g, .pr-tile:focus-visible > text { transform: translateY(-16px); }
  .pr-tile:focus { outline: none; }
  /* the staircase runs top-left to bottom-right, so the card sits in the empty
     bottom-left corner and never covers a tile */
  .pr-card {
    position: absolute; left: 0; bottom: 0; z-index: 5; width: min(300px, calc(100% - 24px));
    background: var(--card); border: 2px solid var(--ink);
    border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px;
    box-shadow: 5px 5px 0 var(--ink); padding: 16px 20px 15px; pointer-events: none;
    opacity: 0; transform: translateY(6px); transition: opacity .15s ease, transform .15s ease;
  }
  .pr-card.on { opacity: 1; transform: none; }
  .pr-card b { display: block; font-family: "Bricolage Grotesque", Inter, sans-serif; font-size: 18px; margin-bottom: 6px; }
  .pr-card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
  .pr-card .skill { display: block; margin-top: 10px; font: 700 20px/1.2 Caveat, cursive; color: var(--accent); }
  .process-art svg { width: 100%; height: auto; max-height: 88vh; overflow: visible; }

  .about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: start; }
  .about p { color: var(--ink-soft); font-size: 18px; margin: 0 0 16px; }
  .note { background: var(--yellow); padding: 28px 28px 24px; transform: rotate(2deg); box-shadow: 0 10px 24px -12px color-mix(in oklab, var(--ink) 50%, transparent); position: relative; }
  .note::before { content: ""; position: absolute; top: -12px; left: 50%; width: 90px; height: 24px; transform: translateX(-50%) rotate(-3deg); background: color-mix(in oklab, var(--card) 70%, transparent); border: 1px solid color-mix(in oklab, var(--ink) 15%, transparent); }
  .note h3 { font: 700 32px/1 Caveat, cursive; margin-bottom: 10px; }
  .note ul { margin: 0; padding-left: 20px; font: 500 24px/1.35 Caveat, cursive; }
  .contact { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }

  footer { padding: 40px 0 56px; color: var(--ink-soft); font-size: 14px; }
  footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1.5px dashed var(--line); padding-top: 24px; }

  /* hand-drawn boxes */
  .btn, .case {
    border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px;
    box-shadow: 5px 5px 0 var(--ink);
  }
  .btn:hover, .case:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }

  @media (max-width: 860px) {
    :root { --gutter: 16px; }
    section { padding: 44px 0; }
    .sec-title { margin-bottom: 28px; }
    .hero, .about { grid-template-columns: 1fr; }
    .hero { padding-block: 24px 40px; }
    .about { gap: 32px; }
    .case { grid-template-columns: 1fr; margin-bottom: 28px; }
    .case:nth-of-type(even) .case-art { order: 0; }
    .case-art { min-height: 0; padding: 18px 12px; }
    /* the drawing shrinks, the handwriting doesn't: keep the labels readable */
    .case-art svg { max-height: 240px; }
    svg text.lbl { font-size: 38px; }
    svg text.num { font-size: 38px; }
    .case-body { padding: 22px 20px; gap: 10px; }
    .case-body h3 { font-size: 24px; }
    .links { gap: 14px; }
  }
  @media (max-width: 860px) {
    /* on a phone the drawing is too small to host a card: it goes underneath */
    .pr-card { position: static; width: 100%; margin-top: 18px; display: none; transform: none; }
    .pr-card.on { display: block; }
  }
  @media (prefers-reduced-motion: reduce) {
    .pr-tile > g, .pr-tile > text, .pr-card { transition: none; }
    .steam { animation: none; opacity: .7; }
    .hot > * { transition: none; }
    html { scroll-behavior: auto; }
  }


/* ── looping case illustrations ── */
/* conveyor (art-pipe): a real production line. Items travel the whole belt in 6s, three at a time
   (2s apart), and change as they pass the stations: brief → mockup under the agent → Figma build → handoff */
.pp-slats { animation: pp-belt .79s linear infinite; }
@keyframes pp-belt { from { transform: none; } to { transform: translate(var(--sx), var(--sy)); } }
.pp-item, .pp-item > g { animation-duration: 6s; animation-iteration-count: infinite; animation-delay: var(--d); }
.pp-item { animation-name: pp-move; animation-timing-function: linear; }
@keyframes pp-move { from { transform: none; } to { transform: translate(var(--dx), var(--dy)); } }
.pp-paper { animation-name: pp-paper; }
.pp-mock { animation-name: pp-mock; }
.pp-fig { animation-name: pp-fig; }
.pp-paper, .pp-mock, .pp-fig { animation-delay: inherit; }
@keyframes pp-paper { 0% { opacity: 0; } 4%, 53% { opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes pp-mock { 0%, 53% { opacity: 0; } 56%, 68% { opacity: 1; } 71%, 100% { opacity: 0; } }
@keyframes pp-fig { 0%, 68% { opacity: 0; } 71%, 92% { opacity: 1; } 98%, 100% { opacity: 0; } }
.pp-agent { animation: pp-bob 1s ease-in-out infinite; }
@keyframes pp-bob { 0%, 100% { transform: none; } 50% { transform: translateY(-5px); } }
.pp-light { animation: pp-blink 1s steps(1) infinite; }
@keyframes pp-blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: .25; } }
/* one item passes the audit / reaches the phone every 2s */
.pp-tick { transform-box: fill-box; transform-origin: center; animation: pp-pop 2s ease infinite; animation-delay: -1.75s; }
@keyframes pp-pop { 0%, 30% { opacity: 0; transform: scale(.4); } 40% { opacity: 1; transform: scale(1.2); } 48%, 70% { opacity: 1; transform: scale(1); } 85%, 100% { opacity: 0; } }
.pp-ping { animation: pp-ping 2s ease infinite; }
@keyframes pp-ping { 0%, 75%, 100% { fill: var(--accent); } 82%, 92% { fill: var(--yellow); } }

/* phones (art-flow): 6s, each phone lifts in turn and the arrow draws to the next */
.fl-phone { animation: fl-lift 6s ease-in-out infinite; animation-delay: calc(var(--i) * 1.6s); }
@keyframes fl-lift { 0%, 2% { transform: none; } 8%, 20% { transform: translateY(-10px); } 28%, 100% { transform: none; } }
.fl-phone .fl-cta { animation: fl-cta 6s ease infinite; animation-delay: calc(var(--i) * 1.6s); }
@keyframes fl-cta { 0%, 6%, 24%, 100% { fill: var(--accent); } 10%, 18% { fill: var(--yellow); } }
.fl-arrow { stroke-dasharray: 1; animation: fl-draw 6s ease-in-out infinite; animation-delay: calc(var(--i) * 1.6s + .9s); }
@keyframes fl-draw { 0% { stroke-dashoffset: 1; } 18%, 80% { stroke-dashoffset: 0; } 92%, 100% { stroke-dashoffset: 1; } }

/* the tide (art-flood): the slab rises and falls on a 7s loop, crests roll along the street,
   and a motorbike wades across once every 11s */
.fw-water { animation: fw-tide 7s ease-in-out infinite; }
@keyframes fw-tide { 0%, 100% { transform: translateY(6px); } 50% { transform: translateY(-7px); } }
.fw-wave { animation: fw-roll 4.6s ease-in-out infinite; animation-delay: calc(var(--i) * -1.15s); opacity: .5; }
@keyframes fw-roll { 0%, 100% { transform: translate(-7px, -4px); } 50% { transform: translate(7px, 4px); } }
.fw-bike { animation: fw-ride 11s linear infinite; }
@keyframes fw-ride {
  0%, 4% { transform: none; opacity: 0; }
  9%, 40% { opacity: 1; }
  46%, 100% { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pp-slats, .pp-item, .pp-item > g, .pp-agent, .pp-light, .pp-tick, .pp-ping, .fl-phone, .fl-phone .fl-cta, .fl-arrow,
  .fw-water, .fw-wave { animation: none; }
  .fw-bike { animation: none; opacity: 0; }
  .pp-item:nth-of-type(n+2) { display: none; }
  .pp-mock, .pp-fig { opacity: 0; }
  .fl-arrow { stroke-dashoffset: 0; }
}

/* hero desk loop (8s): laptop lines type in, theme cubes hop, the loan gets approved, notes and plant move */
.hs-bar { animation: hs-type 8s steps(1) infinite; animation-delay: calc(var(--i) * .5s); }
@keyframes hs-type { 0%, 6% { opacity: 0; } 8%, 82% { opacity: 1; } 84%, 100% { opacity: 0; } }
.hs-hop { transform-box: fill-box; animation: hs-hop 8s ease-in-out infinite; animation-delay: calc(2.4s + var(--i) * .35s); }
@keyframes hs-hop { 0%, 100% { transform: none; } 3% { transform: translateY(-12px); } 6% { transform: none; } }
.hs-pulse { animation: hs-pulse 8s ease infinite; }
@keyframes hs-pulse { 0%, 52%, 90%, 100% { fill: var(--blue); } 58%, 84% { fill: var(--green); } }
.hs-ping { animation: hs-ping 8s ease infinite; }
@keyframes hs-ping { 0%, 46%, 58%, 100% { fill: var(--accent); } 49%, 55% { fill: var(--yellow); } }
.hs-note { transform-box: fill-box; transform-origin: center; animation: hs-note 8s ease-in-out infinite; }
@keyframes hs-note { 0%, 30%, 46%, 100% { transform: none; } 36%, 40% { transform: translateY(-5px) rotate(-2deg); } }
.hs-sway { transform-box: fill-box; transform-origin: 50% 100%; animation: hs-sway 4s ease-in-out infinite; }
@keyframes hs-sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
@media (prefers-reduced-motion: reduce) {
  .hs-bar, .hs-hop, .hs-pulse, .hs-ping, .hs-note, .hs-sway { animation: none; }
}
