@font-face { font-family: Display; src: url(../assets/fonts/display.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: Body; src: url(../assets/fonts/body-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Body; src: url(../assets/fonts/body-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Mono; src: url(../assets/fonts/mono.woff2) format('woff2'); font-display: swap; }

:root, :root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #07101f; --surface: #0e1a30; --raised: #15243f; --text: #e8f0fd; --muted: #a3b4d1;
  --line: #243858; --accent: #37e0ff; --on-accent: #041522; --ok: #5ee6a0;
  --glow: 0 0 28px rgba(55, 224, 255, .28);
  --wash: radial-gradient(60rem 36rem at 90% -8%, rgba(55, 224, 255, .13), transparent 65%), radial-gradient(48rem 40rem at -20% 45%, rgba(74, 105, 255, .12), transparent 65%);
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #faf7f0; --surface: #fffdf8; --raised: #f1ecdf; --text: #131c2b; --muted: #4a566a;
  --line: #ddd5c4; --accent: #1b57c9; --on-accent: #fff; --ok: #0f7345;
  --glow: 0 10px 26px rgba(27, 87, 201, .16);
  --wash: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--wash), var(--bg); color: var(--text); font: 400 1rem/1.65 Body, system-ui, sans-serif; overflow-x: clip; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: Display, system-ui, sans-serif; line-height: 1.1; margin: 0; overflow-wrap: anywhere; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 11vw, 4.5rem); font-weight: 750; letter-spacing: -.025em; }
h2 { font-size: clamp(1.75rem, 7vw, 2.6rem); font-weight: 700; letter-spacing: -.015em; }
h3 { font-size: 1.25rem; font-weight: 650; }
h1:focus, h2:focus, main:focus { outline: none; }
p { margin: .75rem 0 0; overflow-wrap: anywhere; }
li, dd, dt { overflow-wrap: anywhere; }
a { color: var(--accent); }
code { font-family: Mono, ui-monospace, monospace; font-size: .85rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.prose, .lead { max-width: 62ch; }
.lead { color: var(--muted); font-size: 1.1rem; }
.meta { color: var(--muted); margin-top: .35rem; }
.meta em { display: inline-block; font-style: normal; font-size: .82rem; border: 1px solid var(--accent); color: var(--accent); border-radius: 99px; padding: 0 .6rem; margin-left: .6rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; top: -100px; left: 12px; z-index: 50; background: var(--accent); color: var(--on-accent); padding: .75rem 1rem; border-radius: 8px; }
.skip:focus { top: calc(12px + env(safe-area-inset-top)); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .6rem 1.25rem; border: 1.5px solid var(--accent); border-radius: 12px; background: var(--accent); color: var(--on-accent); font: 600 1rem/1.2 Body, system-ui, sans-serif; text-decoration: none; text-align: center; cursor: pointer; box-shadow: var(--glow); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: none; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- Navigation: a thumb bar on phones, a top bar on desktop ---------- */
.bar { position: fixed; z-index: 20; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 30px rgba(0, 0, 0, .22); }
.brand, .topnav { display: none; }
.hop { flex: 1; min-width: 0; order: 2; text-align: center; font: .78rem Mono, ui-monospace, monospace; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hop.ok { color: var(--ok); }
.menu-btn { order: 1; display: inline-flex; align-items: center; gap: .4rem; min-height: 52px; padding: 0 1rem; border: 0; border-radius: 13px; background: var(--raised); color: var(--text); font: 600 .95rem Body, system-ui, sans-serif; cursor: pointer; }
.menu-btn svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-btn { order: 3; position: relative; width: 52px; height: 52px; flex: none; border: 0; border-radius: 13px; background: var(--raised); color: var(--accent); padding: 2px; cursor: pointer; }
.theme-btn svg { width: 100%; height: 100%; fill: currentColor; }
.theme-btn .rays { stroke: currentColor; stroke-width: 3; stroke-linecap: round; transform-origin: 24px 24px; transition: transform .5s, opacity .3s; }
.theme-btn .orb { transform-origin: 24px 24px; transition: transform .5s cubic-bezier(.5, 1.6, .4, 1); }
.theme-btn .bite { transition: transform .5s cubic-bezier(.4, 0, .2, 1); }
.theme-btn .stars { opacity: 0; transform-origin: 24px 24px; transform: scale(.4) rotate(-40deg); transition: transform .5s, opacity .3s; }
[data-theme='dark'] .theme-btn .rays { opacity: 0; transform: rotate(90deg) scale(.4); }
[data-theme='dark'] .theme-btn .orb { transform: scale(1.4); }
[data-theme='dark'] .theme-btn .bite { transform: translate(-15px, 14px); }
[data-theme='dark'] .theme-btn .stars { opacity: 1; transform: none; }
.auto-badge { display: none; position: absolute; right: 3px; bottom: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 600 10px/16px Body, sans-serif; }
[data-pref='auto'] .auto-badge { display: block; }

#sheet { width: 100%; max-width: 520px; margin: auto auto 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-radius: 22px 22px 0 0; background: var(--surface); color: var(--text); max-height: 90dvh; }
#sheet::backdrop { background: rgba(3, 8, 18, .62); }
#sheet nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#sheet nav a { display: flex; align-items: center; min-height: 54px; padding: 0 1rem; border-radius: 12px; background: var(--raised); color: var(--text); text-decoration: none; font-weight: 600; }
#sheet nav a[aria-current] { box-shadow: inset 0 0 0 2px var(--accent); }
#sheet .close-sheet { width: 100%; }

.modes { border: 0; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.modes legend { padding: 0; margin-bottom: 6px; color: var(--muted); font-size: .9rem; }
.modes label { position: relative; }
.modes input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.modes span { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; pointer-events: none; }
.modes input:checked + span { border-color: var(--accent); background: var(--raised); font-weight: 600; }
.modes input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.theme-switching::view-transition-old(root), .theme-switching::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Layout and the request trace ---------- */
.sample-note { margin: 0; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--raised); border-bottom: 1px solid var(--line); font-size: .85rem; line-height: 1.4; text-align: center; }
.status { padding: 3rem 20px; text-align: center; }
#home { position: relative; max-width: 1100px; margin: 0 auto; }
.trace { position: absolute; top: 0; left: 4px; width: 28px; overflow: visible; pointer-events: none; }
.trace path { fill: none; stroke-width: 2; stroke-linejoin: round; }
.trace-base { stroke: var(--line); }
.trace-live { stroke: var(--accent); }
.trace-nodes circle { fill: var(--bg); stroke: var(--line); stroke-width: 2; }
.trace-nodes circle.done { stroke: var(--accent); fill: var(--accent); }
.packet .core { fill: var(--accent); }
.packet .halo { fill: var(--accent); opacity: .22; }
.trace.still .packet { display: none; }

#home > section { padding: 3.5rem 16px 3.5rem 40px; scroll-margin-top: 8px; }
.route { margin-top: .4rem; margin-bottom: 1.25rem; color: var(--muted); }
#home > #hero { min-height: min(84svh, 760px); display: flex; flex-direction: column; justify-content: center; padding-top: 2.5rem; }
.headline { font: 600 clamp(1.45rem, 6.2vw, 2.3rem)/1.2 Display, system-ui, sans-serif; max-width: 22ch; text-wrap: balance; }
.portrait { width: 112px; height: 112px; border-radius: 50%; overflow: hidden; margin-bottom: 1.25rem; border: 2px solid var(--accent); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.request { align-self: flex-start; max-width: 100%; display: grid; gap: .2rem; margin-top: 1.5rem; padding: .9rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px 12px 12px 4px; box-shadow: var(--glow); color: var(--muted); }
.request code { overflow-wrap: anywhere; }
.request span { color: var(--accent); }

.skills { margin: 0; display: grid; gap: 1.5rem; }
.skills dt { font-weight: 600; margin-bottom: .6rem; }
.skills dd { margin: 0; }
.chips { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: .45rem .85rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem; }
.timeline > li { border-top: 1px solid var(--line); padding-top: 1.25rem; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.5rem; }
.filters button { min-height: 48px; padding: 0 1.1rem; border: 1.5px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--text); font: 600 .95rem Body, system-ui, sans-serif; cursor: pointer; }
.filters button[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.card { display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .2s, transform .12s; }
.card:active { transform: scale(.985); }
.card:focus-visible { border-color: var(--accent); }
.stage { height: 230px; display: flex; align-items: center; justify-content: center; padding: 18px; background: var(--raised); }
.card-text { padding: 1rem 1.1rem 1.25rem; }

/* ---------- Device frames ---------- */
.frame { width: 100%; overflow: hidden; background: #101b31; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 28px rgba(0, 0, 0, .22); }
.screen { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.no-image { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; padding: 8px; text-align: center; color: #c3d1ea; font-size: .9rem; }
.chrome { display: flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; background: #263a5e; }
.chrome b { width: 7px; height: 7px; border-radius: 50%; background: #8ea4cc; }
.frame.dashboard { border-top: 3px solid var(--accent); }
.frame.dashboard .chrome b { border-radius: 2px; width: 16px; height: 5px; }
.frame.browser .chrome::after { content: ''; height: 10px; flex: 1; margin-left: 8px; border-radius: 99px; background: #101b31; }
.frame.phone { width: 100%; max-width: 240px; padding: 7px; border-radius: 30px; background: #02060e; border-color: #566a91; }
.frame.phone .screen { aspect-ratio: 420 / 860; border-radius: 23px; background: #101b31; }
.stage .frame { max-width: 300px; }
.stage .frame.phone { width: 96px; padding: 4px; border-radius: 18px; flex: none; }
.stage .frame.phone .screen { border-radius: 14px; }

.ok-line { margin: 0 0 1rem; }
.ok-line span { display: inline-block; margin-right: .5rem; padding: .2rem .75rem; border: 1.5px solid var(--ok); border-radius: 8px; color: var(--ok); font: .95rem Mono, ui-monospace, monospace; }
#home > #contact { min-height: 70svh; }
.contact-links { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 10px; max-width: 520px; }
.contact-links a { display: flex; flex-direction: column; justify-content: center; min-height: 64px; padding: .7rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; }
.contact-links span { color: var(--accent); }

/* ---------- Project details ---------- */
#detail { max-width: 900px; margin: 0 auto; padding: 1rem 16px 3rem; }
.back { display: inline-flex; align-items: center; min-height: 48px; margin-bottom: .75rem; }
.detail-cover { margin-top: 1.75rem; }
.detail-cover.phone { display: flex; justify-content: center; }
.notice { padding: 1rem; border: 1px dashed var(--accent); border-radius: 12px; }
.block { margin-top: 2.75rem; min-width: 0; }
.block h2 { font-size: 1.5rem; margin-bottom: .5rem; }
.bullets { padding-left: 1.2rem; max-width: 62ch; }
.bullets li { margin-top: .4rem; }
.bullets li::marker { color: var(--accent); }
.roles { display: grid; gap: 10px; margin: .75rem 0 0; }
.roles div { padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.roles dt { font-weight: 600; }
.roles dd { margin: 0; color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 1rem 0 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.25rem 3rem; min-height: 52px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -3px; width: 32px; height: 32px; display: grid; place-items: center; border: 1.5px solid var(--accent); border-radius: 50%; font-weight: 600; }
.steps li:not(:last-child)::after { content: ''; position: absolute; left: 15.5px; top: 32px; bottom: 5px; width: 1.5px; background: var(--line); }
.layers { list-style: none; padding: 0; margin: .75rem 0 0; }
.layers > li { position: relative; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.layers > li + li { margin-top: 28px; }
.layers > li + li::before { content: ''; position: absolute; left: 50%; top: -29px; height: 28px; width: 2px; background: var(--accent); }
.layers h3 { font-size: 1.05rem; }
.layers .chips li { background: var(--raised); }

.gallery { min-width: 0; }
.track { list-style: none; margin: .75rem 0 0; padding: 4px 4px 16px; display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scroll-padding-inline: 4px; }
.track > li { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }
.track figure { margin: 0; }
.track figcaption { margin-top: .6rem; text-align: center; color: var(--muted); font-size: .9rem; }
.phones .track > li { flex-basis: min(72%, 240px); }
.mixed .frame.phone { margin: 0 auto; }
.phones .track > li:only-child { margin: 0 auto; }
.gallery-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.pager { display: grid; gap: 10px; margin-top: 3.5rem; }
.pager a { display: flex; flex-direction: column; min-height: 68px; padding: .8rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; }
.pager span { color: var(--muted); font-size: .85rem; }

.foot { max-width: 420px; margin: 2rem auto 0; padding: 0 16px 1.5rem; text-align: center; }
.foot legend { margin-inline: auto; }

@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager a[rel='next'] { text-align: right; }
}

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .bar { position: sticky; top: 0; left: 0; right: 0; bottom: auto; border-width: 0 0 1px; border-radius: 0; padding: 10px max(24px, calc((100% - 1100px) / 2)); box-shadow: none; background: var(--bg); }
  .brand { display: block; margin-right: auto; font: 750 1.35rem Display, system-ui, sans-serif; color: var(--text); text-decoration: none; }
  .topnav { display: flex; gap: 2px; }
  .topnav a { display: flex; align-items: center; min-height: 44px; padding: 0 .75rem; border-radius: 10px; color: var(--muted); text-decoration: none; }
  .topnav a[aria-current] { color: var(--text); background: var(--raised); }
  .hop { flex: none; width: 150px; order: 0; }
  .menu-btn { display: none; }
  .theme-btn { order: 0; width: 46px; height: 46px; }
  .on-detail .topnav a[aria-current] { color: var(--muted); background: none; }
  .sample-note { padding-top: 10px; }
  .trace { left: 24px; width: 48px; }
  #home > section { padding: 6rem 32px 6rem 112px; scroll-margin-top: 70px; }
  .cards { gap: 24px; }
  .track > li { flex-basis: 100%; }
  .phones .track > li { flex-basis: 240px; }
}
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Hover is only an extra on devices that have it. */
@media (hover: hover) {
  .card:hover { border-color: var(--accent); }
  .contact-links a:hover, .pager a:hover, .btn.ghost:hover { border-color: var(--accent); }
}
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .packet .halo { animation: pulse 2s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: .08; r: 17px; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Motion and polish ---------- */
#home > #hero { position: relative; isolation: isolate; }
.ambient { position: fixed; top: 0; left: 0; width: 100%; height: 100lvh; z-index: -1; pointer-events: none; }
@media (min-width: 900px) { .ambient { opacity: .75; } }
#hero h1 { font-size: clamp(4.2rem, 23vw, 9rem); line-height: .95; letter-spacing: -.045em; }
.letter { display: inline-block; }
.trace .trace-comet { stroke: var(--accent); stroke-width: 6; stroke-linecap: round; opacity: .45; }
.trace.still .trace-comet, .trace .trace-comet:not([style]) { display: none; }
.trace .ping { fill: none; stroke: var(--accent); stroke-width: 2; }
.bar::after { content: ''; position: absolute; left: 18px; right: 18px; bottom: -1px; height: 2px; background: var(--accent); transform: scaleX(var(--progress, 0)); transform-origin: left; }
.on-detail .bar::after { display: none; }
@media (min-width: 900px) { .bar::after { left: 0; right: 0; } }
.ok-line { position: relative; }
.ok-line span { display: block; width: fit-content; font-size: 1.6rem; padding: .35rem 1rem; box-shadow: 0 0 26px color-mix(in srgb, var(--ok) 30%, transparent); margin-bottom: .5rem; }
.burst { position: absolute; width: 0; height: 0; pointer-events: none; }
.burst b { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.burst s { position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border: 2px solid var(--ok); border-radius: 50%; opacity: 0; }
.contact-links, #contact .lead { position: relative; }
@media (prefers-reduced-motion: no-preference) {
  .request { position: relative; overflow: hidden; }
  .request::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 40%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: sweep 2.8s linear infinite; }
  .layers > li + li::after { content: ''; position: absolute; left: calc(50% - 3px); top: -29px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: var(--glow); animation: drop 1.6s ease-in infinite; }
  .steps li:not(:last-child)::after { background: linear-gradient(var(--line) 40%, var(--accent) 50%, var(--line) 60%) 0 0 / 100% 300%; animation: flow 2s linear infinite; }
  .stage .frame { animation: float 6s ease-in-out infinite; }
  .cards > li:nth-child(even) .stage .frame { animation-delay: -3s; }
  @keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
  @keyframes drop { from { transform: translateY(0); opacity: 1; } to { transform: translateY(22px); opacity: 0; } }
  @keyframes flow { from { background-position: 0 100%; } to { background-position: 0 0; } }
  @keyframes float { 50% { transform: translateY(-7px); } }
}
#home, #detail { overflow-x: clip; }
#home { overflow-clip-margin: 0px; }

/* ---------- Content blocks ---------- */
.sub { margin-top: 3rem; }
.sub > h3 { font-size: 1.4rem; margin-bottom: 1rem; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.tiles li { padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tiles h4 { margin: 0; font: 700 1.1rem/1.25 Display, system-ui, sans-serif; }
.tiles p { margin-top: .4rem; color: var(--muted); }
.process p { margin-top: .2rem; color: var(--muted); max-width: 55ch; }
.faq { border-top: 1px solid var(--line); max-width: 640px; }
.faq summary { min-height: 52px; padding: .85rem 0; cursor: pointer; font-weight: 600; }
.faq summary::marker { color: var(--accent); }
.faq p { margin: 0 0 1rem; color: var(--muted); }
@media (min-width: 640px) { .tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- API console ---------- */
.console { margin-bottom: 2.5rem; padding: 1.1rem; border: 1px solid var(--accent); border-radius: 18px; background: var(--surface); box-shadow: var(--glow); min-width: 0; }
.console h2 { font-size: 1.5rem; }
.console p { color: var(--muted); margin-top: .35rem; }
.endpoints { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 1rem 0 0; }
.endpoints button { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: .15rem; min-height: 60px; padding: .55rem .9rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--raised); color: var(--text); text-align: left; cursor: pointer; }
.endpoints span { font: 600 1rem/1.3 Body, system-ui, sans-serif; }
.endpoints code { font-size: .75rem; color: var(--muted); }
.endpoints button[aria-pressed='true'] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.endpoints button[aria-pressed='true'] code { color: var(--on-accent); }
.response { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg); }
.flight { position: relative; height: 3px; background: var(--line); overflow: hidden; }
.flight i { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.sending .flight i { animation: travel .75s ease-in-out forwards; }
.arrived .flight i { transform: none; background: var(--ok); }
.response-bar { display: flex; justify-content: space-between; gap: 8px; padding: .6rem .85rem; background: var(--raised); }
.response-bar .code { color: var(--muted); white-space: nowrap; }
.arrived .response-bar .code { color: var(--ok); }
.answer { padding: 1rem; }
.answer h3 { font-size: 1.15rem; }
.answer .chips + h3 { margin-top: 1rem; }
.answer .chips li.open { border: 1px dashed var(--muted); }
.who { display: flex; align-items: center; gap: .9rem; }
.who p { margin: 0; }
.avatar { flex: none; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 750 1.7rem Display, system-ui, sans-serif; }
.console .sample-tag { margin: 0 0 .75rem; font-size: .82rem; }
.mini-line { list-style: none; margin: 0; padding: 0; }
.mini-line li { position: relative; padding: 0 0 1rem 1.5rem; }
.mini-line li::before { content: ''; position: absolute; left: 0; top: .45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.mini-line li:not(:last-child)::after { content: ''; position: absolute; left: 4px; top: 1.2rem; bottom: -.35rem; width: 2px; background: var(--line); }
.mini-line strong, .mini-line span, .mini-projects strong, .mini-projects span span { display: block; }
.mini-line span, .mini-projects span span { color: var(--muted); font-size: .9rem; }
.mini-projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mini-projects a { display: flex; align-items: center; gap: .75rem; min-height: 64px; padding: .5rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; }
.thumb { flex: none; width: 66px; height: 46px; border-radius: 7px; overflow: hidden; background: #101b31; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.more { display: inline-flex; align-items: center; min-height: 48px; }
.arrived .answer > * { animation: land .45s both; }
.arrived .answer > :nth-child(2) { animation-delay: .08s; }
.arrived .answer > :nth-child(3) { animation-delay: .16s; }
.arrived .answer > :nth-child(n+4) { animation-delay: .24s; }
.response pre { margin: 0; max-height: 300px; overflow: auto; padding: .85rem; background: #040a16; color: #d5e2f7; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.response pre b { font-weight: 400; color: #37e0ff; }
.view-json { width: 100%; min-height: 48px; border: 0; border-top: 1px solid var(--line); background: var(--surface); color: var(--accent); font: 600 .95rem Body, system-ui, sans-serif; cursor: pointer; }
@keyframes travel { to { transform: scaleX(1); } }
@keyframes land { from { opacity: 0; transform: translateY(14px); } }
@media (min-width: 640px) { .endpoints { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Technology stack as a system ---------- */
.stack-map { margin-bottom: 2.5rem; }
.stack-map ol { list-style: none; margin: 1rem 0 0; padding: 0; }
.tier { position: relative; padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.tier + .tier { margin-top: 26px; }
.tier + .tier::before { content: ''; position: absolute; left: 50%; top: -27px; width: 2px; height: 26px; background: var(--line); }
.tier h3 { font-size: 1.05rem; margin-bottom: .75rem; }
.tier.hit { border-color: var(--accent); animation: hit .7s var(--delay) both; }
.tier.hit + .tier.hit::before { background: var(--accent); }
.nodes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.node { min-height: 52px; padding: .5rem; border: 1.5px solid var(--accent); border-radius: 10px; background: var(--raised); color: var(--text); font: 600 .95rem Body, system-ui, sans-serif; cursor: pointer; }
.node.open { border: 1.5px dashed var(--muted); font-weight: 400; }
.node[aria-pressed='true'] { background: var(--accent); color: var(--on-accent); border-style: solid; border-color: var(--accent); }
.legend { color: var(--muted); font-size: .85rem; }
.key { display: inline-block; width: 22px; height: 14px; margin-right: .5rem; border: 1.5px dashed var(--muted); border-radius: 4px; vertical-align: -2px; }
.inspector { position: sticky; bottom: calc(86px + env(safe-area-inset-bottom)); min-height: 92px; margin-top: 12px; padding: .8rem 1rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; background: var(--raised); }
.inspector p { margin-top: .2rem; color: var(--muted); font-size: .92rem; }
@media (min-width: 640px) { .nodes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) { .inspector { bottom: 16px; } }
@keyframes hit { 40% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 40%, transparent), var(--glow); } }

/* ---------- Career as a version history ---------- */
.career { list-style: none; margin: 0; padding: 0; }
.career > li { position: relative; padding: 0 0 14px 28px; }
.career > li::before { content: ''; position: absolute; left: 5px; top: 30px; bottom: -26px; width: 2px; background: var(--line); }
.career > li:last-child::before { display: none; }
.career > li::after { content: ''; position: absolute; left: 0; top: 22px; width: 12px; height: 12px; border: 2px solid var(--accent); border-radius: 50%; background: var(--bg); }
.career > li.now::after { background: var(--accent); box-shadow: var(--glow); }
.career details { padding: .25rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.career details[open] { border-color: var(--accent); padding-bottom: 1rem; }
.career summary { position: relative; display: block; list-style: none; padding: .7rem 2rem .7rem 0; cursor: pointer; }
.career summary::-webkit-details-marker { display: none; }
.career summary::after { content: '+'; position: absolute; right: 0; top: 50%; translate: 0 -50%; font-size: 1.6rem; color: var(--accent); }
.career details[open] summary::after { content: '−'; }
.career summary h3, .career summary span { display: block; }
.career .version { font: .8rem Mono, ui-monospace, monospace; color: var(--accent); margin-bottom: .25rem; }
.career .version em { font-style: normal; margin-left: .6rem; color: var(--ok); }
.career summary .meta { font-size: .92rem; }
@media (prefers-reduced-motion: reduce) { .tier.hit { animation: none !important; } }
.brand { align-items: center; min-height: 44px; }
@media (min-width: 900px) { .brand { display: flex; } }

/* A text cursor blinks beside the section you have reached. */
@media (prefers-reduced-motion: no-preference) {
  section.reached > h2::after { content: ''; display: inline-block; width: .45em; height: .09em; margin-left: .18em; background: var(--accent); animation: caret 1s steps(1) infinite; }
  @keyframes caret { 50% { opacity: 0; } }
}


/* ---------- Technology icons ---------- */
.icon { display: inline-block; flex: none; width: 1.25em; height: 1.25em; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.node { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; min-height: 84px; }
.node .icon { width: 30px; height: 30px; color: var(--accent); }
.node.open .icon { color: var(--muted); }
.node[aria-pressed='true'] .icon { color: var(--on-accent); }
.answer .chips li { display: flex; align-items: center; gap: .45rem; }
.answer .chips .icon { color: var(--accent); }
.answer .chips li.open .icon { color: var(--muted); }

/* ---------- Smooth scrolling on phones ---------- */
.trace.light .trace-live, .trace.light .trace-comet, .trace.light .packet { display: none; }
.rail-live, .rail-dot { position: absolute; pointer-events: none; will-change: transform; }
.rail-live { width: 2px; margin-left: -1px; background: var(--accent); transform: scaleY(0); transform-origin: top; }
.rail-dot { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent); }
@media (min-width: 900px) { .rail-live, .rail-dot { display: none; } }
@media (max-width: 899px) {
  .ambient { opacity: .85; will-change: transform; }
  .stage .frame { animation: none !important; box-shadow: none; }
  .bar { box-shadow: none; }
}

.career .logo { width: 48px; height: 48px; object-fit: contain; padding: 5px; margin-bottom: .6rem; border-radius: 12px; background: #000; border: 1px solid var(--line); }
.career .logo.on-light { background: #fff; }

/* Calmer background and clearer text */
.ambient { opacity: .42; }
.ambient[data-scene="net"] { opacity: .7; }
:is(#home, #detail) :is(h1, h2, h3, .route, .prose, .lead, .headline, .meta) { text-shadow: 0 0 6px var(--bg), 0 0 12px var(--bg), 0 0 20px var(--bg); }
.inspector { position: static; min-height: 0; margin-top: .75rem; }
.inspector[hidden] { display: none; }
.roles-line { margin: 1rem 0 0; }
#about .console { margin-top: 2.5rem; }
#hero .request { margin-top: 2rem; }
.career .logo { width: auto; min-width: 48px; max-width: 150px; padding: 8px 10px; }
.name-cover { display: grid; place-items: center; width: 100%; height: 100%; min-height: 140px; padding: 1rem; text-align: center; font-family: Display, system-ui, sans-serif; font-size: 1.15rem; font-weight: 700; color: var(--accent); background: var(--raised); }

/* Project cards and first-screen links */
.card.text-only { border-left: 3px solid var(--accent); }
.card.text-only .card-text { padding-top: 1.25rem; }
.my-role { margin-top: .75rem; }
.open-project { display: inline-block; margin-top: .85rem; color: var(--accent); font-weight: 600; }
.hero-links { list-style: none; display: flex; gap: 1.5rem; margin: .75rem 0 0; padding: 0; }
.hero-links a { display: inline-flex; align-items: center; min-height: 48px; color: var(--accent); font-weight: 600; text-underline-offset: 4px; }
.career li.bare summary { pointer-events: none; cursor: default; }
.career li.bare summary::after { content: none; }
@media (max-width: 430px) { .filters { gap: 6px; } .filters button { padding: 0 .7rem; font-size: .85rem; } .stage { height: 200px; } }
@media (max-width: 430px) { .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ambient[data-scene="terminal"] { opacity: .22; }

/* No text halo inside cards or on the large name: it showed as dark smudges */
:is(#home, #detail) :is(.card, .career details, .console, .tiles li, .tier, .inspector) :is(h2, h3, h4, .meta, .prose, .lead, .route, .headline) { text-shadow: none; }
#home #hero h1, #home #hero h1 * { text-shadow: none; }
.career .no-image { color: var(--muted); }
:root[data-theme='light'] { --line: #d3c9b5; }
