/* ═══════════ UTSAV.GUPTA — design system ═══════════
   "decrypted terminal" · code-dark + run-green · JetBrains Mono */

:root {
  --bg: #0F172A;
  --bg-deep: #0A0F1E;
  --panel: #141D33;
  --panel-2: #182238;
  --accent: #22C55E;
  --accent-dim: rgba(34, 197, 94, .14);
  --accent-glow: rgba(34, 197, 94, .35);
  --on-accent: #06230f;
  --text: #F1F5F9;
  --muted: #94A3B8;
  --dim: #8695AD;
  --border: rgba(148, 163, 184, .14);
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* phosphor themes (switched from the shell: `theme <name>`) */
html[data-theme="amber"] { --accent: #FFB000; --accent-dim: rgba(255,176,0,.14); --accent-glow: rgba(255,176,0,.35); --on-accent: #2A1900; }
html[data-theme="ice"]   { --accent: #7DD3FC; --accent-dim: rgba(125,211,252,.14); --accent-glow: rgba(125,211,252,.35); --on-accent: #062534; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--on-accent); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong { color: var(--text); font-weight: 700; }

/* subtle grid texture over everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(rgba(148,163,184,.045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(148,163,184,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 100%);
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.section { padding: 110px 0; position: relative; scroll-margin-top: 40px; }
h1, h2, h3 { text-wrap: balance; }

/* skip link */
.skip-link { position: fixed; top: -60px; left: 16px; z-index: 500; background: var(--accent); color: #052012;
  padding: 10px 18px; border-radius: 8px; font-weight: 700; font-size: 13px; transition: top .2s; }
.skip-link:focus-visible { top: 12px; }

/* visible focus */
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* tabular numbers for stats */
.cf-num, .cs-num { font-variant-numeric: tabular-nums; }

/* ── eyebrows & titles ── */
.eyebrow { color: var(--accent); font-size: 13px; letter-spacing: .08em; margin-bottom: 10px; }
.sec-title {
  font-size: clamp(30px, 4.6vw, 52px); font-weight: 800; letter-spacing: -0.01em;
  margin-bottom: 14px; color: var(--text);
}
.sec-title::before { content: "> "; color: var(--accent); }
.sec-sub { color: var(--muted); max-width: 640px; margin-bottom: 44px; }

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

/* ══════════ LOADER ══════════ */
#loader {
  position: fixed; inset: 0; z-index: 200; background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: opacity .45s ease, visibility .45s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-box {
  width: min(620px, 92vw); background: #0d1426; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.loader-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted);
}
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot.r { background: #f87171; } .dot.y { background: #fbbf24; } .dot.g { background: var(--accent); }
.loader-title { margin-left: 8px; }
.loader-log { padding: 20px 22px; min-height: 168px; font-size: 13.5px; color: var(--muted); }
.loader-log .ok { color: var(--accent); }
.loader-log .line { margin-bottom: 6px; }
.loader-log .cursor { display: inline-block; width: 8px; height: 15px; background: var(--accent); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
.loader-bar { height: 3px; background: rgba(148,163,184,.12); }
#loader-fill { height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); transition: width .25s ease; }
.loader-skip { text-align: center; padding: 10px; font-size: 11px; color: var(--dim); }
@keyframes blink { 50% { opacity: 0; } }

/* ══════════ NAV ══════════ */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: rgba(10, 15, 30, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.nav-logo:hover { text-decoration: none; }
.prompt { color: var(--accent); } .path { color: #7dd3fc; } .dim { color: var(--dim); }
.caret { color: var(--accent); animation: blink 1.2s steps(1) infinite; font-size: 12px; }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { color: var(--muted); font-size: 13.5px; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-links a::before { content: "./"; color: var(--dim); font-size: 11px; }
.nav-cta {
  border: 1px solid var(--accent); border-radius: 8px; padding: 7px 16px !important;
  color: var(--accent) !important;
}
.nav-cta::before { content: "" !important; }
.nav-cta:hover { background: var(--accent-dim); }
#nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
#nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: .3s; }

/* ══════════ HERO ══════════ */
.hero {
  min-height: 100svh; display: flex; align-items: center; justify-content: center;
  position: relative; padding: 120px 24px 80px; text-align: center;
}
#hexfield { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, black 20%, transparent 75%); }
.hero-inner { position: relative; z-index: 1; max-width: 900px; }
.hero-status {
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-items: center;
  border: 1px solid var(--border); background: rgba(20, 29, 51, .7);
  border-radius: 999px; padding: 8px 20px; font-size: 12.5px; color: var(--muted); margin-bottom: 28px;
}
.hero-status strong { color: var(--accent); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent-glow); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.sep { color: var(--dim); }
.hero-eyebrow { color: var(--accent); font-size: 15px; margin-bottom: 12px; }
.hero-name {
  font-size: clamp(46px, 10vw, 124px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.02;
  text-shadow: 0 0 60px rgba(34,197,94,.18); margin-bottom: 18px; min-height: 1.1em;
}
.hero-roles { font-size: clamp(15px, 2.4vw, 21px); color: var(--muted); min-height: 1.8em; margin-bottom: 20px; }
.hero-roles .caret { font-size: 18px; }
.hero-bio { color: var(--muted); max-width: 660px; margin: 0 auto 36px; font-size: 15.5px; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.btn {
  display: inline-block; padding: 13px 28px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  font-family: var(--mono);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #052012; box-shadow: 0 8px 28px rgba(34,197,94,.28); }
.btn-primary:hover { box-shadow: 0 12px 34px rgba(34,197,94,.42); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); background: rgba(20,29,51,.6); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.hero-socials { display: flex; gap: 22px; justify-content: center; font-size: 13px; }
.hero-socials a { color: var(--dim); }
.hero-socials a:hover { color: var(--accent); }
.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--dim); border-radius: 14px; display: flex; justify-content: center; padding-top: 8px; }
.scroll-cue span { width: 4px; height: 8px; border-radius: 2px; background: var(--accent); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ══════════ ABOUT ══════════ */
.about-grid { display: grid; grid-template-columns: 1.35fr .9fr; gap: 28px; align-items: start; }
.about-main p { color: var(--muted); margin-bottom: 18px; font-size: 15.5px; }
.fact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.fact { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; background: rgba(20,29,51,.5); }
.fact-k { display: block; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.fact-v { font-size: 13.5px; color: var(--text); }
.about-card, .arena-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.card-term { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.card-title { margin-left: 8px; }
.card-link { margin-left: auto; font-size: 12px; }
.json { padding: 20px 22px; font-size: 13px; line-height: 1.8; color: var(--muted); overflow-x: auto; }
.jk { color: #7dd3fc; } .js { color: #a5f3c0; } .jn { color: #fbbf24; }

/* ══════════ PROJECTS (bento) ══════════ */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.proj {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; gap: 12px; position: relative;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.proj:hover { transform: translateY(-5px) scale(1.01); border-color: rgba(34,197,94,.45); box-shadow: 0 20px 50px rgba(0,0,0,.4), 0 0 0 1px rgba(34,197,94,.12); }
.proj.featured { grid-column: span 2; background: linear-gradient(135deg, #152238 0%, #101a30 60%, #0f2a1c 130%); border-color: rgba(34,197,94,.3); }
.proj-top { display: flex; align-items: center; justify-content: space-between; }
.proj-tag { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .12em; }
.proj-links a { color: var(--dim); font-size: 13px; margin-left: 12px; }
.proj-links a:hover { color: var(--accent); }
.proj h3 { font-size: 21px; font-weight: 700; }
.proj.featured h3 { font-size: 27px; }
.proj p { color: var(--muted); font-size: 13.5px; flex: 1; }
.proj-meta { display: flex; gap: 14px; font-size: 12px; color: var(--dim); align-items: center; }
.lang-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }

/* ══════════ ARENA ══════════ */
.arena-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: stretch; }
.cf-stats { display: flex; gap: 26px; padding: 20px 24px 6px; }
.cf-stat { display: flex; flex-direction: column; }
.cf-num { font-size: 30px; font-weight: 800; color: var(--accent); }
.cf-lbl { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.chart-wrap { position: relative; padding: 8px 12px 18px; }
#cf-chart { width: 100%; height: 260px; display: block; }
.cf-tip {
  position: absolute; pointer-events: none; background: #0b1224; border: 1px solid rgba(34,197,94,.4);
  border-radius: 8px; padding: 8px 12px; font-size: 12px; color: var(--text); white-space: nowrap;
  transform: translate(-50%, -115%); z-index: 5; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.cf-tip .dim { display: block; color: var(--dim); font-size: 11px; }

/* ══════════ TIMELINE ══════════ */
.timeline { position: relative; margin-top: 10px; padding-left: 8px; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), rgba(34,197,94,.06)); }
.tl-item { position: relative; padding: 0 0 44px 52px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: 8px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); box-shadow: 0 0 14px var(--accent-glow); }
.tl-date { font-size: 12px; color: var(--accent); letter-spacing: .06em; }
.tl-body h3 { font-size: 19px; margin: 6px 0 2px; }
.tl-org { color: var(--muted); font-size: 13.5px; margin-bottom: 10px; }
.tl-body > p:last-of-type { color: var(--muted); font-size: 14.5px; max-width: 720px; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tl-tags span { font-size: 11.5px; color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(34,197,94,.25); padding: 4px 12px; border-radius: 999px; }

/* ══════════ CERTS ══════════ */
.cert-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cert {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 20px; display: flex; flex-direction: column; gap: 8px; min-height: 158px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; color: var(--text);
}
.cert:hover { text-decoration: none; transform: translateY(-4px); border-color: rgba(34,197,94,.45); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.cert-issuer { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; }
.cert h3 { font-size: 14.5px; font-weight: 600; line-height: 1.45; }
.cert-year { margin-top: auto; font-size: 12px; color: var(--dim); }
.cert-view { font-size: 12px; color: var(--dim); }
.cert:hover .cert-view { color: var(--accent); }

/* ══════════ CONTACT ══════════ */
.contact-wrap { text-align: center; max-width: 720px; }
.contact-wrap .sec-title { margin-bottom: 18px; }
.contact-lede { color: var(--muted); margin-bottom: 34px; }
.contact-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.contact-links { display: flex; gap: 24px; justify-content: center; font-size: 13.5px; }

/* ══════════ FOOTER ══════════ */
footer { border-top: 1px solid var(--border); padding: 26px 0; font-size: 12.5px; color: var(--muted); position: relative; z-index: 1; }
.foot-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ══════════ RESPONSIVE ══════════ */
@media (max-width: 960px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .proj.featured { grid-column: span 2; }
  .cert-grid { grid-template-columns: 1fr 1fr; }
  .arena-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .section { padding: 76px 0; }
  .nav-links {
    position: fixed; top: 57px; right: 0; left: 0; flex-direction: column; gap: 0;
    background: var(--bg-deep); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .3s ease; align-items: stretch;
  }
  .nav-links.open { max-height: 480px; }
  .nav-links a { padding: 14px 28px; border-top: 1px solid var(--border); }
  .nav-cta { margin: 12px 28px; text-align: center; }
  #nav-toggle { display: block; }
  #nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  #nav-toggle.open span:nth-child(2) { opacity: 0; }
  #nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .bento { grid-template-columns: 1fr; }
  .proj.featured { grid-column: span 1; }
  .cert-grid { grid-template-columns: 1fr; }
  .fact-row { grid-template-columns: 1fr; }
  .hero-status { font-size: 11.5px; padding: 8px 16px; }
  #cf-chart { height: 210px; }
}

/* ══════════ REDUCED MOTION ══════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .caret, .pulse, .scroll-cue span { animation: none; }
  .btn:hover, .proj:hover, .cert:hover { transform: none; }
}

/* ══════════ WOW LAYER ══════════ */

/* scroll progress */
#progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 150;
  background: linear-gradient(90deg, var(--accent), #7dd3fc);
  box-shadow: 0 0 12px var(--accent-glow); }

/* custom cursor */
#cursor-dot, #cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 300; border-radius: 50%; }
#cursor-dot { width: 7px; height: 7px; background: var(--accent); transform: translate(-50%,-50%); }
#cursor-ring { width: 34px; height: 34px; border: 1.5px solid rgba(34,197,94,.55); transform: translate(-50%,-50%);
  transition: width .25s, height .25s, border-color .25s, background .25s; }
#cursor-ring.hovering { width: 56px; height: 56px; background: rgba(34,197,94,.08); border-color: var(--accent); }
@media (pointer: fine) {
  body, a, button, .proj, .cert { cursor: none; }
}
@media (pointer: coarse) { #cursor-dot, #cursor-ring { display: none; } }

/* mouse glow orb (hero) */
#glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(34,197,94,.10) 0%, rgba(34,197,94,.03) 40%, transparent 70%);
  transform: translate(-50%,-50%); filter: blur(10px); }

/* marquee ticker */
.marquee { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: rgba(10,15,30,.6); overflow: hidden; white-space: nowrap; position: relative; z-index: 1; }
.marquee-track { display: inline-flex; gap: 0; padding: 14px 0; animation: marquee 28s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-size: 13px; letter-spacing: .18em; color: var(--dim); padding: 0 28px; text-transform: uppercase; }
.marquee-track span b { color: var(--accent); font-weight: 600; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* hero name glitch */
.hero-name { position: relative; }
.hero-name.glitching { animation: hshake .32s linear; }
.hero-name.glitching::before, .hero-name.glitching::after {
  content: attr(data-text); position: absolute; inset: 0; overflow: hidden;
}
.hero-name.glitching::before { color: #f87171; transform: translate(-4px,-2px); clip-path: inset(12% 0 58% 0); opacity: .85; }
.hero-name.glitching::after { color: #7dd3fc; transform: translate(4px,2px); clip-path: inset(62% 0 8% 0); opacity: .85; }
@keyframes hshake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-3px) skewX(-1deg); } 75% { transform: translateX(3px) skewX(1deg); } }

/* breach mode */
#breach { position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center;
  background: rgba(10,2,2,.88); backdrop-filter: blur(2px); }
#breach.on { display: flex; animation: breachflicker .12s 6; }
@keyframes breachflicker { 50% { background: rgba(60,4,4,.92); } }
.breach-box { text-align: center; border: 1px solid #f87171; border-radius: 12px; padding: 40px 52px;
  background: rgba(20,5,5,.9); box-shadow: 0 0 60px rgba(248,113,113,.25); max-width: 90vw; }
.breach-box h2 { color: #f87171; font-size: clamp(20px,4vw,34px); margin-bottom: 12px; letter-spacing: .04em; }
.breach-box p { color: #fca5a5; font-size: 13px; }
#breach-log { text-align: left; margin-top: 18px; font-size: 12px; color: #f87171; min-height: 96px; }
.scanlines::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 401;
  background: repeating-linear-gradient(0deg, rgba(248,113,113,.06) 0 2px, transparent 2px 5px); }

/* timeline draw */
.timeline::before { transform-origin: top; transform: scaleY(0); transition: transform 1.6s cubic-bezier(.2,.7,.2,1); }
.timeline.drawn::before { transform: scaleY(1); }

/* magnetic buttons */
.btn { will-change: transform; }

/* tilt */
.proj, .cert { transform-style: preserve-3d; }
@media (max-width: 640px) {
  #glow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  #cursor-dot, #cursor-ring, #glow { display: none; }
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: #0b1220; border: 1px solid var(--accent); color: var(--text);
  font-family: var(--mono); font-size: 13px; padding: 12px 18px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  z-index: 9999; max-width: min(90vw, 480px); text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ── Codolio profile card: codolio.com's dual-pane card, themed to this site, live via their API ── */
.codcard { padding: 18px 22px 22px; text-align: center; }
.codcard-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.codcard-tabs { display: flex; align-items: center; width: fit-content; max-width: 100%; margin: 0 auto 14px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.cdtab { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; background: none; border: 0; font: inherit; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: all .3s; white-space: nowrap; }
@media (max-width: 440px) {
  .cdtab { font-size: 12px; padding: 7px 12px; gap: 6px; }
  .cdtab svg { display: none; }
}
.cdtab:first-of-type { border-radius: 999px 0 0 999px; }
.cdtab:last-of-type { border-radius: 0 999px 999px 0; }
.cdtab.active { background: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: 0 2px 8px var(--accent-glow); }
.cdtab:not(.active):hover { background: var(--panel); color: var(--text); }
.cdtab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cdtab svg { width: 18px; height: 18px; flex: none; }
/* flat flip: codfolio's react-card-flip — 1s rotateY(180), linear so the 90° edge-on point
   lands exactly at 0.5s. Each face is only ever VISIBLE in its upright half (visibility swaps
   at the edge-on mark), so a mirrored back-face can never paint — in any engine. */
.codcard-flip { perspective: none; }
.codcard-flipper { display: grid; transition: transform 1s linear; }
.codcard-flipper.dev { transform: rotateY(180deg); }
.codcard-face { grid-area: 1 / 1; visibility: visible; transition: visibility 0s linear .5s; }
.codcard-face.back { visibility: hidden; transform: rotateY(180deg); }
.codcard-flipper.dev .codcard-face { visibility: hidden; }
.codcard-flipper.dev .codcard-face.back { visibility: visible; }
.codcard-brand { font-size: 15px; font-weight: 800; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.codcard-brand:hover { opacity: .75; }
.codcard-brand span { color: var(--accent); }
.codcard-kind { font-size: 11px; letter-spacing: .14em; color: var(--dim); }
.codcard-avwrap:empty { display: none; }
.codcard-av { display: block; width: 108px; height: 108px; margin: 0 auto; border-radius: 50%; border: 4px solid var(--accent); object-fit: cover; background: var(--panel-2); }
.codcard-name { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; font-size: 20px; font-weight: 800; color: var(--text); }
.codcard-check { width: 16px; height: 16px; color: var(--accent); flex: none; }
.codcard-handle { display: inline-block; margin-top: 9px; background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(34, 197, 94, .25); border-radius: 999px; padding: 4px 15px; font-size: 13px; font-weight: 600; }
.codcard-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.codcard-stats.s3 { grid-template-columns: repeat(3, 1fr); }
.s3 .cs-lbl { font-size: 11.5px; }
.s3 .cs-num { font-size: 25px; }
.codcard-stat { border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); padding: 9px 8px 11px; }
.cs-lbl { display: block; margin-bottom: 3px; font-size: 12.5px; font-weight: 600; }
.sq .cs-lbl { color: #fbbf24; }
.sa .cs-lbl { color: var(--accent); }
.cs-num { font-size: 30px; font-weight: 800; line-height: 1; color: var(--text); }
.codcard-find { margin-top: 16px; font-size: 13px; color: var(--muted); }
.codcard-icons { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
.codcard-icons a { display: flex; border-radius: 50%; transition: transform .2s; }
.codcard-icons a:hover { transform: translateY(-2px); }
.codcard-icons a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.codcard-icons img { width: 34px; height: 34px; padding: 5px; box-sizing: border-box; background: #fff; border-radius: 50%; object-fit: contain; }
.ghbadge { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; background: #fff; border-radius: 50%; color: #141D33; line-height: 0; }
.ghbadge svg { width: 18px; height: 18px; }
.codcard-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.codcard-chips span { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(34, 197, 94, .25); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; }

/* ══════════ ACTIVITY HEATMAPS ══════════ */
.arena-grid-2 { grid-template-columns: 1fr 1fr; margin-top: 18px; }
.heat-stats { display: flex; gap: 26px; padding: 18px 24px 4px; font-size: 13px; color: var(--dim); }
.heat-stats strong { color: var(--accent); font-size: 22px; font-weight: 800; margin-right: 6px; }
.heat-card .heat-stats strong { color: var(--accent); }
.heatmap-scroll { overflow-x: auto; padding: 14px 24px 6px; }
.heatmap svg { display: block; overflow: visible; }
.heat-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; padding: 4px 24px 18px; font-size: 11px; color: var(--dim); }
.heat-legend .hl { width: 11px; height: 11px; border-radius: 2.5px; }
.hl0 { background: rgba(148,163,184,.13); } .hl1 { background: #0e4429; } .hl2 { background: #006d32; } .hl3 { background: #26a641; } .hl4 { background: #39d353; }
.c0 { background: rgba(148,163,184,.13); } .c1 { background: #4a2c0a; } .c2 { background: #8a4b0f; } .c3 { background: #d97706; } .c4 { background: #fbbf24; }

/* ══════════ HPC / MACCHINA PANEL ══════════ */
.hpc-card { margin-top: 18px; }
.card-tag { margin-left: auto; font-size: 11px; color: var(--dim); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.hpc-body { display: flex; gap: 28px; padding: 24px 28px 28px; align-items: flex-start; }
.hpc-ascii { color: var(--accent); font-size: 12px; line-height: 1.25; white-space: pre; opacity: .9; flex-shrink: 0; }
.hpc-specs { display: grid; grid-template-columns: auto 1fr; gap: 9px 22px; font-size: 13.5px; align-content: start; padding-top: 6px; }
.hpc-specs .hk { color: var(--accent); font-weight: 600; white-space: nowrap; }
.hpc-specs .hv { color: var(--text); }
.hpc-note { grid-column: 1 / -1; color: var(--dim); font-size: 12px; margin-top: 6px; }

/* ══════════ PROJECT DEEP-DIVE MODAL ══════════ */
.proj { cursor: pointer; }
.proj-deep { font-size: 12px; color: var(--dim); margin-top: 2px; }
.proj:hover .proj-deep { color: var(--accent); }
.pmodal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 22px; }
.pmodal[hidden] { display: none; }
.pmodal-backdrop { position: absolute; inset: 0; background: rgba(4,8,18,.78); backdrop-filter: blur(6px); }
.pmodal-box {
  position: relative; width: min(880px, 100%); max-height: 88vh; overflow-y: auto;
  background: #0d1526; border: 1px solid rgba(34,197,94,.35); border-radius: 18px;
  box-shadow: 0 40px 120px rgba(0,0,0,.6), 0 0 0 1px rgba(34,197,94,.08), 0 0 60px rgba(34,197,94,.07);
  animation: pm-in .28s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pm-in { from { transform: translateY(26px) scale(.97); opacity: 0; } }
.pmodal-x {
  position: sticky; top: 14px; margin-left: calc(100% - 52px); z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: #101a30; color: var(--text); font-size: 15px; cursor: pointer;
}
.pmodal-x:hover { border-color: var(--accent); color: var(--accent); }
.pmodal-head { padding: 6px 34px 0; }
.pmodal-head h2 { font-size: 32px; margin: 10px 0 8px; }
.pmodal-head p { color: var(--muted); font-size: 14.5px; line-height: 1.65; max-width: 62ch; }
.pmodal-links { margin-top: 12px; }
.pmodal-links a { color: var(--accent); font-size: 13.5px; }
.pm-stats { display: flex; flex-wrap: wrap; gap: 12px 30px; padding: 20px 34px 4px; }
.pm-stat { display: flex; flex-direction: column; }
.pm-stat b { font-size: 19px; color: var(--text); font-weight: 700; }
.pm-stat span { font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.pm-h { padding: 26px 34px 12px; font-size: 14px; color: var(--accent); }
.pm-arch { margin: 0 34px; padding: 18px 10px; border: 1px solid var(--border); border-radius: 12px; background: rgba(10,17,32,.6); overflow-x: auto; }
.pm-arch svg { display: block; width: auto; max-width: 100%; height: auto; margin: 0 auto; }
.pm-feats { list-style: none; padding: 0 34px; display: flex; flex-direction: column; gap: 9px; }
.pm-feats li { font-size: 13.5px; color: var(--muted); padding-left: 22px; position: relative; line-height: 1.55; }
.pm-feats li::before { content: "▸"; color: var(--accent); position: absolute; left: 2px; }
.pm-stack { display: flex; flex-wrap: wrap; gap: 9px; padding: 0 34px 36px; }
.pm-stack span { font-size: 12.5px; color: var(--text); background: rgba(34,197,94,.09); border: 1px solid rgba(34,197,94,.28); border-radius: 999px; padding: 5px 14px; }
body.pm-open { overflow: hidden; }

@media (max-width: 640px) {
  .arena-grid-2 { grid-template-columns: 1fr; }
  .heatmap-scroll { padding: 14px 10px 6px; }
  .hpc-body { flex-direction: column; gap: 14px; }
  .hpc-ascii { font-size: 9px; }
  .pmodal { padding: 12px; }
  .pmodal-head, .pm-stats { padding-left: 22px; padding-right: 22px; }
  .pmodal-head h2 { font-size: 25px; }
  .pm-h, .pm-feats { padding-left: 22px; padding-right: 22px; }
  .pm-arch { margin: 0 22px; }
  .pm-stack { padding: 0 22px 28px; }
}

/* heatmap cells are SVG rects — they need fill, not background */
#gh-heatmap rect.hl0, #cf-heatmap rect.c0 { fill: rgba(148,163,184,.13); }
#gh-heatmap rect.hl1 { fill: #0e4429; } #gh-heatmap rect.hl2 { fill: #006d32; }
#gh-heatmap rect.hl3 { fill: #26a641; } #gh-heatmap rect.hl4 { fill: #39d353; }
#cf-heatmap rect.c1 { fill: #4a2c0a; } #cf-heatmap rect.c2 { fill: #8a4b0f; }
#cf-heatmap rect.c3 { fill: #d97706; } #cf-heatmap rect.c4 { fill: #fbbf24; }

/* ══════════ INTERACTIVE SHELL ══════════ */
.cli { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-deep); overflow: hidden; max-width: 860px; }
.cli-out { height: clamp(210px, 34vh, 330px); overflow-y: auto; padding: 16px 18px; font-size: 13px; line-height: 1.75; cursor: text; }
.cli-line { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 3px; }
.cli-line.cmd { color: var(--text); }
.cli-line.cmd .prompt, .cli-line.cmd .path { color: var(--accent); }
.cli-line.dim-line { color: var(--muted); }
.cli-ok { color: var(--accent); }
.cli-warn { color: #fbbf24; }
.cli-err { color: #f87171; }
.cli-form { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-top: 1px solid var(--border); background: var(--panel); transition: background .2s ease, box-shadow .2s ease; }
.cli-form:focus-within { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--accent-glow); }
.cli-prompt { font-size: 13.5px; white-space: nowrap; }
.cli-prompt .prompt, .cli-prompt .path { color: var(--accent); }
#cli-in { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font-family: var(--mono); font-size: 13.5px; caret-color: var(--accent); }
#cli-in::placeholder { color: var(--dim); }

/* ── access granted (konami) ── */
#granted { position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center; background: rgba(2, 10, 5, .88); backdrop-filter: blur(2px); }
#granted.on { display: flex; animation: grantedflicker .12s 4; }
@keyframes grantedflicker { 50% { background: rgba(6, 40, 18, .92); } }
.granted-box { text-align: center; border: 1px solid var(--accent); border-radius: 12px; padding: 40px 52px; background: rgba(6, 26, 14, .92); box-shadow: 0 0 60px var(--accent-glow); max-width: 90vw; }
.granted-box h2 { color: var(--accent); font-size: clamp(20px, 4vw, 34px); letter-spacing: .04em; margin-bottom: 12px; }
.granted-box p { color: var(--muted); font-size: 13px; }
#granted-log { text-align: left; margin-top: 18px; font-size: 12px; color: var(--accent); min-height: 60px; }

@media (max-width: 640px) {
  .cli-out { height: 250px; font-size: 12.5px; padding: 14px; }
  .cli-form { padding: 10px 12px; gap: 6px; }
  .cli-prompt, #cli-in { font-size: 12px; }
  .granted-box { padding: 28px 22px; }
}

/* ══════════ themed browser surfaces ══════════ */
* { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.35) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,.3); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,.5); }

code { font-family: var(--mono); background: var(--accent-dim); color: var(--accent); padding: 1px 7px; border-radius: 5px; font-size: .92em; white-space: nowrap; }
