:root {
  --bg: #f4f1ea;
  --ink: #16130f;
  --muted: #8c857a;
  --rope: #2b231a;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.45 ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; }

/* ---------- chrome ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 5;
  /* name and role on top, the button under them, so the header stays clear of the line */
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "id . meta" "cta . meta";
  justify-items: start; align-items: center; gap: 8px 16px;
  padding: 22px 28px; pointer-events: none;
}
.top__id { grid-area: id; }
.top__right { grid-area: meta; justify-self: end; align-self: start; }
.brand { font-weight: 600; letter-spacing: -.01em; }
/* the one call to action on the first screen */
.hello {
  grid-area: cta; pointer-events: auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px 8px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: #f6f2ea; text-decoration: none; text-shadow: none; font-weight: 500;
  box-shadow: 0 6px 14px -8px rgba(22, 19, 15, .6);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.hello span { transition: transform .2s var(--ease); }
.hello:hover { box-shadow: 0 8px 18px -8px rgba(22, 19, 15, .7); }
.hello:hover span { transform: translateX(2px); }
.hello:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.hint { color: var(--muted); }
.hint { transition: opacity .6s; text-align: right; }
.hint.is-hidden { opacity: 0; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; justify-content: center; align-items: flex-end;
  padding: 20px 28px calc(22px + env(safe-area-inset-bottom));
  pointer-events: none;
}

/* tabs: Projects | About Me. The white pill slides (and overshoots a little) to the active one */
.tabs {
  position: relative; pointer-events: auto; display: flex; padding: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .45);
  -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 0 0 1px rgba(30, 20, 10, .08), 0 12px 26px -14px rgba(30, 20, 10, .5);
  transition: background-color .5s, box-shadow .5s;
}
.tabs button {
  position: relative; z-index: 1; border: 0; background: none; padding: 9px 18px; border-radius: 999px;
  cursor: pointer; color: rgba(22, 19, 15, .62); font-weight: 500; white-space: nowrap;
  transition: color .3s; -webkit-tap-highlight-color: transparent;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.tabs__pill {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 4px 10px -4px rgba(0, 0, 0, .22);
}
.is-ready .tabs__pill { transition: transform .55s cubic-bezier(.3, 1.45, .5, 1), width .55s cubic-bezier(.3, 1.45, .5, 1); }
.tabs button:active { transform: scale(.96); }

/* ---------- stage ---------- */
.stage {
  position: fixed; inset: 0; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
}
.stage.is-dragging { cursor: grabbing; }
.layer { position: absolute; inset: 0; perspective: 1200px; }
.layer--line { perspective-origin: 50% 20%; }

/* rope */
.rope { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.rope path { fill: none; stroke-linecap: round; }
.rope-line { stroke: var(--rope); stroke-width: 1.6; }
.rope-shadow { stroke: rgba(40, 25, 10, .10); stroke-width: 5; filter: blur(5px); }

/* ---------- panels ---------- */
.panel {
  --h: var(--hue, 30);
  position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none;
  cursor: pointer; transform-origin: 50% 0; will-change: transform;
  -webkit-tap-highlight-color: transparent;
}
.panel:focus { outline: none; }
.panel:focus-visible .card { box-shadow: 0 0 0 2px var(--ink), 0 1.2em 2.2em -1em rgba(40, 25, 10, .35); }

.card {
  position: absolute; inset: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9em;
  border-radius: 1.8em;
  background: hsl(var(--h) 38% 95%);
  box-shadow:
    0 0 0 1px rgba(30, 20, 10, .07),
    inset 0 .08em 0 rgba(255, 255, 255, .75),
    0 1.2em 2.2em -1em rgba(40, 25, 10, .38);
  transition: box-shadow .3s;
}
.panel--mac .card { border-radius: 1em; padding-top: 1.3em; }
.panel:hover .card {
  box-shadow:
    0 0 0 1px rgba(30, 20, 10, .09),
    inset 0 .08em 0 rgba(255, 255, 255, .75),
    0 1.6em 2.6em -1em rgba(40, 25, 10, .45);
}

.icon {
  display: grid; place-items: center; width: 3.9em; height: 3.9em; border-radius: 1.05em;
  background: linear-gradient(145deg, hsl(var(--h) 80% 66%), hsl(calc(var(--h) + 28) 75% 50%));
  box-shadow: 0 .5em 1em -.4em hsl(var(--h) 70% 38% / .65), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.icon b { font-size: 1.7em; font-weight: 700; color: #fff; line-height: 1; }
.name { font-weight: 600; font-size: .95em; letter-spacing: -.01em; }
.kind { font-size: .68em; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: -.7em; }
.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }

/* a real app icon: square artwork clipped to the same rounded tile */
.icon--img {
  position: relative; overflow: hidden; background: none;
  box-shadow: 0 .5em 1em -.45em rgba(30, 20, 10, .45);
}
.icon--img img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; pointer-events: none; }
/* a hairline keeps light icons (WiNotch, Momence) from melting into a pale card */
.icon--img::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }

.dots { position: absolute; left: .85em; top: .75em; display: flex; gap: .35em; }
.dots b { width: .55em; height: .55em; border-radius: 50%; background: rgba(0, 0, 0, .14); }

/* clothespins: only on the line layout */
.pin { display: none; }
.stage[data-v="line"] .pin {
  display: block; position: absolute; left: 50%; top: -1.3em; width: .8em; height: 2.8em; margin-left: -.4em; z-index: 3;
  border-radius: .3em .3em .2em .2em;
  background: linear-gradient(90deg, #dbb680, #c19661 55%, #a8814f);
  box-shadow: 0 .15em .3em rgba(0, 0, 0, .28);
}
.stage[data-v="line"] .pin::before {
  content: ""; position: absolute; left: 50%; top: 1.2em; width: .3em; height: .3em; margin-left: -.15em;
  border-radius: 50%; background: #6d5232;
}

/* depth: panels fade into the background colour without becoming see-through */
.card::after {
  content: ""; position: absolute; inset: 0; background: var(--bg);
  opacity: var(--fog, 0); pointer-events: none;
}

/* drum */
.layer--drum .panel { transform-origin: 50% 50%; }

/* crate */
.layer--crate .panel { transform-origin: 50% 100%; }

/* ---------- detail ---------- */
.detail {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto; overscroll-behavior: contain;
  background: hsl(var(--hue) 45% 95%);
}
.detail__close {
  position: fixed; top: 18px; right: 22px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, .75); backdrop-filter: blur(8px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .15); transition: transform .25s var(--ease);
}
.detail__close:hover { transform: rotate(90deg); }
.detail__close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.detail__inner {
  min-height: 100%; max-width: 1120px; margin: 0 auto; padding: 88px 40px 64px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
.detail__media { display: grid; place-items: center; }
.detail__text { max-width: 460px; }
.eyebrow { margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; }
.detail h2 { margin: 0; font-size: clamp(44px, 7vw, 84px); line-height: .98; letter-spacing: -.04em; font-weight: 600; }
.lead { margin: 14px 0 0; font-size: 20px; letter-spacing: -.01em; }
.desc { margin: 18px 0 0; color: #4b453c; font-size: 16px; line-height: 1.55; }
.facts { margin: 30px 0 0; display: grid; gap: 16px; }
.facts div { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: start; }
.facts dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding-top: 3px; }
.facts dd { margin: 0; }
.facts ul { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.facts li { padding: 3px 10px; border-radius: 999px; background: rgba(22, 19, 15, .07); font-size: 13px; }
.links { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 10px; }
.links a {
  display: inline-flex; gap: 6px; align-items: center; padding: 11px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 500;
  transition: transform .25s var(--ease);
}
.links a:hover { transform: translateY(-2px); }
.links a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.detail.is-in [data-in] { opacity: 0; transform: translateY(18px); animation: rise .75s var(--ease) forwards; animation-delay: calc(var(--i) * 70ms + 260ms); }
.detail.is-out [data-in] { animation: none; opacity: 0; transition: opacity .2s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- case study (below the hero) ---------- */
.cs { max-width: 1120px; margin: 0 auto; padding: 0 40px 96px; }
.metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px;
  padding: 8px 0 40px;
}
.metric {
  display: grid; align-content: start; gap: 6px; padding: 20px 22px; border-radius: 20px;
  background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 1px hsl(var(--hue) 30% 20% / .08);
}
.metric b { font-size: clamp(30px, 4vw, 44px); line-height: 1; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.metric span { color: #5d564b; font-size: 13px; line-height: 1.4; }

.motion { margin: 0 0 24px; }
.motion video {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 24px; background: #111;
  box-shadow: 0 0 0 1px hsl(var(--hue) 30% 20% / .1), 0 30px 60px -34px rgba(40, 25, 10, .55);
}

.cs__sec {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px;
  padding: 40px 0; border-top: 1px solid hsl(var(--hue) 25% 20% / .12);
}
.cs__label { margin: 4px 0 0; color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; }
.cs__body { max-width: 720px; }
.cs__lead { margin: 0; font-size: clamp(18px, 2.1vw, 22px); line-height: 1.5; letter-spacing: -.01em; }
.cs h4 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.cs p { margin: 0; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 22px; }
.steps li { position: relative; padding-left: 44px; counter-increment: step; }
.steps li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 2px;
  color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.steps p { margin-top: 4px; color: #4b453c; line-height: 1.55; }

.decisions { display: grid; gap: 14px; }
.decisions article { padding: 22px 24px; border-radius: 20px; background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 1px hsl(var(--hue) 30% 20% / .08); }
.decisions p { margin-top: 8px; color: #4b453c; line-height: 1.55; }

.bullets { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.bullets li { position: relative; padding-left: 20px; color: #3b362e; line-height: 1.55; }
.bullets li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--hue) 60% 50%); }
.cs__note { margin-top: 22px; padding: 14px 18px; border-radius: 14px; background: hsl(var(--hue) 40% 90%); color: #4b453c; line-height: 1.5; }
.cs__note b { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); }

/* screenshots inside a process step or design decision */
.shots { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 18px 16px; margin-top: 18px; }
.shot { --w: 100%; --r: 12px; width: min(100%, var(--w)); margin: 0; }
.shot--phone { --w: 240px; --r: 30px; }
.shot--watch { --w: 208px; --r: 40px; }
.shot img, .shot video {
  display: block; width: 100%; height: auto; border-radius: var(--r); background: #111;
  box-shadow: 0 0 0 1px hsl(var(--hue) 30% 20% / .12), 0 18px 40px -26px rgba(40, 25, 10, .55);
}
.shot--bare img { background: none; box-shadow: none; border-radius: 0; }
.shot__zoom {
  display: block; width: 100%; padding: 0; border: 0; border-radius: var(--r); background: none; cursor: zoom-in;
  transition: transform .3s var(--ease);
}
.shot__zoom:hover { transform: translateY(-2px); }
.shot__zoom:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.shot figcaption { margin-top: 10px; color: #5d564b; font-size: 13px; line-height: 1.45; }

/* an enlarged screenshot */
.zoom {
  position: fixed; inset: 0; z-index: 3; display: grid; place-items: center; padding: 24px;
  background: rgba(14, 12, 9, .9); cursor: zoom-out; opacity: 0; transition: opacity .25s var(--ease);
}
.zoom.is-in { opacity: 1; }
.zoom:focus { outline: none; }
.zoom img {
  display: block; max-width: calc(100vw - 48px); max-height: calc(100vh - 48px); width: auto; height: auto;
  object-fit: contain; border-radius: 10px;
}

.tools__row + .tools__row { margin-top: 28px; }
.tools__row h4 { margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
/* Build groups: name on the left, chips on the right, one group per row */
.tools__groups { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px 20px; align-items: start; }
.cs .tools__group { padding-top: 4px; font-size: 13px; font-weight: 500; line-height: 1.3; color: #4b453c; }
.chips { display: flex; flex-wrap: wrap; gap: 8px 6px; padding: 0; margin: 0; list-style: none; }
.chips li { padding: 4px 11px; border-radius: 999px; background: rgba(22, 19, 15, .07); font-size: 13px; line-height: 1.3; }

[data-rv] { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-rv].is-seen { opacity: 1; transform: none; }

/* device mockups */
.dev { position: relative; }
.dev__screen { position: relative; overflow: hidden; background: #fff; }
.dev__screen img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dev--phone { width: min(250px, 58vw); }
.dev--phone .dev__screen { aspect-ratio: 9 / 19; border: 8px solid var(--ink); border-radius: 40px; box-shadow: 0 40px 60px -30px rgba(40, 25, 10, .5); }
.dev__notch { position: absolute; top: 8px; left: 50%; width: 32%; height: 18px; transform: translateX(-50%); border-radius: 99px; background: var(--ink); z-index: 2; }
.dev--mac { width: min(560px, 88vw); }
.dev--mac .dev__screen { aspect-ratio: 16 / 10; border: 10px solid var(--ink); border-radius: 14px 14px 4px 4px; box-shadow: 0 40px 60px -30px rgba(40, 25, 10, .5); }
.dev--mac .dev__screen img { object-position: top; }
.dev__dots { position: absolute; top: 9px; left: 12px; display: flex; gap: 5px; z-index: 2; }
.dev__dots b { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.dev__base { width: 112%; margin: 0 -6%; height: 12px; border-radius: 0 0 16px 16px; background: linear-gradient(#d8d2c7, #bdb6a9); }

.ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: linear-gradient(160deg, hsl(var(--hue) 80% 72%), hsl(calc(var(--hue) + 30) 75% 52%));
}
.ph__icon { width: 26%; aspect-ratio: 1; border-radius: 26%; display: grid; place-items: center; background: rgba(255, 255, 255, .25); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.ph__icon b { font-size: clamp(28px, 6vw, 56px); color: #fff; line-height: 1; }
.ph__bar { width: 52%; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .45); }
.ph__bar--s { width: 34%; opacity: .7; }
.ph__chip { width: 22%; height: 22px; border-radius: 99px; background: rgba(255, 255, 255, .85); }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .detail__inner { grid-template-columns: 1fr; gap: 36px; padding: 84px 22px 48px; align-items: start; }
  .detail__text { max-width: none; }
  .cs { padding: 0 22px 72px; }
  .cs__sec { grid-template-columns: 1fr; gap: 14px; padding: 32px 0; }
  .tools__groups { grid-template-columns: 1fr; gap: 8px; }
  .cs .tools__group { padding-top: 0; }
  .cs .tools__group:not(:first-child) { margin-top: 12px; }
}
@media (max-width: 560px) {
  /* phones: the button and the Jakarta line share a row under the name, so nothing runs off the edge */
  .top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 16px 18px; }
  .top__id { flex: 1 1 100%; min-width: 0; margin-bottom: 4px; }
  .top__right { flex: 1 1 0; min-width: 0; font-size: 12px; line-height: 1.35; }
  .bar { padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); }
  .tabs button { padding: 8px 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .detail.is-in [data-in] { animation: none; opacity: 1; transform: none; }
  .detail__close, .links a, .shot__zoom, .zoom { transition: none; }
  .shot__zoom:hover { transform: none; }
  [data-rv] { opacity: 1; transform: none; transition: none; }
}
