/* ============================================================
   GABRIELTHECODE.COM · "RECOMPOSITION"
   Design system: white day, deep night, one "encre" accent; JetBrains Mono for code only
   ============================================================ */

:root {
  /* Palette: LIGHT theme (default) · pure white, one accent: "encre", a deep ink blue */
  --bg:        #FFFFFF;
  --bg-elev:   #F6F7F9;
  --ink:       #14161C;
  --muted:     #565A66;
  --line:      rgba(20, 22, 28, 0.10);
  --accent:    #2448C8;   /* encre */
  --accent-soft: rgba(36, 72, 200, 0.08);
  --accent-2:  #4A6BD9;   /* encre, a lighter trace (strokes, fills) */
  /* text-safe variants: small ice text on white, white text on blue (AA 4.5:1) */
  --accent-2-ink: #2448C8;
  --accent-fill:  #2448C8;
  --green:     #2448C8;   /* availability & toast */

  /* Code surfaces: IDE Light */
  --code-bg:     #F8F9FB;
  --code-ink:    #171922;
  --code-muted:  #5C606C;
  --code-line:   rgba(20, 22, 28, 0.10);
  --code-accent: #2448C8;
  --code-accent2:#0B6F9E;
  --code-comment:#686C78;

  /* Type */
  --font-display: "Clash Display", "Figtree", system-ui, sans-serif;
  --font-body:    "Figtree", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  /* Scale */
  --text-xs:  0.75rem;
  --text-sm:  0.875rem;
  --text-md:  1.0625rem;
  --text-lg:  clamp(1.25rem, 1rem + 1vw, 1.625rem);
  --text-xl:  clamp(1.75rem, 1.2rem + 2.2vw, 3rem);
  --text-hero: clamp(2.6rem, 1.4rem + 5.6vw, 6.2rem);

  /* Rhythm */
  --space-section: clamp(6rem, 12vw, 11rem);
  --gutter: clamp(1.25rem, 5vw, 6rem);
  /* full-bleed bands (nav, hero, footer) pad to the same 1280px frame as
     the sections, so every left edge lines up on wide screens */
  --edge: max(var(--gutter), calc((100% - 1280px) / 2 + var(--gutter)));
  --radius: 22px;
  /* cards rise off the white: a hairline, then a soft encre-tinted shadow */
  --shadow-card: 0 1px 2px rgba(18, 23, 34, 0.04), 0 28px 56px -36px rgba(36, 72, 200, 0.28);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.6s;
}

html { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #08090C;
  --bg-elev:   #101216;
  --ink:       #F4F6FB;
  --muted:     #9AA1B2;
  --line:      rgba(244, 246, 251, 0.09);
  --accent:    #8FB0FF;   /* encre, lit for the deep night */
  --accent-soft: rgba(143, 176, 255, 0.14);
  --accent-2:  #B5C8FF;
  --accent-2-ink: #B5C8FF;
  --accent-fill:  #3358D4; /* deeper than --accent so white text holds 4.5:1 */
  --green:     #B5C8FF;
  --shadow-card: 0 28px 56px -32px rgba(0, 0, 0, 0.7);

  /* Code surfaces: IDE dark, near-black */
  --code-bg:     #0A0B0E;
  --code-ink:    #F4F6FB;
  --code-muted:  #9AA1B2;
  --code-line:   rgba(244, 246, 251, 0.09);
  --code-accent: #8FB0FF;
  --code-accent2:#8FD9FF;
  --code-comment:#7A8296;
}
html[data-theme="dark"] body::before {
  background:
    radial-gradient(60vw 60vw at 80% -10%, rgba(143, 176, 255, 0.10), transparent 60%),
    radial-gradient(50vw 50vw at -10% 40%, rgba(181, 200, 255, 0.04), transparent 60%);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
.section, [id] { scroll-margin-top: 84px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient grain + violet aura, cheap on GPU */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 80% -10%, rgba(36, 72, 200, 0.05), transparent 55%),
    radial-gradient(50vw 50vw at -10% 40%, rgba(74, 107, 217, 0.03), transparent 55%);
  z-index: 0;
}

main { position: relative; z-index: 1; }

::selection { background: var(--accent-fill); color: #fff; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
/* no single word stranded on the last line of a paragraph */
p, dd { text-wrap: pretty; }

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); font-weight: 400; }
.accent { color: var(--accent); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent-fill); color: #fff; padding: 0.6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; } /* no ring on click/tap; keyboard keeps it */

/* ---------- Reveal engine ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem var(--edge);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(
    color-mix(in srgb, var(--bg) 86%, transparent),
    color-mix(in srgb, var(--bg) 52%, transparent)
  );
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav__brand { display: inline-flex; align-items: center; gap: 0.6rem; font-size: var(--text-sm); letter-spacing: 0; padding: 0.55rem 0.45rem; margin: -0.55rem -0.45rem; }
.nav__mark { display: block; border-radius: 7px; }
.nav__brand-punct { color: var(--accent); }

.nav__links { display: flex; gap: 2rem; font-size: var(--text-sm); font-weight: 500; }
.nav__links a { color: var(--muted); transition: color 0.25s; }
.nav__links a:hover { color: var(--ink); }
.nav__links a.is-active { color: var(--accent); }

.nav__end { display: flex; align-items: center; gap: 0.8rem; flex-shrink: 0; }

.nav__status {
  font-size: var(--text-xs);
  color: var(--accent-2-ink);
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.75rem 0;
  margin: -0.35rem 0; /* a 44px target in the same space */
}
.nav__status span { display: inline-block; transition: transform 0.3s var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .nav__status:hover span { transform: translate(2px, -2px); } }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color 0.25s, border-color 0.25s, transform 0.3s var(--ease-out);
}
.theme-toggle::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; } /* 44px target */
.theme-toggle:hover { color: var(--ink); border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .theme-toggle:hover { transform: rotate(15deg); } }
.theme-toggle:active { transform: scale(0.94); transition-duration: 0.12s; }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem var(--edge) 4rem;
  position: relative;
  /* the halo behind the phone is wider than its column: keep it from widening the page */
  overflow-x: clip;
}


/* sized so each of the four authored lines holds on one line: the widest
   ("and average apps") is about 8.5em; the cap applies once the 1280px
   frame stops the copy column from growing */
.hero__title {
  font-size: min(var(--text-hero), 6.3vw, 5.2rem);
}
.hero__intro {
  margin-top: 1.6rem;
  max-width: 42ch;
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--muted);
  opacity: 0;
  animation: introIn 0.8s var(--ease-out) 0.6s forwards;
}
.hero__intro a { color: var(--ink); }
@keyframes introIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* two-column hero: copy left, device right */
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

/* ---- Hero phone: swings in, gets struck, boots, then reels through shipped apps ---- */
.hero__device {
  position: relative;
  display: grid;
  place-items: center;
  perspective: 1400px;
}
/* electric halo behind the device, lit by the first strike */
.hero__device::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 150%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 26%, transparent), transparent);
  opacity: 0;
  pointer-events: none;
}
.hero__device:has(.phone--hero.is-on)::before {
  animation: haloOn 2.2s var(--ease-out) forwards, haloBreath 5s ease-in-out 2.2s infinite;
}
@keyframes haloOn {
  0% { opacity: 0; transform: scale(0.5); }
  10% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 0.6; transform: scale(1); }
}
@keyframes haloBreath { 50% { opacity: 0.35; transform: scale(0.94); } }

.phone-stage {
  position: relative;
  animation: phoneIn 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}
@keyframes phoneIn {
  from { opacity: 0; transform: translateY(38%) rotateX(56deg) rotateY(-26deg) rotateZ(12deg) scale(0.74); filter: blur(14px); }
  45%  { opacity: 1; filter: blur(0); }
  to   { opacity: 1; transform: none; filter: none; }
}
.phone-float { animation: phoneFloat 6s ease-in-out 1.9s infinite; }
@keyframes phoneFloat { 50% { transform: translateY(-14px) rotate(-1.2deg); } }

.phone__floor {
  position: absolute;
  left: 50%; bottom: -2.4rem;
  width: 70%; height: 26px;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, transparent), transparent);
  animation: floorIn 1.6s var(--ease-out) 0.3s both, floorBreath 6s ease-in-out 1.9s infinite;
}
@keyframes floorIn { from { opacity: 0; transform: scale(0.3); } }
@keyframes floorBreath { 50% { transform: scale(0.82); opacity: 0.6; } }

.phone.phone--hero {
  width: clamp(220px, 20vw, 280px);
  border-radius: 42px;
  padding: 9px;
  background: linear-gradient(150deg, #22252d, #050608 45%, #14161c);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 60px 110px -50px rgba(0, 0, 0, 0.75),
    inset 0 0 0 1px rgba(0, 0, 0, 0.6);
  transition: transform 0.5s var(--ease-out);
  will-change: transform;
}
/* side keys */
.phone--hero::before, .phone--hero::after {
  content: "";
  position: absolute;
  right: -4px;
  width: 3px;
  border-radius: 2px;
  background: #2a2e37;
}
.phone--hero::before { top: 20%; height: 9%; }
.phone--hero::after  { top: 33%; height: 14%; }
/* punch-hole camera */
.phone--hero .phone__notch {
  top: 19px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
  z-index: 6;
}
.phone--hero .phone__screen {
  position: relative;
  display: block;
  padding: 0;
  border-radius: 33px;
  background: #000;
  isolation: isolate;
}
/* strike flash: a double flicker, like real lightning */
.phone--hero .phone__screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  background: radial-gradient(circle at 50% 38%, #fff, #B5C8FF 40%, transparent 85%);
  opacity: 0;
  pointer-events: none;
}
.phone--hero.is-on .phone__screen::after { animation: screenFlash 0.9s ease-out; }
@keyframes screenFlash {
  6%  { opacity: 1; }
  14% { opacity: 0.3; }
  22% { opacity: 0.85; }
}

.reel { position: absolute; inset: 0; }
.js .phone--hero:not(.is-on) .reel,
.js .phone--hero:not(.is-on) .reel__label,
.js .phone--hero:not(.is-on) .reel__bars { opacity: 0; }
.phone--hero .reel img {
  position: absolute;
  inset: 0;
  border-radius: 0;
  opacity: 0;
}
/* App change: the next app burns through the old one in a circle that grows
   from where the bolt touched the frame (--hx/--hy, set by main.js) */
@property --r { syntax: "<length>"; inherits: true; initial-value: 1000px; }
.reel.is-morph { animation: morph 0.95s cubic-bezier(0.3, 0.6, 0.2, 1); }
@keyframes morph { from { --r: 0px; } to { --r: 1000px; } }
.phone--hero .reel img.is-on {
  opacity: 1;
  z-index: 1;
  clip-path: circle(var(--r) at var(--hx, 50%) var(--hy, 50%));
  animation: appIn 0.95s ease-out both;
}
.phone--hero .reel img.is-out { opacity: 1; animation: appOut 0.95s ease-out both; }
/* no brightness lift: three of the four shots are light-themed apps, and any
   multiplier blows them to a full white rectangle on a near-black page */
@keyframes appIn { from { filter: saturate(0); } }
@keyframes appOut { to { filter: brightness(0.35) blur(2px); } }
/* the burning edge of that circle */
.reel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%),
    transparent calc(var(--r) - 18px), rgba(143, 217, 255, 0.35) calc(var(--r) - 4px),
    rgba(196, 238, 255, 0.85) var(--r), transparent calc(var(--r) + 1px));
  opacity: 0;
}
.reel.is-morph::after { animation: ringFade 0.95s ease-out; }
@keyframes ringFade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }

.reel__label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 3.4rem 1.1rem 2rem;
  background: linear-gradient(transparent, rgba(4, 6, 12, 0.88) 62%);
  color: #fff;
  transition: opacity 0.6s var(--ease-out) 1.1s;
}
.reel__label b { font: 600 1.05rem/1.1 var(--font-display); letter-spacing: -0.01em; }
.reel__label span { font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); }
.reel__bars {
  position: absolute;
  left: 1.1rem; right: 1.1rem; bottom: 1.1rem;
  z-index: 3;
  display: flex;
  gap: 4px;
  transition: opacity 0.6s var(--ease-out) 1.1s;
}
.reel__bars i { flex: 1; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.reel__bars i::after {
  content: "";
  display: block;
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
}
.reel__bars i.is-done::after { transform: scaleX(1); }
/* position, not a countdown: the reel only moves when the word is hovered,
   so a filling bar would be counting down to nothing */
.reel__bars i.is-on::after { transform: scaleX(1); }

/* boot splash between the strike and the first app */
.boot {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 46%, #0c2156, #02040a 70%);
  opacity: 0;
  pointer-events: none;
}
.phone--hero .boot img { width: 26%; height: auto; border-radius: 0; }
.phone--hero.is-on .boot { animation: boot 1.5s ease-out both; }
.phone--hero.is-on .boot img { animation: bootLogo 1.5s var(--ease-out) both; }
@keyframes boot { 0% { opacity: 0; } 8%, 66% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bootLogo {
  0%   { transform: scale(0.4); filter: brightness(4) drop-shadow(0 0 0 var(--accent)); }
  30%  { transform: scale(1); filter: brightness(1.2) drop-shadow(0 0 22px var(--accent)); }
  100% { transform: scale(1.1); filter: brightness(1) drop-shadow(0 0 10px var(--accent)); }
}

/* glass: a static sheen plus a slow light sweep */
.phone__glare {
  position: absolute;
  inset: 9px;
  z-index: 7;
  border-radius: 33px;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.09), transparent 38%);
}
.phone__glare::before {
  content: "";
  position: absolute;
  top: -20%; bottom: -20%; left: 0;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16) 45%, rgba(255, 255, 255, 0.04) 55%, transparent);
  transform: translateX(-130%) skewX(-14deg);
  animation: glare 7s ease-in-out 2.6s infinite;
}
@keyframes glare { 24%, 100% { transform: translateX(320%) skewX(-14deg); } }

/* bolt canvases over the hero and the contact section, drawn by spark.js */
.storm { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.storm--back { z-index: -1; } /* under the phone and the copy */

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; gap: 0; }
  .hero__title { font-size: min(var(--text-hero), 9.6vw); }
  /* unwrap the copy so the device can sit between the title and the stats */
  .hero__copy { display: contents; }
  .hero__device { margin: 3.2rem 0 4.4rem; }
  .hero__meta { order: 1; }
  .phone.phone--hero { width: min(200px, 54vw); border-radius: 36px; padding: 8px; }
  .phone--hero .phone__screen, .phone__glare { border-radius: 28px; }
  .phone__glare { inset: 8px; }
  @keyframes phoneFloat { 50% { transform: translateY(-9px) rotate(-1deg); } }
}
@media (prefers-reduced-motion: reduce) {
  .phone-stage, .phone-float, .phone__floor, .phone__glare::before { animation: none; opacity: 1; transform: none; }
}
.hero__title .line { display: block; overflow: hidden; }
/* after the title finishes rising, release the clip on the spark line so bolt halos dissipate naturally */
.hero__title.revealed .line:has([data-spark]) { overflow: visible; }
.hero__title .word {
  display: inline-block;
  transform: translateY(110%);
  animation: rise 0.9s var(--ease-out) forwards;
}
/* staggered per line */
.hero__title .line:nth-child(1) .word { animation-delay: 0.10s; }
.hero__title .line:nth-child(2) .word { animation-delay: 0.22s; }
.hero__title .line:nth-child(3) .word { animation-delay: 0.34s; }
.hero__title .line:nth-child(4) .word { animation-delay: 0.46s; }

@keyframes rise { to { transform: translateY(0); } }

/* syntax colors (used by the KDoc quote in the Identity section) */
.tk-k { color: var(--code-accent); }   /* keyword */
.tk-s { color: var(--code-accent2); }  /* string   */
.tk-c { color: var(--code-comment); }  /* comment  */

/* ===================== KDoc quote in Identity ===================== */
.about__quote {
  margin-top: 2.4rem;
  max-width: 560px;
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.about__quote .hero__code-bar {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--code-line);
}
.hero__code-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--code-line); }
.hero__code-file { margin-left: auto; font-size: var(--text-xs); color: var(--code-muted); }
.about__quote pre {
  padding: 1.1rem 1.25rem 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--code-muted);
  margin: 0;
}

.hero__meta {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 4rem);
}
.stat { display: flex; flex-direction: column; gap: 0.15rem; }
.stat .num {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--accent-2);
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat span { color: var(--muted); font-size: var(--text-sm); max-width: 15ch; }

.hero__scroll {
  position: absolute;
  bottom: 2rem; left: var(--edge);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-xs);
  color: var(--muted);
  transition: color 0.25s;
}
.hero__scroll:hover { color: var(--accent); }

/* ---------- Trust marquee ---------- */
.trust { padding: 3rem 0 1rem; border-top: 1px solid var(--line); }
.trust__label {
  padding: 0 var(--edge);
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 1.4rem;
}
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track {
  display: flex; align-items: center; gap: 3rem;
  width: max-content;
  animation: scroll 34s linear infinite;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--muted);
  padding-bottom: 1.5rem;
}
.marquee__track i { color: var(--accent); font-style: normal; font-size: 0.6em; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: var(--space-section) var(--gutter) 0; max-width: 1280px; margin: 0 auto; }

.section__head { margin-bottom: clamp(2rem, 3.5vw, 3rem); }
.about .section__head { margin-bottom: 1.4rem; }
.about .section__tag { margin-bottom: 0; }
.section__tag {
  display: inline-flex;
  align-items: flex-end;
  margin-bottom: 1rem;
}
/* Oversized outlined numeral; the label tucks into its overhang */
.section__num {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 8vw, 6rem);
  font-weight: 600;
  line-height: 0.72;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
  text-stroke: 1.5px var(--accent);
  user-select: none;
}
.section__label {
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.4rem;
  margin-left: -0.3rem; /* tucked into the numeral on purpose */
}
.section__head h2 { font-size: var(--text-xl); max-width: 16ch; }

/* ---------- About ---------- */
.about__intro {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 340px);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.about__photo { align-self: center; }
.about__lede {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: 1.45;
  max-width: 52ch;
  letter-spacing: -0.01em;
}
.about__lede em { font-style: normal; color: var(--accent); }
.about__social {
  display: flex; flex-wrap: wrap;
  gap: 0.35rem;
  margin: 1.4rem 0 0 -0.6rem;
}
.about__social a {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.25s ease, background-color 0.25s ease, transform 0.25s var(--ease-out);
}
.about__social a:focus-visible { color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .about__social a:hover { color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
}

/* ---- Identity bubbles: words with a thumbnail, previewing the work ---- */
.bub {
  --tw: 2.1em; /* thumbnail + gap, kept out of the highlight */
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bub--round { --tw: 1.35em; }
/* every inline link answers the same way: no underline at rest, a highlight
   sweeps in under the words (--tw keeps a trailing thumbnail or arrow out) */
.bub,
.hero__intro a,
.nav__status,
.contact__links a,
.footer a {
  background: linear-gradient(var(--accent-soft), var(--accent-soft)) 0 88% / 0 0.45em no-repeat;
  background-origin: content-box; /* measured on the words, not the link's padding */
  transition: background-size 0.45s var(--ease-out);
}
.nav__status,
.contact__links a { --tw: 1.2em; } /* the " ↗" */
.bub.is-active,
:is(.bub, .hero__intro a, .nav__status, .contact__links a, .footer a):focus-visible { background-size: calc(100% - var(--tw, 0px)) 0.45em; }
@media (hover: hover) and (pointer: fine) {
  :is(.bub, .hero__intro a, .nav__status, .contact__links a, .footer a):hover { background-size: calc(100% - var(--tw, 0px)) 0.45em; }
}
.bub:focus-visible { outline-offset: 4px; }
.bub__thumb {
  display: inline-block;
  width: 1.75em; height: 0.95em;
  margin-left: 0.3em;
  vertical-align: -0.12em;
  object-fit: cover;
  object-position: 50% 12%;
  border-radius: 0.14em;
  box-shadow: 0 0 0 1px var(--line);
  transition: transform 0.45s var(--ease-out);
  animation: jiggle 9s ease-in-out var(--d, 0s) 2; /* two nudges, then still */
}
.bub__thumb--icon { width: 1em; height: 1em; vertical-align: -0.15em; }
.bub__thumb--icon { border-radius: 0.24em; }
/* WHO: crop the emblem out of the full wordmark */
.bub__thumb--logo { width: 1em; height: 1em; vertical-align: -0.15em; object-fit: cover; object-position: 0 50%; box-shadow: none; }
.bub.is-active .bub__thumb { transform: scale(1.22) rotate(-4deg); animation: none; }
@media (hover: hover) and (pointer: fine) { .bub:hover .bub__thumb { transform: scale(1.22) rotate(-4deg); animation: none; } }
.bub:active { transform: scale(0.97); }
/* a periodic nudge so the thumbnails read as touchable */
@keyframes jiggle {
  0%, 9%, 100% { rotate: 0deg; scale: 1; }
  1.5% { rotate: -9deg; scale: 1.14; }
  3%   { rotate: 7deg; }
  4.5% { rotate: -5deg; }
  6%   { rotate: 3deg; scale: 1.04; }
  7.5% { rotate: -1deg; }
}

/* the floating preview card, built once by main.js */
.bub-card {
  position: fixed;
  top: 0; left: 0;
  z-index: 70;
  width: 220px;
  pointer-events: none;
}
.bub-card[data-kind="screen"] { width: 168px; }
.bub-card[data-kind="icon"] { width: 190px; }
.bub-card[data-kind="logo"] { width: 240px; }
.bub-card__in {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  background: var(--bg-elev);
  box-shadow: 0 34px 60px -30px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--line);
  opacity: 0;
  transform: scale(0.95);
  transform-origin: var(--o, 0 0);
  transition: transform 0.12s var(--ease-out), opacity 0.12s var(--ease-out); /* closing */
}
.bub-card[data-kind="screen"] .bub-card__in {
  aspect-ratio: 480 / 991;
  border-radius: 22px;
  background: #000;
  box-shadow: 0 34px 60px -30px rgba(0, 0, 0, 0.6), 0 0 0 5px #0b0c10, 0 0 0 6px rgba(255, 255, 255, 0.12);
}
.bub-card[data-kind="icon"] .bub-card__in {
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 42%, var(--accent-soft), transparent 70%), var(--bg-elev);
}
.bub-card[data-kind="logo"] .bub-card__in { aspect-ratio: 4 / 3; background: #fff; }
.bub-card.is-on .bub-card__in { opacity: 1; transform: none; transition-duration: 0.18s; } /* opening */
.bub-card__art {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 0;
  clip-path: inset(100% 0 0);
  transition: clip-path 0.55s var(--ease-out);
}
/* app icons: sized to the icon itself, so the corners can round like on a home screen */
.bub-card[data-kind="icon"] .bub-card__art {
  inset: 15% auto auto 24%;
  width: 52%; height: auto;
  aspect-ratio: 1;
  border-radius: 22%;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.45);
  clip-path: inset(100% 0 0 round 22%); /* keep the corners round while it wipes in */
}
.bub-card[data-kind="icon"] .bub-card__art.is-current,
.bub-card[data-kind="icon"] .bub-card__art.is-prev { clip-path: inset(0 round 22%); }
.bub-card[data-kind="logo"] .bub-card__art { object-fit: contain; padding: 18% 12% 26%; }
.bub-card__art.is-current { clip-path: inset(0); z-index: 2; }
.bub-card__art.is-prev { clip-path: inset(0); z-index: 1; transition: none; }
.bub-card__in::after {
  content: "";
  position: absolute;
  inset: 55% 0 0;
  z-index: 3;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}
.bub-card[data-kind="icon"] .bub-card__in::after,
.bub-card[data-kind="logo"] .bub-card__in::after { display: none; }
.bub-card__cap {
  position: absolute;
  left: 12px; right: 12px; bottom: 10px;
  z-index: 4;
  font-size: 0.66rem;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
.bub-card[data-kind="icon"] .bub-card__cap { color: var(--ink); text-shadow: none; text-align: center; }
.bub-card[data-kind="logo"] .bub-card__cap { color: #14161C; text-shadow: none; text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .bub__thumb { animation: none; }
  .bub, .bub-card__in, .bub-card__art { transition: none; }
}

.about__photo {
  display: flex;
  justify-content: center;
}
.about__photo img {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 50%;
  /* box-shadow follows border-radius: circular glow, no Safari filter-rasterization bug */
  box-shadow: 0 14px 38px rgba(36, 72, 200, 0.14);
  transition: transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .about__photo:hover img {
    transform: scale(1.05) rotate(-2deg);
    box-shadow: 0 20px 55px rgba(36, 72, 200, 0.26);
  }
}

/* ---- Story: what I do, how I work, beyond the IDE, off the clock ---- */
.story {
  margin-top: 4.5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: clamp(3.5rem, 8vw, 6rem);
}
.story__chapter {
  display: grid;
  grid-template-columns: minmax(150px, 0.3fr) minmax(0, 1fr);
  gap: 1.2rem 3rem;
  align-items: start;
}
.story__title {
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2.3rem);
  color: var(--ink);
  max-width: 7ch;
  overflow-wrap: break-word;
  hyphens: auto;
}
.story__text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: 1.45;
  letter-spacing: -0.01em;
  max-width: 36ch;
}
.story__text em { font-style: normal; color: var(--accent); }
/* words light up as the reader scrolls through them (main.js sets --p, --n, --i) */
.is-scrub .w {
  opacity: clamp(0.16, calc((var(--p) * var(--n) - var(--i)) / 3 + 0.16), 1);
  transition: opacity 0.2s linear;
}
@media (max-width: 700px) {
  .story__chapter { grid-template-columns: 1fr; }
  .story__title { max-width: none; }
}

/* the plank both shelves stand on: a lit top edge, its front face, and the
   shadow it throws on the wall, as one 22px band at the bottom of the box */
.shelf,
.pile.is-physics {
  --plank:
    linear-gradient(color-mix(in srgb, var(--ink) 17%, var(--bg)) 0 3px,
                    color-mix(in srgb, var(--ink) 8%, var(--bg)) 3px 10px,
                    rgba(0, 0, 0, 0.16) 10px, transparent 22px);
}

/* beyond the IDE: conference badges standing on a shelf */
.shelf {
  list-style: none;
  margin: 0 -12px;
  /* room around the tilted badges, and the plank under them */
  padding: 1.4rem 12px 22px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(118px, 1fr);
  gap: 1rem;
  overflow-x: auto;
  scrollbar-width: none; /* the cut badge at the edge says it scrolls; a bar would read as a second plank */
  /* "local" makes the plank run the whole scrolled length, not just the view */
  background: var(--plank) left bottom / 100% 22px no-repeat local;
}
.shelf::-webkit-scrollbar { display: none; }
.shelf li { position: relative; }
.badge {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 3 / 4;
  padding: 1.75rem 0.8rem 0;
  overflow: hidden; /* the role band follows the corners */
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    /* the barcode every conference badge carries */
    repeating-linear-gradient(90deg, var(--line) 0 2px, transparent 2px 3px, var(--line) 3px 4px, transparent 4px 7px, var(--line) 7px 10px, transparent 10px 11px)
      left 0.8rem bottom 2.55rem / 52% 14px no-repeat,
    var(--bg-elev);
  color: var(--ink);
  box-shadow: 0 14px 22px -18px rgba(0, 0, 0, 0.6);
  transform: rotate(var(--t, 0deg));
  transform-origin: 50% 100%;
  transition: transform 0.45s var(--ease-out), border-color 0.3s;
}
/* the lanyard slot, punched through */
.badge::before {
  content: "";
  position: absolute;
  top: 10px; left: 50%;
  width: 28px; height: 6px;
  translate: -50% 0;
  border-radius: 3px;
  background: var(--bg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.badge b { font: 600 1rem/1.15 var(--font-display); letter-spacing: -0.01em; overflow-wrap: break-word; hyphens: auto; }
.badge__where { margin-top: 0.3rem; font-size: 0.6875rem; color: var(--muted); }
.badge__stars { display: flex; align-items: center; gap: 0.3rem; }
.badge__stars svg { flex: none; color: var(--accent); }
/* the role band across the foot, coloured like the lanyards at the door */
.badge__role {
  margin: auto -0.8rem 0;
  padding: 0.5rem 0.8rem;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: color-mix(in srgb, var(--ink) 6%, var(--bg-elev));
}
a.badge .badge__role { color: var(--accent-2-ink); background: color-mix(in srgb, var(--accent) 12%, var(--bg-elev)); }
.badge--speaker .badge__role { color: #fff; background: var(--accent-fill); }
.shelf a.badge:focus-visible { transform: translateY(-6px) rotate(0deg); border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .shelf li:hover .badge { transform: translateY(-6px) rotate(0deg); border-color: var(--accent); } }
.shelf a.badge:active { transform: translateY(-4px) scale(0.97); transition-duration: 0.12s; }
/* as the shelf comes in, the badges drop onto it one after the other */
.shelf.in .badge { animation: land 0.6s cubic-bezier(0.3, 1.25, 0.5, 1) calc(var(--i, 0) * 70ms) backwards; }
@keyframes land { from { opacity: 0; transform: translateY(-24px) rotate(calc(var(--t, 0deg) * -2)); } }

/* off the clock: hobbies in a pile (main.js drops them in as rigid bodies) */
.pile { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  padding: 0.6em 1.05em;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--bg);
  color: var(--ink);
  font: 500 1rem/1 var(--font-display);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}
.pill i { font-style: normal; font-size: 0.6875rem; color: var(--muted); letter-spacing: 0.06em; }
.pill > a { display: inline-flex; align-items: baseline; gap: inherit; color: inherit; -webkit-user-drag: none; margin: -0.6em -1.05em; padding: 0.6em 1.05em; border-radius: inherit; } /* the whole pill is the link */
.pill--big { font-size: 1.3rem; }
.pill--accent { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.pill--accent i { color: #fff; }
.pill--soft { background: color-mix(in srgb, var(--accent) 12%, var(--bg)); border-color: color-mix(in srgb, var(--accent) 30%, var(--bg)); }
.pill--ink { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pill--ink i { color: color-mix(in srgb, var(--bg) 65%, var(--ink)); }
.pile.is-physics {
  position: relative;
  height: 280px; /* main.js sets the real height from the pills it holds */
  overflow: hidden;
  padding-bottom: 22px; /* the plank; main.js puts the floor on top of it */
  background: var(--plank) left bottom / 100% 22px no-repeat;
}
.pile.is-physics .pill {
  position: absolute;
  top: 0; left: 0;
  cursor: grab;
  touch-action: none;
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) { .pile.is-physics .pill:hover { border-color: var(--accent); } }
/* touch: let a swipe over the pills scroll the page; a long press picks one up */
@media (pointer: coarse) { .pile.is-physics .pill { touch-action: pan-y; } }
.pile.is-physics .pill.is-held { cursor: grabbing; z-index: 2; box-shadow: 0 14px 28px -14px rgba(0, 0, 0, 0.5); }
@media (max-width: 560px) {
  .pill { font-size: 0.88rem; }
  .pill--big { font-size: 1.05rem; }
  /* one shelf that runs off the screen edge and scrolls sideways */
  .shelf {
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    grid-auto-columns: 132px;
  }
  .shelf li { scroll-snap-align: start; }
}

/* on the road: a dotted globe (assets/js/atlas.js draws it), what is lit
   on it, and the photos of the country picked */
.travel { display: grid; gap: clamp(2rem, 4vw, 3rem); min-width: 0; }
.atlas {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1.6rem clamp(1.5rem, 3vw, 2.6rem);
  align-items: center;
}
.atlas__stage { display: none; position: relative; aspect-ratio: 1; }
.js .atlas__stage { display: block; }
.atlas__globe { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.atlas__globe.is-dragging { cursor: grabbing; }
.atlas__globe.is-over { cursor: pointer; }
.atlas__tip {
  position: absolute;
  left: 0; top: 0;
  margin: 0;
  padding: 0.3rem 0.55rem;
  font-size: var(--text-xs);
  white-space: nowrap;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.atlas__tip.is-on { opacity: 1; }

.flag { display: inline-block; width: 18px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); object-fit: cover; flex-shrink: 0; }

/* the panel: home and totals at rest, the country once one is picked. Its
   height never changes, whatever the country, so nothing below it moves:
   the city list takes the room left and scrolls inside it. */
.atlas__panel { min-width: 0; height: 31rem; display: flex; flex-direction: column; }
.atlas__home { margin-block: auto; }
.atlas__detail { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.atlas__based { display: flex; align-items: center; gap: 0.55rem; color: var(--muted); margin: 0 0 1.4rem; }
.atlas__based b { color: var(--ink); font-weight: 500; }
.atlas__count { display: flex; gap: 2.2rem; margin: 0; color: var(--muted); font-size: var(--text-sm); }
.atlas__count span { display: grid; gap: 0.2rem; }
.atlas__count strong {
  font: 600 var(--text-xl)/1 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}
.atlas__head { display: flex; align-items: center; gap: 0.7rem; }
.atlas__head .flag { width: 27px; height: 18px; border-radius: 3px; }
.atlas__name { font-size: var(--text-lg); line-height: 1.1; margin: 0; flex: 1; min-width: 0; }
.atlas__close {
  display: grid; place-items: center;
  width: 44px; height: 44px; margin: -6px -10px -6px 0;
  border: 0; background: none; color: var(--muted);
  border-radius: 50%; cursor: pointer;
  transition: color 0.2s, background-color 0.2s, transform 0.16s ease-out;
}
.atlas__close:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .atlas__close:hover { color: var(--ink); background: var(--bg-elev); } }
.atlas__meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: var(--text-xs); color: var(--muted); margin: 0.35rem 0 0.7rem; }
.atlas__meta { min-height: 1.7rem; }
.atlas__all { font: inherit; color: var(--muted); background: none; border: 0; padding: 0.25rem 0; cursor: pointer; }
.atlas__all[hidden] { display: none; }
.atlas__all:focus-visible { color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .atlas__all:hover { color: var(--ink); } }
/* cities: a numbered list in columns, like an itinerary; one city or
   twenty-three, it fills the same space and scrolls within it, fading at
   the edge that has more */
.atlas__towns {
  flex: 1;
  min-height: 3.2rem;
  overflow-y: auto; /* no overscroll containment: past the last city, the page scrolls on */
  scrollbar-width: none;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  align-content: start;
  column-gap: 1rem;
  --fade-start: 0px;
  --fade-end: 0px;
  mask-image: linear-gradient(var(--fade-dir, 180deg), transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent);
  transition: --fade-start 0.2s, --fade-end 0.2s;
}
@property --fade-start { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --fade-end { syntax: "<length>"; inherits: false; initial-value: 0px; }
.atlas__towns::-webkit-scrollbar { display: none; }
.atlas__towns.has-before { --fade-start: 1.6rem; }
.atlas__towns.has-after { --fade-end: 2.2rem; }
.atlas__towns button {
  display: flex; align-items: baseline; gap: 0.6rem;
  width: 100%;
  min-height: 2.1rem;
  padding: 0.2rem 0.4rem 0.2rem 0;
  font: inherit; font-size: var(--text-sm);
  text-align: left;
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.atlas__towns button i {
  font: normal 500 var(--text-xs) var(--font-body);
  color: var(--muted);
  transition: color 0.2s;
}
.atlas__towns button.is-on,
.atlas__towns button:focus-visible { border-bottom-color: var(--accent-2); }
.atlas__towns button.is-on i,
.atlas__towns button:focus-visible i { color: var(--accent-2-ink); }
@media (hover: hover) and (pointer: fine) {
  .atlas__towns button:hover { border-bottom-color: var(--accent-2); }
  .atlas__towns button:hover i { color: var(--accent-2-ink); }
}

/* photos: a small stack of prints; the top one goes to the back on a tap */
.atlas__photos { position: relative; flex: none; height: 228px; margin: 0 0 0.6rem; }
.print {
  position: absolute;
  left: 50%; top: 4px;
  width: 172px;
  margin-left: -86px;
  padding: 8px 8px 30px;
  border: 0;
  border-radius: 4px;
  background: #F7F5F0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 14px 28px -14px rgba(0, 0, 0, 0.45);
  transform: translateX(var(--nudge, 0px)) rotate(var(--tilt, 0deg)); /* not --r: the hero registers it as a length */
  transition: transform 0.45s var(--ease-out), opacity 0.3s ease;
  cursor: pointer;
}
.print:active { transform: translateX(var(--nudge, 0px)) rotate(var(--tilt, 0deg)) scale(0.98); }
/* past the third, prints wait unseen behind the pile */
.print.is-deep { opacity: 0; pointer-events: none; }
.print__img { display: block; aspect-ratio: 1; border-radius: 2px; overflow: hidden; background: #E3E0D8; }
.print__img img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s ease; }
.print__img img.is-in { opacity: 1; }
/* placeholder until real photos land: a tinted square and a camera */
.print__img--ph {
  display: grid; place-items: center;
  background: linear-gradient(140deg, hsl(var(--hue) 55% 72%), hsl(calc(var(--hue) + 35) 60% 46%));
  color: rgba(255, 255, 255, 0.85);
}
.print__cap {
  position: absolute;
  left: 10px; right: 10px; bottom: 8px;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  color: #3A3D46;
  text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.atlas__nav { display: flex; justify-content: space-between; gap: 1rem; flex: none; }
.atlas__nav button {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 44px;
  font: inherit; font-size: var(--text-xs);
  color: var(--muted);
  background: none; border: 0; padding: 0; cursor: pointer;
  transition: color 0.2s;
}
@media (hover: hover) and (pointer: fine) { .atlas__nav button:hover { color: var(--ink); } }

/* the countries, as chips under the globe (and as a plain list without JS) */
.atlas__list { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.atlas__country {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 40px;
  padding: 0 0.85rem;
  font: inherit; font-size: var(--text-sm);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 99px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.16s ease-out;
}
.atlas__country:active { transform: scale(0.97); }
.atlas__country[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
@media (hover: hover) and (pointer: fine) { .atlas__country:hover { border-color: var(--accent); } }
.atlas__cities { list-style: none; margin: 0.3rem 0 0.6rem 1rem; padding: 0; font-size: var(--text-xs); color: var(--muted); }
.atlas__cities li { display: inline; }
.atlas__cities li + li::before { content: " · "; }
.atlas.is-live .atlas__cities { display: none; }

@media (max-width: 860px) {
  .atlas { grid-template-columns: 1fr; }
  .atlas__stage { max-width: 460px; width: 100%; justify-self: center; }
  /* phones: the countries sit right under the globe, one row that scrolls
     sideways, so the flight stays in view when one is tapped */
  .atlas.is-live .atlas__list {
    order: 1;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: calc(-1 * var(--gutter));
    padding: 0.2rem var(--gutter);
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .atlas.is-live .atlas__list::-webkit-scrollbar { display: none; }
  .atlas.is-live .atlas__list > li { flex-shrink: 0; }
  .atlas.is-live .atlas__panel { order: 2; }
  /* one column: no globe beside the panel to match, so no fixed height to
     leave empty. At rest it is just home and the totals; for a country every
     part has a set height (three rows of cities, scrolling), so it is the
     same height for each one and switching still moves nothing below. */
  .atlas__panel, .atlas__detail { height: auto; }
  /* the cities: one row that scrolls sideways, like the countries above, the
     same height for one city or twenty-five */
  .atlas__towns {
    flex: none;
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 calc(-1 * var(--gutter)) 1rem;
    padding: 0 var(--gutter);
    scroll-padding-inline: var(--gutter);
    --fade-dir: 90deg;
  }
  .atlas__towns li { flex: none; }
  .atlas__towns button { width: auto; white-space: nowrap; padding-right: 0; }
}

/* ---------- Logcat experience ---------- */
.logcat {
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius);
  overflow: hidden;
}
.logcat__bar {
  position: relative;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-bottom: 1px solid var(--code-line);
  font-size: var(--text-xs);
  color: var(--code-muted);
}
/* scroll-linked buffer fill */
.logcat__bar::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(var(--lc, 0));
  transform-origin: left;
  transition: transform 0.15s linear;
}
.logcat__filter b { color: var(--code-accent); font-weight: 500; }

/* scroll-driven print-in */
.log--pending { opacity: 0; transform: translateY(12px); }
.log--printed {
  opacity: 1; transform: none;
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

.logcat__list { list-style: none; }
.log {
  display: grid;
  grid-template-columns: 150px 130px 1fr;
  gap: 1.4rem;
  padding: 1.6rem 1.4rem;
  border-bottom: 1px solid var(--code-line);
  position: relative;
  transition: background 0.3s;
}
.log:last-child { border-bottom: none; }
.log:hover { background: color-mix(in srgb, var(--code-accent) 6%, transparent); }
.log::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--code-accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--ease-out);
}
.log:hover::before { transform: scaleY(1); }

.log__time { font-size: var(--text-xs); color: var(--code-muted); padding-top: 0.3rem; display: flex; flex-direction: column; gap: 0.25rem; }
.log__loc { font-style: normal; color: var(--code-muted); font-size: var(--text-xs); }
.log__tag {
  font-size: var(--text-xs);
  color: var(--code-accent);
  align-self: start;
  padding-top: 0.3rem;
}
.tag--live { color: var(--green); }
.tag--founder { color: var(--accent-2-ink); }
.log__body h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.2; margin-bottom: 0.4rem; color: var(--code-ink); }
.log__body p { color: var(--code-muted); font-size: 1rem; line-height: 1.65; max-width: 44ch; }

/* ---------- Case studies ---------- */
.case {
  display: grid;
  grid-template-columns: minmax(280px, 460px) 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-bottom: 1px solid var(--line);
}
.case--flip { grid-template-columns: 1fr minmax(280px, 460px); }
.case--flip .case__media { order: 2; }

a.case__media { cursor: pointer; }
a.case__media:hover { border-color: var(--accent); }
/* focus (keyboard OR tap) reuses the exact hover affordance: no second ring, ever */
a.case__media:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-color: var(--accent); }

.case__store {
  position: absolute;
  bottom: 0.9rem; right: 0.9rem;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;   /* comfortable tap target */
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 50%;
  z-index: 2;
  transition: transform 0.3s var(--ease-out);
}
.case__store svg { width: 15px; height: 15px; margin-left: 2px; }
@media (hover: hover) and (pointer: fine) { a.case__media:hover .case__store { transform: scale(1.1); } }

.case__media {
  position: relative;
  display: flex;
  justify-content: center;
  padding: clamp(2rem, 4vw, 3rem);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  border-radius: calc(var(--radius) + 6px);
  transition: transform 0.5s var(--ease-out);
  will-change: transform;
}
.case__badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--accent-2-ink);
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent);
  padding: 0.25rem 0.7rem;
  border-radius: 99px;
  white-space: nowrap;
}

/* CSS phone frame */
.phone {
  width: min(230px, 58vw);
  aspect-ratio: 9 / 19;
  background: #060409;
  border: 2px solid rgba(237, 235, 242, 0.18);
  border-radius: 30px;
  padding: 8px;
  position: relative;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8);
}
.phone__notch {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 62px; height: 7px;
  border-radius: 99px;
  background: rgba(237, 235, 242, 0.14);
  z-index: 2;
}
.phone__screen {
  width: 100%; height: 100%;
  border-radius: 22px;
  overflow: hidden;
  padding: 2rem 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.phone__screen.has-img { padding: 0; }
.phone__screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 22px; }

/* ---- Case phones play their app: real screens, pushed in like a navigation, after a tap ----
   Without JS (or under reduced motion) the first screen stands alone; main.js arms .is-live. */
.demo { position: relative; }
.demo img { position: absolute; inset: 0; }
.demo img:not(:first-child) { opacity: 0; }
.demo.is-live img { opacity: 1; transform: translateX(100%); transition: transform 0.75s var(--ease-out), filter 0.75s var(--ease-out); }
.demo.is-live img.is-on { transform: none; z-index: 2; }
.demo.is-live img.is-out { transform: translateX(-28%); filter: brightness(0.75); z-index: 1; }
.demo__tap {
  position: absolute; z-index: 3;
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, #fff 70%, transparent);
  opacity: 0; pointer-events: none;
}
.demo__tap.is-tap { animation: demoTap 0.6s var(--ease-out); }
@keyframes demoTap {
  0%   { opacity: 0; transform: scale(0.5); }
  35%  { opacity: 1; transform: scale(0.85); }
  100% { opacity: 0; transform: scale(1.5); }
}
@media (prefers-reduced-motion: no-preference) {
  /* the phone arrives leaning and straightens, then breathes */
  .js .case .phone { opacity: 0; translate: 0 56px; rotate: -4deg; transition: opacity 0.6s ease 0.15s, translate 1.1s var(--ease-out) 0.15s, rotate 1.1s var(--ease-out) 0.15s; }
  .js .case--flip .phone { rotate: 4deg; }
  .js .case.in .phone { opacity: 1; translate: 0 0; rotate: 0deg; animation: phoneFloat 7s ease-in-out 1.3s infinite; }
  /* Welltech: the three apps land one after another */
  .js .case .applist__item { opacity: 0; translate: 0 18px; transition: opacity 0.5s ease, translate 0.7s var(--ease-out); }
  .js .case.in .applist__item { opacity: 1; translate: 0 0; }
  .js .case.in .applist__item:nth-child(2) { transition-delay: 0.12s; }
  .js .case.in .applist__item:nth-child(3) { transition-delay: 0.24s; }
  .js .case .applist__note { opacity: 0; transition: opacity 0.6s ease 0.5s; }
  .js .case.in .applist__note { opacity: 1; }
  .case.in .applist__icon { animation: iconBob 4.8s ease-in-out 1.2s infinite; }
  .case.in .applist__item:nth-child(2) .applist__icon { animation-delay: 1.6s; }
  .case.in .applist__item:nth-child(3) .applist__icon { animation-delay: 2s; }
}
@keyframes iconBob { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(-3px) rotate(-6deg); } 90% { transform: translateY(0) rotate(4deg); } }

.case__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
  font-size: var(--text-xs);
  color: var(--muted);
  margin-bottom: 0.9rem;
}
.case__text h3 { font-size: clamp(1.5rem, 1rem + 1.6vw, 2.3rem); margin-bottom: 1.6rem; max-width: 18ch; }

.case__facts { display: flex; flex-direction: column; gap: 1.1rem; }
.case__facts dt {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.case__facts dd { color: var(--muted); font-size: var(--text-md); line-height: 1.65; max-width: 40ch; }

.chips {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 1.6rem;
}
.chips li {
  font-size: var(--text-xs);
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  transition: border-color 0.25s, color 0.25s;
}
.chips li:hover { border-color: var(--accent); color: var(--ink); }

/* interlude: full-width typographic breath between cases. The figure is
   drawn in outline like the section numerals and charges with colour as it
   scrolls in (main.js sets --p, 0 to 1); once full, one spark runs across. */
@property --glint { syntax: "<percentage>"; inherits: false; initial-value: -30%; }
.interlude {
  padding: clamp(3rem, 7vw, 5.5rem) 0;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.interlude__big .num {
  --p: 1; /* no script, or reduced motion: fully charged */
  --fill: calc(var(--p) * 104% - 2%);
  display: inline-block; /* the charge spans the figure, not the column */
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(4.5rem, 14vw, 11rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin: 0 0 0.8rem;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent-2);
  background:
    linear-gradient(100deg, transparent calc(var(--glint) - 8%), #fff var(--glint), transparent calc(var(--glint) + 8%)),
    /* the charge, with a brighter front where it is still moving */
    linear-gradient(90deg, var(--accent-2) calc(var(--fill) - 3%), color-mix(in srgb, var(--accent-2) 35%, #fff) var(--fill), transparent calc(var(--fill) + 0.5%));
  -webkit-background-clip: text;
  background-clip: text;
}
.interlude__big .num.is-charged { animation: glint 1.1s cubic-bezier(0.45, 0, 0.2, 1) 0.1s; }
@keyframes glint {
  50% { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent-2) 55%, transparent)); }
  to { --glint: 130%; }
}
.interlude__sub { color: var(--muted); font-size: var(--text-sm); max-width: 44ch; margin: 0 auto; line-height: 1.7; }

/* ---------- Gradle stack ---------- */

/* ---------- Stack: interactive module graph ---------- */
.stack__lede {
  max-width: 52ch;
  color: var(--muted);
  margin: 0 0 clamp(1.8rem, 4vw, 2.8rem);
}

.modmap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(230px, 24vw, 300px);
  gap: clamp(1.2rem, 3vw, 2.4rem);
  align-items: start;
}
.modmap__stage {
  grid-column: 1;
  grid-row: 1;
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius);
  padding: clamp(0.8rem, 2vw, 1.6rem);
  overflow-x: auto;
}
.modmap__svg { display: block; width: 100%; min-width: 620px; height: auto; }

/* --- edges --- */
.mm-edge {
  fill: none;
  stroke: var(--code-line);
  stroke-width: 1.5;
  color: var(--code-line);           /* the arrowhead inherits this */
  marker-end: url(#mmArrow);
  transition: stroke 0.25s ease, opacity 0.25s ease, color 0.25s ease;
}
.mm-edge.is-plugin { stroke-dasharray: 4 5; }
.mm-edge.is-lit {
  stroke: var(--accent);
  color: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 7 9;
  animation: mm-flow 0.55s linear infinite;
  filter: drop-shadow(0 0 5px var(--accent-soft));
}
@keyframes mm-flow { to { stroke-dashoffset: -16; } }

/* --- nodes --- */
.mm-node { cursor: pointer; outline: none; transform-box: fill-box; transform-origin: center; }
.mm-node rect {
  fill: var(--bg);
  stroke: var(--line);
  stroke-width: 1.5;
  transition: fill 0.25s ease, stroke 0.25s ease, opacity 0.25s ease;
}
.mm-node text {
  font-family: var(--font-mono);
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  transition: fill 0.25s ease;
}
.mm-node .mm-name { font-size: 12.5px; fill: var(--muted); }
.mm-node .mm-kmp {
  font-size: 11px;
  fill: var(--accent-2-ink);
  letter-spacing: 0.12em;
}
.mm-node.is-kmp rect { stroke: var(--accent-2); stroke-opacity: 0.55; }
.mm-node.is-lit rect { stroke: var(--accent); }
.mm-node.is-lit .mm-name { fill: var(--ink); }
.mm-node.is-active rect {
  fill: var(--accent-fill);
  stroke: var(--accent-fill);
  filter: drop-shadow(0 0 14px var(--accent-soft));
}
.mm-node.is-active .mm-name { fill: #fff; }
.mm-node.is-active .mm-kmp { fill: rgba(255, 255, 255, 0.8); }
.mm-node:focus-visible rect { stroke: var(--accent-2); stroke-width: 2.5; }

/* dim everything unrelated once a module is engaged */
.modmap.is-engaged .mm-node:not(.is-lit):not(.is-active) { opacity: 0.3; }
.modmap.is-engaged .mm-edge:not(.is-lit) { opacity: 0.18; }

/* --- side panel --- */
.modmap__panel {
  grid-column: 2;
  grid-row: 1;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 2vw, 1.5rem);
  background: var(--bg-elev);
  min-height: 210px;
}
.modmap__hint {
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.7rem;
}
.modmap__name {
  font-size: var(--text-md);
  letter-spacing: 0;
  line-height: 1.3;
  color: var(--accent);
  margin: 0 0 0.6rem;
  word-break: break-word;
}
.modmap__role { font-size: var(--text-sm); color: var(--muted); margin: 0 0 1rem; line-height: 1.6; }

.mm-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.mm-chips span {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0.25rem 0.6rem;
}

/* the graph's data source, and the accessible copy of it */
.sr-only,
.mm-data {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* phones: one row per layer instead of a graph too wide to read */
.modmap__layers { display: none; }
@media (max-width: 900px) {
  .modmap { grid-template-columns: 1fr; }
  /* one column: fall back to source order */
  .modmap__stage,
  .modmap__panel { grid-column: 1; grid-row: auto; }
  .modmap__panel { min-height: 0; }
}
@media (max-width: 760px) {
  .modmap__stage { display: none; }
  .modmap__layers {
    display: grid;
    gap: 22px;
    background: var(--code-bg);
    border: 1px solid var(--code-line);
    border-radius: var(--radius);
    padding: 1.1rem 0.9rem;
  }
}
.mm-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}
/* the dependency direction, between layers */
.mm-row + .mm-row::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -18px;
  width: 1px;
  height: 12px;
  background: var(--code-line);
}
.mm-row + .mm-row::after {
  content: "";
  position: absolute;
  left: calc(50% - 3px);
  top: -7px;
  border: 3.5px solid transparent;
  border-top: 4px solid var(--code-line);
  border-bottom: 0;
}
.mm-chip {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  min-height: 40px;
  padding: 0 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, transform 0.16s ease-out;
}
.mm-chip i { font-style: normal; font-size: 10px; letter-spacing: 0.12em; color: var(--accent-2-ink); }
.mm-chip.is-kmp { border-color: color-mix(in srgb, var(--accent-2) 55%, transparent); }
.mm-chip.is-lit { border-color: var(--accent); color: var(--ink); }
.mm-chip.is-active { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.mm-chip.is-active i { color: rgba(255, 255, 255, 0.8); }
.mm-chip:active { transform: scale(0.97); }
.modmap.is-engaged .mm-chip:not(.is-lit):not(.is-active) { opacity: 0.4; }
@media (prefers-reduced-motion: reduce) {
  .mm-edge.is-lit { animation: none; stroke-dasharray: none; }
}

/* ---------- Contact ---------- */
.contact { text-align: center; padding-bottom: var(--space-section); }
.contact__kicker { margin-bottom: 1.5rem; }
.contact__kicker .section__tag { margin-bottom: 0; }
.contact__meta { font-size: var(--text-sm); color: var(--muted); margin-bottom: 2rem; }
.contact__title { font-size: min(var(--text-hero), 6.3vw, 5.2rem); margin: 0 auto 1.6rem; }
.contact__lede { max-width: 46ch; margin: 0 auto 2.4rem; color: var(--muted); line-height: 1.6; }

.contact__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.9rem; }
.btn {
  display: inline-flex; align-items: center;
  padding: 1rem 1.8rem;
  border-radius: 99px;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s, border-color 0.3s;
  will-change: transform;
}
.btn--primary {
  background: var(--accent-fill);
  color: #fff;
  box-shadow: 0 12px 40px -12px rgba(36, 72, 200, 0.5);
}
.btn--primary:hover { box-shadow: 0 16px 50px -10px rgba(36, 72, 200, 0.65); }
.btn--ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn--ghost:hover { color: var(--ink); border-color: var(--accent); }

.contact__links {
  margin-top: 2.3rem;
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 0.8rem;
  font-size: var(--text-sm);
  color: var(--muted);
}
.contact__links a { padding: 0.7rem 0.6rem; } /* 44px targets, even for "X" */

/* ---------- Footer ---------- */
.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem;
  padding: 1.6rem var(--edge);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 1.6rem; left: 50%;
  transform: translate(-50%, calc(100% + 2.5rem));
  opacity: 0;
  pointer-events: none;
  background: var(--bg-elev);
  border: 1px solid var(--green);
  color: var(--green);
  padding: 0.7rem 1.3rem;
  border-radius: 99px;
  font-size: var(--text-sm);
  transition: transform 0.45s var(--ease-out), opacity 0.3s;
  z-index: 60;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Mobile section bar ---------- */
.mbar { display: none; }
@media (max-width: 900px) {
  .mbar {
    position: fixed;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 55;
    display: flex;
    gap: 2px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.45);
    transform: translate(-50%, calc(100% + 24px));
    transition: transform 0.35s var(--ease-out);
  }
  .mbar.is-shown { transform: translate(-50%, 0); }
  .mbar a {
    display: grid;
    place-items: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0 0.75rem;
    border-radius: 99px;
    font-size: var(--text-xs);
    color: var(--muted);
    white-space: nowrap;
    transition: color 0.2s, background-color 0.2s;
  }
  .mbar a.is-active { color: var(--accent); background: var(--accent-soft); }
  .mbar a:active { transform: scale(0.96); }
  /* keep the last lines of the page clear of the bar */
  body:has(.mbar) { padding-bottom: 76px; }
}
@media (max-width: 380px) { .mbar a { padding: 0 0.55rem; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .log { grid-template-columns: 1fr; gap: 0.4rem; padding: 1.4rem 1.2rem; }
  .log__time { flex-direction: row; align-items: baseline; gap: 0.7rem; }
  .case, .case--flip { grid-template-columns: 1fr; }
  .case--flip .case__media { order: 0; }
  .hero__scroll { display: none; }
  .about__intro { grid-template-columns: 1fr; justify-items: center; }
  .about__photo img { max-width: 260px; }
}

@media (max-width: 560px) {
  .nav { padding: 0.9rem 1.1rem; gap: 0.8rem; }
  .nav__brand-text { display: none; } /* mark only, status keeps room */
  .nav__mark { width: 30px; height: 30px; }
  .hero { padding-top: 7rem; }
  .hero__title { font-size: clamp(2.05rem, 9.4vw, 2.6rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.025em; }
  .about__quote pre { font-size: clamp(11px, 2.95vw, 0.74rem); padding-inline: 1rem; }
  .hero__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line);
  }
  .stat .num { font-size: 1.6rem; }
  .stat span { max-width: none; font-size: var(--text-xs); line-height: 1.4; }
  .section__head h2 { font-size: clamp(1.6rem, 8vw, 2.2rem); }
  .case__media { padding: 1.6rem 1rem; }
  .case__text h3 { font-size: clamp(1.45rem, 7vw, 2rem); }
  .contact__title { font-size: clamp(2.05rem, 9.4vw, 2.6rem); font-weight: 500; }
  .contact__actions { flex-direction: column; align-items: stretch; padding: 0 0.5rem; }
  .btn { justify-content: center; }
  .contact__links { gap: 0; }
  .footer { flex-direction: column; text-align: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* reduced, not removed: blocks still fade in, they just do not travel */
  .js .reveal { transform: none; transition: opacity 0.2s linear !important; }
  .hero__title .word { transform: none; animation: none; }
  .marquee__track { animation: none; flex-wrap: wrap; width: auto; padding-left: var(--gutter); }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ============================================================
   INTERACTIONS (all degrade gracefully)
   ============================================================ */

/* 2 · Line reveal: each line rises from behind a mask */
.lr { display: block; overflow: hidden; }
[data-lines] .lr__i {
  display: inline-block;
  transform: translateY(105%);
  opacity: 0;
  transition: transform 0.85s var(--ease-out), opacity 0.85s var(--ease-out);
}
[data-lines].lr-in .lr__i { transform: translateY(0); opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  [data-lines] .lr__i { transform: none; opacity: 1; transition: none; }
}


/* Static-electricity canvas over [data-spark] words */
.spark-canvas {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}
/* additive light on dark; on white, screen blending would erase the bolts.
   The hero storm stays unblended: it crosses white app screens in both themes. */
html[data-theme="dark"] .spark-canvas { mix-blend-mode: screen; }

/* Touch devices tap the word instead of hovering it */
@media (hover: none) {
  [data-spark] {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

/* ---- Smooth theme transition: fade only surface colours, never transforms/opacity ---- */
html.theme-anim body,
html.theme-anim .nav,
html.theme-anim .section,
html.theme-anim .hero,
html.theme-anim .trust,
html.theme-anim .footer,
html.theme-anim .about__quote,
html.theme-anim .log,
html.theme-anim .case__media,
html.theme-anim .chip,
html.theme-anim .btn {
  transition: background-color 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease !important;
}

@media (prefers-reduced-motion: reduce) {
  html.theme-anim body { transition: none !important; }
}

/* ---- Theme change via View Transitions: circular reveal, site stays visible ---- */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* ---- Custom scrollbar, Encre tones, theme-aware ---- */
/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
/* WebKit / Chromium */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 99px;
  border: 3px solid var(--bg);         /* inset look, matches page bg */
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  background-clip: padding-box;
}
::-webkit-scrollbar-corner { background: transparent; }


/* ---- Handwritten signature text (Allison), right of the console ---- */
.about__quoterow {
  /* mirrors .about__intro so the signature sits in the photo's exact column */
  display: grid;
  grid-template-columns: 1fr minmax(240px, 340px);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;              /* vertically centred against the console */
  margin-top: 2.4rem;
}
.about__quoterow .about__quote { margin-top: 0; min-width: 0; }

.sig-text {
  margin: 0;
  transform: translateX(-0.42em) rotate(-4deg);  /* optical nudge + slight hand-signed tilt */
  text-align: center;        /* centred on the photo's vertical axis */
  font-family: "Allison", cursive;
  font-weight: 400;
  color: var(--ink);                /* black in light, near-white in dark */
  line-height: 0.90;
  font-size: clamp(3rem, 5.4vw, 4.4rem);
  letter-spacing: 0.01em;
  user-select: none;
}
.sig-text__l1 { display: block; }
.sig-text__l2 { display: block; margin-left: 1.5em; }   /* second line offset */

@media (max-width: 900px) {
  .about__quoterow { grid-template-columns: 1fr; justify-items: center; }
  .sig-text { font-size: clamp(2.6rem, 13vw, 3.6rem); }
}



/* Code surfaces must use the IDE font, not the browser's default monospace */
pre, code, kbd, samp { font-family: var(--font-mono); }

/* ---- Welltech platform card: list of powered apps instead of one mockup ---- */
.case__media--apps {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.9rem;
  padding: clamp(1.2rem, 3vw, 2rem);
}
.applist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; width: 100%; }
.applist__item a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  text-decoration: none;
  transition: border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.applist__item a:hover { border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .applist__item a:hover { transform: translateY(-2px); } }
.applist__item a:active { transform: scale(0.98); transition-duration: 0.12s; }
.applist__item a:focus, .applist__item a:focus-visible { outline: none; border-color: var(--accent); }
.applist__icon { width: 36px; height: 36px; border-radius: 9px; flex: 0 0 auto; box-shadow: 0 0 0 1px var(--line); }
.applist__name { flex: 1; color: var(--ink); font-weight: 500; font-size: var(--text-sm); }
.applist__dl { color: var(--accent); font-size: var(--text-xs); }
.applist__play { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; }
.applist__play svg { width: 14px; height: 14px; }
.applist__note { text-align: center; color: var(--code-muted); font-size: var(--text-xs); margin: 0; }
