:root {
  /* pure white · powder blue · orange · an essence of purple (Lucas himself is deep purple) */
  --bg: #ffffff;
  --bg-2: rgba(255, 255, 255, 0.62);      /* glass panels over the fluid background */
  --line: rgba(28, 40, 80, 0.12);
  --text: #191a3a;                        /* ink with a violet hint */
  --text-2: #464a6c;
  --muted: #7a7f9c;
  --accent: #ff6a13;                      /* orange */
  --accent-2: #d9520a;                    /* orange, dark enough for small text */
  --powder: #b7d8f0;                      /* powder blue */
  --powder-deep: #5b8fcf;
  --purple: #6b2fd6;
  --deep: #2a0b4a;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--purple); }
::selection { background: var(--powder); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor {
  position: fixed; left: 0; top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: var(--accent); pointer-events: none; z-index: 60;
  transition: width .25s, height .25s, margin .25s, background .25s;
  mix-blend-mode: multiply; opacity: 0;
}
.cursor.on { opacity: 1; }
.cursor.big { width: 44px; height: 44px; margin: -22px 0 0 -22px; background: var(--powder); }
@media (pointer: coarse) { .cursor { display: none; } }

/* ---- nav ------------------------------------------------------------------ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) var(--gutter) 18px;
  transition: padding .3s, background .3s, backdrop-filter .3s;
}
.nav.scrolled { padding-block: 12px; background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--deep); box-shadow: 14px 0 0 -3px var(--accent), 24px 0 0 -4px var(--powder-deep); margin-right: 18px; }
.nav nav { display: flex; gap: clamp(12px, 2.5vw, 30px); align-items: center; font-size: 14px; }
.nav nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav nav a:hover { color: var(--text); }
.nav .nav-cta { color: var(--text); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; }
@media (max-width: 720px) { .nav nav a:not(.nav-cta) { display: none; } }

/* ---- buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px; font: 500 15px var(--sans); text-decoration: none;
  border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), background .2s, border-color .2s, color .2s;
}
.btn-primary { background: linear-gradient(120deg, #ff6a13, #ff9446); color: #fff; border-color: transparent; box-shadow: 0 8px 26px -8px rgba(255,106,19,.6); }
.btn-primary:hover { box-shadow: 0 12px 34px -6px rgba(255,106,19,.7); }
.btn-ghost { background: rgba(255,255,255,.55); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--accent); }

/* ---- hero -------------------------------------------------------------------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: calc(104px + env(safe-area-inset-top, 0px)) var(--gutter) 84px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 5vw, 80px); align-items: center; width: 100%; max-width: 1280px; margin: 0 auto; }
.eyebrow, .kicker { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px; }
.hello { margin: 0; font: 500 clamp(56px, 8.4vw, 124px)/0.92 var(--sans); letter-spacing: -0.045em; }
.hello em { font-size: 1.08em; letter-spacing: -0.02em; background: linear-gradient(100deg, #ff6a13 5%, #ff9446 45%, #6b2fd6 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .08em; }
.hello .line { display: block; overflow: hidden; padding: 0 .1em .16em 0; margin-bottom: -.1em; }
.hello .w { display: inline-block; transform: translateY(110%); transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.hello.in .w { transform: none; }
.hello.in .line:nth-child(1) .w:nth-child(2) { transition-delay: .08s; }
.hello.in .line:nth-child(2) .w { transition-delay: .18s; }
.hello.waving .line:nth-child(1) .w:first-child { animation: nod 1.2s .3s ease-in-out; transform-origin: 70% 90%; }
@keyframes nod { 0%,100% { rotate: 0deg; } 25% { rotate: -8deg; } 60% { rotate: 6deg; } }
.lede { color: var(--text-2); font-size: clamp(16px, 1.35vw, 19px); max-width: 46ch; margin: 22px 0 28px; opacity: 0; transform: translateY(14px); transition: .9s .35s cubic-bezier(.2,.8,.2,1); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; opacity: 0; transform: translateY(14px); transition: .9s .5s cubic-bezier(.2,.8,.2,1); }
.hello.in ~ .lede, .hello.in ~ .cta-row { opacity: 1; transform: none; }

/* the portrait: straight lines sketched onto a sheet of graph paper */
.portrait { --px: 0px; --py: 0px; position: relative; justify-self: center; width: min(100%, 500px); aspect-ratio: 464 / 512; cursor: pointer; outline-offset: 12px; border-radius: 6px;
  transform: translate(var(--px), var(--py)) rotate(-1.2deg); transition: transform .3s ease-out; }
.paper {
  position: absolute; inset: -4% -7% -4%; border-radius: 6px; background-color: #fcfcfd;
  background-image:
    linear-gradient(rgba(91,143,207,.22) 1px, transparent 1px), linear-gradient(90deg, rgba(91,143,207,.22) 1px, transparent 1px),
    linear-gradient(rgba(91,143,207,.11) 1px, transparent 1px), linear-gradient(90deg, rgba(91,143,207,.11) 1px, transparent 1px);
  background-size: calc(100% / 8) calc(100% / 8), calc(100% / 8) calc(100% / 8), calc(100% / 40) calc(100% / 40), calc(100% / 40) calc(100% / 40);
  box-shadow: 0 30px 60px -28px rgba(40,60,110,.45), 0 2px 6px rgba(40,60,110,.12), inset 0 0 0 1px rgba(91,143,207,.25);
}
.paper::after { content: ''; position: absolute; left: 7%; top: 0; bottom: 0; width: 1.5px; background: rgba(255,106,19,.45); }  /* margin rule */
.paper-tab, .paper-count { position: absolute; font: 500 11px var(--mono); letter-spacing: .06em; color: var(--muted); }
.paper-tab { right: 14px; top: 10px; text-transform: uppercase; }
.paper-count { right: 14px; bottom: 10px; color: var(--accent-2); }
.portrait-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.portrait:hover { transform: translate(var(--px), var(--py)) rotate(-.6deg) scale(1.01); }
}

.hint { position: absolute; left: var(--gutter); bottom: 34px; margin: 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.hint-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,106,19,.5); } 100% { box-shadow: 0 0 0 12px rgba(255,106,19,0); } }
.scroll-cue { position: absolute; left: 50%; bottom: 28px; width: 22px; height: 36px; margin-left: -11px; border: 1.5px solid var(--line); border-radius: 12px; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--text); animation: cue 1.8s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

@media (max-width: 860px) {
  .hero { padding-top: calc(88px + env(safe-area-inset-top, 0px)); padding-bottom: 56px; }
  .hero-inner { grid-template-columns: 1fr; gap: 20px; }
  .portrait { order: -1; width: min(78%, 340px); margin: 10px auto 18px; }
  .paper-tab { display: none; }
  .hello { font-size: clamp(52px, 15vw, 96px); }
  .eyebrow { font-size: 11px; }
  .code-line { font-size: 11.5px; margin-top: -4px; }
  .hint, .scroll-cue { display: none; }
}

/* ---- sections ------------------------------------------------------------------ */
.section { position: relative; isolation: isolate; padding: clamp(90px, 14vh, 160px) var(--gutter) 0; max-width: 1280px; margin: 0 auto; }
.section-head { position: relative; max-width: 760px; margin-bottom: clamp(36px, 6vh, 64px); }
h2 { font: 500 clamp(40px, 6vw, 76px)/1.0 var(--sans); letter-spacing: -0.04em; margin: 0 0 20px; }
.section-sub { color: var(--text-2); font-size: clamp(16px, 1.3vw, 18px); max-width: 58ch; margin: 0 0 24px; }
.muted { color: var(--muted); }

.reveal { opacity: 0; transform: translateY(26px); filter: blur(6px); transition: opacity .9s var(--d, 0ms), transform .9s var(--d, 0ms) cubic-bezier(.2,.8,.2,1), filter .9s var(--d, 0ms); }
.reveal.shown { opacity: 1; transform: none; filter: none; }

/* services */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; perspective: 1000px; }
.tilt {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  position: relative; transform-style: preserve-3d;
}
.tilt.shown { transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: opacity .9s, transform .25s ease-out; }
.tilt::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx) var(--my), rgba(91,143,207,.14), transparent 50%);
  opacity: 0; transition: opacity .3s;
}
.tilt:hover::after { opacity: 1; }
.service { background: var(--bg-2); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 22px; padding: 30px; min-height: 300px; display: flex; flex-direction: column; }
.service-num { font-family: var(--serif); font-style: italic; font-size: 40px; color: var(--accent); line-height: 1; }
.service h3 { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; margin: 26px 0 10px; }
.service p { color: var(--text-2); margin: 0 0 22px; }
.service ul { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.service li, .chip { font-size: 13px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2); }

.process { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border-top: 1px solid var(--line); counter-reset: step; }
.process li { padding: 22px 20px 0 0; counter-increment: step; }
.process b { display: block; font-weight: 500; margin-bottom: 6px; }
.process b::before { content: '0' counter(step) '  '; color: var(--accent); font-weight: 400; white-space: pre; }
.process span { color: var(--muted); font-size: 15px; }

/* ---- cardistry --------------------------------------------------------------------- */
.deck {
  position: relative; border: 1px solid var(--line); border-radius: 28px; overflow: hidden;
  background: radial-gradient(70% 80% at 50% 35%, #ffffff 0%, rgba(255,255,255,.92) 55%, rgba(225,238,249,.9) 100%);
  backdrop-filter: blur(10px);
  padding: 0 0 24px;
}
.deck::before { /* felt texture */
  content: ''; position: absolute; inset: 0; opacity: .25; pointer-events: none;
  background-image: radial-gradient(rgba(42,11,74,.07) 1px, transparent 1.3px); background-size: 9px 9px;
}
.deck-stage {
  position: relative; height: clamp(380px, 52vh, 520px); perspective: 1400px;
  display: grid; place-items: center; touch-action: pan-y; user-select: none; cursor: grab;
}
.deck-stage:active { cursor: grabbing; }
.deck-controls { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0 16px; }
.deck-controls button {
  font: 500 14px var(--sans); color: var(--text); background: rgba(255,255,255,.8); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.deck-controls button:hover { border-color: var(--accent); }
.deck-controls button[aria-pressed="true"] { background: var(--deep); color: #fff; border-color: var(--deep); }
.deck-caption { position: relative; text-align: center; color: var(--text-2); margin: 16px 16px 0; min-height: 1.6em; font-size: 15px; }

/* ---- CV ------------------------------------------------------------------------- */
.cv-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 90px); }
@media (max-width: 860px) { .cv-grid { grid-template-columns: 1fr; } }
.cv-label { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 20px; }
aside .cv-label:not(:first-child) { margin-top: 44px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.job { position: relative; padding: 0 0 38px 28px; }
.job::before { content: ''; position: absolute; left: -5px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--accent); }
.job:first-child::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px rgba(255,106,19,.2); }
.job-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.job h4, .edu h4, .project h4 { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -0.015em; }
.when { color: var(--muted); font-size: 14px; white-space: nowrap; }
.org { color: var(--accent-2); font-weight: 500; margin: 2px 0 10px; font-size: 15px; }
.job ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 15px; }
.job li { margin-bottom: 6px; }
.job li::marker { color: var(--muted); }
.edu { margin-bottom: 22px; }
.edu p { margin: 4px 0 0; font-size: 15px; }
.skill-group { margin-bottom: 18px; }
.skill-group p { margin: 0 0 8px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; perspective: 1000px; }
.project { background: var(--bg-2); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.project p { margin: 0; font-size: 15px; color: var(--text-2); }
.project .muted { font-size: 13px; margin-bottom: 10px; color: var(--muted); }
.project h4 { margin-bottom: 8px; }
.projects + * { margin-top: 0; }
#cv .cv-grid + .cv-label { margin-top: 70px; }

/* ---- contact ------------------------------------------------------------------- */
.contact { padding-bottom: clamp(90px, 14vh, 160px); }
.contact-big { font-size: clamp(52px, 10vw, 150px); line-height: .92; max-width: 12ch; letter-spacing: -.045em; }
.contact-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.email-text { color: var(--muted); margin-top: 18px; font-size: 15px; user-select: all; }

.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
  html { scroll-behavior: auto; }
}

/* ---- fluid background -------------------------------------------------------- */
.fluid { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; pointer-events: none; }
body { background: var(--bg); }

/* ---- photos of work & projects (or a styled tile until a photo is added) ---------- */
.job { display: grid; grid-template-columns: minmax(0, 1fr) clamp(140px, 16vw, 200px); gap: 22px; align-items: start; }
.job:not(:has(.media)) { grid-template-columns: minmax(0, 1fr); max-width: 680px; }
@media (max-width: 640px) { .job { grid-template-columns: 1fr; } .job .media { max-width: 260px; } }
.media { margin: 0; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.media { position: relative; }
.media-credit { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 3px 7px; border-radius: 6px; background: rgba(25, 26, 58, .55); color: #fff; font: 400 9.5px/1.3 var(--mono); opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; backdrop-filter: blur(4px); width: fit-content; max-width: calc(100% - 12px); }
.job:hover .media img, .project:hover .media img { transform: scale(1.05); }
.media-tile {
  position: relative; display: grid; place-items: center;
  background:
    radial-gradient(70% 70% at 85% 85%, rgba(255, 128, 50, calc(.35 + var(--h) / 1200)), transparent 60%),
    radial-gradient(60% 60% at 15% 10%, rgba(107, 47, 214, .28), transparent 60%),
    linear-gradient(140deg, #b7d8f0, #5b8fcf);
}
.media-tile::after { /* subtle dot texture, echoing the hero */
  content: ''; position: absolute; inset: 0; opacity: .35;
  background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.4px); background-size: 7px 7px;
}
.media-tile span { position: relative; z-index: 1; font: italic 400 clamp(24px, 2.6vw, 34px) var(--serif); color: #fff; text-align: center; padding: 0 10px; line-height: 1.05; }
.project .media { margin: -6px -6px 16px; aspect-ratio: 16 / 9; }

/* ---- hobbies ------------------------------------------------------------------------ */
.hobby {
  background: var(--bg-2); backdrop-filter: blur(14px); border: 1px solid var(--line);
  border-radius: 28px; padding: clamp(20px, 3vw, 34px); overflow: hidden;
}
.hobby + .hobby-pair, .hobby-pair { margin-top: 18px; }
.hobby-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.hobby-head { max-width: 560px; margin-bottom: 18px; }
.hobby-head h3 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 500; letter-spacing: -0.02em; margin: 10px 0 8px; }
.hobby-head p { color: var(--text-2); margin: 0; }
.hobby-tag {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--purple); font-weight: 500;
}
.hobby-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 10px 0 0 -1px var(--purple), 19px 0 0 -2px var(--powder-deep); margin-right: 20px; }
.hobby-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; }
.hobby-hint { margin: 10px 0 0; font-size: 14px; min-height: 1.5em; }

.hobby-cards .deck { margin: 0 calc(-1 * clamp(20px, 3vw, 34px)) calc(-1 * clamp(20px, 3vw, 34px)); border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
.deck-stage { display: block; }
.deck-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.watch { display: grid; place-items: center; perspective: 1200px; }
.watch-flip { position: relative; width: min(100%, 250px); aspect-ratio: 300 / 470; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.watch-flip.flipped { transform: rotateY(180deg) !important; }
.watch-face, .watch-back { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: visible; filter: drop-shadow(0 18px 24px rgba(40, 60, 110, .25)); }
.watch-back { transform: rotateY(180deg); }
.w-brand { font: 600 7px var(--sans); letter-spacing: .32em; fill: #2b2b2e; }
.w-omega-sym { font: 400 12px Georgia, serif; fill: #2b2b2e; }
.w-script { font: italic 400 9.5px var(--serif); fill: #b33a2c; }
.w-small { font: 600 5px var(--sans); letter-spacing: .18em; fill: #3a3a3e; white-space: pre; }
.w-tiny { font: 500 3.4px var(--sans); letter-spacing: .16em; fill: #5b5b60; }
.w-date { font: 600 10px var(--sans); fill: #2b2b2e; }
.w-rotor { font: 600 7px var(--sans); letter-spacing: .2em; fill: #5d6772; }

.coffee { position: relative; aspect-ratio: 1 / 1.05; max-height: 460px; margin: 0 auto; width: 100%; touch-action: none; }
.coffee-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.coffee-canvas:active { cursor: grabbing; }

/* ---- coder touches ------------------------------------------------------------------ */
.kicker, .eyebrow, .cv-label, .hobby-tag { font-family: var(--mono); letter-spacing: .06em; }
.eyebrow a { color: var(--purple); text-decoration: none; border-bottom: 1px dashed currentColor; pointer-events: auto; }
.section-sub a, .studio-line a { color: var(--purple); text-underline-offset: 3px; }
.code-line {
  font: 400 clamp(12px, 1vw, 14px)/1.5 var(--mono); color: var(--text-2); margin: -10px 0 26px;
  padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.6); border: 1px solid var(--line);
  width: fit-content; max-width: 100%;
  opacity: 0; transform: translateY(14px); transition: .9s .45s cubic-bezier(.2,.8,.2,1);
}
.hello.in ~ .code-line { opacity: 1; transform: none; }
.t-k { color: var(--purple); } .t-p { color: #2f6fb5; } .t-s { color: var(--accent-2); }
.caret { display: inline-block; width: .55em; height: 1.1em; background: var(--accent); vertical-align: -0.2em; margin-left: 2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
kbd { font: 500 .85em var(--mono); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); background: #fff; box-shadow: 0 1px 0 var(--line); }

/* ---- websites showcase --------------------------------------------------------------- */
.sites { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.site-featured { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); align-items: center; }
@media (max-width: 980px) { .sites { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .sites, .site-featured { grid-template-columns: 1fr; } }
.browser {
  display: block; text-decoration: none; border-radius: 16px; overflow: hidden; background: #fff;
  border: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(40, 60, 120, .45), 0 2px 0 rgba(255,255,255,.6) inset;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), box-shadow .5s;
}
.browser:hover { transform: translateY(-6px); box-shadow: 0 40px 80px -30px rgba(40, 60, 120, .55); }
.browser-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #f3f5fa; border-bottom: 1px solid var(--line); }
.pg-dots { display: inline-flex; gap: 6px; flex: none; }
.pg-dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.pg-dots i:nth-child(2) { background: #febc2e; } .pg-dots i:nth-child(3) { background: #28c840; }
.browser-url {
  flex: 1; min-width: 0; font: 400 12px var(--mono); color: var(--muted); background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lock { font-size: 10px; margin-right: 6px; opacity: .6; }
.browser-view { --scroll: 0px; --dur: 8s; aspect-ratio: 16 / 10.5; overflow: hidden; background: #f6f7fb; }
.site-featured .browser-view { aspect-ratio: 16 / 9.5; }
.browser-view img { width: 100%; height: auto; display: block; transform: translateY(0); transition: transform 1.2s cubic-bezier(.4,0,.2,1); }
.browser:hover .browser-view img, .browser:focus-visible .browser-view img, .browser.autoscroll .browser-view img {
  transform: translateY(var(--scroll)); transition: transform var(--dur) linear;
}
.site-info { padding: 18px 4px 0; }
.site-featured .site-info { padding: 0; }
.site-kind { font: 400 12px var(--mono); margin: 0 0 6px; }
.site-info h3 { font-size: clamp(22px, 2vw, 28px); font-weight: 500; letter-spacing: -.02em; margin: 0 0 8px; }
.site-featured .site-info h3 { font-size: clamp(30px, 3.2vw, 44px); }
.site-info p { color: var(--text-2); margin: 0 0 14px; font-size: 15px; }
.site-tags { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.site-tags li { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); background: rgba(255,255,255,.6); }
.site-link { font: 500 14px var(--mono); color: var(--accent-2); text-decoration: none; }
.site-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---- live code playground --------------------------------------------------------------- */
.playground { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: 0 30px 60px -34px rgba(40, 60, 120, .45); }
.pg-bar { display: flex; align-items: center; gap: 16px; padding: 10px 14px; background: #f3f5fa; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pg-tabs { display: flex; gap: 4px; }
.pg-tabs button { font: 400 12.5px var(--mono); color: var(--muted); background: none; border: 1px solid transparent; border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.pg-tabs button[aria-selected="true"] { color: var(--text); background: #fff; border-color: var(--line); }
.pg-status { margin-left: auto; font: 400 12px var(--mono); color: var(--muted); }
.pg-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 380px; }
@media (max-width: 760px) { .pg-body { grid-template-columns: 1fr; } .pg-preview { min-height: 260px; border-left: 0; border-top: 1px solid var(--line); } }
.pg-editor { display: grid; grid-template-columns: auto 1fr; background: #1b1530; color: #e8e3f7; position: relative; height: 380px; }
.pg-lines { margin: 0; padding: 16px 10px 16px 14px; font: 400 13px/1.6 var(--mono); color: #6d6390; text-align: right; overflow: hidden; user-select: none; }
.pg-code { position: relative; overflow: hidden; }
.pg-highlight, .pg-input {
  position: absolute; inset: 0; margin: 0; padding: 16px 16px 16px 6px; font: 400 13px/1.6 var(--mono);
  white-space: pre; overflow: auto; tab-size: 2; border: 0;
}
.pg-highlight { pointer-events: none; color: #e8e3f7; scrollbar-width: none; }
.pg-highlight::-webkit-scrollbar { display: none; }
.pg-input { background: transparent; color: transparent; caret-color: #ff9446; resize: none; outline: none; }
.pg-input::selection { background: rgba(183,216,240,.3); color: transparent; }
.t-tag { color: #ff9fd0; } .t-attr { color: #ffd479; } .t-str { color: #9ee6a8; }
.t-sel { color: #b7d8f0; } .t-prop { color: #c7a6ff; } .t-num { color: #ffb38a; }
.pg-preview { width: 100%; height: 100%; min-height: 380px; border: 0; border-left: 1px solid var(--line); background: #fbfcff; }
.stack { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.stack li { font: 400 13px var(--mono); padding: 6px 12px; border-radius: 8px; background: rgba(255,255,255,.7); border: 1px solid var(--line); color: var(--text-2); }
.inspect-hint { margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.studio-line { color: var(--text-2); margin-top: 22px; }

/* ---- inspect mode ------------------------------------------------------------------- */
.inspect-toggle {
  font: 500 13px var(--mono); color: var(--text-2); background: rgba(255,255,255,.6); border: 1px dashed var(--line);
  border-radius: 8px; padding: 6px 9px; cursor: pointer;
}
.inspect-toggle[aria-pressed="true"] { background: var(--deep); color: #fff; border-style: solid; }
.inspect-grid {
  position: fixed; inset: 0 var(--gutter); z-index: 70; pointer-events: none; display: none;
  grid-template-columns: repeat(12, 1fr); gap: 20px; max-width: 1280px; margin: 0 auto;
}
.inspect-grid div { background: rgba(255, 106, 19, .06); border-inline: 1px solid rgba(255, 106, 19, .25); }
.inspecting .inspect-grid { display: grid; }
.inspecting :is(main h1, main h2, main h3, main p, main article, main figure, main ul, main ol, main a, main button, .section-head, .services, .sites, .projects, .hobby-pair) {
  outline: 1px dashed rgba(107, 47, 214, .35); outline-offset: -1px;
}
.inspecting [data-inspect-label] { position: relative; outline: 1.5px solid rgba(91, 143, 207, .7) !important; }
.inspecting [data-inspect-label]::before {
  content: attr(data-inspect-label); position: absolute; top: 0; left: 0; z-index: 71;
  font: 500 11px var(--mono); color: #fff; background: #5b8fcf; padding: 2px 8px; border-radius: 0 0 6px 0;
}
.inspecting .nav[data-inspect-label]::before { top: auto; bottom: -18px; }
.inspect-hud {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 72;
  font: 400 12px/1.5 var(--mono); color: #e8e3f7; background: rgba(27, 21, 48, .92); padding: 10px 14px; border-radius: 10px;
  box-shadow: 0 12px 30px -12px rgba(0,0,0,.5); max-width: min(360px, calc(100vw - 32px));
}
.inspect-hud b { color: #ffb38a; font-weight: 500; }
.inspect-hud span { color: #b7d8f0; word-break: break-all; }
.inspect-tip { position: fixed; left: 0; top: 0; z-index: 69; pointer-events: none; background: rgba(183, 216, 240, .25); outline: 1.5px solid #5b8fcf; transition: transform .08s, width .08s, height .08s; }
.inspect-tip::after { content: attr(data-label); position: absolute; left: 0; bottom: 100%; font: 500 11px var(--mono); color: #fff; background: #2a0b4a; padding: 2px 6px; border-radius: 4px 4px 0 0; white-space: nowrap; }
@media (max-width: 720px) { .nav .inspect-toggle { display: none; } }

/* ---- case-study details + trust strip + skip link ------------------------------------------ */
.site-brief { font: italic 400 clamp(18px, 1.6vw, 22px)/1.3 var(--serif) !important; color: var(--text) !important; margin: 0 0 10px !important; }
.site-facts { margin: 0 0 16px; display: grid; gap: 8px; }
.site-facts div { display: grid; grid-template-columns: 82px 1fr; gap: 10px; align-items: baseline; font-size: 14px; }
.site-facts dt { font: 400 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.site-facts dd { margin: 0; color: var(--text-2); }
.site-facts b { color: var(--accent-2); font-size: 16px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 22px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--text-2); pointer-events: auto;
  opacity: 0; transform: translateY(14px); transition: .9s .6s cubic-bezier(.2,.8,.2,1); }
.hello.in ~ .trust { opacity: 1; transform: none; }
.trust li { display: inline-flex; align-items: baseline; gap: 6px; }
.trust b { font: 600 15px var(--sans); color: var(--text); }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--deep); color: #fff; text-decoration: none; }
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

/* ---- play: games ---------------------------------------------------------------------------- */
.arcade { background: var(--bg-2); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 28px; padding: clamp(18px, 3vw, 30px); }
.arcade-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.arcade-tabs button { font: 500 14px var(--sans); color: var(--text-2); background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; cursor: pointer; }
.arcade-tabs button[aria-selected="true"] { background: var(--deep); color: #fff; border-color: var(--deep); }
.game { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: clamp(18px, 3vw, 40px); align-items: center; }
@media (max-width: 820px) { .game { grid-template-columns: 1fr; } }
.game-status { color: var(--text-2); min-height: 3em; margin: 12px 0 0; }

.sl-board { position: relative; display: grid; grid-template-columns: repeat(10, 1fr); aspect-ratio: 1; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.sl-cell { position: relative; background: #ffffff; }
.sl-cell.alt { background: #eef5fc; }
.sl-cell.goal { background: #fff0e4; }
.sl-cell span { position: absolute; left: 4px; top: 2px; font: 500 clamp(7px, 1vw, 10px) var(--mono); color: var(--muted); }
.sl-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sl-ladder line { stroke: #c08a4a; stroke-width: .75; stroke-linecap: round; }
.sl-ladder .rung { stroke-width: .6; }
.sl-snake { opacity: .88; }
.sl-snake .body { fill: none; stroke: #6b2fd6; stroke-width: 1.9; stroke-linecap: round; }
.sl-snake .belly { fill: none; stroke: #b9a0f5; stroke-width: .6; stroke-dasharray: 1 1.4; stroke-linecap: round; }
.sl-snake .head { fill: #6b2fd6; }
.sl-token { position: absolute; width: 4.6%; aspect-ratio: 1; border-radius: 50%; translate: -50% -50%; transition: left .12s ease-out, top .12s ease-out; box-shadow: 0 3px 8px rgba(25,26,58,.35), inset 0 -3px 0 rgba(0,0,0,.18); border: 2px solid #fff; z-index: 2; }
.sl-token.you, .sl-chip.you { background: #ff6a13; }
.sl-token.cpu, .sl-chip.cpu { background: #2a0b4a; }
.sl-legend { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.sl-chip { width: 14px; height: 14px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.sl-die { margin-top: 16px; width: 64px; height: 64px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 24px -10px rgba(40,60,110,.45); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 10px; transition: transform .06s; }
.sl-die.spin { transform: rotate(14deg) scale(1.05); }
.sl-die i { width: 10px; height: 10px; border-radius: 50%; background: var(--deep); place-self: center; visibility: hidden; }
/* pip layouts: positions 1-9 on a 3x3 grid */
.sl-die i:nth-child(1) { grid-area: 1 / 1; } .sl-die i:nth-child(2) { grid-area: 1 / 3; } .sl-die i:nth-child(3) { grid-area: 2 / 1; }
.sl-die i:nth-child(4) { grid-area: 2 / 3; } .sl-die i:nth-child(5) { grid-area: 3 / 1; } .sl-die i:nth-child(6) { grid-area: 3 / 3; }
.sl-die[data-v="1"] i:nth-child(1) { grid-area: 2 / 2; visibility: visible; }
.sl-die[data-v="2"] i:nth-child(1), .sl-die[data-v="2"] i:nth-child(6) { visibility: visible; }
.sl-die[data-v="3"] i:nth-child(1), .sl-die[data-v="3"] i:nth-child(6) { visibility: visible; }
.sl-die[data-v="3"] i:nth-child(3) { grid-area: 2 / 2; visibility: visible; }
.sl-die[data-v="4"] i:is(:nth-child(1), :nth-child(2), :nth-child(5), :nth-child(6)) { visibility: visible; }
.sl-die[data-v="5"] i:is(:nth-child(1), :nth-child(2), :nth-child(5), :nth-child(6)) { visibility: visible; }
.sl-die[data-v="5"] i:nth-child(3) { grid-area: 2 / 2; visibility: visible; }
.sl-die[data-v="6"] i { visibility: visible; }

.mm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; perspective: 900px; max-width: 420px; }
.mm-card { aspect-ratio: 3 / 4; border: 0; padding: 0; background: none; cursor: pointer; }
.mm-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.mm-card.up .mm-inner { transform: rotateY(180deg); }
.mm-back, .mm-front { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 8px 20px -10px rgba(40,60,110,.45); }
.mm-back { background: linear-gradient(150deg, #ffb27a, #ff6a13 55%, #d9480a); color: #fff; font: italic 400 clamp(20px, 3vw, 30px) var(--serif); border: 4px solid #fff; }
.mm-front { background: #fff; color: var(--deep); font: 500 clamp(26px, 4vw, 40px) var(--sans); transform: rotateY(180deg); border: 1px solid var(--line); }
.mm-card.done .mm-front { background: #eef5fc; color: var(--purple); }

.ttt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 360px; }
.ttt-cell { aspect-ratio: 1; border-radius: 16px; border: 1px solid var(--line); background: #fff; cursor: pointer; padding: 18%; transition: background .2s, transform .2s; }
.ttt-cell:not(:disabled):hover { background: #eef5fc; transform: translateY(-2px); }
.ttt-cell:disabled { cursor: default; }
.ttt-cell svg { width: 100%; height: 100%; fill: none; stroke-width: 4.5; stroke-linecap: round; }

/* ---- arcade picker + quick games ---- */
.arcade { position: relative; }
.arcade-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; margin-bottom: 26px; }
.arcade-pick button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 12px 11px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.75); color: var(--text); cursor: pointer; font: inherit; transition: transform .2s, background .2s, box-shadow .2s; }
.arcade-pick button:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(40,60,110,.5); }
.arcade-pick button[aria-selected="true"] { background: var(--deep); border-color: var(--deep); color: #fff; box-shadow: 0 14px 28px -16px rgba(42,11,74,.8); }
.arcade-pick b { font: 500 14px var(--sans); line-height: 1.25; }
.arcade-pick small { font: 400 11px var(--mono); color: var(--muted); line-height: 1.35; }
.arcade-pick button[aria-selected="true"] small { color: #c9bfe0; }
.pick-ico { width: 36px; height: 36px; border-radius: 11px; margin-bottom: 8px; display: grid; place-items: center; font: 600 16px var(--sans); background: #eef5fc; color: var(--deep); }
.pick-ico.red { color: #e0301e; font-size: 14px; }
.arcade-pick button[aria-selected="true"] .pick-ico { background: rgba(255,255,255,.12); color: #fff; }
.arcade-pick button[aria-selected="true"] .pick-ico.red { color: #ff8a70; }
.game-side .btn:disabled { opacity: .45; cursor: default; transform: none; }
.hud { display: flex; gap: 10px; flex-wrap: wrap; }
.hud span { flex: 1 1 0; min-width: 78px; padding: 10px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: grid; gap: 2px; }
.hud b { font: 600 26px var(--sans); color: var(--deep); letter-spacing: -.02em; text-transform: none; }
.confetti { position: absolute; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; z-index: 5; }
.game.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* bug squash: twelve little editor windows */
.bs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.bs-hole { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: visible; cursor: crosshair; display: grid; grid-template-rows: auto 1fr; aspect-ratio: 1 / .92; font: inherit; color: inherit; transition: transform .12s; }
.bs-hole.miss { transform: scale(.96); }
.bs-hole.squash { transform: scale(.92); }
.bs-bar { display: flex; align-items: center; gap: 3px; padding: 5px 7px; border-bottom: 1px solid var(--line); background: #f3f5fa; border-radius: 12px 12px 0 0; min-width: 0; }
.bs-bar i { width: 5px; height: 5px; border-radius: 50%; background: #d6d9e6; flex: none; }
.bs-bar span { margin-left: 4px; font: 400 clamp(8.5px, 1.1vw, 11px) var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-pit { position: relative; overflow: hidden; border-radius: 0 0 12px 12px; }
.bs-code { position: absolute; inset: 9px 9px auto; height: 60%; background: repeating-linear-gradient(180deg, #e6e9f4 0 3px, transparent 3px 9px); mask: linear-gradient(90deg, #000 55%, transparent 90%); opacity: .9; }
.bs-critter { position: absolute; left: 50%; bottom: 0; width: 64%; aspect-ratio: 1; translate: -50% 105%; transition: translate .14s cubic-bezier(.2,.9,.3,1.3); }
.bs-critter svg { width: 100%; height: 100%; display: block; }
.bs-hole.up .bs-critter { translate: -50% 4%; }
.bs-hole.up[data-kind="feature"] { background: #fff6ee; }
.bs-hole.up[data-kind="bug"] { background: #f6f1ff; }
.bs-pop { position: absolute; left: 50%; top: 30%; translate: -50% 0; z-index: 3; font: 600 14px var(--sans); color: var(--purple); white-space: nowrap; pointer-events: none; animation: pop-up .7s ease-out forwards; }
.bs-pop.bad { color: var(--accent-2); font-size: 12px; }
@keyframes pop-up { to { transform: translateY(-34px); opacity: 0; } }

/* find the lady */
.ftl-table { --dur: 400ms; position: relative; aspect-ratio: 16 / 9; max-width: 520px; width: 100%; border-radius: 22px; background: radial-gradient(120% 90% at 50% 20%, #3d1470, #2a0b4a 70%); box-shadow: inset 0 0 0 6px rgba(255,255,255,.06); }
.ftl-card { --slot: 0; --lift: 0%; position: absolute; top: 14%; height: 72%; aspect-ratio: 5 / 7; left: calc(9% + var(--slot) * 29%); translate: 0 var(--lift); border: 0; padding: 0; background: none; cursor: pointer; perspective: 800px; transition: left var(--dur) cubic-bezier(.45,.05,.35,1), translate calc(var(--dur) / 2) ease-out; }
.ftl-card:disabled { cursor: default; }
.ftl-card:not(:disabled):hover .ftl-inner { transform: translateY(-6px); }
.ftl-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .42s cubic-bezier(.2,.8,.2,1); }
.ftl-card.up .ftl-inner { transform: rotateY(180deg); }
.ftl-back, .ftl-face { position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 14px 26px -12px rgba(0,0,0,.6); }
.ftl-back { display: grid; place-items: center; border: 5px solid #fff; background: repeating-linear-gradient(45deg, #ff6a13 0 6px, #ff8a3d 6px 12px); }
.ftl-back b { font: italic 400 clamp(18px, 3vw, 28px) var(--serif); color: #fff; background: #ff6a13; padding: 0 8px; border-radius: 6px; }
.ftl-face { transform: rotateY(180deg); background: #fff; color: var(--deep); display: grid; place-items: center; }
.ftl-card.red .ftl-face { color: #e0301e; }
.ftl-corner { position: absolute; left: 7%; top: 5%; font: 600 clamp(10px, 1.5vw, 14px)/1.05 var(--sans); text-align: center; }
.ftl-corner.flip { left: auto; top: auto; right: 7%; bottom: 5%; rotate: 180deg; }
.ftl-mid { font: italic 400 clamp(36px, 6vw, 64px)/1 var(--serif); display: grid; place-items: center; }
.ftl-mid small { font: 400 clamp(16px, 2.4vw, 24px) var(--sans); }

/* stop at 12 */
.st-dial { width: 100%; max-width: 380px; justify-self: center; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; border-radius: 50%; }
.st-dial:focus-visible { outline: 3px solid var(--powder-deep); outline-offset: 6px; }
.st-dial svg { width: 100%; display: block; filter: drop-shadow(0 22px 30px rgba(40,60,110,.28)); }
.st-case { fill: #e9ebf0; stroke: #c4c8d2; stroke-width: 2; }
.st-face { fill: #f4ead7; }
.st-zone { fill: rgba(255, 106, 19, .2); }
.st-dial line { stroke: #8a8f9e; stroke-width: 1; stroke-linecap: round; }
.st-dial line.major { stroke: #4b4f5e; stroke-width: 3.2; }
.st-dial line.twelve { stroke: var(--accent); stroke-width: 5; }
.st-ghost line { stroke: var(--purple); stroke-width: 1.4; opacity: .35; }
.st-hand line { stroke: var(--deep); stroke-width: 2.2; }
.st-hand circle { fill: var(--accent); }
.st-pin { fill: var(--deep); }
.st-brand { font: 600 8px var(--mono); letter-spacing: .2em; fill: #9a8f7a; text-anchor: middle; }
.game.playing .st-dial svg { filter: drop-shadow(0 22px 30px rgba(107,47,214,.35)); }

/* bean catch */
.bc-canvas { width: 100%; max-width: 520px; aspect-ratio: 6 / 5; border-radius: 18px; border: 1px solid var(--line); display: block; touch-action: none; cursor: none; background: #fffdf8; }
.bc-canvas:focus-visible { outline: 3px solid var(--powder-deep); outline-offset: 3px; }
.ttt-cell.x svg { stroke: #ff6a13; } .ttt-cell.o svg { stroke: #2a0b4a; }
.ttt-cell path, .ttt-cell circle { stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw .35s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.ttt-cell.win { background: #fff0e4; border-color: #ffb27a; }

/* ---- play: photo booth ------------------------------------------------------------------------ */
.photobooth { margin-top: 18px; background: var(--bg-2); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 28px; padding: clamp(20px, 3vw, 34px); }
.pb-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 40px); align-items: start; }
@media (max-width: 860px) { .pb-body { grid-template-columns: 1fr; } }
.pb-stage { position: relative; aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden; background: linear-gradient(150deg, #e9f2fb, #ffffff 60%, #fff0e4); border: 1px solid var(--line); }
.pb-stage video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.photobooth:has([data-pb-mirror]:not(:checked)) .pb-stage video { transform: none; }
.pb-placeholder { position: absolute; inset: 0; display: grid; place-items: center; font-size: 56px; opacity: .55; }
.photobooth:not([data-state="idle"]) .pb-placeholder { display: none; }
.pb-count { position: absolute; inset: 0; display: grid; place-items: center; font: 600 clamp(80px, 14vw, 150px) var(--sans); color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,.35); pointer-events: none; }
.pb-count.pop { animation: pop .8s ease-out; }
@keyframes pop { 0% { transform: scale(1.4); opacity: 0; } 25% { opacity: 1; } 100% { transform: scale(.9); opacity: .2; } }
.pb-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.pb-flash.go { animation: flash .45s ease-out; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }
.pb-thumbs { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; }
.pb-thumbs img { width: 64px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.pb-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); }
.pb-inline select { font: inherit; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.pb-side { display: grid; gap: 16px; }
.pb-styles { border: 0; margin: 0; padding: 0; }
.pb-styles legend { font: 400 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; padding: 0; }
.pb-opts { display: flex; flex-wrap: wrap; gap: 7px; }
.pb-opts label { display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px 6px 7px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.75); cursor: pointer; font-size: 13.5px; }
.pb-opts input { position: absolute; opacity: 0; pointer-events: none; }
.pb-opts label:has(input:checked) { border-color: var(--deep); box-shadow: inset 0 0 0 1px var(--deep); background: #fff; }
.pb-opts label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pb-stickers label { padding: 4px 9px; font-size: 20px; }
.sw { width: 20px; height: 24px; border-radius: 4px; border: 1px solid var(--line); flex: none; }
.sw-layout { display: grid; grid-template-columns: repeat(var(--c), 1fr); gap: 2px; padding: 3px; background: #fff; }
.sw-layout b { background: #9aa4ae; border-radius: 1px; min-height: 3px; }
.sw-colour { border-radius: 50%; width: 20px; height: 20px; }
.sw-frame { background: #fff; position: relative; }
.sw-frame::after { content: ''; position: absolute; inset: 4px; background: #c9d3df; }
.sw-frame-film { background: #141414; box-shadow: inset 3px 0 0 #f4efe6, inset -3px 0 0 #f4efe6; } .sw-frame-film::after { background: #666; inset: 5px 5px; }
.sw-frame-polaroid::after { inset: 3px 3px 8px; }
.sw-frame-tape::after { inset: 5px 3px 3px; } .sw-frame-tape::before { content: ''; position: absolute; left: 5px; right: 5px; top: 1px; height: 4px; background: #ffe296; z-index: 1; }
.sw-frame-dots { background: radial-gradient(#b7d8f0 1px, transparent 1.2px) 0 0 / 5px 5px #fff; }
.sw-frame-rounded::after { border-radius: 6px; }
.sw-filter { background: linear-gradient(135deg, #ff6a13, #6b2fd6, #5b8fcf); border-radius: 50%; width: 20px; height: 20px; }
.pb-caption { display: grid; gap: 6px; }
.pb-caption span { font: 400 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.pb-caption input { font: inherit; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.pb-only-live, .pb-only-done { display: none; }
.photobooth[data-state="live"] .pb-only-live, .photobooth[data-state="done"] .pb-only-done { display: inline-flex; }
.photobooth:not([data-state="idle"]) .pb-only-idle { display: none; }
.photobooth[data-state="shooting"] .hobby-controls { visibility: hidden; }
.pb-strip { display: none; margin-top: 16px; max-width: 100%; max-height: 560px; width: auto; height: auto; border-radius: 6px; box-shadow: 0 20px 40px -18px rgba(40,60,110,.5); }
.photobooth[data-state="done"] .pb-strip { display: block; }
.photobooth[data-state="done"] .pb-stage { display: none; }

/* ---- free tools ------------------------------------------------------------------------------- */
.tools { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 28px; padding: clamp(18px, 3vw, 30px); }
.tools-tabs button { color: #c9bfe0; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
.tools-tabs button[aria-selected="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.tool-intro { max-width: 620px; margin-bottom: 18px; }
.tool-intro h3 { margin: 0 0 6px; font-size: clamp(20px, 2.2vw, 28px); font-weight: 500; letter-spacing: -.02em; }
.tool-intro p { margin: 0; color: #c9bfe0; }
.tool-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.tool-form input[type="text"] { flex: 1 1 260px; min-width: 0; font: inherit; padding: 13px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; }
.tool-form input::placeholder { color: #8e85ad; }
.colour-pick { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #c9bfe0; font-size: 14px; cursor: pointer; }
.colour-pick input { width: 34px; height: 34px; border: 0; padding: 0; background: none; border-radius: 50%; overflow: hidden; cursor: pointer; }
.hex-in { flex: 0 0 120px !important; font-family: var(--mono) !important; text-transform: uppercase; }
.tool-out { min-height: 20px; }
.tool-wait, .tool-err, .tool-foot { color: #c9bfe0; }
.tool-err { color: #ffb38a; }
.tool-foot a, .tool-err a { color: #fff; }
.tool-foot.ok { color: #8ee3b0; }
.tool-score { display: inline-flex; align-items: baseline; gap: 4px; padding: 10px 18px; border-radius: 16px; margin-bottom: 10px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); position: relative; padding-left: 64px; }
.tool-score::before { content: ''; position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 40px; height: 40px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); -webkit-mask: radial-gradient(circle, transparent 11px, #000 12px); mask: radial-gradient(circle, transparent 11px, #000 12px); }
.tool-score b { font: 600 40px var(--sans); color: #fff; letter-spacing: -.03em; }
.tool-score span { color: #8e85ad; font-family: var(--mono); }
.tool-lead { color: #fff; margin: 0 0 14px; }
.tool-checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 8px; }
.tool-checks li { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.tool-checks li > span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 600; font-size: 13px; }
.tool-checks .ok > span { background: rgba(94,227,138,.18); color: #8ee3b0; }
.tool-checks .fix > span { background: rgba(255,106,19,.2); color: #ffb38a; }
.tool-checks b { font-weight: 500; color: #fff; display: block; }
.tool-checks small { color: #c9bfe0; display: block; margin-top: 2px; line-height: 1.45; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.swatch { padding: 10px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); display: grid; gap: 4px; }
.swatch i { display: block; height: 56px; border-radius: 10px; background: var(--c); border: 1px solid rgba(255,255,255,.12); }
.swatch b { font: 500 13px var(--mono); color: #fff; }
.swatch code { font: 400 11.5px var(--mono); color: #c9bfe0; }
.swatch small { color: #8e85ad; font-size: 12px; line-height: 1.4; }
.og-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-bottom: 14px; }
.og-card { position: relative; margin: 0; border-radius: 14px; overflow: hidden; background: #fff; color: #191a3a; }
.og-card em { position: absolute; top: 10px; left: 10px; font: 500 11px var(--mono); background: rgba(0,0,0,.6); color: #fff; padding: 3px 8px; border-radius: 6px; }
.og-img { aspect-ratio: 1.91 / 1; background: #e9edf2; display: grid; place-items: center; color: #7a7f9c; font-size: 13px; }
.og-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.og-card figcaption { padding: 10px 14px 12px; }
.og-card figcaption b { display: block; font-weight: 600; font-size: 15px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.og-card figcaption p { margin: 4px 0; font-size: 13px; color: #45465a; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.og-card figcaption small { color: #7a7f9c; font-size: 12px; text-transform: uppercase; }
.og-wa { background: #e7ffdb; } .og-wa figcaption { background: #dcf8c6; }
.qr-form input[type="text"] { flex: 1 1 320px; }
.qr-wrap { display: grid; justify-items: start; gap: 8px; }
.qr-wrap canvas { width: min(100%, 280px); height: auto; border-radius: 16px; background: #fff; padding: 10px; box-sizing: border-box; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* =====================================================================================
   RHYTHM: full-bleed bands, ghost numerals, marquee, progress bar
   ===================================================================================== */
.progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 80; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), #c04cf0 60%, var(--powder-deep)); pointer-events: none; }

.section--dark, .section--tint { padding-bottom: clamp(90px, 14vh, 160px); }
.section--dark::before, .section--tint::before { content: ''; position: absolute; top: 0; bottom: 0; left: -100vw; right: -100vw; z-index: -1; }
.section--tint::before { background: linear-gradient(180deg, rgba(183,216,240,.35), rgba(183,216,240,.55) 50%, rgba(183,216,240,.3)); }
.section--dark { --bg-2: rgba(255,255,255,.05); --line: rgba(255,255,255,.14); --text: #f6f1ff; --text-2: #c9bfe0; --muted: #8e85ad; --purple: #c9b3ff; --accent-2: #ffa366; color-scheme: dark; }
.section--dark::before { background: radial-gradient(70% 60% at 20% 0%, rgba(107,47,214,.35), transparent 60%), radial-gradient(50% 50% at 90% 100%, rgba(255,106,19,.18), transparent 60%), #140b26; }
.section--dark .section-sub, .section--dark p { color: var(--text-2); }
.section--dark h2, .section--dark h3 { color: var(--text); }
.section--dark .btn-ghost { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.22); }
.section--dark .btn-ghost:hover { border-color: #fff; }
.section--dark kbd { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2); box-shadow: none; }

/* oversized ghost numeral behind each section heading */
.section-head::before {
  content: attr(data-num); position: absolute; left: -.1em; top: -.58em; z-index: -1; pointer-events: none;
  font: 600 clamp(120px, 20vw, 260px)/1 var(--sans); letter-spacing: -.05em; color: transparent;
  -webkit-text-stroke: 1.5px rgba(25, 26, 58, .13);
}
.section--dark .section-head::before { -webkit-text-stroke-color: rgba(255,255,255,.16); }
.section--tint .section-head::before { -webkit-text-stroke-color: rgba(91,143,207,.35); }

/* marquee strip under the hero */
.marquee { overflow: hidden; width: 100%; max-width: 100vw; contain: paint; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; background: rgba(255,255,255,.5); backdrop-filter: blur(6px); }
.marquee-track { display: flex; align-items: center; gap: 34px; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font: 600 clamp(28px, 4vw, 54px)/1 var(--sans); letter-spacing: -.03em; white-space: nowrap; color: transparent; -webkit-text-stroke: 1.5px var(--text); }
.marquee span.fill { color: var(--accent); -webkit-text-stroke: 0; }
.marquee i { width: 10px; height: 10px; border-radius: 50%; background: var(--purple); flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* =====================================================================================
   WORK WITH ME: big list rows + process timeline
   ===================================================================================== */
.offer { list-style: none; padding: 0; margin: 0; border-top: 1px solid rgba(25,26,58,.18); }
.offer-row {
  position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.5fr) auto; gap: 18px 28px; align-items: baseline;
  padding: 30px 18px; margin: 0 -18px; border-bottom: 1px solid rgba(25,26,58,.18); border-radius: 14px; transition: background .35s;
}
.offer-row::after { content: '→'; grid-column: 4; font: 500 clamp(24px, 2.5vw, 34px) var(--sans); color: var(--accent); opacity: 0; transform: translateX(-10px); transition: .35s; }
.offer-row:hover { background: rgba(255,255,255,.75); }
.offer-row:hover::after { opacity: 1; transform: none; }
.offer-row:hover h3 { transform: translateX(8px); color: var(--accent-2); }
.offer-num { font: 500 14px var(--mono); color: var(--accent); }
.offer-row h3 { margin: 0; font: 500 clamp(26px, 3.4vw, 44px)/1.05 var(--sans); letter-spacing: -.03em; transition: transform .35s cubic-bezier(.2,.8,.2,1), color .35s; }
.offer-row p { margin: 0; color: var(--text-2); font-size: 16px; max-width: 48ch; }
.offer-tags { grid-column: 2 / 4; font: 400 12.5px var(--mono); color: var(--muted); letter-spacing: .04em; }
@media (max-width: 780px) {
  .offer-row { grid-template-columns: 44px minmax(0, 1fr); padding: 22px 12px; margin: 0 -12px; }
  .offer-row p, .offer-tags { grid-column: 2; }
  .offer-row::after { display: none; }
}
.process-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 56px 0 8px; }
.process-head h3 { margin: 0; font-size: clamp(22px, 2.4vw, 30px); font-weight: 500; letter-spacing: -.02em; }
.process { position: relative; border-top: 0; margin-top: 10px; gap: 18px; }
.process::before { content: ''; position: absolute; left: 14px; right: 14px; top: 29px; border-top: 2px dashed rgba(91,143,207,.5); }
.process li { position: relative; padding: 0 24px 0 0; counter-increment: step; }
.process b::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 14px; border-radius: 50%;
  background: var(--accent); color: #fff; font: 600 14px var(--mono); position: relative; z-index: 1; white-space: normal; box-shadow: 0 0 0 6px rgba(183,216,240,.6); }
.process b { display: block; font-size: 18px; }
@media (max-width: 720px) { .process::before { display: none; } }

/* =====================================================================================
   PROJECTS: terminal tiles
   ===================================================================================== */
.term { margin: -6px -6px 16px; border-radius: 14px; overflow: hidden; background: #171229; color: #e8e3f7; box-shadow: 0 18px 40px -22px rgba(23,18,41,.7); }
.term-bar { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: #221b3a; border-bottom: 1px solid rgba(255,255,255,.08); }
.term-title { font: 400 12px var(--mono); color: #9d93bf; }
.term-body { margin: 0; padding: 14px 16px 16px; font: 400 12.5px/1.75 var(--mono); white-space: pre-wrap; }
.t-cmd { color: #b7d8f0; }
.t-key { display: inline-block; min-width: 13ch; padding-right: 1ch; color: #8e85ad; }
.t-val { color: #ffb38a; }
.project:hover .term { box-shadow: 0 24px 50px -22px rgba(23,18,41,.85); }

/* =====================================================================================
   HOBBIES: each panel gets its own mood
   ===================================================================================== */
.hobby-cards { background: linear-gradient(160deg, #fff7ef, rgba(255,255,255,.75) 60%); }
.hobby-cards .deck { background: radial-gradient(70% 80% at 50% 35%, #fffaf5 0%, rgba(255,250,245,.92) 55%, rgba(255,235,220,.9) 100%); }
.hobby-watch { background: linear-gradient(160deg, #eef3f9, #dde6f0); }
.hobby-coffee { background: linear-gradient(160deg, #fff9f1, #f4e7d9); }
.hobby { transition: transform .5s cubic-bezier(.2,.8,.2,1), box-shadow .5s; }
.hobby:hover { box-shadow: 0 30px 60px -30px rgba(40,60,110,.35); }

/* =====================================================================================
   CONTACT: the closing block
   ===================================================================================== */
.contact { text-align: left; }
.contact .kicker { color: #ffb38a; }
.contact-status { display: inline-flex; align-items: center; gap: 10px; font: 400 13px var(--mono); color: #c9bfe0; margin: 0 0 22px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); }
.contact-status .pulse { width: 8px; height: 8px; border-radius: 50%; background: #5ee38a; box-shadow: 0 0 0 0 rgba(94,227,138,.6); animation: pulse-green 2s infinite; }
@keyframes pulse-green { 0% { box-shadow: 0 0 0 0 rgba(94,227,138,.6); } 100% { box-shadow: 0 0 0 10px rgba(94,227,138,0); } }
.contact .email-text { color: #c9bfe0; font-family: var(--mono); }
.contact .studio-line { color: #c9bfe0; }
.contact .studio-line a { color: #c9b3ff; }
.contact .copy { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.22); }

/* =====================================================================================
   POLISH: links, cards, chips
   ===================================================================================== */
.section-sub a, .studio-line a { text-decoration: none; background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 100% 1px; transition: background-size .3s; }
.section-sub a:hover, .studio-line a:hover { background-size: 100% 2px; }
.nav nav a:not(.nav-cta) { position: relative; }
.nav nav a:not(.nav-cta)::after { content: ''; position: absolute; left: 0; right: 100%; bottom: -4px; height: 2px; background: var(--accent); transition: right .3s cubic-bezier(.2,.8,.2,1); }
.nav nav a:not(.nav-cta):hover::after { right: 0; }
.site { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.site:hover { transform: translateY(-4px); }
.chip, .service li, .site-tags li, .stack li { transition: border-color .2s, color .2s; }
.chip:hover, .site-tags li:hover, .stack li:hover { border-color: var(--accent); color: var(--accent-2); }
.section--dark .stack li { background: rgba(255,255,255,.06); color: #d6cbee; border-color: rgba(255,255,255,.14); }
.section--dark .playground { border-color: rgba(255,255,255,.12); box-shadow: 0 40px 90px -40px rgba(0,0,0,.7); }
.section--dark .inspect-hint { color: #8e85ad; }
.section--dark .inspect-hint b { color: #fff; }
.section--tint .arcade, .section--tint .photobooth { background: rgba(255,255,255,.72); }
.section--tint .offer-row:hover { background: rgba(255,255,255,.85); }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }
html, body { overflow-x: clip; }   /* nothing may widen the page on phones */

/* =====================================================================================
   PHONES (≤ 640px): tighter rhythm, scrollable tab rows, no overlapping numerals
   ===================================================================================== */
@media (max-width: 640px) {
  :root { --gutter: 18px; }
  .section { padding-top: clamp(64px, 11vh, 96px); }
  .section--dark, .section--tint { padding-bottom: clamp(64px, 11vh, 96px); }
  .section-head { margin-bottom: 28px; }
  .section-head::before { font-size: 96px; top: -.3em; left: -.04em; -webkit-text-stroke-width: 1px; }
  h2 { font-size: clamp(34px, 10.5vw, 44px); }
  .section-sub { font-size: 15.5px; }

  /* hero */
  .hero { min-height: auto; padding-bottom: 36px; }
  .hello { font-size: clamp(48px, 15.5vw, 64px); }
  .lede { font-size: 15.5px; margin: 16px 0 20px; }
  .code-line { display: none; }
  .cta-row .btn { flex: 1 1 auto; justify-content: center; }
  .trust { gap: 6px 14px; font-size: 12.5px; }
  .trust b { font-size: 14px; }
  .marquee { padding: 12px 0; }
  .marquee span { font-size: 24px; }

  /* tab rows scroll sideways instead of stacking three deep */
  .arcade-tabs, .pg-tabs, .deck-controls { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; margin-inline: -4px; padding-inline: 4px; }
  .arcade-tabs::-webkit-scrollbar, .pg-tabs::-webkit-scrollbar, .deck-controls::-webkit-scrollbar { display: none; }
  .arcade-tabs button, .deck-controls button { flex: none; white-space: nowrap; }
  .arcade-pick { display: flex; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding: 2px 4px 6px; }
  .arcade-pick::-webkit-scrollbar { display: none; }
  .arcade-pick button { flex: none; width: 138px; }
  .bs-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hud b { font-size: 22px; }
  .deck-controls { justify-content: flex-start; }

  /* offer rows and process */
  .offer-row h3 { font-size: 24px; }
  .offer-row p { font-size: 15px; }
  .process { grid-template-columns: 1fr 1fr; gap: 16px 14px; }
  .process-head { margin-top: 36px; }

  /* hobbies */
  .hobby, .arcade, .photobooth { border-radius: 20px; padding: 18px; }
  .hobby-cards .deck { margin: 0 -18px -18px; }
  .deck-stage { height: clamp(300px, 70vw, 380px); }
  .coffee { max-height: 360px; }
  .watch-flip { width: min(100%, 210px); }

  /* games */
  .game { gap: 14px; }
  .game-side { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; }
  .game-side .sl-legend { grid-column: 1 / -1; }
  .game-side .sl-die { margin-top: 0; width: 54px; height: 54px; padding: 8px; }
  .game-side .sl-die i { width: 8px; height: 8px; }
  .game-side .game-status { min-height: 0; margin: 0; font-size: 14px; }
  .game-side .hobby-controls { grid-column: 1 / -1; margin-top: 4px; }
  .game-side .hud, .game-side:has(.hud) .game-status { grid-column: 1 / -1; }
  .game-side .hud span { min-width: 0; padding: 8px 10px; }
  .game-side .hud b { font-size: 20px; }
  .ftl-table { aspect-ratio: 3 / 2; }
  .ftl-card { top: 17%; height: 66%; left: calc(4% + var(--slot) * 32%); }
  .mm-grid { max-width: none; }
  .ttt-grid { max-width: none; }

  /* photo booth */
  .pb-opts label { font-size: 13px; padding: 5px 10px 5px 6px; }
  .pb-stickers label { font-size: 18px; }
  .pb-inline { font-size: 13px; }

  /* tools */
  .tools { border-radius: 20px; padding: 16px; }
  .tool-form .btn { width: 100%; justify-content: center; }
  .tool-score b { font-size: 32px; }
  .og-cards { grid-template-columns: 1fr; }

  /* CV + contact */
  .job { padding-left: 22px; padding-bottom: 28px; }
  .job h4 { font-size: 18px; }
  .contact-big { font-size: clamp(40px, 12.5vw, 56px); max-width: none; }
  .contact-row .btn { flex: 1 1 calc(50% - 6px); justify-content: center; }
  .footer { flex-direction: column; gap: 6px; }
}
