/* =========================================================
   Katarina Stefanović · portfolio
   Aesthetic: night-shift network operations centre
   ========================================================= */
:root {
  --bg: #0a0f14;
  --bg-2: #0d141b;
  --panel: #101922;
  --panel-2: #14202b;
  --line: rgba(150, 182, 208, 0.13);
  --line-strong: rgba(150, 182, 208, 0.26);
  --text: #e6edf3;
  --muted: #8797a8;
  --dim: #5b6b7b;
  --signal: #47d6b6;
  --signal-soft: rgba(71, 214, 182, 0.12);
  --hot: #ff6a3d;
  --hot-soft: rgba(255, 106, 61, 0.14);
  --amber: #f2b84b;

  --f-display: 'Unbounded', 'Arial Black', sans-serif;
  --f-body: 'Instrument Sans', 'Helvetica Neue', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --pad: clamp(20px, 5vw, 72px);
  --max: 1280px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
em { font-style: normal; color: var(--signal); }
mark { background: linear-gradient(transparent 62%, var(--hot-soft) 62%); color: var(--text); }
::selection { background: var(--signal); color: var(--bg); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

.mono { font-family: var(--f-mono); font-size: .82em; letter-spacing: .01em; }
.small { font-size: .78rem; }
.muted { color: var(--muted); }

/* Film grain + scanline overlay (fixed, non-interactive) */
.grain {
  position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 16px var(--pad);
  transition: background .4s var(--ease), border-color .4s, padding .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10, 15, 20, .78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-color: var(--line);
  padding-top: 11px; padding-bottom: 11px;
}
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--f-display); font-weight: 500; font-size: .9rem; letter-spacing: .02em; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.bars i { width: 4px; background: var(--signal); border-radius: 1px; animation: bar 2.6s var(--ease) infinite; }
.bars i:nth-child(1) { height: 30%; animation-delay: 0s; }
.bars i:nth-child(2) { height: 55%; animation-delay: .15s; }
.bars i:nth-child(3) { height: 78%; animation-delay: .3s; }
.bars i:nth-child(4) { height: 100%; background: var(--hot); animation-delay: .45s; }
@keyframes bar { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a {
  position: relative; font-size: .88rem; color: var(--muted);
  transition: color .25s;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--signal); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.lang-switch {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px;
  font-family: var(--f-mono); font-size: .74rem; letter-spacing: .08em;
}
.lang-switch button { position: relative; z-index: 1; padding: 6px 12px; border-radius: 999px; color: var(--muted); transition: color .3s; }
.lang-switch button[aria-pressed="true"] { color: var(--bg); font-weight: 500; }
.lang-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  background: var(--signal); border-radius: 999px; transition: transform .45s var(--ease);
}
html[data-lang="sr"] .lang-thumb { transform: translateX(100%); }
body.lang-swap [data-i18n], body.lang-swap .hops, body.lang-swap .cert-list { animation: swap .5s var(--ease); }
@keyframes swap { 0% { opacity: 0; filter: blur(4px); } 100% { opacity: 1; filter: none; } }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 120px var(--pad) 90px;
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 78% 45%, rgba(71, 214, 182, .09), transparent 60%),
    radial-gradient(50% 40% at 10% 100%, rgba(255, 106, 61, .07), transparent 70%),
    var(--bg);
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 160px;
  background: linear-gradient(transparent, var(--bg)); pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 2; width: 100%; max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: clamp(30px, 5vw, 80px); align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); position: relative; flex: none; }
.dot.live::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--signal);
  animation: ping 2s var(--ease) infinite;
}
.dot.warn { background: var(--amber); }
@keyframes ping { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }

.hero-name {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(2.7rem, 7.4vw, 6.6rem); line-height: .95; letter-spacing: -.035em;
  margin: 22px 0 26px;
}
.hero-name .line { display: block; }
.hero-name .outline {
  color: transparent; -webkit-text-stroke: 1.4px var(--text);
  background: linear-gradient(100deg, var(--text) 0 40%, transparent 40%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
  animation: fill 2.4s .9s var(--ease) forwards;
}
@keyframes fill { to { background-position: 0 0; } }
.hero-lead { max-width: 560px; font-size: clamp(1.02rem, 1.3vw, 1.16rem); color: #b9c6d2; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px; font-weight: 500; font-size: .93rem;
  transition: transform .3s var(--ease), background .3s, border-color .3s, color .3s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .3s var(--ease); }
.btn-primary { background: var(--signal); color: #04201a; }
.btn-primary:hover { background: #6de4ca; transform: translateY(-2px); }
.btn-primary:hover svg { transform: translateX(4px); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--signal); color: var(--signal); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }

.kpis {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; margin-top: 54px;
  border-top: 1px solid var(--line); max-width: 640px;
}
.kpi { padding: 18px 16px 0 0; }
.kpi + .kpi { padding-left: 16px; border-left: 1px solid var(--line); }
.kpi dt { font-family: var(--f-mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); min-height: 3.3em; line-height: 1.6; }
.kpi dd { font-family: var(--f-display); font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 500; margin-top: 6px; display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.kpi dd .mono { font-family: var(--f-display); font-size: 1em; }
.kpi dd small { font-family: var(--f-mono); font-size: .7rem; color: var(--signal); }

/* Visual: portrait inside a cell site */
.hero-visual { position: relative; display: grid; place-items: center; }
.cell-site { position: relative; width: min(100%, 440px); aspect-ratio: 1; display: grid; place-items: center; }
.ring { position: absolute; border-radius: 50%; border: 1px solid var(--line-strong); }
.r1 { inset: 8%; }
.r2 { inset: -4%; border-style: dashed; border-color: var(--line); animation: spin 80s linear infinite; }
.r3 { inset: 8%; border-color: var(--signal); opacity: 0; animation: wave 4s var(--ease) infinite; }
@keyframes wave { 0% { transform: scale(.85); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.portrait {
  position: relative; width: 76%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: #dfe3e4;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 0 6px var(--bg), 0 0 0 7px var(--line-strong);
}
.portrait img {
  position: absolute; width: 175%; max-width: none; height: auto; left: 50%; top: -12%;
  transform: translateX(-50%);
  filter: saturate(.9) contrast(1.04);
}
.portrait::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(10, 15, 20, .45));
}
.orbit {
  position: absolute; inset: -12%; border-radius: 50%;
  border: 1px solid rgba(255, 106, 61, .28);
  transform: rotateX(70deg) rotateZ(-18deg);
  transform-style: preserve-3d;
}
.orbit .sat { position: absolute; inset: 0; border-radius: 50%; animation: spin 12s linear infinite; }
.orbit .sat::before {
  content: ''; position: absolute; left: 50%; top: -5px; width: 10px; height: 10px; margin-left: -5px; border-radius: 2px;
  background: var(--hot); box-shadow: 0 0 0 4px var(--hot-soft);
}
.hud {
  position: absolute; right: -6px; bottom: 4%;
  background: rgba(13, 20, 27, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px;
  font-family: var(--f-mono); font-size: .7rem; min-width: 190px;
}
.hud-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 8px; align-items: baseline; padding: 3px 0; }
.hud-row span { color: var(--dim); letter-spacing: .1em; }
.hud-row b { font-weight: 500; color: var(--signal); font-variant-numeric: tabular-nums; }
.hud-row i { font-style: normal; color: var(--muted); }

.scroll-cue { position: absolute; z-index: 3; left: 50%; bottom: 28px; width: 22px; height: 36px; border: 1px solid var(--line-strong); border-radius: 12px; transform: translateX(-50%); }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; background: var(--signal); border-radius: 2px; animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }

/* ---------- TICKER ---------- */
.ticker { border-block: 1px solid var(--line); background: var(--bg-2); overflow: hidden; padding: 16px 0; }
.ticker-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.ticker-track span {
  font-family: var(--f-display); font-size: .95rem; font-weight: 400; color: var(--muted);
  padding: 0 26px; position: relative; white-space: nowrap;
}
.ticker-track span::after { content: '/'; position: absolute; right: -4px; color: var(--signal); opacity: .6; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- SECTIONS ---------- */
.section { position: relative; max-width: var(--max); margin: 0 auto; padding: clamp(90px, 12vw, 150px) var(--pad) 0; }
.section-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: clamp(40px, 6vw, 70px); }
.section-head .idx { font-family: var(--f-mono); font-size: .8rem; color: var(--signal); padding: 4px 8px; border: 1px solid var(--signal-soft); border-radius: 6px; background: var(--signal-soft); }
.section-head h2 { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.9rem, 4.4vw, 3.4rem); letter-spacing: -.03em; line-height: 1.05; }
.mini { font-family: var(--f-mono); font-weight: 500; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease) var(--d, 0s), transform .9s var(--ease) var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- ABOUT ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(30px, 6vw, 90px); align-items: start; }
.about-lead { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.25rem, 2.3vw, 1.85rem); line-height: 1.38; letter-spacing: -.015em; }
.about-side { color: #b9c6d2; padding-top: 8px; }
.about-side .mini { margin-top: 34px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: .85rem; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text);
  transition: border-color .3s, background .3s, color .3s;
}
.chips li:hover { border-color: var(--signal); color: var(--signal); background: var(--signal-soft); }

/* ---------- EXPERIENCE ---------- */
.timeline { position: relative; }
.timeline::before { content: ''; position: absolute; left: 220px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--signal), var(--line) 60%, transparent); }
.tl-item { display: grid; grid-template-columns: 220px 1fr; gap: 0; padding-bottom: 56px; }
.tl-when { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; color: var(--muted); padding-right: 30px; padding-top: 6px; }
.tl-body { position: relative; padding-left: 44px; }
.tl-body::before {
  content: ''; position: absolute; left: -6px; top: 10px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--signal);
}
.tl-item:first-child .tl-body::before { background: var(--signal); box-shadow: 0 0 0 6px var(--signal-soft); }
.tl-body h3 { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.15rem, 2vw, 1.55rem); letter-spacing: -.02em; line-height: 1.2; }
.where { color: var(--muted); margin-top: 6px; font-size: .95rem; }
.ticks { margin-top: 20px; display: grid; gap: 12px; max-width: 760px; }
.ticks li { position: relative; padding-left: 26px; color: #c3cfda; }
.ticks li::before { content: ''; position: absolute; left: 0; top: .7em; width: 12px; height: 1px; background: var(--signal); }
.tag { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--muted); }
.tag-live { color: var(--signal); border-color: rgba(71, 214, 182, .4); background: var(--signal-soft); }
.vendor-row { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.vendor-row span { font-family: var(--f-mono); font-size: .76rem; padding: 8px 14px; border: 1px dashed var(--line-strong); border-radius: 6px; color: var(--text); }

.project {
  position: relative; margin-top: 30px;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(30px, 5vw, 70px); align-items: center;
  padding: clamp(28px, 4vw, 50px); border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(71, 214, 182, .08), transparent 45%),
    var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}
.project::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px; mask-image: radial-gradient(70% 90% at 90% 50%, #000, transparent); -webkit-mask-image: radial-gradient(70% 90% at 90% 50%, #000, transparent); opacity: .6;
}
.project > * { position: relative; }
.project-title { font-family: var(--f-display); font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 700; letter-spacing: -.04em; line-height: 1; margin-top: 16px; }
.project-sub { font-family: var(--f-mono); color: var(--signal); font-size: .86rem; margin: 8px 0 18px; }
.project-copy p:not(.eyebrow):not(.project-sub) { color: #b9c6d2; }
.project-copy .mono { margin-top: 18px; color: var(--muted); }
.pipeline { display: grid; grid-template-columns: 1fr 40px 1fr 40px 1fr; align-items: center; }
.stage {
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 18px 14px;
  display: flex; flex-direction: column; gap: 6px; min-height: 130px;
  transition: border-color .3s, transform .3s var(--ease);
}
.stage:hover { border-color: var(--signal); transform: translateY(-4px); }
.stage .n { font-family: var(--f-mono); font-size: .7rem; color: var(--signal); }
.stage b { font-family: var(--f-display); font-weight: 500; font-size: .98rem; margin-top: auto; overflow-wrap: anywhere; }
.stage small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.wire { height: 1px; background: var(--line-strong); position: relative; overflow: hidden; }
.wire i { position: absolute; top: -1px; left: 0; width: 14px; height: 3px; border-radius: 2px; background: var(--signal); animation: flow 1.8s linear infinite; }
.wire:nth-of-type(4) i { animation-delay: .9s; }
@keyframes flow { from { transform: translateX(-14px); } to { transform: translateX(40px); } }

/* ---------- TALKS ---------- */
.terminal { border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: #070b0f; max-width: 820px; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.term-bar i:first-child { background: var(--hot); }
.term-bar span { margin-left: 10px; font-family: var(--f-mono); font-size: .72rem; color: var(--dim); }
.term-body { padding: 18px 20px; font-family: var(--f-mono); font-size: clamp(.74rem, 1.3vw, .9rem); white-space: pre-wrap; word-break: break-word; line-height: 1.8; }
.prompt { color: var(--signal); }
.caret { display: inline-block; width: .6em; height: 1.1em; vertical-align: -.2em; background: var(--signal); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.term-out { color: var(--muted); }

.route { position: relative; margin: 60px 0 30px; }
.route-line { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 40px; overflow: visible; }
.route-line path { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 4 6; fill: none; vector-effect: non-scaling-stroke; }
.route-line .packet { fill: var(--hot); }
.route-nodes { position: relative; display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); }
.route-nodes li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.route-nodes button { display: contents; }
.route-nodes .nd {
  margin-top: 13px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--signal);
  transition: transform .3s var(--ease), background .3s;
}
.route-nodes li.far .nd { border-color: var(--hot); }
.route-nodes li:hover .nd, .route-nodes li.on .nd { transform: scale(1.4); background: var(--signal); }
.route-nodes .lbl { font-family: var(--f-mono); font-size: .64rem; color: var(--muted); line-height: 1.3; }
.route-nodes .lbl b { display: block; color: var(--text); font-weight: 500; font-size: .7rem; }

.hops { margin-top: 40px; border-top: 1px solid var(--line); }
.hop {
  display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(20px, 3.5vw, 50px);
  padding: clamp(34px, 5vw, 58px) 0; border-bottom: 1px solid var(--line);
  position: relative;
}
.hop-meta { font-family: var(--f-mono); font-size: .78rem; color: var(--muted); display: flex; flex-direction: column; gap: 8px; }
.hop-num { font-family: var(--f-display); font-size: 2.6rem; font-weight: 500; color: transparent; -webkit-text-stroke: 1px rgba(150, 182, 208, .5); line-height: 1; transition: -webkit-text-stroke-color .4s, color .4s; }
.hop:hover .hop-num { -webkit-text-stroke-color: var(--signal); }
.hop-meta .date { color: var(--text); }
.hop-meta .type { align-self: flex-start; }
.hop-award { align-self: flex-start; display: inline-flex; gap: 6px; align-items: center; font-family: var(--f-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--bg); background: var(--amber); padding: 4px 8px; border-radius: 4px; }
.hop-title { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.12rem, 1.8vw, 1.45rem); line-height: 1.25; letter-spacing: -.02em; }
.hop-sub { color: var(--signal); font-size: .88rem; margin-top: 10px; }
.hop-desc { color: #b9c6d2; margin-top: 14px; font-size: .97rem; }
.hop-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hop-links a {
  display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; padding: 8px 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; transition: border-color .3s, color .3s, background .3s;
}
.hop-links a::before { content: ''; width: 0; height: 0; border-left: 7px solid var(--hot); border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; }
.hop-links a:hover { border-color: var(--hot); background: var(--hot-soft); }

.mosaic { display: grid; gap: 8px; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 92px; }
.mosaic button { position: relative; overflow: hidden; border-radius: 10px; background: var(--panel); }
.mosaic button img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .5s; filter: saturate(.85); }
.mosaic button:hover img { transform: scale(1.06); filter: saturate(1.05); }
.mosaic button::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .3s;
}
.mosaic button:hover::after { box-shadow: inset 0 0 0 2px var(--signal); }
/* layouts by count */
.mosaic.n1 button { grid-column: 1 / -1; grid-row: span 3; }
.mosaic.n2 button:nth-child(1) { grid-column: span 4; grid-row: span 3; }
.mosaic.n2 button:nth-child(2) { grid-column: span 2; grid-row: span 3; }
.mosaic.n3 button:nth-child(1) { grid-column: span 4; grid-row: span 3; }
.mosaic.n3 button:nth-child(2), .mosaic.n3 button:nth-child(3) { grid-column: span 2; grid-row: span 1; }
.mosaic.n3 button:nth-child(2) { grid-row: span 2; }
.mosaic.n4 button:nth-child(1) { grid-column: span 4; grid-row: span 2; }
.mosaic.n4 button:nth-child(2) { grid-column: span 2; grid-row: span 2; }
.mosaic.n4 button:nth-child(3), .mosaic.n4 button:nth-child(4) { grid-column: span 3; grid-row: span 2; }
.mosaic .count-badge { position: absolute; left: 10px; bottom: 10px; font-family: var(--f-mono); font-size: .64rem; padding: 3px 7px; border-radius: 4px; background: rgba(10, 15, 20, .75); color: var(--text); }

/* ---------- STACK ---------- */
.stack-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.gen-bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 260px; padding-top: 10px; }
.gb { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.gb::before {
  content: ''; display: block; height: var(--h); border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--signal), rgba(71, 214, 182, .15));
  transform-origin: bottom; transform: scaleY(0); transition: transform 1.2s var(--ease);
}
.gb.alt::before { background: linear-gradient(180deg, #7aa7c7, rgba(122, 167, 199, .12)); }
.gb.hot::before { background: linear-gradient(180deg, var(--hot), rgba(255, 106, 61, .12)); }
.gen.in .gb::before { transform: scaleY(1); }
.gen .gb:nth-child(2)::before { transition-delay: .08s; }
.gen .gb:nth-child(3)::before { transition-delay: .16s; }
.gen .gb:nth-child(4)::before { transition-delay: .24s; }
.gen .gb:nth-child(5)::before { transition-delay: .32s; }
.gen .gb:nth-child(6)::before { transition-delay: .4s; }
.gb span { font-family: var(--f-display); font-size: .9rem; margin-top: 10px; }
.gb small { font-family: var(--f-mono); font-size: .62rem; color: var(--muted); }
.rack { display: grid; gap: 8px; }
.rack li {
  display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; font-size: .9rem;
  transition: border-color .3s, transform .3s var(--ease);
}
.rack li:hover { border-color: var(--line-strong); transform: translateX(4px); }
.rack b { font-weight: 500; }
.rack small { font-family: var(--f-mono); font-size: .64rem; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); animation: bar 3s infinite; }
.rack li:nth-child(2n) .led { animation-delay: .7s; }
.rack li:nth-child(3n) .led { animation-delay: 1.4s; }
.tools .chips { margin-bottom: 28px; }
.langs { display: grid; gap: 12px; margin-bottom: 22px; }
.langs li { display: grid; grid-template-columns: 1fr auto 96px; align-items: center; gap: 12px; font-size: .92rem; }
.langs small { color: var(--muted); font-size: .78rem; text-align: right; }
.meter { display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.meter i { width: 5px; background: var(--line-strong); border-radius: 1px; }
.meter i:nth-child(1) { height: 30%; } .meter i:nth-child(2) { height: 47%; } .meter i:nth-child(3) { height: 64%; } .meter i:nth-child(4) { height: 82%; } .meter i:nth-child(5) { height: 100%; }
.meter[style*="--v:5"] i, .meter[style*="--v:4"] i:nth-child(-n+4), .meter[style*="--v:1"] i:nth-child(1) { background: var(--signal); }

/* ---------- CREDENTIALS ---------- */
.award {
  display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center;
  padding: 30px clamp(24px, 4vw, 44px); margin-bottom: 18px; border-radius: 18px;
  background: linear-gradient(110deg, rgba(242, 184, 75, .13), rgba(242, 184, 75, .02) 60%), var(--panel);
  border: 1px solid rgba(242, 184, 75, .28);
}
.award-badge svg { width: 88px; height: 88px; fill: none; stroke: var(--amber); stroke-width: 1.4; }
.award-badge svg circle:first-child { stroke-dasharray: 3 5; animation: spin 40s linear infinite; transform-origin: center; }
.award-badge svg path { fill: rgba(242, 184, 75, .16); }
.award .eyebrow { color: var(--amber); }
.award h3 { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.3rem, 2.6vw, 2rem); letter-spacing: -.02em; margin: 8px 0 6px; }

.cred-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 18px; }
.edu { display: grid; gap: 20px; }
.edu li { display: grid; gap: 3px; padding-left: 16px; border-left: 1px solid var(--line-strong); }
.edu li:first-child { border-color: var(--signal); }
.edu .mono { color: var(--signal); }
.edu b, .list b { font-weight: 500; font-size: .96rem; line-height: 1.35; }
.edu small, .list small { color: var(--muted); font-size: .82rem; }
.list { display: grid; gap: 14px; margin-bottom: 28px; }
.list:last-child { margin-bottom: 0; }
.list li { display: grid; gap: 2px; }
.pubs { counter-reset: p; display: grid; gap: 18px; }
.pubs li { counter-increment: p; position: relative; padding-left: 38px; font-size: .95rem; line-height: 1.45; }
.pubs li::before { content: counter(p, decimal-leading-zero); position: absolute; left: 0; top: 2px; font-family: var(--f-mono); font-size: .72rem; color: var(--signal); }
.pubs small { display: block; color: var(--muted); font-size: .8rem; margin-top: 3px; }

.certs { margin-top: 18px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; }
.cert-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0 34px; }
.cert-list li {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 14px 0; border-bottom: 1px dashed var(--line);
}
.cert-list b { font-weight: 500; font-size: .93rem; line-height: 1.35; }
.cert-list small { grid-column: 1; color: var(--muted); font-size: .8rem; }
.cert-list .mono { grid-column: 2; grid-row: 1 / span 2; color: var(--dim); white-space: nowrap; }

/* ---------- CONTACT ---------- */
.contact { padding-bottom: clamp(80px, 10vw, 130px); }
.contact-inner {
  position: relative; overflow: hidden; border-radius: 26px; padding: clamp(40px, 7vw, 96px) clamp(24px, 6vw, 80px);
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(71, 214, 182, .16), transparent 60%),
    radial-gradient(40% 60% at 0% 100%, rgba(255, 106, 61, .1), transparent 70%),
    var(--panel);
  border: 1px solid var(--line-strong);
}
.contact-inner::before {
  content: ''; position: absolute; right: -120px; top: -120px; width: 480px; height: 480px; border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 38px, var(--line) 38px 39px);
  pointer-events: none;
}
.contact-inner > * { position: relative; }
.contact-title { font-family: var(--f-display); font-weight: 600; font-size: clamp(2.1rem, 6vw, 5rem); letter-spacing: -.04em; line-height: 1; margin: 22px 0 20px; max-width: 900px; }
.contact-lead { color: #b9c6d2; max-width: 560px; font-size: 1.05rem; }
.big-mail {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 40px;
  font-family: var(--f-display); font-size: clamp(1.05rem, 3vw, 2rem); font-weight: 500; letter-spacing: -.02em;
  padding-bottom: 8px; border-bottom: 2px solid var(--signal); overflow-wrap: anywhere;
  transition: color .3s, gap .3s var(--ease);
}
.big-mail svg { width: 1em; height: 1em; flex: none; fill: none; stroke: var(--signal); stroke-width: 2; transition: transform .35s var(--ease); }
.big-mail:hover { color: var(--signal); }
.big-mail:hover svg { transform: translate(4px, -4px); }
.contact-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 60px; padding-top: 28px; border-top: 1px solid var(--line); }
.contact-links li { display: grid; gap: 4px; min-width: 0; }
.contact-links small { font-family: var(--f-mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); }
.contact-links a { font-size: .95rem; overflow-wrap: anywhere; transition: color .25s; }
.contact-links a:hover { color: var(--signal); }

.footer {
  max-width: var(--max); margin: 0 auto; padding: 28px var(--pad) 40px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); border-top: 1px solid var(--line);
}
.footer a:hover { color: var(--signal); }

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: grid; grid-template-columns: 64px 1fr 64px; align-items: center;
  background: rgba(6, 9, 12, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 24px; animation: swap .35s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox figure { display: grid; justify-items: center; gap: 14px; min-width: 0; }
.lightbox img { max-height: 80vh; width: auto; max-width: 100%; border-radius: 10px; background: var(--panel); }
.lightbox figcaption { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); text-align: center; }
.lb-close { position: absolute; top: 16px; right: 20px; font-size: 2rem; line-height: 1; width: 44px; height: 44px; border-radius: 50%; }
.lb-nav { font-size: 2.4rem; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line-strong); justify-self: center; transition: border-color .3s, color .3s; }
.lb-nav:hover, .lb-close:hover { color: var(--signal); border-color: var(--signal); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1080px) {
  .stack-grid, .cred-grid { grid-template-columns: 1fr 1fr; }
  .stack-grid .gen { grid-column: 1 / -1; }
  .cred-grid .panel:last-child { grid-column: 1 / -1; }
  .hop { grid-template-columns: 130px minmax(0, 1fr); }
  .hop .mosaic { grid-column: 2; }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .lang-switch { margin-left: auto; }
  .hero { padding-top: 100px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 280px; margin: 0 auto; width: 100%; }
  .hud { right: -14px; bottom: -2%; min-width: 170px; font-size: .64rem; }
  .about-grid, .project { grid-template-columns: 1fr; }
  .timeline::before { left: 5px; }
  .tl-item { grid-template-columns: 1fr; }
  .tl-when { flex-direction: row; align-items: center; padding: 0 0 12px 32px; }
  .tl-body { padding-left: 32px; }
  .tl-body::before { left: 0; }
  .route-nodes .lbl span { display: none; }
  .route-nodes .lbl b { font-size: .58rem; writing-mode: vertical-rl; transform: rotate(180deg); }
  .contact-links { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(3) { padding-left: 0; border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 14px; }
  .stack-grid, .cred-grid { grid-template-columns: 1fr; }
  .hop { grid-template-columns: 1fr; gap: 18px; }
  .hop .mosaic { grid-column: auto; }
  .hop-meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
  .hop-num { font-size: 1.8rem; }
  .mosaic { grid-auto-rows: 64px; }
  .pipeline { grid-template-columns: 1fr; gap: 0; }
  .wire { width: 1px; height: 28px; justify-self: center; }
  .stage { min-height: 0; }
  .stage b { margin-top: 6px; }
  .wire i { width: 3px; height: 12px; left: -1px; top: 0; animation-name: flowv; }
  .route { display: none; }
  .award { grid-template-columns: 1fr; gap: 16px; }
  .award-badge svg { width: 64px; height: 64px; }
  .contact-links { grid-template-columns: 1fr; }
  .lightbox { grid-template-columns: 1fr; padding: 60px 12px; }
  .lb-nav { position: absolute; bottom: 20px; }
  .lb-prev { left: 30%; } .lb-next { right: 30%; }
  .footer { flex-direction: column; }
}
@keyframes flowv { from { transform: translateY(-12px); } to { transform: translateY(28px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .hero-name .outline { background-position: 0 0; }
}

/* ---------- PRINT ---------- */
@media print {
  :root { --bg: #fff; --bg-2: #fff; --panel: #fff; --text: #111; --muted: #444; --dim: #666; --line: #ddd; --line-strong: #bbb; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .grain, .nav, .hero-canvas, .scroll-cue, .ticker, .hud, .orbit, .ring, .hero-actions, .route, .terminal, .mosaic, .lightbox, .hop-links, .pipeline { display: none !important; }
  .hero { min-height: 0; padding: 0 0 20px; background: none; }
  .hero::after { display: none; }
  .hero-inner { grid-template-columns: 1fr 140px; }
  .hero-visual { order: 0; }
  .cell-site { width: 140px; }
  .portrait { box-shadow: none; }
  .hero-name { font-size: 28pt; margin: 6px 0 10px; }
  .hero-name .outline { color: #111; -webkit-text-stroke: 0; background: none; }
  .hero-lead, .about-side, .ticks li, .hop-desc, .contact-lead, .project-copy p { color: #222 !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .section { padding: 18px 0 0; max-width: none; }
  .section-head { margin-bottom: 12px; }
  .section-head h2 { font-size: 16pt; }
  .hop { grid-template-columns: 90px 1fr; padding: 10px 0; break-inside: avoid; }
  .panel, .project, .award, .certs, .contact-inner { border: 1px solid #ddd; background: #fff !important; break-inside: avoid; padding: 14px; }
  .contact-inner::before, .project::before { display: none; }
  .contact-title { font-size: 18pt; }
  .stack-grid, .cred-grid { grid-template-columns: 1fr 1fr; }
  .gb::before { transform: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  em, .prompt, .hop-sub, .project-sub { color: #0b7d66; }
}
