:root {
  --bg: #FAF6EE;
  --bg-2: #F2ECDF;
  --ink: #16161D;
  --ink-2: #55545E;
  --blue: #1F3BFF;
  --orange: #FF5A1F;
  --lime: #C6FF3D;
  --line: rgba(22, 22, 29, .12);
  --card: #FFFFFF;
  --shadow: 0 1px 0 rgba(22,22,29,.06), 0 18px 40px -24px rgba(31,59,255,.35);
  --serif: "Instrument Serif", "Fraunces", Georgia, serif;
  --sans: "Inter Tight", system-ui, -apple-system, Segoe UI, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --radius: 22px;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0D0E1A;
  --bg-2: #151732;
  --ink: #F4F1EA;
  --ink-2: #A9A8B8;
  --blue: #7C8CFF;
  --orange: #FF6B35;
  --line: rgba(244, 241, 234, .12);
  --card: #171930;
  --shadow: 0 1px 0 rgba(255,255,255,.04), 0 18px 40px -20px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .4s, color .4s;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.mono { font-family: var(--mono); font-size: .8em; }
::selection { background: var(--lime); color: #16161D; }

/* ---------- typography ---------- */
.display {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--blue);
  font-size: clamp(2.6rem, 6.4vw, 5.4rem);
  line-height: .98;
  letter-spacing: -.02em;
  max-width: 16ch;
}
.display em { font-style: italic; color: var(--ink); }
.display.big { font-size: clamp(3rem, 9vw, 8rem); max-width: 14ch; }
.eyebrow {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex; align-items: center; gap: .55rem;
  margin-bottom: 1.2rem;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: inline-block; box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 20%, transparent); }
.sub { color: var(--ink-2); max-width: 56ch; margin-top: 1.2rem; }

/* ---------- pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px;
  font-weight: 600; font-size: .95rem;
  transition: transform .25s cubic-bezier(.3,1.6,.5,1), box-shadow .25s, background .25s;
  white-space: nowrap;
}
.pill:hover { transform: translateY(-3px) rotate(-1.5deg); }
.pill-orange { background: var(--orange); color: #fff; box-shadow: 0 10px 24px -12px var(--orange); font-family: var(--serif); font-style: italic; font-size: 1.1rem; font-weight: 400; }
.pill-blue { background: var(--blue); color: #fff; box-shadow: 0 10px 24px -12px var(--blue); }
.pill-ghost { border: 1.5px solid var(--ink); }
.pill-ghost:hover { background: var(--ink); color: var(--bg); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .4s;
}
.nav.scrolled { border-color: var(--line); }
.brand { font-family: var(--serif); font-size: 1.55rem; color: var(--blue); letter-spacing: -.01em; }
.brand sup { font-family: var(--sans); font-size: .55rem; font-weight: 700; margin-left: 2px; vertical-align: super; }
.nav-links { display: flex; gap: 2.2rem; font-size: .95rem; }
.nav-links a { position: relative; padding: .2rem 0; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px; background: var(--blue); transition: right .3s; }
.nav-links a:hover::after, .nav-links a.active::after { right: 0; }
.nav-links a.active { color: var(--blue); }
.nav-right { display: flex; align-items: center; gap: .8rem; }
.theme-toggle { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 1.05rem; transition: transform .5s; }
.theme-toggle:hover { transform: rotate(180deg); }
.theme-toggle .moon, [data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: inline; }
.burger { display: none; width: 42px; height: 42px; position: relative; }
.burger span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); transition: transform .3s, top .3s; }
.burger span:first-child { top: 16px; } .burger span:last-child { top: 24px; }
.burger[aria-expanded="true"] span:first-child { top: 20px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 20px; transform: rotate(-45deg); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(3rem, 7vw, 6rem) var(--gutter) clamp(3rem, 6vw, 5rem);
  min-height: calc(100vh - 80px);
}
.hero .display { font-size: clamp(3.2rem, 8.2vw, 7.4rem); max-width: none; }
.cycle { display: inline-block; color: var(--orange) !important; white-space: nowrap; }
.caret { font-style: normal; color: var(--blue); animation: blink 1s steps(1) infinite; font-size: .7em; margin-left: .05em; vertical-align: .08em; }
@keyframes blink { 50% { opacity: 0; } }
.bio { margin-top: 1.8rem; max-width: 50ch; font-size: 1.12rem; color: var(--ink-2); min-height: 5.4em; transition: color .3s; }
.bio.hot { color: var(--ink); }
.bio .w { display: inline-block; transition: transform .3s; }

.temp { margin-top: 1.4rem; max-width: 420px; padding: 1rem 1.2rem; border: 1px dashed var(--line); border-radius: 16px; background: color-mix(in srgb, var(--card) 50%, transparent); }
.temp label { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); }
.temp label b { color: var(--blue); }
.temp input { width: 100%; margin: .5rem 0 .2rem; accent-color: var(--orange); }
.temp-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .68rem; color: var(--ink-2); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

.hero-visual { position: relative; display: flex; flex-direction: column; align-items: center; }
.avatar-card {
  position: relative; width: min(100%, 420px); aspect-ratio: 4/5;
  border-radius: 28px; background: var(--blue);
  box-shadow: var(--shadow);
  transform-style: preserve-3d; transition: transform .2s ease-out;
  overflow: visible;
}
.avatar { position: absolute; inset: 0; border-radius: 28px; overflow: hidden; display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(198,255,61,.55), transparent 40%),
    radial-gradient(circle at 80% 85%, rgba(255,90,31,.8), transparent 45%),
    linear-gradient(160deg, #1F3BFF, #0A1A9E);
}
.avatar-initials { font-family: var(--serif); font-style: italic; font-size: clamp(7rem, 16vw, 11rem); color: #FAF6EE; line-height: 1; transform: translateZ(40px); text-shadow: 0 20px 40px rgba(0,0,0,.25); }
.avatar-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(circle at center, #000 30%, transparent 75%); }
.avatar-meta { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; justify-content: space-between; align-items: center; color: #FAF6EE; z-index: 2; }
.status { white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem; background: rgba(0,0,0,.35); padding: .3rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%{ box-shadow: 0 0 0 0 rgba(198,255,61,.7);} 100%{ box-shadow: 0 0 0 10px rgba(198,255,61,0);} }
.bbox { position: absolute; border: 2.5px solid var(--lime); border-radius: 6px; z-index: 3; animation: bbox 4s ease-in-out infinite; }
.bbox span { position: absolute; top: -1.55rem; left: -2.5px; background: var(--lime); color: #16161D; font-family: var(--mono); font-size: .7rem; font-weight: 600; padding: .1rem .45rem; border-radius: 4px 4px 4px 0; white-space: nowrap; }
.bbox-face { top: 22%; left: 18%; width: 64%; height: 46%; }
.bbox-coffee { top: 72%; right: -6%; width: 30%; height: 18%; border-color: var(--orange); animation-delay: -2s; }
.bbox-coffee span { background: var(--orange); color: #fff; }
@keyframes bbox { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(4px,-6px) scale(1.03); } }
.hero-note { margin-top: 1.2rem; font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--ink-2); }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); background: var(--ink); color: var(--bg); padding: 1.1rem 0; transform: rotate(-1.5deg) scale(1.02); margin: 2rem 0; }
.marquee-track { display: flex; gap: 2.5rem; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 2.2rem); white-space: nowrap; display: flex; align-items: center; gap: 2.5rem; }
.marquee span::after { content: "✦"; color: var(--lime); font-size: .7em; }
.marquee span:nth-child(3n) { font-style: italic; color: var(--lime); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: clamp(4.5rem, 10vw, 8rem) var(--gutter); max-width: 1320px; margin: 0 auto; }

.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 6vw, 6rem); margin-top: 3rem; }
.about-copy p { color: var(--ink-2); margin-bottom: 1.2rem; max-width: 52ch; }
.about-copy .lead { font-family: var(--serif); font-size: clamp(1.6rem, 2.8vw, 2.3rem); line-height: 1.2; color: var(--ink); }
.attn { font-family: var(--mono); font-size: .75rem !important; color: var(--orange) !important; }
.attn-text .tok { cursor: default; border-radius: 6px; padding: 0 .08em; transition: background .25s, color .25s; }
.attn-text .tok.src { background: var(--blue); color: #fff; }
.timeline { list-style: none; position: relative; }
.timeline::before { content: ""; position: absolute; left: 3.1rem; top: .6rem; bottom: .6rem; width: 2px; background: repeating-linear-gradient(var(--line) 0 6px, transparent 6px 12px); }
.timeline li { display: grid; grid-template-columns: 4.6rem 1fr; gap: 1.2rem; padding: 1rem 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: calc(3.1rem - 5px); top: 1.55rem; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2.5px solid var(--blue); }
.timeline li.now::before { background: var(--orange); border-color: var(--orange); animation: pulse 1.6s infinite; }
.t-year { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); padding-top: .25rem; }
.timeline b { display: block; font-weight: 600; }
.timeline div span { color: var(--ink-2); font-size: .92rem; }

/* numbers */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 3rem; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--bg); padding: 2rem 1.6rem; transition: background .3s; }
.stat:hover { background: var(--lime); color: #16161D; }
.stat:hover p { color: #16161D; }
.stat-num { font-family: var(--serif); font-size: clamp(3rem, 6vw, 5rem); line-height: 1; color: var(--blue); }
.stat:hover .stat-num { color: #16161D; }
.stat-num small { font-size: .4em; margin-left: .1em; }
.stat p { color: var(--ink-2); margin-top: .6rem; font-size: .95rem; }

/* experience */
.job { margin-top: 3rem; padding: clamp(1.4rem, 3vw, 2.4rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.job header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: 1.2rem; }
.job h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.1; }
.job-role { color: var(--ink-2); font-size: .95rem; }
.job-date { background: var(--bg-2); padding: .35rem .8rem; border-radius: 999px; }
.job ul { list-style: none; display: grid; gap: .7rem; }
.job li { padding-left: 1.6rem; position: relative; color: var(--ink-2); }
.job li::before { content: "→"; position: absolute; left: 0; color: var(--orange); }
.job li b { color: var(--ink); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.2rem; }
.tags span { font-family: var(--mono); font-size: .72rem; padding: .25rem .6rem; border-radius: 6px; background: var(--bg-2); color: var(--ink-2); }
.flip-hint { font-family: var(--mono); font-size: .75rem; color: var(--orange); margin-bottom: 1rem; }
.flips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.flip { perspective: 1000px; height: 260px; text-align: left; }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .7s cubic-bezier(.3,1.4,.5,1); transform-style: preserve-3d; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back { position: absolute; inset: 0; border-radius: 18px; padding: 1.3rem; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; }
.flip-front { background: var(--blue); color: #fff; justify-content: space-between; }
.flip:nth-child(2) .flip-front { background: var(--orange); }
.flip:nth-child(3) .flip-front { background: var(--ink); color: var(--bg); }
.flip:nth-child(4) .flip-front { background: var(--lime); color: #16161D; }
.flip-front h4 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; line-height: 1.05; }
.flip-icon { font-size: 2rem; }
.flip-metric { font-family: var(--mono); font-size: .75rem; opacity: .85; }
.flip-back { background: var(--bg-2); transform: rotateY(180deg); justify-content: space-between; font-size: .92rem; color: var(--ink-2); }
.flip-back .tags { margin-top: .6rem; }
.flip-back .tags span { background: var(--card); }
.flip:hover .flip-inner { transform: rotateY(8deg); }
.flip.flipped:hover .flip-inner { transform: rotateY(172deg); }

/* projects / embedding map */
.map-wrap { margin-top: 2.5rem; border: 1px solid var(--line); border-radius: var(--radius); background:
  radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 26px 26px, var(--card); position: relative; overflow: hidden; }
.map { position: relative; height: clamp(360px, 48vw, 520px); }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map line { stroke: var(--blue); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: 0; transition: opacity .25s; }
.map line.on { opacity: .8; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -16; } }
.node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: .35rem; transition: transform .3s cubic-bezier(.3,1.6,.5,1), opacity .3s; animation: float 6s ease-in-out infinite; }
.node .pt { width: 18px; height: 18px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 6px color-mix(in srgb, var(--blue) 18%, transparent); transition: transform .3s; }
.node.work .pt { background: var(--orange); box-shadow: 0 0 0 6px color-mix(in srgb, var(--orange) 18%, transparent); }
.node .nlabel { font-family: var(--mono); font-size: .72rem; background: var(--bg); border: 1px solid var(--line); padding: .15rem .5rem; border-radius: 6px; white-space: nowrap; }
.node:hover, .node:focus-visible, .node.near { z-index: 2; }
.node:hover .pt, .node:focus-visible .pt { transform: scale(1.5); }
.node.near .pt { transform: scale(1.25); }
.node .sim { font-family: var(--mono); font-size: .65rem; color: var(--blue); opacity: 0; transition: opacity .2s; }
.node.near .sim { opacity: 1; }
.map.hovering .node:not(.near):not(:hover):not(:focus-visible) { opacity: .3; }
@keyframes float { 0%,100% { margin-top: 0; } 50% { margin-top: -8px; } }
.map-legend { position: absolute; left: 1rem; bottom: .8rem; display: flex; gap: 1rem; font-family: var(--mono); font-size: .72rem; color: var(--ink-2); }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .35rem; vertical-align: -1px; }
.lg-blue { background: var(--blue); } .lg-orange { background: var(--orange); }

.project-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 1.5rem; }
.pcard { position: relative; padding: 1.8rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; transition: transform .35s cubic-bezier(.3,1.6,.5,1), box-shadow .3s; }
.pcard:hover { transform: translateY(-6px) rotate(-.6deg); box-shadow: var(--shadow); }
.pcard.flash { animation: flash 1.2s; }
@keyframes flash { 0%,100% { box-shadow: none; } 30% { box-shadow: 0 0 0 4px var(--lime); } }
.pcard-no { color: var(--orange); }
.pcard h3 { font-family: var(--serif); font-weight: 400; font-size: 1.75rem; line-height: 1.1; margin: .6rem 0 .8rem; }
.pcard p { color: var(--ink-2); font-size: .95rem; flex: 1; }
.plink { margin-top: 1.2rem; font-weight: 600; color: var(--blue); }
.plink:hover { text-decoration: underline; }

.pcard-img { width: calc(100% + 3.6rem); margin: -1.8rem -1.8rem 1.2rem; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; display: block; background: var(--bg-2); }
.plinks { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1.2rem; }
.plinks .plink { margin-top: 0; }
[hidden] { display: none !important; }

/* skills footnote */
.also-ships { margin-top: 2rem; color: var(--ink-2); font-size: .95rem; }
.also-ships .mono { color: var(--orange); margin-right: .4rem; }
.also-ships a { color: var(--blue); font-weight: 600; margin-left: .6rem; }

/* ---------- side quests: phones ---------- */
.quests { position: relative; }
.quests::before { content: "LVL UP"; position: absolute; right: var(--gutter); top: clamp(4rem, 9vw, 7rem); font-family: var(--mono); font-weight: 600; font-size: .7rem; letter-spacing: .2em; color: var(--bg); background: var(--ink); padding: .35rem .7rem; border-radius: 6px; transform: rotate(6deg); }
.phones { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem); margin-top: 3rem; }
.quest { display: flex; flex-direction: column; align-items: center; text-align: center; }
.phone {
  position: relative; width: min(230px, 70vw); aspect-ratio: 390 / 844; padding: 10px;
  border-radius: 40px; background: #0E0F1C;
  box-shadow: 0 0 0 2px #2A2C45 inset, 0 30px 60px -28px rgba(31,59,255,.55), 0 10px 20px -10px rgba(0,0,0,.4);
  transform: rotate(var(--tilt, 0deg));
  transition: transform .5s cubic-bezier(.3,1.5,.5,1), box-shadow .3s;
}
.phone:hover, .phone:focus-visible { transform: rotate(0deg) translateY(-12px) scale(1.04); box-shadow: 0 0 0 2px #2A2C45 inset, 0 40px 70px -24px rgba(255,90,31,.55), 0 10px 20px -10px rgba(0,0,0,.4); }
.phone:focus-visible { outline: 3px solid var(--lime); outline-offset: 4px; }
.phone-notch { position: absolute; top: 18px; left: 50%; width: 64px; height: 18px; margin-left: -32px; border-radius: 999px; background: #000; z-index: 3; }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 31px; overflow: hidden; background: #111; }
.phone-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity .45s, transform .6s; }
.phone-screen img.on { opacity: 1; transform: none; }
.phone-dots { position: absolute; bottom: -22px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.phone-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background .3s, width .3s; }
.phone-dots i.on { background: var(--orange); width: 16px; border-radius: 3px; }
/* placeholder app screen */
.ph-ui { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 34px 18px 18px; color: #fff; }
.ph-status { position: absolute; top: 10px; left: 20px; right: 20px; display: flex; justify-content: space-between; font: 600 .62rem var(--sans); opacity: .85; }
.ph-icon { margin-top: 26%; width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center; font-size: 2.4rem; background: rgba(255,255,255,.16); box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: bob 3s ease-in-out infinite; }
.ph-name { margin-top: .9rem; font-family: var(--serif); font-size: 1.5rem; line-height: 1.05; }
.ph-sk { margin-top: auto; width: 100%; display: grid; gap: 8px; }
.ph-sk i { height: 34px; border-radius: 10px; background: linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,.28), rgba(255,255,255,.12)); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.ph-sk i:nth-child(2) { width: 82%; } .ph-sk i:nth-child(3) { width: 64%; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes shimmer { to { background-position: -200% 0; } }

.quest-info { margin-top: 2.2rem; max-width: 300px; }
.quest-meta { color: var(--orange); font-size: .7rem !important; letter-spacing: .04em; }
.quest-info h3 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; line-height: 1.1; margin: .35rem 0 .5rem; }
.quest-desc { color: var(--ink-2); font-size: .92rem; }
.quest-info .tags, .quest-info .plinks { justify-content: center; }
.apps-more { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem; margin-top: 3rem; }
.apps-more .mono { color: var(--ink-2); }
.app-pill { padding: .5rem 1rem; border-radius: 999px; border: 1.5px dashed var(--ink); font-weight: 500; font-size: .9rem; transition: transform .25s cubic-bezier(.3,1.8,.5,1), background .2s, color .2s; }
.app-pill:hover { background: var(--ink); color: var(--bg); border-style: solid; transform: translateY(-3px) rotate(-2deg); }
.modal.is-app .modal-gallery img { width: auto !important; height: 420px; max-height: 60vh; object-fit: contain; background: #0E0F1C; }

/* uploaded portrait */
.avatar-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.has-photo .avatar-initials, .avatar.has-photo .avatar-grid { display: none; }
.avatar.has-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(10,16,80,.65)); }
.status.busy i { background: var(--orange); animation: none; }

/* skills */
.skill-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem 3rem; margin-top: 3rem; }
.sg h4 { font-family: var(--mono); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin-bottom: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips span { padding: .45rem .9rem; border: 1.5px solid var(--ink); border-radius: 999px; font-size: .9rem; font-weight: 500; transition: transform .25s cubic-bezier(.3,1.8,.5,1), background .2s, color .2s; cursor: default; user-select: none; }
.chips span:hover { background: var(--blue); border-color: var(--blue); color: #fff; transform: translateY(-3px) rotate(-3deg); }
.chips span.pop { animation: pop .5s; }
@keyframes pop { 40% { transform: scale(1.25) rotate(6deg); background: var(--lime); color: #16161D; } }

/* terminal */
.terminal { margin-top: 2.5rem; border-radius: 18px; overflow: hidden; background: #0E0F1C; color: #E8E6F0; font-family: var(--mono); font-size: .9rem; box-shadow: 0 30px 60px -30px rgba(31,59,255,.6); max-width: 820px; }
.term-bar { display: flex; align-items: center; gap: .45rem; padding: .7rem 1rem; background: #1A1C33; }
.term-bar i { width: 12px; height: 12px; border-radius: 50%; background: #FF5F57; }
.term-bar i:nth-child(2) { background: #FEBC2E; } .term-bar i:nth-child(3) { background: #28C840; }
.term-bar span { margin-left: .8rem; color: #8A89A0; font-size: .78rem; }
.term-body { padding: 1rem 1.2rem 0; max-height: 300px; overflow-y: auto; }
.term-body p { margin-bottom: .35rem; white-space: pre-wrap; word-break: break-word; }
.term-body .muted { color: #8A89A0; }
.term-body b, .term-body .hl { color: var(--lime); font-weight: 600; }
.term-body .cmd { color: #9AA6FF; }
.term-body a { color: #FF8A5C; text-decoration: underline; }
.term-input { display: flex; align-items: center; gap: .6rem; padding: .6rem 1.2rem 1.1rem; }
.prompt { color: var(--lime); }
.term-input input { flex: 1; background: transparent; border: 0; outline: 0; color: #fff; font: inherit; caret-color: var(--lime); }

/* contact */
.contact { text-align: left; }
.contact-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }
.big-pill { padding: 1.2rem 2rem; font-size: 1.15rem; }
#copy-email { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.2; font-size: clamp(1.2rem, 2.6vw, 1.7rem); }
.ce-hint { font-family: var(--mono); font-style: normal; font-size: .7rem; opacity: .8; }
.socials { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.social { display: inline-flex; align-items: center; gap: .55rem; padding: .7rem 1.1rem; border-radius: 14px; border: 1px solid var(--line); font-weight: 600; transition: transform .25s cubic-bezier(.3,1.6,.5,1), background .2s, color .2s; }
.social svg { width: 20px; height: 20px; fill: currentColor; }
.social:hover { background: var(--blue); color: #fff; transform: translateY(-4px) rotate(2deg); }

.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 2rem var(--gutter); border-top: 1px solid var(--line); color: var(--ink-2); font-size: .9rem; }
.secret { opacity: .35; transition: opacity .3s; }
.secret:hover { opacity: 1; color: var(--orange); }

/* modal */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(13,14,26,.55); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .25s; }
.modal[hidden] { display: none; }
.modal-card { position: relative; max-width: 560px; width: 100%; background: var(--card); border-radius: var(--radius); padding: 2.2rem; box-shadow: 0 40px 80px -30px rgba(0,0,0,.5); animation: rise .4s cubic-bezier(.3,1.5,.5,1); }
.modal-close { position: absolute; top: .8rem; right: 1rem; font-size: 1.8rem; line-height: 1; color: var(--ink-2); }
.modal-kind { color: var(--orange); }
.modal-card h3 { font-family: var(--serif); font-weight: 400; font-size: 2.1rem; line-height: 1.1; margin: .5rem 0 .8rem; color: var(--blue); }
.modal-desc { color: var(--ink-2); }
.modal-card { max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-gallery { display: flex; gap: .6rem; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 0 1rem; padding-bottom: .3rem; }
.modal-gallery img { flex: 0 0 auto; width: 100%; max-height: 300px; object-fit: cover; border-radius: 14px; scroll-snap-align: start; }
.modal-gallery img:not(:only-child) { width: 85%; }
.modal-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(30px) scale(.96); } }

/* fine-tune easter egg */
.finetune { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: rgba(13,14,26,.7); padding: 16px; }
.finetune[hidden] { display: none; }
.ft-card { background: #0E0F1C; color: #E8E6F0; border-radius: 18px; padding: 1.8rem; width: min(520px, 100%); box-shadow: 0 0 0 2px var(--lime); }
.ft-bar { height: 12px; border-radius: 999px; background: #22243F; margin: 1rem 0 .8rem; overflow: hidden; }
.ft-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--lime)); transition: width .1s linear; }
.ft-log { color: var(--lime); }
body.finetuned .display em { color: var(--orange); }
body.finetuned .brand::after { content: " (fine-tuned)"; font-family: var(--mono); font-size: .65rem; color: var(--orange); }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 130; }

/* custom cursor */
.cursor { display: none; }
@media (pointer: fine) {
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
  body.has-cursor input, body.has-cursor input[type="range"] { cursor: auto; }
  .cursor { display: block; position: fixed; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--orange); pointer-events: none; z-index: 200; transform: translate(-50%, -50%); transition: width .2s, height .2s, border-radius .2s, background .2s, border .2s; mix-blend-mode: normal; }
  .cursor-label { position: absolute; left: -2px; top: -1.45rem; font-family: var(--mono); font-size: .65rem; font-weight: 600; background: var(--lime); color: #16161D; padding: .05rem .4rem; border-radius: 3px; white-space: nowrap; opacity: 0; transition: opacity .15s; }
  .cursor.box { background: transparent; border: 2px solid var(--lime); border-radius: 6px; }
  .cursor.box .cursor-label { opacity: 1; }
  .cursor.hidden { opacity: 0; }
}

/* loss curve */
.loss { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); z-index: 40; width: 74px; display: none; flex-direction: column; align-items: center; gap: .3rem; font-family: var(--mono); font-size: .6rem; color: var(--ink-2); padding: .6rem .4rem; border-radius: 14px; background: color-mix(in srgb, var(--bg) 80%, transparent); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.loss svg { width: 60px; height: 200px; overflow: visible; }
.loss-track { fill: none; stroke: var(--line); stroke-width: 2; }
.loss-path { fill: none; stroke: var(--orange); stroke-width: 2.5; stroke-linecap: round; }
.loss-dot { fill: var(--blue); }
.loss b { color: var(--blue); }
@media (min-width: 1200px) { .loss { display: flex; } main { padding-right: 84px; } }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .flips { grid-template-columns: repeat(2, 1fr); }
  .project-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav-links { position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: .5rem var(--gutter) 1.2rem; transform: translateY(-120%); transition: transform .35s; z-index: -1; }
  .nav-links.open { transform: none; }
  .nav-links a { padding: .9rem 0; font-family: var(--serif); font-size: 1.8rem; color: var(--blue); border-bottom: 1px solid var(--line); }
  .nav-links a::after { display: none; }
  .burger { display: block; }
  .nav-right .pill-orange { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-visual { order: -1; }
  .avatar-card { width: min(78%, 320px); }
  .about-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .project-cards, .skill-groups { grid-template-columns: 1fr; }
  .node .nlabel { font-size: .62rem; }
}
@media (max-width: 700px) {
  .phones { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 1.2rem; margin-inline: calc(-1 * var(--gutter)); padding: 1rem var(--gutter) 1.5rem; scrollbar-width: none; }
  .phones::-webkit-scrollbar { display: none; }
  .quest { flex: 0 0 78%; scroll-snap-align: center; }
  .phone { width: min(210px, 62vw); }
  .quests::before { top: 3.4rem; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .flips { grid-template-columns: 1fr; }
  .flip { height: 220px; }
  .stats { grid-template-columns: 1fr; }
  .stat { padding: 1.5rem 1.2rem; }
  .hero-ctas .pill, .contact-row .pill { flex: 1 1 100%; justify-content: center; }
  #copy-email { align-items: center; font-size: 1.05rem; }
  .bbox-coffee { right: -4%; }
  .avatar-meta { font-size: .72rem; }
  .avatar-meta .mono { display: none; }
  .status { white-space: nowrap; }
  .map { height: 460px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
