:root {
  --bg: #f5f4f0;
  --paper: #f8f7f3;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --blue: #0071e3;
  --tomi: #0a6cff;
  --zara: #8a3ffc;
  --dami: #f57c00;
  --kemi: #1ea446;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Bai Jamjuree", var(--font); /* headings */
  --gutter: clamp(20px, 6vw, 90px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); /* strong ease-out: fast start, long soft landing */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1); /* iOS-like sheet curve */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 100%/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Headings use the display face; the mock screens in the Work section keep their own fonts. */
:is(h1, h2, h3, .logo, .project-meta strong, .menu a):not(.site *) { font-family: var(--font-display); }

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

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  --pad: clamp(20px, 3.4vw, 48px);
  --pad-solid: 18px; /* room above the pill for the little mascot */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--pad) var(--gutter);
  pointer-events: none; /* only the logo and links take clicks, not the empty strip */
}
.nav > * { pointer-events: auto; transition: transform 300ms var(--ease-out); }

/* Once the page scrolls, the bar becomes a translucent layer content passes under.
   The compact bar is a fixed-size layer that fades in while the logo and links
   slide up into it, so nothing here animates layout. */
.nav::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: calc(100% - (var(--pad) - var(--pad-solid)) * 2);
  background: rgba(245, 244, 240, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
}
.nav.solid::before { opacity: 1; }
.nav.solid > * { transform: translateY(calc(var(--pad-solid) - var(--pad))); }

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: inherit;
  text-decoration: none;
}

.nav nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav nav a {
  font-size: 0.9375rem;
  color: inherit;
  text-decoration: none;
}
.nav nav a:not(.cta) {
  position: relative;
  z-index: 1;
  padding: 8px 14px;
  border-radius: 980px;
  color: rgba(29, 29, 31, 0.68);
  transition: color 250ms var(--ease-out);
}
.nav nav a[aria-current="true"] { color: var(--ink); }

/* The current section's indicator: one pill that glides from link to link.
   nav.js sets its position (--x) and width (--w) from the active link. */
.nav-pill {
  position: absolute;
  left: 0;
  top: 50%;
  width: var(--w, 0px);
  height: 36px;
  margin-top: -18px;
  border-radius: 980px;
  background: rgba(29, 29, 31, 0.07);
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, 0.05);
  opacity: 0;
  transform: translateX(var(--x, 0px));
  pointer-events: none;
  transition: transform 460ms var(--ease-out), width 460ms var(--ease-out), opacity 240ms ease;
}
.nav-pill.is-on { opacity: 1; }
@media (hover: hover) and (pointer: fine) { /* touch fires false hovers on tap */
  .nav nav a:not(.cta):hover { color: var(--ink); }
  .nav nav .cta:hover { opacity: 1; }
  .nav nav .cta:hover::before { background: #3a3a3c; }
  .nav nav .cta:hover .pal { transform: translateY(-2.5px); }
}

/* The pill is painted by ::before so a small mascot can sit both behind it (body and
   eyes peeking over the top edge) and in front of it (hands gripping the edge). */
.nav nav .cta {
  position: relative;
  isolation: isolate;
  padding: 9px 18px;
  border-radius: 980px;
  color: #fff;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  margin-left: clamp(10px, 1.6vw, 22px);
  transition: transform 100ms ease-out;
}
.nav nav .cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--ink);
  transition: background-color 150ms ease-out;
}
.nav nav .cta:active { transform: scale(0.97); }
.nav nav .cta:focus-visible { border-radius: 980px; }

.pal {
  position: absolute;
  left: 13px;
  top: -18px;
  width: 36px;
  height: 27px;
  overflow: visible;
  pointer-events: none;
  transition: transform 260ms var(--ease-out);
}
.pal-back { z-index: -2; }
.pal-front { z-index: 1; }
.pal-body, .pal-hand { fill: #ff5a0a; }
.pal-hand { stroke: rgba(0, 0, 0, 0.18); stroke-width: 0.6; }
.pal-eye { transform-box: fill-box; transform-origin: center; animation: pal-blink 5.2s infinite; }
.pal-eye + .pal-eye { animation-delay: 40ms; }
.pal-pupil { transition: transform 200ms ease-out; }
@keyframes pal-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.12); } }


:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 4px; }

/* ───────── Hero ───────── */

/* The hero pins to the viewport; the next section slides over it like a sheet. */
.hero {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 520px;
  display: grid;
  place-items: center;
  padding: clamp(84px, 11vh, 130px) var(--gutter) clamp(48px, 9vh, 110px);
  overflow: hidden;
}

.stage { will-change: transform, opacity; transform-origin: 50% 40%; }

/* ───────── MacBook ───────── */

.mac {
  width: min(76vw, 112svh, 1080px);
  container-type: inline-size;
  animation: rise 900ms var(--ease-out) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
}

.lid {
  position: relative;
  padding: 3cqw 1.9cqw 0;
  background: #060606;
  border-radius: 2.4cqw 2.4cqw 0 0;
  box-shadow:
    inset 0 0 0 0.16cqw #2a2a2d,
    0 0 0 0.1cqw #4a4a4d;
}

.cam {
  position: absolute;
  top: 1.25cqw;
  left: 50%;
  width: 0.5cqw;
  height: 0.5cqw;
  margin-left: -0.25cqw;
  border-radius: 50%;
  background: #1c1c20;
  box-shadow: inset 0 0 0 0.08cqw #0d0d10;
}

.chin {
  height: 3.4cqw;
  display: grid;
  place-items: center;
  font-size: 1.15cqw;
  letter-spacing: 0.01em;
  color: #8e8e93;
}

.base {
  position: relative;
  width: 120%;
  margin-left: -10%;
  height: 1.7cqw;
  border-radius: 0.25cqw 0.25cqw 1.7cqw 1.7cqw / 0.25cqw 0.25cqw 1.5cqw 1.5cqw;
  background: linear-gradient(#cfd0d3 0, #9c9da1 9%, #6b6c70 26%, #3b3b3e 72%, #232325 100%);
}
.base::before { /* thumb notch */
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 16%;
  height: 46%;
  transform: translateX(-50%);
  border-radius: 0 0 0.8cqw 0.8cqw;
  background: linear-gradient(#77787c, #a9aaae);
}
.base::after { /* contact shadow */
  content: "";
  position: absolute;
  inset: 70% 3% auto;
  height: 3.2cqw;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 0, rgba(0, 0, 0, 0.26), transparent 68%);
  filter: blur(0.7cqw);
}

/* ───────── Screen ───────── */
/* Everything inside is sized in cqw, so the canvas scales with the laptop. */

.screen {
  position: relative;
  aspect-ratio: 16 / 10;
  container-type: inline-size;
  overflow: hidden;
  border-radius: 0.3cqw;
  background: var(--paper);
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
}

/* faint large grid + a soft light pooled in the centre: gives the canvas depth
   and sets it apart from the page behind the laptop */
.grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 58% 62% at 50% 46%, #fff 0, rgba(255, 255, 255, 0.85) 38%, rgba(255, 255, 255, 0) 100%),
    linear-gradient(rgba(29, 29, 31, 0.055) max(1px, 0.08cqw), transparent 0) 0 0 / 12.5cqw 12.5cqw,
    linear-gradient(90deg, rgba(29, 29, 31, 0.055) max(1px, 0.08cqw), transparent 0) 6.25cqw 0 / 12.5cqw 12.5cqw;
}

.bar {
  position: absolute;
  inset: 2.2cqw 2.2cqw auto;
  display: flex;
  justify-content: space-between;
}
.bar-side { display: flex; gap: 1cqw; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.8cqw;
  height: 3.6cqw;
  padding: 0 1.2cqw;
  border-radius: 1cqw;
  background: #fff;
  box-shadow: 0 0 0 max(1px, 0.08cqw) rgba(0, 0, 0, 0.06), 0 0.2cqw 0.7cqw rgba(0, 0, 0, 0.04);
  font-size: 1.3cqw;
  font-weight: 500;
  white-space: nowrap;
}
.chip svg { width: 1.1cqw; height: 1.1cqw; }

.lights { gap: 0.75cqw; padding: 0 1cqw; }
.lights i { width: 1.05cqw; height: 1.05cqw; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }


.share { background: var(--ink); color: #fff; font-weight: 600; box-shadow: none; }

/* canvas + type */

.canvas {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.6cqw;
  padding-top: 2.4cqw;
}

.frame { position: relative; }
.frame-h { padding: 0.5cqw 1.8cqw 1.3cqw; }
.frame-b { padding: 0.7cqw 2cqw 0.9cqw; }

.sel {
  position: absolute;
  inset: 0;
  border: max(1px, 0.1cqw) solid rgba(0, 113, 227, 0.55);
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 320ms var(--ease-out), transform 420ms var(--ease-out);
}
.frame.show .sel { opacity: 1; transform: none; }
.sel i {
  position: absolute;
  width: 0.75cqw;
  height: 0.75cqw;
  background: #fff;
  border: max(1px, 0.1cqw) solid rgba(0, 113, 227, 0.8);
  border-radius: 0.12cqw;
}
.sel i:nth-child(1) { left: -0.4cqw; top: -0.4cqw; }
.sel i:nth-child(2) { right: -0.4cqw; top: -0.4cqw; }
.sel i:nth-child(3) { left: -0.4cqw; bottom: -0.4cqw; }
.sel i:nth-child(4) { right: -0.4cqw; bottom: -0.4cqw; }

.headline {
  margin: 0;
  font-size: 12.6cqw;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em; /* display size: tight tracking */
  white-space: nowrap;
}

.body {
  margin: 0;
  font-size: 2.55cqw;
  font-weight: 400;
  line-height: 1.32;
  letter-spacing: -0.022em;
  text-align: center;
  white-space: nowrap;
}

/* Each letter reserves its final width (ghost) so nothing reflows while glyphs shuffle. */
.word { position: relative; display: inline-block; }
.ch { position: relative; display: inline-block; border-radius: 0.2em; transition: background-color 200ms ease-out; }
.ghost { visibility: hidden; }
.glyph {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  white-space: pre;
  transition: color 300ms ease-out;
}
.ch.set .glyph { animation: land 220ms var(--ease-out); }
.ch.marked { background: color-mix(in srgb, var(--mark, var(--kemi)) 22%, transparent); }

@keyframes land {
  from { transform: translateX(-50%) translateY(0.07em); }
}

.caret {
  position: absolute;
  right: -0.16em;
  top: 0.14em;
  width: max(1.5px, 0.17cqw);
  height: 1.05em;
  background: var(--blue);
  opacity: 0;
}
.caret.show { opacity: 1; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* placed components */

.card {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 1.8cqw;
  background: #eceae5;
  color: #c3c1bb;
  opacity: 0;
  transform: rotate(var(--r)) scale(0.7);
  transition: opacity 260ms var(--ease-out), transform 520ms var(--ease-out);
}
.card.show { opacity: 1; transform: rotate(var(--r)) scale(1); }
.card-plus { --r: 4deg; right: 3cqw; top: 67%; width: 8cqw; height: 8cqw; }
.card-plus svg { width: 3cqw; }

.tools {
  position: absolute;
  left: 50%;
  bottom: 7.5%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4cqw;
  padding: 0.5cqw;
  border-radius: 1.2cqw;
  background: #fff;
  box-shadow: 0 0 0 max(1px, 0.08cqw) rgba(0, 0, 0, 0.05), 0 0.6cqw 2cqw rgba(0, 0, 0, 0.08);
}
.tools span {
  display: grid;
  place-items: center;
  width: 3.4cqw;
  height: 3.4cqw;
  border-radius: 0.8cqw;
  transition: background-color 200ms ease-out;
}
.tools span.on { background: #ececee; }
.tools svg { width: 2cqw; height: 2cqw; }

/* agent cursors */

.cursor {
  --u: 1cqw; /* overridden in px once a cursor leaves the screen for the page overlay */
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  pointer-events: none;
  will-change: transform;
  transition: opacity 180ms ease-out;
}
.cursor svg {
  position: absolute;
  left: calc(var(--u) * -0.4);   /* arrow tip sits exactly on the cursor origin */
  top: calc(var(--u) * -0.25);
  width: calc(var(--u) * 2.4);
  height: calc(var(--u) * 2.4);
  transform-origin: 17% 10%;
  transition: transform 110ms ease-out;
  filter: drop-shadow(0 calc(var(--u) * 0.12) calc(var(--u) * 0.25) rgba(0, 0, 0, 0.22));
}
.cursor path { fill: var(--c); transition: fill 420ms ease-out; }
.cursor.press svg { transform: scale(0.84); }
.cursor b {
  position: absolute;
  left: calc(var(--u) * 1.55);
  top: calc(var(--u) * 1.65);
  padding: 0.22cqw 0.8cqw 0.28cqw;
  border-radius: 0.75cqw;
  background: var(--c);
  color: #fff;
  font-size: 1.22cqw;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

/* ───────── Overlay + mascot (page level, outside the laptop) ───────── */

.fx {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
}
.fx canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.mascot {
  --mc: #ff5a0a; /* body colour; main.js shifts it pale when tired and toward purple when annoyed */
  position: fixed;
  right: clamp(14px, 3vw, 44px);
  bottom: clamp(14px, 3vw, 36px);
  z-index: 15;
  width: clamp(72px, 8vw, 112px);
  padding: 0;
  border: 0;
  background: none;
  opacity: 0;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}
.mascot.on { opacity: 1; }
.mascot:not(:disabled) { pointer-events: auto; cursor: pointer; } /* it is the replay button */
.mascot svg { display: block; width: 100%; overflow: visible; transform-origin: 50% 92%; transition: transform 120ms ease-out; }
.mascot:not(:disabled):active svg { transform: scale(1.06, 0.9); }
.mascot:focus-visible { outline-offset: 8px; border-radius: 16px; }

.m-body, .m-legs, .m-arm, .m-lid, .m-fold { fill: var(--mc); transition: fill 700ms ease-out; }
.m-fold { stroke: rgba(0, 0, 0, 0.16); stroke-width: 1.4; } /* a crease so the folded arms read against the body */
.m-hole { fill: #fff; }
.m-shadow { fill: rgba(60, 30, 10, 0.12); opacity: 0; }
.m-ticks { fill: none; stroke: var(--mc); stroke-width: 3.6; stroke-linecap: round; opacity: 0; transform-origin: 98px 18px; }

/* resting pose is "not assembled yet"; main.js animates each part into place */
.m-float { transform: translateY(-34px); transform-origin: 60px 58px; }
.m-squash { transform-origin: 60px 114px; }
.m-body { transform-origin: 60px 58px; transform: scale(0); }
.m-hole { transform-origin: 60px 67px; transform: scale(0); }
.m-eye { transform: scale(0); }
.m-legs { transform-origin: 60px 92px; transform: scaleY(0); }
.m-arm-l { transform-origin: 20px 63px; transform: rotate(-25deg) scale(0); }
.m-arm-r { transform-origin: 100px 63px; transform: rotate(25deg) scale(0); }
.m-lid { transform: translateY(-19px); }
.m-lid-l { transform-origin: 51px 47px; }
.m-lid-r { transform-origin: 68px 47px; }
.m-pupil { transition: transform 200ms ease-out; }

/* assembled */
.mascot.static :is(.m-float, .m-body, .m-hole, .m-eye, .m-legs) { transform: none; }
.mascot.static .m-arm-l { transform: rotate(-25deg); }
.mascot.static .m-arm-r { transform: rotate(25deg); }
.mascot.static .m-shadow { opacity: 1; }
.mascot.static :is(.m-hole, .m-squash, .m-arm, .m-lid, .m-face, .m-fold) {
  transition: transform 320ms var(--ease-out), opacity 200ms var(--ease-out), fill 700ms ease-out;
}
.m-face { transform-origin: 60px 58px; }
.m-fold { opacity: 0; transform: translateY(5px) scale(0.85); transform-origin: 60px 80px; }

/* moods */
.mascot.rolling .m-lid { transform: translateY(-12px); }
.mascot.tired .m-lid { transform: translateY(-10px); }
.mascot.static.tired .m-squash { transform: scale(1.04, 0.95); }
.mascot.static.tired .m-hole { transform: scale(1.05, 0.7); }
.mascot.static.tired .m-arm-l { transform: rotate(-48deg); }
.mascot.static.tired .m-arm-r { transform: rotate(48deg); }
.mascot.upset .m-lid-l { transform: translateY(-9px) rotate(22deg); }
.mascot.upset .m-lid-r { transform: translateY(-9px) rotate(-22deg); }
/* refusing: arms fold across the belly and the face turns away to one side */
.mascot.static.upset .m-hole { transform: scale(0.62, 0.42); }
.mascot.static.upset .m-arm { opacity: 0; }
.mascot.static.upset .m-arm-l { transform: rotate(10deg) scale(0.5); }
.mascot.static.upset .m-arm-r { transform: rotate(-10deg) scale(0.5); }
.mascot.static.upset .m-fold { opacity: 1; transform: translateX(-5px); }
.mascot.static.upset .m-face { transform: translate(-12px, -1px); }
.mascot.static.upset .m-squash { transform: rotate(-4deg) scale(1.02, 0.98); }
.mascot.static.upset .m-ticks { opacity: 1; transform: none; transition: opacity 200ms ease-out; }

/* happy (an answer in the contact form): eyes close into smiles, mouth opens, arms up */
.m-joy { fill: none; stroke: #111; stroke-width: 3.2; stroke-linecap: round; opacity: 0; transform: translateY(2px); }
.mascot.static :is(.m-eye, .m-joy) { transition: transform 260ms var(--ease-out), opacity 160ms var(--ease-out); }
.mascot.static.happy .m-eye { opacity: 0; transform: scaleY(0.2); }
.mascot.static.happy .m-joy { opacity: 1; transform: none; }
.mascot.static.happy .m-hole { transform: scale(1.12, 1.28); }
.mascot.static.happy .m-arm-l { transform: rotate(40deg); }
.mascot.static.happy .m-arm-r { transform: rotate(-40deg); }

/* eager (the visitor is typing): leans toward the form, eyes wide open, hands ready */
.mascot.static.eager .m-squash { transform: rotate(-5deg) translateX(-2px); }
.mascot.static.eager .m-eye { transform: scale(1.12); }
.mascot.static.eager .m-lid { transform: translateY(-19px); }
.mascot.static.eager .m-arm-l { transform: rotate(4deg); }
.mascot.static.eager .m-arm-r { transform: rotate(-4deg); }

/* ───────── About ───────── */

.backsheets { position: relative; z-index: 1; height: 0; pointer-events: none; }
.backsheets i {
  position: absolute;
  height: 140px;
  border-radius: clamp(24px, 3vw, 44px) clamp(24px, 3vw, 44px) 0 0;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.7), 0 -14px 40px rgba(0, 0, 0, 0.05);
  will-change: transform;
}
.backsheets i:nth-child(1) { inset: -36px 7% auto; background: #f4f3ef; }
.backsheets i:nth-child(2) { inset: -18px 3.5% auto; background: #f0efea; }

.about {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  padding: clamp(88px, 14vh, 150px) var(--gutter) clamp(72px, 12vh, 130px);
  border-radius: clamp(24px, 3vw, 44px) clamp(24px, 3vw, 44px) 0 0;
  background: #ecebe6;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.7), 0 -24px 70px rgba(0, 0, 0, 0.09);
  scroll-margin-top: 0;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.88fr) minmax(0, 1.25fr);
  gap: clamp(28px, 4.4vw, 72px);
  max-width: 1280px;
  margin: 0 auto;
}

.about-intro { display: flex; flex-direction: column; }
.about h2 {
  margin: 0 0 0.45em;
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.about-roles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.about-roles li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, 0.1);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.about-roles .is-ai { background: var(--ink); color: #fff; box-shadow: none; }
.about-roles .is-ai::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ff7a1a; box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.25); }
.about-intro p {
  margin: 0;
  max-width: 30em;
  font-size: 1.0625rem;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}
.about-arrow {
  width: min(46%, 220px);
  margin: auto 8% 6% auto;
  padding-top: 40px;
  fill: none;
  stroke: rgba(29, 29, 31, 0.07);
  stroke-width: 15;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.about-card {
  padding: clamp(20px, 2vw, 28px);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 18px 50px rgba(0, 0, 0, 0.05);
}
.badge {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f0efeb;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.badge svg { width: 28px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.about-card h3 {
  margin: 0.5em 0 0.3em;
  font-size: clamp(2rem, 3.1vw, 2.75rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.about-card p { margin: 0; font-size: 1.0625rem; line-height: 1.55; letter-spacing: -0.01em; color: var(--ink-2); }
.portrait {
  display: grid;
  place-items: center;
  margin-top: clamp(24px, 3vw, 44px);
  aspect-ratio: 5 / 6;
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 38%, #fbfaf7, #efede7 75%);
}
.portrait svg { width: 52%; overflow: visible; }
.portrait { position: relative; overflow: hidden; }
.portrait img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.portrait img, .portrait svg { transition: transform 400ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .portrait:hover img, .portrait:hover svg { transform: scale(1.09); }
}

.about-side { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.talk {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-self: center;
  width: min(100%, 250px);
  aspect-ratio: 9 / 8;
  padding: 18px;
  border-radius: 16px;
  background: #17171a;
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-decoration: none;
}
/* the mascot, cropped in close so only its face peers out of the tile */
.talk-mascot {
  position: absolute;
  z-index: -2;
  left: -33%;
  top: -30%;
  width: 150%;
  transition: transform 400ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .talk:hover .talk-mascot { transform: translateY(-3%) scale(1.05); }
  .talk:hover .go svg { transform: translate(2px, -2px); }
}
.talk.offscreen :is(.t-eye, .t-glance) { animation-play-state: paused; } /* set by main.js */
.talk-shade { /* dark gradient so the label stays legible over the orange */
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(18, 18, 20, 0.94) 0%, rgba(18, 18, 20, 0.78) 30%, rgba(18, 18, 20, 0.25) 62%, rgba(18, 18, 20, 0) 85%);
}
.t-eye { animation: t-blink 4.6s infinite; }
.t-glance { animation: t-glance 9s ease-in-out infinite; }
.t-pupil { transition: transform 200ms ease-out; }
@keyframes t-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
@keyframes t-glance {
  0%, 38%, 84%, 100% { transform: translate(0, 0); }
  44%, 56% { transform: translate(2.2px, -0.6px); }
  62%, 76% { transform: translate(-2px, 0.5px); }
}

.talk:active .go { transform: scale(0.92); }
.go {
  display: grid;
  place-items: center;
  align-self: flex-end;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms var(--ease-out);
}
.go svg { width: 22px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 200ms var(--ease-out); }

.skills { display: grid; gap: 32px; margin: 0; padding: 0; list-style: none; }
.skills li { display: grid; grid-template-columns: 38px 1fr; gap: 14px; align-items: start; }
.skills svg { width: 38px; }
.skills circle { fill: var(--ink); }
.skills path { fill: #fff; }
.skills p { margin: 0; font-size: 1.0625rem; line-height: 1.6; letter-spacing: -0.01em; color: var(--ink-2); }
.skills strong { font-weight: 600; color: var(--ink); }

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; max-width: 560px; }
  .about-arrow { display: none; }
  .talk { align-self: flex-start; }
}

/* ───────── Accessibility ───────── */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-transparency: reduce) {
  .nav::before { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mac { animation: fade 300ms ease both; }
  @keyframes fade { from { opacity: 0; } }
  .ch.set .glyph, .caret.show, .t-eye, .t-glance, .pal-eye { animation: none; }
  .backsheets { display: none; }
  .portrait img, .portrait svg, .talk-mascot { transition: none; transform: none !important; }
  .sel, .card { transition: opacity 200ms ease; transform: rotate(var(--r, 0deg)); }
}

/* ───────── Phone menu ───────── */

.menu-btn { display: none; }
.menu, .scrim { display: none; }
.br-m { display: none; } /* phone-only line breaks in the canvas copy */

@media (max-width: 640px) {
  .nav nav a:not(.cta) { display: none; }
  .nav nav { gap: 10px; }

  .menu-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(29, 29, 31, 0.07);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 160ms var(--ease-out);
  }
  .menu-btn:active { transform: scale(0.94); }
  .menu-btn span {
    position: absolute;
    width: 18px;
    height: 1.75px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform 300ms var(--ease-out);
  }
  .menu-btn span:first-child { transform: translateY(-3.5px); }
  .menu-btn span:last-child { transform: translateY(3.5px); }
  .menu-btn[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

  /* a translucent sheet that drops from under the bar and leaves the same way */
  .menu {
    display: block;
    position: fixed;
    inset: 0 0 auto;
    z-index: 29; /* under the bar, so the button stays on top to close it */
    padding: 92px var(--gutter) 22px;
    border-radius: 0 0 28px 28px;
    background: rgba(245, 244, 240, 0.86);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
    transform: translateY(-104%);
    visibility: hidden;
    transition: transform 420ms var(--ease-drawer), visibility 0s 420ms;
  }
  .menu.open { transform: none; visibility: visible; transition: transform 420ms var(--ease-drawer), visibility 0s; }
  .menu a {
    display: block;
    padding: 16px 0;
    border-top: 1px solid rgba(29, 29, 31, 0.08);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: inherit;
    text-decoration: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
  }
  .menu.open a { opacity: 1; transform: none; transition-duration: 380ms; }
  .menu.open a:nth-child(1) { transition-delay: 90ms; }
  .menu.open a:nth-child(2) { transition-delay: 140ms; }
  .menu.open a:nth-child(3) { transition-delay: 190ms; }
  .menu a:active { opacity: 0.5; }
  .menu a { display: flex; align-items: center; justify-content: space-between; }
  .menu a[aria-current="true"]::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #ff5a0a; }
  .nav-pill { display: none; }
  .nav nav .cta { margin-left: 0; }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 28;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 320ms var(--ease-out);
  }
  .scrim.open { opacity: 1; pointer-events: auto; }
  html.menu-open { overflow: hidden; }

  /* ───────── Phone mockup: the laptop becomes a phone ───────── */

  .hero { padding-inline: 16px; }
  .mac { width: min(72vw, 36svh, 320px); }

  .lid {
    padding: 2.8cqw;
    border-radius: 14cqw;
    background: #0b0b0c;
    box-shadow:
      inset 0 0 0 0.5cqw #3a3a3d,
      0 0 0 0.35cqw #55565a,
      0 10cqw 20cqw -8cqw rgba(0, 0, 0, 0.3);
  }
  .lid::before, .lid::after { /* side buttons */
    content: "";
    position: absolute;
    width: 0.9cqw;
    border-radius: 0.5cqw;
    background: #48494d;
  }
  .lid::before { left: -1.2cqw; top: 30%; height: 12cqw; }
  .lid::after { right: -1.2cqw; top: 36%; height: 18cqw; }
  .cam { /* the camera pill */
    top: 5.6cqw;
    z-index: 6;
    width: 27cqw;
    height: 7.6cqw;
    margin-left: -13.5cqw;
    border-radius: 4cqw;
    background: #0b0b0c;
    box-shadow: none;
  }
  .chin, .base { display: none; }

  .screen { aspect-ratio: 9 / 18.4; border-radius: 11.4cqw; }
  .screen::after { /* home indicator */
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2.6cqw;
    width: 36cqw;
    height: 1.5cqw;
    margin-left: -18cqw;
    border-radius: 1cqw;
    background: rgba(29, 29, 31, 0.28);
  }

  /* portrait canvas: everything inside is re-sized for a narrow screen */
  .br-d { display: none; }
  .br-m { display: inline; }

  .grid {
    background:
      radial-gradient(ellipse 90% 46% at 50% 46%, #fff 0, rgba(255, 255, 255, 0.85) 40%, rgba(255, 255, 255, 0) 100%),
      linear-gradient(rgba(29, 29, 31, 0.055) 1px, transparent 0) 0 0 / 25cqw 25cqw,
      linear-gradient(90deg, rgba(29, 29, 31, 0.055) 1px, transparent 0) 12.5cqw 0 / 25cqw 25cqw;
  }

  .bar { inset: 17cqw 5cqw auto; }
  .bar-side { gap: 2cqw; }
  .lights { display: none; }
  .chip { gap: 1.6cqw; height: 9.4cqw; padding: 0 3.4cqw; border-radius: 3cqw; font-size: 3.6cqw; }
  .chip svg { width: 2.8cqw; height: 2.8cqw; }

  .canvas { gap: 6cqw; padding-top: 6cqw; }
  .frame-h { padding: 1.6cqw 4.4cqw 3.4cqw; }
  .frame-b { padding: 2.4cqw 4.4cqw 2.8cqw; }
  .sel i { width: 2.2cqw; height: 2.2cqw; border-radius: 0.4cqw; }
  .sel i:nth-child(1) { left: -1.2cqw; top: -1.2cqw; }
  .sel i:nth-child(2) { right: -1.2cqw; top: -1.2cqw; }
  .sel i:nth-child(3) { left: -1.2cqw; bottom: -1.2cqw; }
  .sel i:nth-child(4) { right: -1.2cqw; bottom: -1.2cqw; }

  .headline { font-size: 24cqw; line-height: 0.98; text-align: center; }
  .body { font-size: 5.3cqw; line-height: 1.36; }

  .card { border-radius: 4.4cqw; }
  .card-plus { right: 7cqw; top: 73%; width: 17cqw; height: 17cqw; }
  .card-plus svg { width: 7cqw; }

  .tools { bottom: 7.5%; gap: 0.8cqw; padding: 1.3cqw; border-radius: 3.6cqw; }
  .tools span { width: 9.6cqw; height: 9.6cqw; border-radius: 2.4cqw; }
  .tools svg { width: 5.6cqw; height: 5.6cqw; }

  .cursor { --u: 2.5cqw; }
  .cursor b { padding: 0.6cqw 2.2cqw 0.8cqw; border-radius: 2cqw; font-size: 3.3cqw; }
}

/* visually hidden, still read by screen readers */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ───────── Scroll cue: an arrow that nudges down; on the last section it turns up ───────── */
.scroll-cue {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 50;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, 0.1);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-out), background-color 200ms ease;
}
.scroll-cue::before { /* a soft ring that pulses out, so the eye finds it */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(29, 29, 31, 0.18);
  animation: cue-ring 2.4s var(--ease-out) infinite;
}
.scroll-cue.is-on { opacity: 1; pointer-events: auto; transform: none; }
.scroll-cue.is-on:active { transform: scale(0.92); }
.scroll-cue svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 520ms var(--ease-out);
}
.scroll-cue:not(.is-top) svg { animation: cue-bob 1.6s ease-in-out infinite; }
.scroll-cue.is-top svg { transform: rotate(180deg); }
.scroll-cue.is-top::before { animation: none; opacity: 0; }
@keyframes cue-bob { 0%, 100% { translate: 0 -2px; } 50% { translate: 0 3px; } }
@keyframes cue-ring { 0% { transform: scale(1); opacity: 0.9; } 70%, 100% { transform: scale(1.5); opacity: 0; } }
html.case-open .scroll-cue, .scroll-cue.is-away { opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .scroll-cue:hover { background: #fff; }
}
@media (max-width: 640px) {
  .scroll-cue { bottom: max(14px, env(safe-area-inset-bottom)); width: 36px; height: 36px; margin-left: -18px; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-cue svg, .scroll-cue::before { animation: none !important; }
}
