/* ============================================================
   Bhavishya Jain — portfolio v2
   Theme: "infrastructure as a living system"
   ============================================================ */
:root {
  --bg: #06090f;
  --bg-2: #0b1019;
  --bg-3: #10182380;
  --card: #0d141f;
  --card-2: #111a27;
  --line: #1c2838;
  --line-2: #27364a;
  --text: #e8eef6;
  --text-2: #c3cfdd;
  --muted: #8a9cb3;
  --ember: #ff7a45;   /* primary accent: signal orange */
  --ember-2: #ffb08a;
  --ice: #45e0ff;     /* secondary: electric cyan */
  --lime: #b8ff57;    /* healthy / pass */
  --amber: #ffc857;
  --rose: #ff5d8f;
  --violet: #b48cff;  /* security namespace */
  --acc: var(--ember);  /* per-page accent, set by body[data-accent] on sub-pages */
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 14px;
  --r-sm: 9px;
  --wrap: 1180px;
  --gutter: 20px;
  --shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
@property --tint { syntax: "<number>"; inherits: true; initial-value: 0.88; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 122, 69, .14), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(69, 224, 255, .10), transparent 60%);
  background-repeat: no-repeat;
}
a { color: var(--ice); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--ember); color: #1a0a03; }
img, canvas, svg { max-width: 100%; display: block; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
code, kbd { font-family: var(--mono); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ember); color: #1a0a03; padding: 8px 12px; border-radius: 8px; z-index: 100; font-weight: 600; }
.skip:focus { top: 8px; }

/* subtle grid/noise backdrop */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}

/* ---------------- nav ---------------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(6, 9, 15, .78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 700; color: var(--text); font-size: 15px; }
.logo b { color: var(--ember); }
.logo:hover { text-decoration: none; }
.logo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(184, 255, 87, .15), 0 0 14px var(--lime); }
.menu { display: flex; align-items: center; gap: 4px; }
.menu a { color: var(--muted); font-size: 14px; padding: 8px 10px; border-radius: 8px; display: block; }
.menu a:hover { color: var(--text); background: var(--card-2); text-decoration: none; }
.menu-btn { display: none; background: var(--card); border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; padding: 7px 12px; font-family: var(--mono); font-size: 13px; cursor: pointer; }
.kbd-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line-2); color: var(--text-2); border-radius: 8px; padding: 6px 10px; font-family: var(--mono); font-size: 12.5px; cursor: pointer; margin-left: 8px; }
.kbd-btn:hover { border-color: var(--ember); color: var(--text); }
.kbd-btn kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 11px; color: var(--muted); background: var(--bg); }

/* ---------------- pipeline rail ---------------- */
.rail { position: fixed; left: 18px; top: 50%; transform: translateY(-50%); z-index: 40; display: none; }
.rail ol { margin: 0; padding: 0; list-style: none; position: relative; }
.rail ol::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: var(--line-2); }
.rail li { position: relative; }
.rail a { display: flex; align-items: center; gap: 12px; padding: 7px 0; color: var(--muted); font-family: var(--mono); font-size: 11.5px; text-decoration: none; }
.rail i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--bg); position: relative; z-index: 1; flex: none; transition: background .3s, border-color .3s, box-shadow .3s; }
.rail span { opacity: 0; transform: translateX(-6px); transition: opacity .25s, transform .25s; }
.rail:hover span, .rail a:focus-visible span, .rail li.active span { opacity: 1; transform: none; }
.rail li.done i { background: var(--lime); border-color: var(--lime); }
.rail li.active i { background: var(--ember); border-color: var(--ember); box-shadow: 0 0 0 5px rgba(255, 122, 69, .2), 0 0 16px var(--ember); }
.rail li.active a { color: var(--text); }
@media (min-width: 1360px) { .rail { display: block; } }

/* ---------------- buttons ---------------- */
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.cta.center { justify-content: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 11px; font-weight: 600; font-size: 15px; border: 1px solid var(--line-2); color: var(--text); background: var(--card); transition: transform .15s, border-color .15s, background .15s; line-height: 1.2; }
.btn:hover { text-decoration: none; border-color: var(--ice); transform: translateY(-1px); }
.btn.primary { background: var(--ember); color: #1a0a03; border-color: var(--ember); }
.btn.primary:hover { background: var(--ember-2); border-color: var(--ember-2); }
.btn.ghost { background: transparent; }

/* ---------------- hero ---------------- */
.hero { position: relative; padding: 56px 0 40px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.eyebrow { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(184, 255, 87, .6); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(184, 255, 87, 0); } 100% { box-shadow: 0 0 0 0 rgba(184, 255, 87, 0); } }
h1 { font-size: clamp(36px, 5.2vw, 66px); letter-spacing: -.035em; margin-bottom: 20px; text-wrap: balance; }
.hl-1, .hl-2, .hl-3 { position: relative; white-space: nowrap; }
.hl-1 { color: var(--ember); }
.hl-2 { color: var(--ice); }
.hl-3 { color: var(--lime); }
.lede { font-size: clamp(16px, 1.5vw, 18.5px); color: var(--text-2); max-width: 560px; margin-bottom: 26px; }
.lede strong { color: var(--text); }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.hero-tags li { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 11px; background: rgba(13, 20, 31, .6); }
.hero-tags li::before { content: "▲ "; color: var(--lime); font-size: 9px; vertical-align: 1px; }

/* cinematic hero backdrop: fx/home.js canvas (+ optional scroll-scrubbed video when site.heroVideo is set) */
.hero-bg { position: absolute; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; mask-image: linear-gradient(180deg, #000 55%, transparent 100%); -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); }
.hero-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s ease; z-index: 1; }
.hero-bg canvas.on { opacity: 1; }
.hero-bg.has-clip canvas.on { opacity: .7; mix-blend-mode: screen; }
/* background clips (hero + category headers): cover, slightly dimmed; the poster shows instantly, the video fades in once it plays */
.clip { position: absolute; left: 0; top: -6%; width: 100%; height: 112%; object-fit: cover; filter: saturate(.9) brightness(.62); will-change: transform; z-index: 0; }
.hero-bg::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background:
  linear-gradient(90deg, rgba(6, 9, 15, .92) 0%, rgba(6, 9, 15, .74) 40%, rgba(6, 9, 15, .3) 68%, rgba(6, 9, 15, .5) 100%),
  linear-gradient(180deg, rgba(6, 9, 15, .5), transparent 28%, transparent 68%, var(--bg) 100%); }

/* portrait + topology stage */
.stage { margin: 0; position: relative; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 60%, rgba(255, 122, 69, .16), transparent 60%), linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); min-width: 0; }
#topo-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: pan-y; }
.stage-view { position: relative; aspect-ratio: 5 / 4; min-height: 300px; overflow: hidden; perspective: 900px; }
/* --tint = strength of the ember/ice duotone. 1 = fully "cloaked"; hovering the stage or scrolling the hero decloaks to true colour. */
.portrait { --tint: 0; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); height: 88%; max-width: 52%; aspect-ratio: 3 / 4; pointer-events: none; mask-image: linear-gradient(180deg, #000 72%, transparent 100%); -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%); transition: --tint .6s; }
.portrait-in { position: relative; width: 100%; height: 100%; border-radius: 160px 160px 0 0; overflow: hidden; transform-style: preserve-3d; will-change: transform; isolation: isolate; }
.portrait picture { display: block; width: 100%; height: 100%; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top; filter: contrast(1.04); }
/* the AI-graded portrait needs no duotone — ::before is only a faint scan-line texture that lifts on hover */
.portrait-in::before { content: ""; position: absolute; inset: 0; z-index: 1; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .14) 0 1px, transparent 1px 3px); opacity: .7; transition: opacity .7s ease; }
.portrait-in::after { content: ""; position: absolute; inset: 0; z-index: 2; box-shadow: inset 0 0 0 1px rgba(69, 224, 255, .35), inset 0 0 70px rgba(69, 224, 255, .12); background: linear-gradient(180deg, transparent 60%, rgba(6, 9, 15, .6)); }
.stage:hover .portrait-in::before, .stage:focus-within .portrait-in::before { opacity: .15; }
/* scan-line reveal on load (class added by app.js; `.static` under reduced motion) */
.portrait .scan, .portrait .rescan { position: absolute; left: -6%; right: -6%; z-index: 3; pointer-events: none; opacity: 0; }
.portrait .scan { top: 0; height: 3px; background: var(--ice); box-shadow: 0 0 18px 4px rgba(69, 224, 255, .75), 0 0 60px 12px rgba(69, 224, 255, .25); }
.portrait .rescan { top: -12%; height: 10%; background: linear-gradient(180deg, transparent, rgba(69, 224, 255, .16) 60%, rgba(69, 224, 255, .4)); }
.portrait.reveal picture { animation: por-reveal 1.5s cubic-bezier(.65, 0, .25, 1) .35s both; }
.portrait.reveal .scan { animation: por-scan 1.5s cubic-bezier(.65, 0, .25, 1) .35s both; }
.portrait.reveal .rescan { animation: por-rescan 9s linear 4s infinite; }
@keyframes por-reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes por-scan { 0% { top: 0; opacity: 0; } 6% { opacity: 1; } 94% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes por-rescan { 0% { top: -12%; opacity: 0; } 4% { opacity: 1; } 22% { top: 104%; opacity: 0; } 100% { top: 104%; opacity: 0; } }
.stage-head { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-family: var(--mono); font-size: 12px; color: var(--text-2); background: linear-gradient(180deg, rgba(6, 9, 15, .8), transparent); pointer-events: none; }
.stage-meta { margin-left: auto; color: var(--muted); white-space: nowrap; }
.stage-caption { padding: 8px 14px 10px; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); }
.topo-tip { position: absolute; z-index: 3; background: rgba(6, 9, 15, .96); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; font-family: var(--mono); font-size: 12px; color: var(--text); pointer-events: none; max-width: 230px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.topo-tip small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.led { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.led.ok { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.scrollbar { position: fixed; top: 0; left: 0; height: 2px; width: 100%; background: linear-gradient(90deg, var(--ember), var(--ice)); transform-origin: 0 50%; transform: scaleX(0); z-index: 60; }

/* terminal */
.term { margin-top: 28px; background: #070b12; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); font-family: var(--mono); }
.term:focus-within { border-color: var(--ember); }
.term-bar { display: flex; align-items: center; gap: 12px; padding: 9px 14px; background: #0b111b; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.term-lights { display: inline-flex; gap: 6px; }
.term-lights i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.term-lights i:nth-child(2) { background: #febc2e; }
.term-lights i:nth-child(3) { background: #28c840; }
.term-title { color: var(--text-2); }
.term-hint { margin-left: auto; }
.term-hint code { color: var(--ember-2); }
.term-out { padding: 12px 14px 4px; font-size: 13px; line-height: 1.55; min-height: 150px; max-height: 260px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; color: #c9d6e3; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.term-out .in { color: var(--text); }
.term-out .in::before { content: "$ "; color: var(--ember); }
.term-out .o { color: #b7c5d6; }
.term-out .k { color: var(--amber); }
.term-out .g { color: var(--lime); }
.term-out .c { color: var(--ice); }
.term-out .e { color: var(--rose); }
.term-out .m { color: var(--muted); }
.term-out a { color: var(--ice); text-decoration: underline; text-decoration-thickness: 1px; }
.term-line { display: flex; align-items: center; gap: 8px; padding: 6px 14px 12px; font-size: 13px; }
.term-prompt { white-space: nowrap; color: var(--text-2); }
.p-user { color: var(--lime); }
.p-host { color: var(--ice); }
#term-in { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font: inherit; caret-color: var(--ember); padding: 2px 0; }
#term-in::placeholder { color: var(--line-2); }

/* ---------------- sections ---------------- */
.section { padding: 88px 0; border-top: 1px solid var(--line); position: relative; }
.sec-head { margin-bottom: 36px; max-width: 760px; }
.sec-head.center { margin: 0 auto 28px; text-align: center; }
.stage-tag { font-family: var(--mono); font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: rgba(13, 20, 31, .7); }
.stage-no { background: var(--line); color: var(--text); border-radius: 999px; padding: 1px 8px; font-weight: 700; }
.stage-state { color: var(--line-2); transition: color .5s; }
.section.seen .stage-state { color: var(--lime); }
h2 { font-size: clamp(28px, 3.6vw, 44px); margin-bottom: 12px; }
.lead { color: var(--muted); font-size: 17px; max-width: 640px; }
.sec-head.center .lead { margin: 0 auto; }

/* reveal */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.rv.in { opacity: 1; transform: none; }

/* ---------------- metrics ---------------- */
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 12px; display: grid; grid-template-rows: auto auto 1fr auto; gap: 6px; min-width: 0; position: relative; overflow: hidden; }
.panel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(255, 122, 69, .05)); pointer-events: none; }
.panel header { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: lowercase; }
.panel .big { font-family: var(--mono); font-size: clamp(30px, 3.4vw, 44px); font-weight: 700; color: var(--text); letter-spacing: -.02em; line-height: 1; }
.panel .big span { color: var(--ember); }
.spark { width: 100%; height: 48px; }
.panel footer { font-size: 12.5px; color: var(--muted); }
.cert-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.cert-strip li { font-size: 13.5px; color: var(--text-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: rgba(13, 20, 31, .6); display: inline-flex; gap: 8px; align-items: center; }
.cert-strip b { font-family: var(--mono); color: var(--ice); font-size: 12px; }

/* ---------------- experience ---------------- */
.job { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); padding: 26px 28px; margin-bottom: 16px; position: relative; overflow: hidden; }
.job::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--ember), var(--ice)); }
.job-head { display: flex; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; align-items: flex-start; }
.job h3 { font-size: 22px; }
.job .at { color: var(--ember); font-weight: 500; }
.meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.badge { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 11px; color: var(--text-2); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.badge.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.log { display: grid; gap: 10px; }
.log li { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-top: 1px dashed var(--line); }
.log li:first-child { border-top: 0; padding-top: 0; }
.log .k { font-family: var(--mono); font-size: 11.5px; color: var(--ice); background: rgba(69, 224, 255, .08); border: 1px solid rgba(69, 224, 255, .25); border-radius: 6px; padding: 3px 0; text-align: center; margin-top: 3px; }
.log p { color: var(--text-2); font-size: 15.5px; }
.log b { color: var(--text); }
.mini-jobs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mini { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.mini .meta { margin: 0 0 8px; }
.mini h3 { font-size: 17px; }
.mini .org { color: var(--ember-2); font-size: 14px; margin: 2px 0 8px; }
.mini p:last-child { color: var(--text-2); font-size: 14.5px; }

/* ---------------- projects ---------------- */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.proj { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; transition: border-color .2s, transform .2s; }
.proj:hover { border-color: var(--line-2); transform: translateY(-2px); }
.proj h3 { font-size: 20px; }
.proj > p, .proj-body > p { color: var(--text-2); font-size: 15px; }
.proj ul { padding-left: 18px; list-style: square; color: var(--text-2); font-size: 14.5px; }
.proj li { margin: 4px 0; }
.proj li::marker { color: var(--ember); }
.tag { font-family: var(--mono); font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dot.own { background: var(--ember); box-shadow: 0 0 8px var(--ember); }
.dot.ai { background: var(--ice); box-shadow: 0 0 8px var(--ice); }
.dot.win { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.chips span { font-family: var(--mono); font-size: 11.5px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); background: var(--bg-2); }
.proj.featured { grid-column: span 2; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: stretch; border-color: rgba(255, 122, 69, .35); }
.proj.featured .proj-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.proj.win { border-color: rgba(255, 200, 87, .4); background: linear-gradient(160deg, rgba(255, 200, 87, .06), var(--card) 60%); }
.screen { background: #050810; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; display: grid; grid-template-rows: auto 1fr; min-height: 200px; position: relative; }
.screen-bar { display: flex; gap: 6px; padding: 8px 10px; background: #0b111b; border-bottom: 1px solid var(--line); }
.screen-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.screen-body { display: grid; place-content: center; text-align: center; padding: 20px; font-family: var(--mono); color: var(--muted); font-size: 13px; gap: 4px; background:
  repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px),
  radial-gradient(ellipse at center, rgba(255, 122, 69, .10), transparent 65%); }
.screen-t { color: var(--ember); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; }
.screen-s { color: var(--line-2); font-size: 11.5px; margin-top: 8px; border: 1px dashed var(--line-2); border-radius: 6px; padding: 4px 8px; display: inline-block; }

/* ---------------- category cards (home) ---------------- */
.cats { overflow: hidden; }
.cats-track { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.cat { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 260px; padding: 22px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; overflow: hidden; transition: transform .25s, border-color .25s; min-width: 0; }
.cat:hover, .cat:focus-visible { text-decoration: none; transform: translateY(-4px); border-color: var(--c); }
.cat::before { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 220px at 90% -10%, color-mix(in srgb, var(--c) 28%, transparent), transparent 70%); pointer-events: none; }
.cat .ns { font-family: var(--mono); font-size: 12px; color: var(--c); display: flex; align-items: center; gap: 8px; }
.cat .ns i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.cat h3 { font-size: 24px; letter-spacing: -.02em; }
.cat p { color: var(--text-2); font-size: 14.5px; }
.cat .cat-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.cat .arrow { color: var(--c); font-size: 18px; transition: transform .25s; }
.cat:hover .arrow { transform: translateX(4px); }
.cat.has-bg::after { content: ""; position: absolute; inset: 0; z-index: 0; background: var(--bg) center / cover no-repeat; opacity: .34; mask-image: linear-gradient(200deg, #000 15%, transparent 78%); -webkit-mask-image: linear-gradient(200deg, #000 15%, transparent 78%); transition: opacity .3s; pointer-events: none; }
.cat.has-bg:hover::after { opacity: .55; }
.cat > * { position: relative; z-index: 1; }
.cat .cat-fx { font-family: var(--mono); font-size: 11.5px; color: var(--muted); border: 1px dashed color-mix(in srgb, var(--c) 40%, transparent); border-radius: 999px; padding: 3px 9px; align-self: flex-start; }
[data-accent="ice"] { --c: var(--ice); } [data-accent="ember"] { --c: var(--ember); } [data-accent="amber"] { --c: var(--amber); } [data-accent="lime"] { --c: var(--lime); } [data-accent="rose"] { --c: var(--rose); } [data-accent="violet"] { --c: var(--violet); }
body[data-accent] { --acc: var(--c); }
/* pinned horizontal mode (added by JS on wide screens when GSAP is available) */
.cats.pinned .cats-stage { height: 100vh; display: flex; align-items: center; }
.cats.pinned .cats-stage .wrap { max-width: none; padding: 0; width: 100%; }
.cats.pinned .cats-track { display: flex; gap: 20px; padding: 0 var(--gutter) 0 max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))); width: max-content; will-change: transform; }
.cats.pinned .cat { width: 380px; min-height: 340px; flex: none; }

/* ---------------- sub-pages ---------------- */
.sub-hero { padding: 72px 0 44px; position: relative; min-height: min(72vh, 640px); display: flex; align-items: flex-end; overflow: hidden; }
.sub-hero .wrap { position: relative; z-index: 1; width: 100%; }
.sub-hero h1 { font-size: clamp(34px, 5vw, 60px); margin: 0 0 14px; }
/* signature-animation layer behind the hero copy */
.sub-hero .fx { position: absolute; inset: 0; z-index: 0; pointer-events: none; mask-image: linear-gradient(180deg, #000 60%, transparent 100%); -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent 100%); }
.sub-hero .fx canvas { position: relative; z-index: 1; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s ease; }
.sub-hero .fx canvas.on { opacity: 1; }
.sub-hero.has-video .fx canvas.on { opacity: .75; mix-blend-mode: screen; }
.sub-hero .fx .clip { filter: saturate(.95) brightness(.78); }
.sub-hero .fx::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(90deg, rgba(6, 9, 15, .84) 0%, rgba(6, 9, 15, .5) 38%, rgba(6, 9, 15, .08) 68%); }
/* pages without a clip: lighter veil + a soft accent glow so the canvas animation reads clearly */
.sub-hero:not(.has-video) .fx::after { background: linear-gradient(90deg, rgba(6, 9, 15, .62) 0%, rgba(6, 9, 15, .22) 38%, transparent 62%); }
.sub-hero:not(.has-video) .fx { background: radial-gradient(900px 420px at 72% 35%, color-mix(in srgb, var(--acc) 12%, transparent), transparent 70%); }
.sub-hero .lead { max-width: 600px; text-shadow: 0 2px 20px rgba(6, 9, 15, .9); }
.sub-hero h1 { text-shadow: 0 2px 24px rgba(6, 9, 15, .9); }
.fx-note { margin-top: 18px; font-family: var(--mono); font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 9px; background: rgba(6, 9, 15, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.fx-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 10px var(--acc); animation: pulse 2.4s infinite; }
.fx-note .fx-sep { color: var(--line-2); } .fx-note .fx-what { color: var(--text-2); }
body[data-accent] .stage-tag .stage-no { background: color-mix(in srgb, var(--acc) 22%, var(--line)); color: var(--text); }
body[data-accent] .pcard .tagline { color: color-mix(in srgb, var(--acc) 70%, #fff); }
body[data-accent] .pcard li::marker, body[data-accent] .entry .date { color: var(--acc); }
body[data-accent] .status.live::before { background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.crumbs { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--text); }
.crumbs span:last-child { color: var(--acc); }
.sub-body { padding-top: 24px; }
/* cross-link card ("see also" another namespace) */
.pcard.xlink { grid-template-columns: 1fr; color: var(--text); text-decoration: none; border-style: dashed; border-color: color-mix(in srgb, var(--c) 45%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--c) 9%, var(--card)), var(--card) 60%); transition: transform .25s, border-color .25s; }
.pcard.xlink:hover, .pcard.xlink:focus-visible { text-decoration: none; transform: translateY(-3px); border-color: var(--c); border-style: solid; }
.pcard.xlink .ns { font-family: var(--mono); font-size: 12px; color: var(--c); display: flex; align-items: center; gap: 8px; }
.pcard.xlink .ns i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.pcard.xlink .tagline { color: var(--text-2) !important; }
.pcard.xlink .cat-foot { margin-top: 6px; display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 12.5px; color: var(--c); }
.pcard.xlink .arrow { font-size: 18px; transition: transform .25s; } .pcard.xlink:hover .arrow { transform: translateX(4px); }
.status.cert { border-color: rgba(180, 140, 255, .5); color: var(--violet); } .status.cert::before { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.sub-contact { padding-top: 64px; }
.proj-list { display: grid; gap: 18px; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 26px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; min-width: 0; }
.pcard.noMedia { grid-template-columns: 1fr; }
.pcard .pbody { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pcard h2 { font-size: clamp(22px, 2.4vw, 28px); margin: 0; }
.pcard .tagline { color: var(--ember-2); font-size: 15px; }
.pcard .desc { color: var(--text-2); font-size: 15px; }
.pcard ul { padding-left: 18px; list-style: square; color: var(--text-2); font-size: 14.5px; }
.pcard li { margin: 4px 0; } .pcard li::marker { color: var(--ember); }
.pcard .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pcard .links .btn { padding: 8px 13px; font-size: 13.5px; }
.status { font-family: var(--mono); font-size: 11.5px; border-radius: 999px; padding: 3px 9px; border: 1px solid var(--line-2); color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.status.live::before { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.status.proprietary::before { background: var(--ember); box-shadow: 0 0 8px var(--ember); }
.status.winner { border-color: rgba(255, 200, 87, .5); color: var(--amber); } .status.winner::before { background: var(--amber); }
.status.wip::before { background: var(--ice); }
.media { display: grid; gap: 10px; align-content: start; min-width: 0; }
.media video, .media iframe, .media img { width: 100%; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: #050810; display: block; }
.media .frame { position: relative; aspect-ratio: 16 / 9; }
.media .frame iframe, .media .frame video { position: absolute; inset: 0; width: 100%; height: 100%; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.shots a { display: block; } .shots img { aspect-ratio: 16 / 10; object-fit: cover; }
.soon { aspect-ratio: 16 / 9; border: 1px dashed var(--line-2); border-radius: var(--r-sm); display: grid; place-content: center; text-align: center; gap: 4px; font-family: var(--mono); color: var(--muted); font-size: 13px; background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px), radial-gradient(ellipse at center, rgba(255, 122, 69, .10), transparent 65%); }
.soon b { color: var(--ember); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 600; }
.soon small { color: var(--line-2); font-size: 11px; }

/* progress timeline */
.timeline { position: relative; display: grid; gap: 18px; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, var(--ember), var(--ice), transparent); }
.entry { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 22px; display: grid; gap: 8px; min-width: 0; }
.entry::before { content: ""; position: absolute; left: -27px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ember); box-shadow: 0 0 10px rgba(255, 122, 69, .6); }
.entry:first-child::before { background: var(--lime); border-color: var(--lime); box-shadow: 0 0 10px var(--lime); }
.entry .date { font-family: var(--mono); font-size: 12.5px; color: var(--ice); }
.entry h2 { font-size: 20px; margin: 0; }
.entry p { color: var(--text-2); font-size: 15px; }
.entry .media { margin-top: 6px; max-width: 560px; }
.timeline .chips { margin-top: 0; }

/* live gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.gcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.gcard .media { padding: 12px 12px 0; } .gcard .soon { aspect-ratio: 16 / 9; }
.gcard .gbody { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.gcard h2 { font-size: 20px; margin: 0; }
.gcard p { color: var(--text-2); font-size: 14.5px; }
.gcard .links { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.gcard .links .btn { padding: 8px 13px; font-size: 13.5px; }
.empty { color: var(--muted); font-family: var(--mono); border: 1px dashed var(--line-2); border-radius: var(--r); padding: 28px; text-align: center; }

/* ---------------- skills ---------------- */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.skill { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.skill h3 { font-family: var(--mono); font-size: 14px; color: var(--ice); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.pass { font-size: 10.5px; color: #0f2a05; background: var(--lime); border-radius: 4px; padding: 1px 6px; font-weight: 700; letter-spacing: .06em; }
.skill .chips { margin-top: 0; padding-top: 0; }

/* ---------------- credentials ---------------- */
.certs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cert { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; position: relative; overflow: hidden; }
a.cert { display: block; color: inherit; text-decoration: none; transition: border-color .2s, box-shadow .2s; }
a.cert:hover, a.cert:focus-visible { border-color: rgba(184, 255, 87, .55); box-shadow: 0 0 0 1px rgba(184, 255, 87, .25), 0 10px 30px rgba(0, 0, 0, .35); }
.cert-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 16px; font-size: 13.5px; }
.cert-more span { font-family: var(--mono); font-size: 12px; color: var(--muted, #8a9cb3); }
.cert-more a { color: var(--text-2); border-bottom: 1px dashed var(--line); text-decoration: none; }
.cert-more a:hover, .cert-more a:focus-visible { color: var(--lime); border-color: var(--lime); }
a.cert::after { content: "verify ↗"; position: absolute; right: 12px; top: 12px; font-family: var(--mono); font-size: 10.5px; color: var(--lime); border: 1px solid rgba(184, 255, 87, .3); border-radius: 999px; padding: 2px 7px; }
.cert-code { font-family: var(--mono); font-weight: 700; font-size: 26px; color: var(--ember); margin-bottom: 10px; }
.cert h3 { font-size: 16.5px; }
.extras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.award, .edu { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; display: grid; gap: 8px; }
.award { border-color: rgba(255, 200, 87, .4); background: linear-gradient(160deg, rgba(255, 200, 87, .07), var(--card) 65%); }
.award h3, .edu h3 { font-size: 18px; }
.award p:last-child, .edu p:last-child { color: var(--text-2); font-size: 14.5px; }

/* ---------------- off-duty photo strip ---------------- */
.offduty { background: radial-gradient(900px 400px at 20% 100%, rgba(69, 224, 255, .07), transparent 70%); }
.od-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: end; }
.od { margin: 0; display: grid; gap: 10px; min-width: 0; }
.od:nth-child(2) { transform: translateY(-28px); }
.od-frame { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--card); box-shadow: var(--shadow); }
.od-frame img { width: 100%; height: 118%; object-fit: cover; object-position: center 30%; transform: translateY(-8%); will-change: transform; filter: saturate(1.05) contrast(1.03); transition: filter .5s; }
.od-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 9, 15, .0) 55%, rgba(6, 9, 15, .55)); pointer-events: none; }
.od-frame::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); pointer-events: none; }
.od figcaption { font-family: var(--mono); font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.od-no { color: var(--ice); border: 1px solid rgba(69, 224, 255, .3); border-radius: 6px; padding: 1px 7px; font-size: 11px; }
.od:hover .od-frame img { filter: saturate(1.15) contrast(1.05); }

/* ---------------- contact ---------------- */
.contact { background: radial-gradient(800px 320px at 50% 100%, rgba(255, 122, 69, .14), transparent 70%); }
.contact .btn.primary { word-break: break-all; }

/* ---------------- footer ---------------- */
.foot { border-top: 1px solid var(--line); padding: 22px 0; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }

/* ---------------- responsive ---------------- */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .lede { max-width: 640px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .certs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-jobs { grid-template-columns: 1fr; }
  .proj.featured { grid-template-columns: 1fr; }
  .screen { min-height: 150px; }
  .pcard { grid-template-columns: 1fr; }
  .stage { max-width: 640px; } .stage-view { aspect-ratio: 4 / 3; }
  .sub-hero { min-height: min(60vh, 520px); }
}
@media (max-width: 760px) {
  .section { padding: 64px 0; }
  .menu-btn { display: block; }
  .menu { display: none; position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 8px 0 12px; }
  .menu.open { display: flex; }
  .menu a { padding: 12px 20px; font-size: 15px; border-radius: 0; }
  .menu-term { padding: 8px 20px 0; }
  .kbd-btn { margin: 0; }
  .projects { grid-template-columns: 1fr; }
  .proj.featured { grid-column: auto; }
  .extras { grid-template-columns: 1fr; }
  .log li { grid-template-columns: 1fr; gap: 6px; }
  .log .k { justify-self: start; padding: 2px 8px; }
  .job { padding: 20px 18px 20px 20px; }
  .stage-view { aspect-ratio: 1 / 1; }
  .stage-meta { display: none; }
  .pcard { padding: 20px 18px; }
  .timeline { padding-left: 22px; } .entry::before { left: -21px; }
  .od-track { gap: 12px; } .od:nth-child(2) { transform: translateY(-16px); }
  .sub-hero { padding-top: 56px; min-height: 440px; }
  .sub-hero .fx::after, .sub-hero:not(.has-video) .fx::after { background: linear-gradient(180deg, rgba(6, 9, 15, .22) 0%, rgba(6, 9, 15, .38) 40%, rgba(6, 9, 15, .82) 100%); }
  .hero-bg::after { background: linear-gradient(180deg, rgba(6, 9, 15, .5), rgba(6, 9, 15, .72) 55%, var(--bg) 100%); }
}
@media (max-width: 520px) {
  .hero { padding-top: 36px; }
  .metrics, .skills, .certs { grid-template-columns: 1fr; }
  .panel .big { font-size: 34px; }
  .hero-tags li { font-size: 11.5px; }
  .eyebrow { font-size: 11.5px; }
  .term-hint { display: none; }
  .stage-view { aspect-ratio: 4 / 5; }
  .portrait { height: 78%; max-width: 54%; }
  .cat { min-height: 200px; }
  .btn { padding: 10px 14px; font-size: 14px; }
  .contact .btn.primary { font-size: 13.5px; }
  .term-out { min-height: 120px; max-height: 220px; }
  .od-track { grid-template-columns: 1fr 1fr; } .od:nth-child(3) { grid-column: span 2; } .od:nth-child(3) .od-frame { aspect-ratio: 16 / 11; }
  .od:nth-child(2) { transform: none; }
  .od figcaption { font-size: 11.5px; }
  .fx-note { font-size: 11px; } .fx-note .fx-what { display: none; } .fx-note .fx-sep { display: none; }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1; transform: none; }
  .section .stage-state { color: var(--lime); }
  .portrait .scan, .portrait .rescan { display: none; }
  .portrait picture { clip-path: none; }
  .hero-bg canvas, .sub-hero .fx canvas { opacity: 1; }
  .hero-bg.has-clip canvas.on { opacity: .5; }
  .od-frame img { transform: none; height: 100%; }
}
