/* ========== Tokens ========== */
:root {
  --bg: #f3f3f3;
  --paper: #ffffff;
  --ink: #111111;
  --ink-2: #3a3a3a;
  --muted: #8a8a8a;
  --line: #e2e2e2;
  --dark: #1f1f1f;
  --dark-2: #2a2a2a;
  --dark-line: #353535;
  --slab: #111111;           /* always-dark strips: stats, footer */
  --on-ink: #ffffff;         /* text on var(--ink) */
  --glass: rgba(255,255,255,.72);
  --ghost: rgba(0,0,0,.045);
  --glow: rgba(255,255,255,.9);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.06);
  --shadow-card: 0 1px 2px rgba(0,0,0,.04), 0 18px 40px rgba(0,0,0,.05);
  --shadow-lift: 0 1px 2px rgba(0,0,0,.04), 0 28px 60px rgba(0,0,0,.1);
  --green: #22c55e;
  --ping: #10b981;
  color-scheme: light;
  --radius: 18px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gutter: clamp(16px, 4vw, 56px);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

/* Dark theme — set by the toggle, or by the OS when no choice is saved */
:root[data-theme="dark"] {
  --ping: #6ee7b7;
  --bg: #0b0b0c;
  --paper: #151516;
  --ink: #f2f2f2;
  --ink-2: #c2c2c2;
  --muted: #8a8a8a;
  --line: #262628;
  --dark: #1b1b1d;
  --dark-2: #242426;
  --dark-line: #2f2f32;
  --slab: #111112;
  --on-ink: #0b0b0c;
  --glass: rgba(21,21,22,.72);
  --ghost: rgba(255,255,255,.045);
  --glow: rgba(255,255,255,.06);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5), 0 6px 18px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.06);
  --shadow-card: 0 1px 2px rgba(0,0,0,.5), 0 18px 40px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.05);
  --shadow-lift: 0 1px 2px rgba(0,0,0,.5), 0 28px 60px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.09);
  color-scheme: dark;
}
:root[data-theme="dark"] .experience { border-block: 1px solid var(--dark-line); }
:root[data-theme="dark"] .hero-portrait img { filter: grayscale(1) contrast(1.05) brightness(1.08); }
:root[data-theme="dark"] .hero-portrait:hover img { filter: grayscale(0) brightness(1.05); }
:root[data-theme="dark"] .hero-portrait::before {
  content: ""; position: absolute; inset: 0 -20% -10%; z-index: 1; pointer-events: none;
  background: radial-gradient(50% 55% at 50% 60%, rgba(255,255,255,.11), transparent 70%);
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* No text selection (mouse drag or long press) or iOS callout menu */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
::selection { background: var(--ink); color: var(--on-ink); }

/* ========== Shared ========== */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--paper); font-size: 12px; font-weight: 600;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); position: relative; }
.dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: var(--green); opacity: .35; animation: ping 2s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(.4); opacity: .5 } 100% { transform: scale(1.6); opacity: 0 } }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
  transition: transform .4s var(--ease), background .3s, box-shadow .3s;
  white-space: nowrap;
}
.btn .arrow { display: inline-block; transition: transform .4s var(--ease); }
.btn:hover .arrow { transform: translate(2px, -2px) rotate(45deg); }
.btn:hover { transform: translateY(-2px); }
.btn-dark { background: var(--ink); color: var(--on-ink); box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.btn-dark:hover { opacity: .88; }
.btn-light { background: var(--paper); box-shadow: var(--shadow-sm); }

.link-arrow { font-size: 13px; font-weight: 600; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.muted { color: var(--muted); }

/* ========== Nav ========== */
.nav {
  position: fixed; top: 14px; left: 50%; z-index: 50;
  width: min(1240px, calc(100% - 2 * var(--gutter)));
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 8px 8px 8px; border-radius: 999px;
  transition: background .4s, box-shadow .4s, backdrop-filter .4s;
  animation: nav-in .65s .5s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes nav-in { from { opacity: 0; translate: 0 -14px; } }
@keyframes hero-in {
  from { transform: scale(1.2); opacity: .35; filter: blur(5px) brightness(1.45) contrast(.55); }
  to { transform: none; opacity: 1; filter: none; }
}
.nav.scrolled {
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 6px 30px rgba(0,0,0,.08);
}
.nav-links { display: flex; gap: clamp(18px, 4vw, 64px); font-size: 13px; font-weight: 500; }
.nav-links a { position: relative; }
.nav-links a sup { color: #666; font-size: 9px; margin-left: 2px; }   /* 5.7:1 on the white nav */
:root[data-theme="dark"] .nav-links a sup { color: #9a9a9a; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -3px; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.status .short { display: none; }

/* ========== Theme toggle ========== */
.theme-toggle {
  position: relative; flex: none;
  width: 64px; height: 34px; padding: 0; border-radius: 999px;
  background: var(--paper); box-shadow: var(--shadow-sm);
  transition: background .5s var(--ease), box-shadow .5s var(--ease), transform .4s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { transform: translateY(-2px); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.tt-knob {
  position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: var(--on-ink); display: grid; place-items: center;
  transition: transform .7s cubic-bezier(.68, -0.4, .27, 1.4), background .5s var(--ease);
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
}
.tt-knob svg { width: 18px; height: 18px; overflow: visible; }
.tt-core { fill: currentColor; transform-origin: 12px 12px; transition: transform .7s var(--ease); }
.tt-mask { transform: translate(8px, -8px); transition: transform .7s var(--ease); }
.tt-rays { stroke: currentColor; stroke-width: 2; stroke-linecap: round; transform-origin: 12px 12px; transition: transform .7s var(--ease), opacity .4s; }
.tt-stars i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--ink);
  opacity: 0; transform: scale(0); transition: opacity .4s, transform .5s var(--ease);
}
.tt-stars i:nth-child(1) { left: 13px; top: 10px; }
.tt-stars i:nth-child(2) { left: 21px; top: 19px; width: 2px; height: 2px; }
.tt-stars i:nth-child(3) { left: 10px; top: 22px; width: 2px; height: 2px; }

/* Dark state: knob slides right, sun shrinks into a crescent, rays spin away, stars appear */
:root[data-theme="dark"] .tt-knob { transform: translateX(30px) rotate(-360deg); }
:root[data-theme="dark"] .tt-core { transform: scale(1.75); }
:root[data-theme="dark"] .tt-mask { transform: translate(0, 0); }
:root[data-theme="dark"] .tt-rays { transform: rotate(90deg) scale(0); opacity: 0; }
:root[data-theme="dark"] .tt-stars i { opacity: 1; transform: scale(1); animation: twinkle 2.4s ease-in-out infinite; }
:root[data-theme="dark"] .tt-stars i:nth-child(2) { animation-delay: .6s; }
:root[data-theme="dark"] .tt-stars i:nth-child(3) { animation-delay: 1.2s; }
@keyframes twinkle { 50% { opacity: .25; } }

/* Circular reveal via the View Transitions API (driven from main.js) */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }
/* Fallback for browsers without View Transitions: smooth colour crossfade */
html.theme-fade, html.theme-fade *, html.theme-fade *::before, html.theme-fade *::after {
  transition: background-color .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease),
              fill .5s var(--ease), box-shadow .5s var(--ease), -webkit-text-stroke-color .5s var(--ease) !important;
}

/* ========== Hero ========== */
.hero {
  position: relative; min-height: 100vh; min-height: calc(100svh - var(--promo-h));  /* always fills the screen, any size */
  background: var(--paper);
  padding: 110px var(--gutter) 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  transform-origin: 50% 0;
  animation: hero-in 1.3s cubic-bezier(.22, 1, .36, 1) both;
}
.hero-name {
  grid-column: 1 / -1;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 0 .28em;
  font-family: "Poppins", var(--font);
  font-size: clamp(48px, 9vw, 240px); font-weight: 800; line-height: 1; letter-spacing: -.01em; white-space: nowrap;
  position: relative; z-index: 1;
}
/* Starts faint, not invisible: Chrome only records Largest Contentful Paint for content that paints
   with non-zero opacity, so a fully transparent start can leave LCP unmeasured (NO_LCP). */
.hero-name .outline, .hero-name .solid { display: inline-block; opacity: .18; filter: blur(16px); transform: translateY(30px); animation: rise 1s var(--ease) forwards; }
.hero-name .outline { animation-delay: 0s; }
.hero-name .solid { animation-delay: .08s; }
.hero-name .outline { color: transparent; -webkit-text-stroke: 1.6px var(--ink); font-weight: 500; }
@keyframes rise { to { opacity: 1; filter: blur(0); transform: none; } }


.hero-portrait {
  grid-column: 2; grid-row: 2; align-self: end;
  width: clamp(280px, min(48vw, 100svh - 9vw - 150px), 1000px); aspect-ratio: 1 / 1;
  position: relative; margin-top: -6vw; z-index: 2;
  opacity: 0; animation: fadeUp 1s .7s var(--ease) forwards;
}
.hero-portrait img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom;
  filter: grayscale(1) contrast(1.05); transition: filter .8s var(--ease); z-index: 2;
}
.hero-portrait:hover img { filter: grayscale(0); }
.hero-portrait img + .monogram { display: none; }
.monogram {
  position: absolute; inset: 8% 6% 0; border-radius: 50% 50% 0 0 / 46% 46% 0 0;
  background: radial-gradient(120% 90% at 50% 0%, #4a4a4a 0%, #1a1a1a 55%, #0d0d0d 100%);
  display: grid; place-items: center; overflow: hidden;
  box-shadow: inset 0 -40px 80px rgba(0,0,0,.5);
}
.monogram > span {
  font-size: clamp(90px, 13vw, 190px); font-weight: 800; letter-spacing: -.04em; color: transparent;
  -webkit-text-stroke: 1.5px rgba(255,255,255,.85);
  transition: color .8s var(--ease);
}
.hero-portrait:hover .monogram > span { color: #fff; }
.orbit { position: absolute; inset: 0; animation: spin 40s linear infinite; }
.orbit i {
  position: absolute; left: 50%; top: 50%; font-style: normal; font-family: var(--mono);
  font-size: 11px; color: rgba(255,255,255,.55); white-space: nowrap;
  --r: clamp(110px, 14vw, 190px);
  transform: rotate(calc(var(--i) * 72deg)) translateY(calc(var(--r) * -1)) rotate(calc(var(--i) * -72deg));
  translate: -50% -50%;
}
.orbit i:nth-child(1) { --i: 0 } .orbit i:nth-child(2) { --i: 1 } .orbit i:nth-child(3) { --i: 2 }
.orbit i:nth-child(4) { --i: 3 } .orbit i:nth-child(5) { --i: 4 }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-intro {
  grid-column: 1; grid-row: 2; align-self: center; max-width: 320px; padding-bottom: 6vh;
  opacity: 0; animation: fadeUp .85s .55s var(--ease) forwards;
}
.hero-intro h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.hero-intro p { color: var(--ink-2); font-size: 13.5px; margin: 0 0 18px; text-wrap: pretty; }
.hero-intro p strong { color: var(--ink); font-weight: 700; }

.hero-social {
  grid-column: 3; grid-row: 2; justify-self: end; align-self: center;
  list-style: none; margin: 0; padding: 0 0 6vh; display: grid; min-width: 168px;
  opacity: 0; animation: fadeUp .85s .62s var(--ease) forwards;
}
/* Small mono heading + hairline rows, so six links read as one tidy list */
.hero-social::before { content: "// elsewhere"; font-family: var(--mono); font-size: 11px; color: var(--muted); padding-bottom: 8px; }
.hero-social li + li { border-top: 1px solid var(--line); }
.hero-social a {
  display: flex; align-items: center; gap: 10px; padding: 9px 2px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); transition: color .3s, padding .4s var(--ease);
}
.hero-social a::after { content: "↗"; margin-left: auto; opacity: 0; transform: translate(-4px, 4px); transition: opacity .3s, transform .4s var(--ease); }
.hero-social a:hover, .hero-social a:focus-visible { color: var(--ink); padding-left: 6px; }
.hero-social a:hover::after, .hero-social a:focus-visible::after { opacity: 1; transform: none; }
.hero-social svg { flex: none; width: 15px; height: 15px; fill: currentColor; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ========== Stats ========== */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--slab); color: #fff;
}
.stats > div { padding: 34px var(--gutter); border-right: 1px solid #2c2c2c; }
.stats > div:last-child { border-right: 0; }
.stats strong { font-size: clamp(36px, 4.4vw, 60px); font-weight: 800; letter-spacing: -.03em; }
.stats > div > span { font-size: 18px; font-weight: 600; color: #8a8a8a; margin-left: 6px; letter-spacing: -.01em; }
/* "live" indicator: pulsing dot + periodic shimmer across the word */
.live {
  display: inline; font-weight: 700; color: #6ee7b7;
  background: linear-gradient(100deg, #6ee7b7 0%, #6ee7b7 40%, #ecfdf5 50%, #6ee7b7 60%, #6ee7b7 100%);
  background-size: 250% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmer 3.2s ease-in-out 1s infinite;
}
.live .dot { display: inline-block; width: 6px; height: 6px; margin: 0 6px 0 1px; vertical-align: 1px; box-shadow: 0 0 10px rgba(34,197,94,.7); }
@keyframes shimmer { 0%, 55% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.stats p { margin: 4px 0 0; color: #9a9a9a; font-size: 13px; max-width: 230px; }

/* ========== Sections ========== */
.section { padding: clamp(80px, 11vw, 150px) var(--gutter); position: relative; overflow-x: clip; }
.section-head { position: relative; margin: 0 auto 48px; max-width: 1240px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 46px); font-weight: 600; position: relative; z-index: 1; }
.section-head.center { text-align: center; }
.section-head.row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.ghost {
  position: absolute; top: -.55em; left: -.04em; z-index: 0; pointer-events: none;
  font-size: clamp(64px, 10vw, 150px); font-weight: 600; letter-spacing: .08em; line-height: 1;
  color: var(--ghost); white-space: nowrap;
  will-change: transform;
}
.section-head.center .ghost { left: 50%; translate: -50% 0; }

/* ========== Work ========== */
.work-bar {
  max-width: 1080px; margin: 0 auto 28px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted);
  transition: color .3s, background .3s;
}
.filters button:hover { color: var(--ink); }
.filters button.active { color: var(--ink); background: var(--paper); box-shadow: var(--shadow-sm); }

.grid { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  background: var(--paper); border-radius: var(--radius); padding: 10px 10px 18px;
  box-shadow: var(--shadow-card);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease), opacity .5s;
  cursor: pointer; text-align: left; display: block; width: 100%;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.card.hide { display: none; }
.card .thumb { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 10; }
.card .thumb > .mock { transition: transform 1s var(--ease); }
.mock.shots { background: #111; }
.mock.shots img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .mock.shots img { object-position: left top; } /* 2:1 screenshots in 16:10 cards: keep the headline side */

/* Slideshow: incoming screen zooms down and fades up, outgoing one drifts back and fades */
.slideshow { --dur: 3.4s; }
.slideshow .slide {
  position: absolute; inset: 0; display: block; opacity: 0;
  transform: scale(1.08) translateY(3%); filter: blur(6px);
  transition: opacity .9s var(--ease), transform 1.3s var(--ease), filter .9s var(--ease);
}
.slideshow .slide.is-active { opacity: 1; transform: none; filter: none; z-index: 1; }
.slideshow .slide.is-leaving { opacity: 0; transform: scale(.94) translateY(-2%); filter: blur(4px); z-index: 0; }
.slideshow .slide.is-active img { animation: drift calc(var(--dur) + 1.3s) linear both; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.035); } }
.slide-bars {
  position: absolute; left: 14px; right: 14px; bottom: 6px; z-index: 3;
  display: flex; gap: 6px; pointer-events: none;
}
.detail-shot .slide-bars { pointer-events: auto; left: 20px; right: 20px; bottom: 6px; }
.bar { flex: 1; padding: 6px 0; }                      /* hit area */
.bar[role=button] { cursor: pointer; padding: 12px 0; }
.bar[role=button]:focus-visible { outline: 2px solid #fff; outline-offset: -6px; border-radius: 6px; }
.bar i { display: block; height: 3px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }  /* track */
.bar i::after { content: ""; display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: left; }  /* fill */
.bar.done i::after { transform: scaleX(1); }
.bar.on i::after { animation: fill var(--dur) linear forwards; }
.slideshow.paused .bar.on i::after, .slideshow.paused .slide.is-active img { animation-play-state: paused; }
.slideshow.manual .bar.on i::after { animation: none; transform: scaleX(1); }
@keyframes fill { to { transform: scaleX(1); } }
.card:hover .thumb > .mock { transform: scale(1.04); }
.card .badges { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 3; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.card .badge {
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(255,255,255,.92); color: #111; padding: 4px 9px; border-radius: 999px;
}
/* Real (shipped, professional) work gets a solid green badge with a dot so it stands out */
.card .badge.real {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green); color: #fff; box-shadow: 0 4px 14px rgba(34,197,94,.45);
}
.card .badge.real::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.detail-hero h1 small.real { color: var(--green); font-weight: 600; }
.card .open {
  position: absolute; z-index: 3; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%;
  background: #fff; color: #111; display: grid; place-items: center; font-size: 18px;
  transform: translate(-50%, -50%) scale(.4); opacity: 0; transition: .5s var(--ease);
}
.card:hover .open { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.card h3 { font-size: 16px; font-weight: 600; margin: 14px 6px 10px; line-height: 1.35; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 6px; }
.tags span { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--bg); }

/* ---- Mock visuals (CSS-drawn project thumbnails) ---- */
.mock { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.mock.m-dark { background: radial-gradient(90% 80% at 50% 110%, var(--accent, #555) 0%, #111 60%); }
.phones { display: flex; gap: 4%; align-items: flex-end; height: 82%; }
.phone {
  height: 100%; aspect-ratio: 9 / 19; border-radius: 14px; background: #0c0c0c; padding: 4px;
  box-shadow: 0 20px 40px rgba(0,0,0,.45), inset 0 0 0 1px #333;
}
.phone:nth-child(2) { height: 108%; transform: translateY(-4%); }
.phone .scr { height: 100%; border-radius: 11px; background: var(--scr, #fafafa); padding: 10% 9%; display: flex; flex-direction: column; gap: 6%; overflow: hidden; }
.scr .b { border-radius: 4px; background: rgba(0,0,0,.1); height: 7%; }
.scr .b.w60 { width: 60%; } .scr .b.w80 { width: 80%; } .scr .b.big { height: 26%; background: var(--accent, #333); opacity: .85; border-radius: 8px; }
.scr .b.ac { background: var(--accent, #333); width: 70%; height: 9%; border-radius: 99px; margin-top: auto; align-self: center; }
.scr .clock { font-weight: 800; font-size: clamp(12px, 1.8vw, 20px); color: var(--accent); text-align: center; margin-top: 18%; letter-spacing: -.03em; }
.scr .ring { width: 70%; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--accent); align-self: center; border-right-color: transparent; }

.dash { width: 86%; height: 78%; border-radius: 10px; background: #161616; box-shadow: 0 20px 50px rgba(0,0,0,.5), inset 0 0 0 1px #2c2c2c; display: grid; grid-template-columns: 18% 1fr; overflow: hidden; }
.dash .side { background: #1d1d1d; padding: 12% 14%; display: flex; flex-direction: column; gap: 9%; }
.dash .side i { height: 5px; border-radius: 3px; background: #383838; }
.dash .side i:first-child { background: #fff; width: 60%; }
.dash .main { padding: 4.5%; display: grid; grid-template-rows: auto 1fr; gap: 6%; }
.dash .kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6%; }
.dash .kpis b { height: 30px; border-radius: 6px; background: #232323; position: relative; }
.dash .kpis b::after { content: ""; position: absolute; left: 12%; bottom: 25%; width: 40%; height: 5px; border-radius: 3px; background: #6ee7b7; }
.dash .chart { display: flex; align-items: flex-end; gap: 3%; border-radius: 6px; background: #1c1c1c; padding: 4%; }
.dash .chart i { flex: 1; background: linear-gradient(#a3a3a3, #4b4b4b); border-radius: 3px 3px 0 0; }

.term { width: 80%; border-radius: 10px; background: #0d0d0d; box-shadow: 0 20px 50px rgba(0,0,0,.5), inset 0 0 0 1px #2a2a2a; font-family: var(--mono); font-size: clamp(9px, 1.05vw, 12px); color: #d4d4d4; overflow: hidden; }
.term .bar { display: flex; gap: 5px; padding: 8px 10px; background: #1a1a1a; }
.term .bar i { width: 8px; height: 8px; border-radius: 50%; background: #444; }
.term pre { margin: 0; padding: 12px 14px 16px; white-space: pre; line-height: 1.6; }
.term .g { color: #6ee7b7; } .term .d { color: #737373; }
.term .cursor { display: inline-block; width: .6em; height: 1em; background: #d4d4d4; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ========== Service (accordion) ========== */
.accordion { max-width: 1240px; margin: 0 auto; border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: clamp(18px, 2.6vw, 30px) clamp(8px, 1vw, 14px);
  font-size: clamp(22px, 3.4vw, 44px); font-weight: 500; text-transform: uppercase; letter-spacing: -.01em; text-align: left;
  transition: padding .5s var(--ease), color .4s;
}
.acc-head:hover { padding-left: clamp(16px, 2vw, 28px); }
.acc-head .ico { font-size: .6em; transition: transform .5s var(--ease); flex: none; }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.acc-body > div { overflow: hidden; }
.acc-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; padding: 0 clamp(8px, 1vw, 14px) 30px; align-items: center; }
.acc-inner p { color: #bdbdbd; margin: 0 0 16px; max-width: 520px; }
.acc-inner .chips span { background: #2d2d2d; color: #e5e5e5; }
.proof { list-style: none; margin: 20px 0 0; padding: 0; display: grid; max-width: 560px; }
.proof li {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: baseline;
  padding: 10px 0; border-top: 1px solid #333; font-size: 13.5px; color: #c9c9c9;
  opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .6s var(--ease);
}
.proof li b { color: #fff; font-weight: 700; }
.proof li em { font-style: normal; font-weight: 700; color: #6ee7b7; white-space: nowrap; }
.acc-item.open .proof li { opacity: 1; transform: none; }
.acc-item.open .proof li:nth-child(2) { transition-delay: .07s; }
.acc-item.open .proof li:nth-child(3) { transition-delay: .14s; }
.acc-item.open .proof li:nth-child(4) { transition-delay: .21s; }
.acc-item.open { background: var(--dark); color: #fff; border-radius: 14px; border-bottom-color: transparent; }
.acc-item.open .acc-head .ico { transform: rotate(45deg); }
.acc-item.open .acc-body { grid-template-rows: 1fr; }
/* Screenshot deck: one panel at a time, reusing the project slideshow engine */
.acc-deck { position: relative; width: 100%; max-width: 520px; justify-self: end; aspect-ratio: 900 / 361; margin-bottom: 30px; }
.acc-deck .mock.shots { background: transparent; overflow: visible; }
.acc-deck .slide img { object-fit: contain; border-radius: 16px; filter: drop-shadow(0 16px 28px rgba(0,0,0,.45)); }
.acc-deck .slide-bars { left: 10%; right: 10%; bottom: -30px; pointer-events: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--bg); }

/* ========== Experience ========== */
.experience { background: var(--dark); color: #fff; }
.experience .ghost { color: rgba(255,255,255,.04); }
.experience .muted { color: #a3a3a3; font-size: 14px; }
.xp { list-style: none; margin: 0 auto; padding: 0; max-width: 1240px; }
.xp-row { border-bottom: 1px solid var(--dark-line); }
.xp-head {
  position: relative; display: grid; grid-template-columns: 1fr auto auto; gap: 24px; align-items: center;
  padding: 20px 6px; transition: padding .5s var(--ease); cursor: pointer;
}
.xp-head:hover { padding-left: 16px; }
.xp-toggle { padding: 0; }
.xp-toggle::before { content: ""; position: absolute; inset: 0; }          /* whole row is the click target */
.xp-toggle:focus-visible { outline: none; }
.xp-toggle:focus-visible::before { outline: 2px solid #fff; outline-offset: -2px; border-radius: 8px; }
.xp-co h3 { display: inline; }
.xp-li {
  position: relative; z-index: 1;                                            /* above the stretched toggle */
  display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 8px; vertical-align: -4px;
  border-radius: 5px; color: #8a8a8a; transition: color .25s, background .25s;
}
.xp-li svg { width: 18px; height: 18px; fill: currentColor; }
.xp-li:hover, .xp-li:focus-visible { color: #fff; background: #0a66c2; outline: none; }
.xp-row h3 { font-size: 16px; font-weight: 600; }
.xp-row .role { color: #9a9a9a; font-size: 14px; display: block; margin-top: 2px; }
.xp-row .when { color: #a3a3a3; font-size: 14px; text-align: right; }
.xp-row .where { color: #6b6b6b; font-size: 12px; display: block; }
.xp-row .ico { font-size: 18px; color: #777; transition: transform .5s var(--ease); width: 20px; text-align: center; }
.xp-row.open .ico { transform: rotate(45deg); color: #fff; }
.xp-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.xp-detail > div { overflow: hidden; }
.xp-row.open .xp-detail { grid-template-rows: 1fr; }
.xp-detail ul { margin: 0; padding: 0 6px 26px 22px; display: grid; gap: 8px; color: #c9c9c9; max-width: 900px; font-size: 14px; }
.xp-detail li::marker { color: #555; }
.xp-detail .chips { padding: 0 6px 28px; }
.xp-detail .chips span { background: #2c2c2c; color: #ddd; }
.xp-preview {
  position: fixed; z-index: 40; left: 0; top: 0; width: 210px; pointer-events: none;
  opacity: 0; transform: translate(-50%, -50%) scale(.6) rotate(-6deg);
  transition: opacity .35s, transform .5s var(--ease);
}
.xp-preview.show { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-6deg); }
.xp-preview .tile {
  border-radius: 14px; padding: 16px; background: #f4f4f4; color: #111;
  box-shadow: 0 30px 60px rgba(0,0,0,.45);
}
.xp-preview .tile b { font-size: 28px; font-weight: 800; letter-spacing: -.03em; display: block; }
.xp-preview .tile small { font-size: 12px; color: #555; }

/* ========== Beyond ========== */
.beyond-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.b-card {
  background: var(--paper); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow-card);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
a.b-card:hover, .b-card:has(.b-links):hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.b-card[data-href] { cursor: pointer; }
.b-card .tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.b-card h3 { font-size: 18px; font-weight: 700; }
.b-card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.b-card .link-arrow { align-self: flex-start; }
.b-card > .link-arrow, .b-links { margin-top: auto; }
.b-links { display: flex; gap: 20px; flex-wrap: wrap; }
/* Full-width recognition strip under the two Beyond Code cards */
.b-award { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 22px; }
.b-award .award-badge {
  flex: none; width: 84px; aspect-ratio: 1; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at 30% 25%, #ffb547, #ff9900 55%, #c76a00); color: #111;
  box-shadow: 0 10px 24px rgba(255,153,0,.25); transition: transform .6s var(--ease);
}
.b-award .award-badge small { font-family: var(--mono); font-size: 10px; font-weight: 600; }
.b-award .award-badge b { font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.b-award:hover .award-badge { transform: rotate(-8deg) scale(1.05); }
.b-award .award-text { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.b-award > .link-arrow { margin-top: 0; align-self: center; white-space: nowrap; }
@media (max-width: 640px) {
  .b-award { flex-wrap: wrap; }
  .b-award .award-badge { width: 64px; }
  .b-award .award-badge b { font-size: 17px; }
  .b-award .award-text { flex-basis: calc(100% - 86px); }
}
/* Publication card: a filled button with a soft pulse so the eBook link gets noticed */
.ebook-cta { align-self: flex-start; margin-top: auto; padding: 12px 22px; font-size: 14px; animation: ebook-pulse 2.4s ease-out infinite; }
a.b-card:hover .ebook-cta { transform: translateY(-2px); animation: none; }
a.b-card:hover .ebook-cta .arrow { transform: translate(2px, -2px) rotate(45deg); }
@keyframes ebook-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--ink) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .ebook-cta { animation: none; } }
.agenda { margin: 0; padding: 0; list-style: none; counter-reset: ag; display: grid; font-size: 13.5px; color: var(--ink-2); }
.agenda li { counter-increment: ag; display: grid; grid-template-columns: 28px 1fr; padding: 7px 0; border-top: 1px solid var(--line); }
.agenda li::before { content: counter(ag, decimal-leading-zero); font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding-top: 2px; }
.b-card .sub { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: -8px; }
.b-card .chips span { font-size: 11.5px; padding: 4px 10px; }
.b-card p.meta { flex: none; font-size: 12.5px; color: var(--muted); }
.book, .stage { height: 170px; border-radius: 12px; display: grid; place-items: center; }
.book { background: linear-gradient(135deg, var(--bg), var(--line)); perspective: 600px; }
.book.pair { grid-auto-flow: column; justify-content: center; gap: 28px; } /* two covers side by side */
.book-cover {
  width: 104px; height: 140px; border-radius: 3px 8px 8px 3px; padding: 12px 10px;
  background: linear-gradient(160deg, #1b1b1b, #3b3b3b); color: #fff; display: flex; flex-direction: column;
  box-shadow: -6px 0 0 #0a0a0a inset, 0 18px 30px rgba(0,0,0,.35); transform: rotateY(-18deg);
  transition: transform .8s var(--ease);
}
.b-card:hover .book-cover { transform: rotateY(0); }
.book-cover small { font-size: 7px; letter-spacing: .2em; color: #aaa; }
.book-cover b { font-size: 15px; margin-top: auto; line-height: 1.1; }
.book-cover em { font-size: 9px; color: #bbb; }
.book-cover i { font-size: 6.5px; font-style: normal; color: #8a8a8a; margin-top: 3px; }
.book-cover span { font-size: 7px; margin-top: 10px; color: #888; }
.stage { background: radial-gradient(70% 90% at 50% 0%, #4b4b4b, #141414); color: #eee; padding: 20px; text-align: center; gap: 10px; grid-template-rows: auto auto; align-content: center; }
.stage p { color: #ddd !important; font-size: 13px !important; font-style: italic; max-width: 240px; flex: none !important; }
.mic { width: 16px; height: 26px; border-radius: 10px; background: #ddd; position: relative; box-shadow: 0 0 30px rgba(255,255,255,.4); }
.mic::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 10px; background: #aaa; translate: -50% 0; }

/* ========== CTA ========== */
.cta {
  padding: clamp(90px, 12vw, 170px) var(--gutter);
  text-align: center; background:
    radial-gradient(60% 60% at 50% 0%, var(--glow), transparent 70%), var(--bg);
}
.cta h2 { font-size: clamp(32px, 5.6vw, 72px); font-weight: 700; margin: 22px 0 14px; letter-spacing: -.03em; }
.cta p { max-width: 560px; margin: 0 auto 28px; color: var(--ink-2); }
.cta-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ========== Footer ========== */
.footer {
  background: var(--slab); color: #bbb; padding: 40px var(--gutter);
  display: grid; grid-template-columns: 1fr auto; gap: 24px; font-size: 13px; align-items: center;
}
.footer b { color: #fff; display: block; font-size: 15px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-links a:hover { color: #fff; }
.footer-links.social { justify-content: flex-end; }
.footer .copy { grid-column: 1 / -1; margin: 12px 0 0; padding-top: 20px; border-top: 1px solid #2a2a2a; color: #8f8f8f; font-size: 12px; }

/* ========== Project detail ========== */
body.viewing #home { display: none; }
.detail { padding: 96px var(--gutter) 40px; max-width: 1240px; margin: 0 auto; min-height: 60vh; }
.detail[hidden] { display: none; }
.detail-top .status { display: none; }
.detail-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.detail .back { cursor: pointer; transition: transform .4s var(--ease); }
.detail .back:hover { transform: translateX(-4px); }
.detail-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; margin: 60px 0 40px; animation: fadeUp .9s var(--ease); }
.detail-hero .tags { margin: 0 0 16px; }
.detail-hero .tags span { background: var(--paper); box-shadow: var(--shadow-sm); }
.detail-hero h1 { font-size: clamp(34px, 5vw, 62px); font-weight: 600; letter-spacing: -.03em; line-height: 1.05; }
.detail-hero h1 small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 8px; }
.detail-hero > div > p { color: var(--ink-2); max-width: 520px; margin: 16px 0 22px; }
.detail-meta { display: grid; gap: 18px; align-content: start; text-align: right; }
.detail-meta small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.detail-meta span { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-shot { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 16 / 8; background: var(--paper); box-shadow: var(--shadow-card); animation: fadeUp 1.1s .1s var(--ease) both; }
.detail-note { margin: 28px auto; max-width: 760px; background: var(--paper); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow-card); }
.detail-note h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.detail-note ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.detail-more { margin-top: 60px; }
.detail-more > h2 { font-size: 22px; font-weight: 600; margin-bottom: 20px; }

/* ========== Open source ==========
   Rows of pull requests (home section, list page, "More contributions") and the PR page itself */
:root { --add: #1a7f37; --del: #cf222e; --tint: color-mix(in srgb, var(--ink) 7%, transparent); }
:root[data-theme="dark"] { --add: #3fb950; --del: #f85149; }
.pr-list { list-style: none; margin: 0 auto; padding: 0; max-width: 1240px; border-top: 1px solid var(--line); }
.pr-row { border-bottom: 1px solid var(--line); }
.pr-row > a {
  display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr) auto 104px 16px; gap: 24px; align-items: center;
  padding: 20px 6px; transition: padding .5s var(--ease);
}
.pr-row > a:hover { padding-left: 16px; }
.pr-repo { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-repo b { color: var(--ink); font-weight: 500; }
.pr-title { font-size: 16px; font-weight: 600; line-height: 1.4; text-wrap: pretty; }
.pr-num { font-weight: 500; color: var(--muted); }
.pr-row time { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.pr-go { color: var(--muted); transition: transform .4s var(--ease), color .3s; }
.pr-row > a:hover .pr-go { color: var(--ink); transform: translateX(4px); }
.pr-title code, .pr-h1 code, .pr-line code {
  font-family: var(--mono); font-size: .86em; font-weight: 500; padding: .08em .35em; border-radius: 6px; background: var(--tint);
}
.pr-state {
  display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 11.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap;
}
.pr-state svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pr-state i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pr-state.is-merged { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.pr-state.is-open i { background: var(--green); }
.pr-state.is-closed { color: var(--muted); }
/* Loading rows while GitHub answers */
.pr-skel { display: grid; grid-template-columns: 180px 1fr 100px; gap: 24px; padding: 27px 6px; border-bottom: 1px solid var(--line); }
.pr-skel span {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--line) 30%, var(--tint) 50%, var(--line) 70%) 100% 0 / 300% 100%;
  animation: skel 1.4s ease-in-out infinite;
}
@keyframes skel { to { background-position: 0 0; } }
.pr-empty { padding: 26px 6px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.pr-empty .link-arrow { margin-left: 6px; }
.oss-more { display: flex; justify-content: center; margin-top: 32px; }
.oss-more .btn:hover .arrow { transform: translateX(3px); }
.pr-row.reveal:not(.in) { transform: translateX(-48px); }

/* PR page */
.detail-hero h1.pr-h1 { font-size: clamp(26px, 3.4vw, 44px); line-height: 1.15; text-wrap: pretty; }
.pr-h1 code { font-size: .74em; padding: .04em .3em; vertical-align: .08em; }
.detail-meta span { overflow-wrap: anywhere; } /* long branch names */
.detail-hero > div > p.pr-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 14px; }
.pr-stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; margin-bottom: 22px; overflow: hidden;
  background: var(--line); border-radius: 14px; box-shadow: var(--shadow-card); animation: fadeUp 1s .05s var(--ease) both;
}
.pr-stats div { background: var(--paper); padding: 18px 20px; }
.pr-stats b { display: block; font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pr-stats small { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pr-stats .add, .pr-diff ins { color: var(--add); text-decoration: none; }
.pr-stats .del, .pr-diff del { color: var(--del); text-decoration: none; }
.pr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; animation: fadeUp 1.1s .1s var(--ease) both; }
.pr-card { background: var(--paper); border-radius: 14px; padding: 22px 24px; box-shadow: var(--shadow-card); min-width: 0; }
.pr-card > h2 {
  display: flex; justify-content: space-between; margin-bottom: 14px;
  font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.pr-files { position: sticky; top: calc(90px + var(--promo-h)); }
.pr-files ul { list-style: none; margin: 0; padding: 0; }
.pr-files li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; }
.pr-file { display: flex; min-width: 0; }
.pr-file .dir { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pr-file b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 100%; }
.pr-diff { flex: none; display: flex; gap: 8px; }
/* The PR description, as GitHub renders it (GitHub's own sanitised HTML) */
.prose { font-size: 15px; line-height: 1.65; color: var(--ink-2); overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-size: 18px; font-weight: 700; color: var(--ink); margin: 26px 0 8px; }
.prose p, .prose ul, .prose ol, .prose details, .prose blockquote, .prose table { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 4px; }
.prose li.task-list-item { list-style: none; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { color: var(--ink); }
.prose code { font-family: var(--mono); font-size: .86em; padding: .1em .35em; border-radius: 6px; background: var(--tint); }
.prose pre { margin: 0 0 12px; padding: 14px 16px; border-radius: 10px; background: var(--bg); overflow-x: auto; font-size: 12.5px; line-height: 1.55; }
.prose pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; }
.prose img { height: auto; border-radius: 10px; }
.prose blockquote { padding-left: 14px; border-left: 3px solid var(--line); color: var(--muted); }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 13.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.prose summary { cursor: pointer; font-weight: 600; color: var(--ink); }
@media (max-width: 900px) {
  .pr-grid { grid-template-columns: 1fr; }
  .pr-files { position: static; }
  .pr-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .pr-row > a { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .pr-repo { grid-row: 1; }
  .pr-row time { grid-row: 1; }
  .pr-title { grid-column: 1 / -1; }
  .pr-go { display: none; }
  .pr-skel { grid-template-columns: 1fr 1fr; }
  .pr-skel span:last-child { display: none; }
  .pr-stats { grid-template-columns: repeat(2, 1fr); }
  .pr-stats div:last-child { grid-column: 1 / -1; }
}

/* ========== Reveal ========== */
/* Scroll reveal: main.js adds .in once an element is well inside the viewport (variants under "Scroll reveals") */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ========== Inspector cursor ==========
   Crosshair follows the pointer; on interactive elements DevTools-style corner brackets
   wrap the element with a mono W × H label; click sends a mint ping ring.
   Crosshair + brackets use "difference" blending so they read on any background.
   Only active (and native cursor hidden) once main.js adds .insp-on on a real mouse move. */
.insp { display: none; }
@media (hover: hover) and (pointer: fine) {
  html.insp-on, html.insp-on * { cursor: none !important; }
  html.insp-on .insp { display: block; }
  .insp-blend { position: fixed; inset: 0; pointer-events: none; z-index: 9998; mix-blend-mode: difference; }
  .insp-cross {
    /* centre point + four short ticks with a gap, like a precision crosshair */
    position: fixed; left: 0; top: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; will-change: translate;
    background:
      linear-gradient(#fff, #fff) center / 3px 3px no-repeat,
      linear-gradient(#fff, #fff) center top / 2px 7px no-repeat,
      linear-gradient(#fff, #fff) center bottom / 2px 7px no-repeat,
      linear-gradient(#fff, #fff) left center / 7px 2px no-repeat,
      linear-gradient(#fff, #fff) right center / 7px 2px no-repeat;
    transition: opacity .2s, scale .25s var(--ease);
  }
  .insp.has-target .insp-cross { scale: .8; }
  .insp-box {
    --k: 13px; --t: 2px;
    position: fixed; left: 0; top: 0; width: 0; height: 0; opacity: 0;
    background:
      linear-gradient(#fff, #fff) top left / var(--k) var(--t) no-repeat,
      linear-gradient(#fff, #fff) top left / var(--t) var(--k) no-repeat,
      linear-gradient(#fff, #fff) top right / var(--k) var(--t) no-repeat,
      linear-gradient(#fff, #fff) top right / var(--t) var(--k) no-repeat,
      linear-gradient(#fff, #fff) bottom left / var(--k) var(--t) no-repeat,
      linear-gradient(#fff, #fff) bottom left / var(--t) var(--k) no-repeat,
      linear-gradient(#fff, #fff) bottom right / var(--k) var(--t) no-repeat,
      linear-gradient(#fff, #fff) bottom right / var(--t) var(--k) no-repeat;
    transition: left .28s var(--ease), top .28s var(--ease), width .28s var(--ease), height .28s var(--ease), opacity .2s, scale .15s var(--ease);
  }
  .insp.has-target .insp-box { opacity: 1; }
  .insp.is-down .insp-box { scale: .97; }
  .insp-label {
    position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; opacity: 0;
    font: 500 10.5px/1 var(--mono); letter-spacing: .02em; white-space: nowrap;
    padding: 4px 6px; border-radius: 4px; background: #6ee7b7; color: #0b0b0c;
    transition: left .28s var(--ease), top .28s var(--ease), opacity .2s;
  }
  .insp.has-target .insp-label { opacity: 1; }
}
.insp-ping {
  position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; border-radius: 50%;
  border: 2px solid var(--ping); width: 60px; height: 60px; margin: -30px 0 0 -30px;
}

/* ========== Toast ========== */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; translate: -50% 0;
  background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 600; padding: 10px 18px; border-radius: 999px;
  opacity: 0; transform: translateY(20px); transition: .5s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }

/* ========== Community ========== */
.community-intro { max-width: 1240px; margin: -16px auto 40px; }
.community-intro h3 { font-size: clamp(18px, 2vw, 24px); font-weight: 700; margin-bottom: 10px; }
.community-intro p { margin: 0; max-width: 760px; color: var(--muted); font-size: clamp(15px, 1.4vw, 18px); }
.community-intro strong { color: var(--ink); font-weight: 600; }
/* Same-size post cards, 4 / 3 / 2 per row; the part-filled last row stays left-aligned. Phones swipe a row instead. */
.events { --cols: 4; --gap: 20px; list-style: none; margin: 0 auto; padding: 0; max-width: 1240px; display: flex; flex-wrap: wrap; gap: var(--gap); }
.events > .ev { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); min-width: 0; }
/* Collapsed to two rows (8 / 6 / 4 cards) until "Show all" is pressed */
.events:not(.open) > .ev:nth-child(n+9) { display: none; }
.events-more { display: flex; justify-content: center; margin-top: 32px; }
.events.open + .events-more .arrow { rotate: 180deg; }
#eventsMore:hover .arrow { transform: translateY(2px); }
.ev {
  position: relative; display: flex; flex-direction: column; padding: 8px; border-radius: var(--radius);
  background: var(--paper); box-shadow: var(--shadow-card);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease), opacity 1s var(--ease);
}
.ev:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
/* The photo fills the frame; --pos (set per post) keeps the subject in view where it has to be cropped */
.ev-img { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--line); }
.ev-img img {
  width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, center);
  filter: grayscale(1); transition: transform .8s var(--ease), filter .6s var(--ease);
}
/* Black and white until the card is hovered or focused; touch screens can't hover, so they get colour */
.ev:hover .ev-img img, .ev:focus-within .ev-img img { transform: scale(1.04); filter: none; }
@media (hover: none) { .ev-img img { filter: none; } }
.ev-body { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 14px 8px 6px; }
.ev-meta { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ev-title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.ev-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.ev-where { font-size: 13px; color: var(--ink-2); }
.ev-posts { margin-top: auto; padding-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.ev-posts a {
  position: relative; z-index: 1; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; color: var(--ink-2); transition: background .3s, color .3s, border-color .3s;
}
.ev-posts a:hover { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
@media (max-width: 1100px) { .events { --cols: 3; } .events:not(.open) > .ev:nth-child(n+7) { display: none; } }
@media (max-width: 760px) { .events { --cols: 2; --gap: 14px; } .events:not(.open) > .ev:nth-child(n+5) { display: none; } }
@media (max-width: 520px) {
  .events {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter)); padding: 6px var(--gutter) 24px; scroll-padding-inline: var(--gutter);
  }
  .events::-webkit-scrollbar { display: none; }
  .events { flex-wrap: nowrap; }
  .events:not(.open) > .ev:nth-child(n) { display: flex; }   /* the swipe row always holds every card */
  .events-more { display: none; }
  .events > .ev { flex: 0 0 78%; scroll-snap-align: start; }
}

/* ========== Scroll reveals ==========
   Each section gets its own entrance; siblings that arrive together are staggered from main.js.
   Start states use :not(.in), so once revealed nothing fights the hover transforms. The hero is left alone. */
/* Headings rise through a mask; the ghost word behind them fades in as its letters draw together */
.section-head.reveal, .stats.reveal { opacity: 1; transform: none; }
.section-head h2, .cta h2 { transition: clip-path 1.1s var(--ease), transform 1.1s var(--ease); }
.section-head.reveal:not(.in) h2, .cta .reveal:not(.in) h2 { clip-path: inset(0 0 100% 0); transform: translateY(.5em); }
.section-head .ghost { transition: opacity 1.6s var(--ease) .1s, letter-spacing 1.8s var(--ease) .1s; }
.section-head.reveal:not(.in) .ghost { opacity: 0; letter-spacing: .35em; }
.section-head .muted { transition: opacity 1s var(--ease) .35s; }
.section-head.reveal:not(.in) .muted { opacity: 0; }
/* Stats: the four cells rise one after another while their numbers count up */
.stats > div { transition: opacity .9s var(--ease), transform 1s var(--ease); }
.stats > div:nth-child(2) { transition-delay: .1s; }
.stats > div:nth-child(3) { transition-delay: .2s; }
.stats > div:nth-child(4) { transition-delay: .3s; }
.stats.reveal:not(.in) > div { opacity: 0; transform: translateY(28px); }
/* Cards rise, settle from slightly smaller and come into focus */
.card.reveal, .b-card.reveal, .ev.reveal {
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease), box-shadow .6s var(--ease);
}
.card.reveal:not(.in), .b-card.reveal:not(.in), .ev.reveal:not(.in) { transform: translateY(56px) scale(.94); filter: blur(8px); }
/* Experience rows slide in from the left; Expertise items rise */
.xp-row.reveal:not(.in) { transform: translateX(-48px); }
.acc-item.reveal:not(.in) { transform: translateY(28px); }
/* Contact: the buttons follow the headline */
.cta-actions { transition: opacity .9s var(--ease) .3s, transform .9s var(--ease) .3s; }
.cta .reveal:not(.in) .cta-actions { opacity: 0; transform: translateY(16px); }

/* ========== E-book bar ==========
   A slim always-dark strip above the nav. --promo-h pushes the page and the floating nav down;
   dismissing animates it to 0 (registered with @property so it can transition) until the next page load. */
@property --promo-h { syntax: "<length>"; inherits: true; initial-value: 0px; }
:root { --promo-h: 0px; } /* e-book bar removed; set a height here to bring a top bar back */
:root.promo-off { --promo-h: 0px; }
body { padding-top: var(--promo-h); }
.nav { top: calc(14px + var(--promo-h)); }
.promo {
  position: fixed; inset: 0 0 auto; z-index: 60; height: var(--promo-h); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--slab); color: #fff; border-bottom: 1px solid #262626;
}
.promo-off .promo { visibility: hidden; transition: visibility 0s .45s; }
/* A soft highlight sweeps across every few seconds */
.promo::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.09) 50%, transparent 70%) no-repeat;
  background-size: 50% 100%; animation: promo-sheen 6s ease-in-out 1.5s infinite;
}
@keyframes promo-sheen { 0% { background-position: -100% 0; } 35%, 100% { background-position: 250% 0; } }
.promo-link {
  position: relative; display: flex; align-items: center; gap: 12px; min-width: 0;
  height: 100%; padding: 0 56px; font-size: 14.5px; white-space: nowrap;
}
.promo-tag {
  display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 4px 10px 4px 8px; border-radius: 999px;
  border: 1px solid #3a3a3a; font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: #d4d4d4;
}
.promo-tag svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.promo-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: #bdbdbd; }
.promo-text b { color: #fff; font-weight: 600; }
.promo-cta { flex: none; font-weight: 600; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.promo-cta .arrow { display: inline-block; transition: transform .4s var(--ease); }
.promo-link:hover .promo-cta .arrow { transform: translate(2px, -2px) rotate(45deg); }
.promo-link:hover .promo-text { color: #e5e5e5; }
.promo-close {
  position: absolute; right: max(8px, calc(var(--gutter) - 8px)); top: 50%; translate: 0 -50%;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #9a9a9a;
  transition: background .3s, color .3s;
}
.promo-close:hover { background: #262626; color: #fff; }
.promo-close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 760px) { .promo-sub { display: none; } }
@media (max-width: 520px) {
  .promo-link { gap: 8px; padding: 0 44px 0 12px; font-size: 13px; justify-content: flex-start; }
  .promo-cta { display: none; }   /* the whole bar is the link */
}
@media (prefers-reduced-motion: reduce) { .promo::before { animation: none; } }

/* ========== Responsive ========== */
/* Stacked hero: phones, small tablets, and any tablet held in portrait.
   The photo grows to fill whatever height is left under the intro. */
@media (max-width: 900px), (max-width: 1366px) and (orientation: portrait) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; padding-top: 100px; text-align: center; min-height: calc(100svh - var(--promo-h)); align-content: start; }
  .hero-name { gap: 0; flex-direction: column; align-items: center; font-size: clamp(40px, 14vw, 140px); min-width: 0; }
  .hero-intro { grid-column: 1; grid-row: 2; justify-self: center; padding: 24px 0 0; }
  .hero-social { grid-column: 1; grid-row: 3; justify-self: center; grid-auto-flow: column; padding: 22px 0 10px; gap: 18px; }
  .hero-social { min-width: 0; }
  .hero-social::before, .hero-social a::after { display: none; }
  .hero-social li + li { border-top: 0; }
  .hero-social a { font-size: 0; gap: 0; padding: 0; } .hero-social a:hover { padding-left: 0; }
  .hero-social svg { width: 20px; height: 20px; }
  .hero-portrait { grid-column: 1; grid-row: 4; justify-self: center; align-self: end; margin-top: 10px; width: clamp(300px, min(92vw, 100svh - 28vw - 350px), 820px); }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div:nth-child(2) { border-right: 0; }
  .stats > div:nth-child(-n+2) { border-bottom: 1px solid #2c2c2c; }
  .acc-inner { grid-template-columns: 1fr; }
  .acc-deck { justify-self: stretch; max-width: none; }
  .proof li { grid-template-columns: 1fr auto; gap: 2px 12px; }
  .proof li span { grid-column: 1 / -1; grid-row: 2; }
  .beyond-grid { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-meta { text-align: left; grid-template-columns: repeat(2, 1fr); }
  .footer { grid-template-columns: 1fr; }
  .footer-links.social { justify-content: flex-start; }
  .xp-preview { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .nav .status { font-size: 11px; padding: 6px 11px; }
  .nav .status .full { display: none; } .nav .status .short { display: inline; }
  .theme-toggle { width: 58px; height: 32px; } .tt-knob { width: 24px; height: 24px; }
  :root[data-theme="dark"] .tt-knob { transform: translateX(26px) rotate(-360deg); }
  .work-bar { justify-content: center; }
  .grid { grid-template-columns: 1fr; }
  .xp-head { grid-template-columns: 1fr auto; }
  .xp-row .when { grid-column: 1; grid-row: 2; text-align: left; }
  .xp-row .xp-toggle { grid-column: 2; grid-row: 1 / 3; }
  .section-head.row { flex-direction: column; gap: 4px; }
  .stats > div { padding: 24px 16px; }
  .detail-shot { aspect-ratio: 4 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-delay: 0s !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
