/* ───────── Tokens ───────── */
:root {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --c1: #22d3ee;
  --c2: #6366f1;
  --c3: #a855f7;
  --grad: linear-gradient(120deg, var(--c1) 0%, var(--c2) 50%, var(--c3) 100%);

  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root,
:root[data-theme="dark"] {
  --bg: #07080d;
  --bg-2: #0c0e16;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #eef0f7;
  --text-2: #a4a9bb;
  --text-3: #6d7388;
  --grid-line: rgba(255, 255, 255, .035);
  --orb-opacity: .55;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
  --term-bg: #0a0c14;
}
:root[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-2: #ffffff;
  --surface: rgba(255, 255, 255, .75);
  --surface-2: #ffffff;
  --border: rgba(15, 18, 40, .08);
  --border-strong: rgba(15, 18, 40, .18);
  --text: #0d1020;
  --text-2: #4a5068;
  --text-3: #7d8399;
  --grid-line: rgba(15, 18, 40, .045);
  --orb-opacity: .22;
  --shadow: 0 30px 60px -30px rgba(30, 40, 90, .25);
  --term-bg: #0d1020;
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}
a { color: inherit; text-decoration: none; }
img { display: block; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: rgb(var(--c2-rgb) / .35); }
:focus-visible { outline: 2px solid var(--c1); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ───────── Background ───────── */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--orb-opacity); }
.o1 { width: 520px; height: 520px; background: var(--c2); top: -180px; left: -120px; animation: drift 22s ease-in-out infinite; }
.o2 { width: 440px; height: 440px; background: var(--c1); top: 80px; right: -160px; opacity: calc(var(--orb-opacity) * .7); animation: drift 26s ease-in-out infinite reverse; }
.o3 { width: 380px; height: 380px; background: var(--c3); top: 520px; left: 35%; opacity: calc(var(--orb-opacity) * .5); animation: drift 30s ease-in-out infinite; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.08); }
}

/* ───────── Nav ───────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom-color: var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 24px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo img { transition: transform .5s var(--ease); }
.logo:hover img { transform: rotate(-8deg) scale(1.06); }
.wordmark { font: 500 19px var(--font-display); letter-spacing: -.02em; color: var(--text); }
.wordmark b { font-weight: 700; margin-left: 4px; }
.links { display: flex; gap: 6px; }
.links a {
  font-size: 14.5px; color: var(--text-2); padding: 8px 14px; border-radius: 999px;
  transition: color .2s, background .2s;
}
.links a:hover, .links a.active { color: var(--text); background: var(--surface-2); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; font: 600 12.5px var(--font-mono); letter-spacing: .04em;
  transition: border-color .2s, background .2s, transform .2s;
}
.icon-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
:root[data-theme="dark"] .i-moon, :root[data-theme="light"] .i-sun { display: none; }
.menu-btn { display: none; }

/* ───────── Buttons ───────── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 24px; border-radius: 999px;
  font: 600 15px var(--font-body); cursor: pointer; border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s;
}
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-primary {
  color: #fff; background: var(--grad); background-size: 160% 100%;
  box-shadow: 0 10px 30px -10px rgb(var(--c2-rgb) / .7), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover { transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 16px 40px -12px rgb(var(--c2-rgb) / .85), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-ghost { color: var(--text); background: var(--surface); border-color: var(--border-strong); backdrop-filter: blur(8px); }
.btn-ghost:hover { transform: translateY(-2px); background: var(--surface-2); }

/* ───────── Hero ───────── */
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 56px;
  padding-top: 72px; padding-bottom: 72px; min-height: calc(100vh - 76px - 140px);
}
.pill {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px;
  padding: 7px 16px 7px 12px; border-radius: 999px;
  font-size: 13.5px; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, color .2s;
}
.pill:hover { border-color: var(--border-strong); color: var(--text); }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex: none; }
.pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #22c55e;
  animation: ping 2s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.hero h1 {
  font-size: clamp(40px, 5.2vw, 68px); line-height: 1.04; letter-spacing: -.045em; font-weight: 700;
  margin-bottom: 26px;
}
.lead { font-size: clamp(17px, 1.5vw, 19.5px); color: var(--text-2); max-width: 590px; margin-bottom: 36px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 24px; color: var(--text-3); font-size: 14px; }
.hero-meta li { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { color: var(--c1); }

/* Terminal */
.terminal {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--term-bg); border: 1px solid rgba(255,255,255,.09);
  box-shadow: var(--shadow), 0 0 0 1px rgb(var(--c2-rgb) / .08), 0 0 80px -20px rgb(var(--c2-rgb) / .4);
}
.terminal::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgb(var(--c1-rgb) / .5), transparent 40%, transparent 60%, rgb(var(--c3-rgb) / .5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.02); }
.term-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.term-title { margin-left: auto; margin-right: auto; font: 12.5px var(--font-mono); color: #7a8099; transform: translateX(-24px); }
.term-body {
  margin: 0; padding: 22px 22px 26px; min-height: 340px;
  font: 13.5px/1.75 var(--font-mono); color: #c9cde0; white-space: pre-wrap; word-break: break-word;
}
.term-body .p { color: #22d3ee; }
.term-body .c { color: #eef0f7; }
.term-body .o { color: #9aa0b8; }
.term-body .k { color: #a78bfa; }
.term-body .ok { color: #4ade80; }
.cursor { display: inline-block; width: 8px; height: 1.1em; background: #22d3ee; vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ───────── Stats ───────── */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); backdrop-filter: blur(12px);
}
.stat { padding: 30px 28px; display: flex; flex-direction: column; gap: 6px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat strong { font: 700 40px/1 var(--font-display); letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--text-2); font-size: 14px; line-height: 1.5; }

/* ───────── Sections ───────── */
.section { padding-top: 130px; }
.section-head { max-width: 720px; margin-bottom: 52px; }
.eyebrow { display: inline-block; font: 500 13px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c1); margin-bottom: 16px; }
.section-head h2 { font-size: clamp(32px, 4.2vw, 52px); line-height: 1.08; letter-spacing: -.035em; margin-bottom: 16px; }
.section-head p { font-size: 18px; color: var(--text-2); }

/* Cards */
.cards4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card, .project, .cert, .eco-card, .tl-card, .skill-group, .contact {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); backdrop-filter: blur(12px);
  transition: transform .35s var(--ease), border-color .35s, background .35s, box-shadow .35s;
}
.card { padding: 28px 26px; display: flex; flex-direction: column; }
.card:hover, .project:hover, .cert:hover, .eco-card:hover {
  transform: translateY(-4px); border-color: var(--border-strong); background: var(--surface-2); box-shadow: var(--shadow);
}
.card-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 22px;
  color: #fff; background: var(--grad); box-shadow: 0 10px 24px -10px rgb(var(--c2-rgb) / .8);
}
.card h3 { font-size: 20px; margin-bottom: 10px; line-height: 1.25; }
.card p { color: var(--text-2); font-size: 15px; margin-bottom: 22px; }
.mini { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.mini li { font: 12px var(--font-mono); color: var(--text-2); padding: 4px 9px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); }

/* Timeline */
.timeline { position: relative; display: grid; gap: 18px; }
.timeline::before {
  content: ""; position: absolute; left: 180px; top: 12px; bottom: 12px; width: 1px;
  background: linear-gradient(var(--c1), var(--c2), var(--c3), transparent);
}
.tl { display: grid; grid-template-columns: 180px 1fr; }
.tl-date { position: relative; padding-top: 28px; padding-right: 32px; font: 500 14px var(--font-mono); color: var(--text-2); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.tl-date::after {
  content: ""; position: absolute; right: -6px; top: 32px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--c2); box-shadow: 0 0 0 4px var(--bg);
}
.tl-card { margin-left: 36px; padding: 26px 30px; }
.tl-card h3 { font-size: 21px; margin-bottom: 4px; }
.tl-org { color: var(--c1); font-size: 14px; margin-bottom: 12px; }
.tl-card p:not(.tl-org), .tl-card li { color: var(--text-2); font-size: 15px; }
.tl-card ul { display: grid; gap: 8px; }
.tl-card li { position: relative; padding-left: 20px; }
.tl-card li::before { content: ""; position: absolute; left: 0; top: .7em; width: 8px; height: 2px; border-radius: 2px; background: var(--grad); }
.tag { font: 600 11px var(--font-mono); font-style: normal; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; }
.tag-live { color: #4ade80; background: rgba(74, 222, 128, .12); }

/* Work */
.work { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.project { padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.project-top { display: flex; gap: 8px; flex-wrap: wrap; }
.kicker { font: 500 11.5px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); }
.kicker-live { color: #4ade80; border-color: rgba(74,222,128,.3); }
.project h3 { font-size: 26px; letter-spacing: -.03em; }
.project p { color: var(--text-2); }
.sec-note { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--radius-sm); background: rgb(var(--c1-rgb) / .06); border: 1px solid rgb(var(--c1-rgb) / .15); font-size: 14px; color: var(--text-2); }
.sec-note b { font: 600 11.5px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--c1); }
.project-feature { background: linear-gradient(140deg, rgb(var(--c1-rgb) / .10), rgb(var(--c2-rgb) / .10) 50%, rgb(var(--c3-rgb) / .12)); border-color: rgb(var(--c2-rgb) / .3); }
.link-arrow { margin-top: auto; font-weight: 600; color: var(--text); }
.project-feature:hover .link-arrow { color: var(--c1); }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.skill-group { padding: 28px; }
.skill-group h3 { font-size: 18px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.skill-group h3::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--grad); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: 14px; padding: 7px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); transition: border-color .2s, color .2s; }
.chips li:hover { border-color: var(--c2); }

/* Certs */
.certs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cert { padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.cert h3 { font-size: 19px; line-height: 1.3; }
.cert p { color: var(--text-2); font-size: 14.5px; }
.cert-issuer { font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--c1); }
.cert-foot { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-3); border-top: 1px solid var(--border); }
.verify { color: var(--text); font-weight: 600; }
.cert:hover .verify { color: var(--c1); }
.cert-hero { grid-column: 1 / -1; flex-direction: row; gap: 28px; padding: 32px; align-items: flex-start;
  background: linear-gradient(120deg, rgb(var(--c1-rgb) / .08), rgb(var(--c2-rgb) / .06) 60%, transparent); }
.cert-hero h3 { font-size: 28px; }
.cert-hero .cert-body { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cert-badge {
  flex: none; width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center;
  font: 700 32px var(--font-display); color: #fff; background: var(--grad); box-shadow: 0 16px 36px -14px rgb(var(--c2-rgb) / .9);
}
.cert-more { margin-top: 18px; padding: 22px 26px; border: 1px dashed var(--border-strong); border-radius: var(--radius); display: flex; gap: 20px; align-items: baseline; flex-wrap: wrap; }
.cert-more-label { font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.cert-more ul { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--text-2); }
.cert-more a:hover { color: var(--c1); }

/* Ecosystem */
.eco { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.eco-card { padding: 28px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.eco-card::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  background: var(--grad); opacity: .12; filter: blur(30px); transition: opacity .35s;
}
.eco-card:hover::after { opacity: .3; }
.eco-domain { font: 500 14px var(--font-mono); color: var(--text-3); }
.eco-domain b { color: var(--c1); font-weight: 500; }
.eco-card h3 { font-size: 22px; }
.eco-card p { color: var(--text-2); font-size: 15px; }

/* Contact */
.contact {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; padding: 56px;
  background: linear-gradient(135deg, rgb(var(--c1-rgb) / .10), rgb(var(--c2-rgb) / .10) 45%, rgb(var(--c3-rgb) / .12));
  border-color: rgb(var(--c2-rgb) / .28); overflow: hidden;
}
.contact h2 { font-size: clamp(32px, 4vw, 50px); line-height: 1.08; letter-spacing: -.035em; margin-bottom: 16px; }
.contact-copy p { color: var(--text-2); font-size: 18px; margin-bottom: 32px; max-width: 520px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.contact-links { display: grid; gap: 10px; align-content: center; }
.clink {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); transition: border-color .2s, transform .25s var(--ease), background .2s;
}
.clink:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateX(4px); }
.clink > svg { color: var(--c1); flex: none; }
.clink span { display: flex; flex-direction: column; line-height: 1.3; }
.clink small { color: var(--text-3); font-size: 13px; }
.clink i { margin-left: auto; font-style: normal; color: var(--text-3); }

/* Footer */
.footer { margin-top: 130px; border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 32px; padding-bottom: 40px; font-size: 14px; color: var(--text-3); }
.footer .wordmark { font-size: 16px; }
.footer a:hover { color: var(--text); }
.footer-note { font: 12.5px var(--font-mono); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0;
  padding: 12px 20px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px;
  transition: opacity .3s, transform .3s var(--ease); pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

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

/* ───────── Responsive ───────── */
@media (max-width: 1080px) {
  .cards4 { grid-template-columns: repeat(2, 1fr); }
  .certs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1100px) {
  .links {
    position: fixed; top: 76px; left: 0; right: 0; flex-direction: column; gap: 0; padding: 12px 20px 20px;
    background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease);
  }
  .links.open { opacity: 1; transform: none; pointer-events: auto; }
  .links a { padding: 14px 12px; font-size: 16px; border-radius: 10px; }
  .menu-btn { display: inline-grid; }
  .hide-sm { display: none; }
}
@media (max-width: 820px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .work, .skills, .eco, .contact { grid-template-columns: 1fr; }
  .contact { padding: 36px 28px; gap: 32px; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .nav-inner { height: 68px; }
  .wordmark { font-size: 17px; }
  .hero { padding-top: 40px; gap: 40px; }
  .section { padding-top: 96px; }
  .cards4, .certs { grid-template-columns: 1fr; }
  .cert-hero { flex-direction: column; gap: 18px; padding: 26px; }
  .stat { padding: 22px 18px; }
  .stat strong { font-size: 32px; }
  .timeline::before { left: 5px; }
  .tl { grid-template-columns: 1fr; }
  .tl-date { padding: 0 0 10px 28px; flex-direction: row; align-items: center; }
  .tl-date::after { left: 0; right: auto; top: 5px; }
  .tl-card { margin-left: 28px; padding: 22px; }
  .project { padding: 24px; }
  .btn { height: 48px; }
  .hero-cta .btn { flex: 1 1 auto; }
}

/* ═════════════════════ MOTION & 3D LAYER ═════════════════════ */
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

/* WebGL canvas */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 1.4s var(--ease); }
.gl-ready #gl { opacity: 1; }
.no-gl #gl { display: none; }

/* Film grain */
.grain { position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%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");
  animation: grain 1.2s steps(6) infinite; }
:root[data-theme="light"] .grain { opacity: .035; mix-blend-mode: multiply; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); } }

/* Cursor glow */
.cursor-glow { position: fixed; top: 0; left: 0; width: 600px; height: 600px; border-radius: 50%; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, rgb(var(--c2-rgb) / .16), rgb(var(--c1-rgb) / .06) 40%, transparent 70%); will-change: transform; }
:root[data-theme="light"] .cursor-glow { background: radial-gradient(circle, rgb(var(--c2-rgb) / .12), transparent 65%); }
@media (hover: none) { .cursor-glow { display: none; } }

/* Scroll progress */
.scrollbar { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 12px rgb(var(--c2-rgb) / .8); }

/* ───────── Hero entrance ───────── */
@keyframes rise { from { opacity: 0; transform: translateY(28px); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
.booted .hero-copy > * { animation: rise 1s var(--ease) both; }
.booted .hero-copy > h1 { animation-name: riseClean; }
@keyframes riseClean { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
.booted .hero-copy > :nth-child(1) { animation-delay: .05s; }
.booted .hero-copy > :nth-child(2) { animation-delay: .15s; }
.booted .hero-copy > :nth-child(3) { animation-delay: .3s; }
.booted .hero-copy > :nth-child(4) { animation-delay: .42s; }
.booted .hero-copy > :nth-child(5) { animation-delay: .54s; }
.hero-copy { opacity: var(--hero-fade, 1); transform: translateY(calc((1 - var(--hero-fade, 1)) * -40px)); }

.hero h1 .grad { background-size: 220% 100%; animation: sheen 6s ease-in-out infinite; }
@keyframes sheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* Pill shimmer */
.pill { position: relative; overflow: hidden; }
.pill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.14) 50%, transparent 70%); transform: translateX(-100%); animation: shimmer 4.5s 2s ease-in-out infinite; }
@keyframes shimmer { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* Buttons: shine sweep + magnetic smoothing */
.btn, .icon-btn { will-change: transform; transition: transform .35s var(--ease), box-shadow .25s, background .25s, border-color .25s; }
.btn-primary { overflow: hidden; isolation: isolate; }
.btn-primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); transition: left .7s var(--ease); }
.btn-primary:hover::after { left: 130%; }

/* ───────── Terminal: glass, rotating border, parallax ───────── */
.terminal { background: rgba(10, 12, 20, .72); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); transform-style: preserve-3d; }
.terminal.reveal.in { transform: perspective(1200px) rotateX(var(--trx, 0deg)) rotateY(var(--try, 0deg)); transition: opacity .8s var(--ease), transform .25s linear; }
.terminal::before, .contact::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--angle), transparent 0 55%, var(--c1) 70%, var(--c2) 80%, var(--c3) 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 5s linear infinite;
}
@keyframes spin { to { --angle: 360deg; } }
.term-body::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px); }
.terminal .term-body { position: relative; }

/* ───────── Spotlight cards ───────── */
.fx-spot { --mx: 50%; --my: 50%; transform-style: preserve-3d; will-change: transform; transition: transform .4s var(--ease), border-color .35s, background .35s, box-shadow .35s; }
.fx-spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgb(var(--c1-rgb) / .9), rgb(var(--c2-rgb) / .6) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.fx-spot:hover::before { opacity: 1; }
.fx-spot:hover { background-image: radial-gradient(420px circle at var(--mx) var(--my), rgb(var(--c2-rgb) / .13), transparent 45%); }
.fx-spot:hover .card-icon { transform: translateZ(30px) rotate(-8deg) scale(1.08); }
.card-icon { transition: transform .5s var(--ease); }
.fx-spot h3 { transition: transform .5s var(--ease); }
.fx-spot:hover h3 { transform: translateZ(20px); }

/* Cert badge orbit ring */
.cert-badge { position: relative; }
.cert-badge::after { content: ""; position: absolute; inset: -6px; border-radius: 24px; padding: 2px;
  background: conic-gradient(from var(--angle), transparent 0 60%, var(--c1), var(--c3), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 3.5s linear infinite; }

/* Section heading wipe */
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.section-head.in h2, .contact.in h2 { animation: wipe 1.1s .1s cubic-bezier(.7,0,.2,1) both; }
.section-head h2 { position: relative; }

/* Timeline draws on scroll */
.timeline::before { opacity: .18; }
.timeline::after { content: ""; position: absolute; left: 180px; top: 12px; bottom: 12px; width: 2px; margin-left: -.5px;
  background: linear-gradient(var(--c1), var(--c2), var(--c3)); transform-origin: top; transform: scaleY(var(--tp, 0));
  box-shadow: 0 0 14px rgb(var(--c2-rgb) / .8); border-radius: 2px; }
.tl-date::after { transition: background .4s, box-shadow .4s, transform .4s var(--ease); z-index: 1; }
.tl.lit .tl-date::after { background: var(--c1); border-color: var(--c1); box-shadow: 0 0 0 4px var(--bg), 0 0 18px var(--c1); transform: scale(1.25); }
.tl-card { transition: border-color .5s, transform .5s var(--ease); }
.tl.lit .tl-card { border-color: rgb(var(--c2-rgb) / .3); }

/* Stats glow */
.stat { position: relative; transition: background .35s; }
.stat:hover { background: radial-gradient(240px circle at 30% 30%, rgb(var(--c2-rgb) / .12), transparent 70%); }

/* ───────── Marquee ───────── */
.marquee { padding-top: 80px; display: grid; gap: 14px; overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.mq-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.mq-track.rev { animation-direction: reverse; animation-duration: 56s; }
.marquee:hover .mq-track { animation-play-state: paused; }
.mq-row { display: flex; gap: 14px; padding-right: 14px; }
.mq-row span { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; padding: 12px 22px; border-radius: 999px;
  font: 500 15px var(--font-display); color: var(--text-2); border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(8px); transition: color .25s, border-color .25s; }
.mq-row span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--grad); }
.mq-row span:hover { color: var(--text); border-color: var(--c2); }
@keyframes marquee { to { transform: translateX(-50%); } }

@media (max-width: 1080px) {
  .hero { min-height: 0; }
  .terminal.reveal.in { transform: none; }
}
@media (max-width: 640px) {
  .timeline::after { left: 5px; }
  .marquee { padding-top: 56px; }
  .mq-row span { font-size: 13.5px; padding: 9px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .grain, .cursor-glow { display: none !important; }
  .timeline::after { transform: none; }
  .mq-track { animation: none; flex-wrap: wrap; width: auto; }
}


/* ═════════════════════ SIGNATURE LOGO ═════════════════════ */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sig-logo { display: block; height: 46px; margin: -4px 0; filter: drop-shadow(0 0 6px rgb(var(--c2-rgb) / .35)); width: auto; aspect-ratio: 4871 / 1134; fill: url(#sigGrad); overflow: visible; transition: filter .35s; }
.sig-logo.sig-sm { height: 34px; }
.logo:hover .sig-logo { filter: drop-shadow(0 0 10px rgb(var(--c2-rgb) / .75)); }
@keyframes sigWrite { from { clip-path: inset(-20% 100% -20% 0); } to { clip-path: inset(-20% -5% -20% 0); } }
.booted .nav .sig-logo { animation: sigWrite 1.6s .15s cubic-bezier(.6, .1, .3, 1) both; }

/* ═════════════════════ WELCOME GATE ═════════════════════ */
.gate { position: fixed; inset: 0; z-index: 300; background: #05060a; color: #a4a9bb; font-family: var(--font-mono); transition: opacity .9s var(--ease); }
.gate.done { opacity: 0; pointer-events: none; }
.gate-on body { overflow: hidden; }
#gateGl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gate-ui { position: absolute; inset: 0; pointer-events: none; }
.gate-top { position: absolute; top: 24px; left: 28px; right: 28px; display: flex; justify-content: space-between; font-size: 11.5px; letter-spacing: .22em; color: #6d7388; }
.gate-center { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); width: min(560px, 82vw); display: grid; justify-items: center; gap: 26px; }
.gate-sig { width: 100%; height: auto; aspect-ratio: 4871 / 1134; fill: url(#sigGrad); overflow: visible; clip-path: inset(-20% 100% -20% 0);
  filter: drop-shadow(0 0 22px rgb(var(--c2-rgb) / .8)) drop-shadow(0 0 2px rgba(255,255,255,.6)); transition: opacity .6s, transform .9s var(--ease); }
.gate-sig.write { animation: sigWrite 1.35s cubic-bezier(.6, .1, .3, 1) forwards; }
.gate-sig.away { opacity: 0; transform: scale(1.25); }
.gate-status { font-size: 12.5px; letter-spacing: .32em; padding: 9px 18px 9px 22px; border-radius: 999px; color: #c9cde0;
  border: 1px solid rgba(255,255,255,.12); background: rgba(5,6,10,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: color .3s, border-color .3s, box-shadow .3s; }
.gate-status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #22d3ee; margin-right: 12px; vertical-align: 1px; animation: blink 1s steps(1) infinite; }
.gate-status.granted { color: #4ade80; border-color: rgba(74,222,128,.5); box-shadow: 0 0 40px rgba(74,222,128,.3); animation: glitch .45s steps(2) 1; }
.gate-status.granted::before { background: #4ade80; animation: none; }
.gate-status.welcome { color: #fff; border-color: rgba(255,255,255,.35); }
.gate-status.welcome::before { background: #fff; animation: none; }
@keyframes glitch {
  0% { transform: translate(0); text-shadow: none; }
  25% { transform: translate(-3px, 1px); text-shadow: 3px 0 #22d3ee, -3px 0 #a855f7; }
  50% { transform: translate(3px, -1px); text-shadow: -3px 0 #22d3ee, 3px 0 #f472b6; }
  75% { transform: translate(-1px, 0); text-shadow: 2px 0 #4ade80; }
  100% { transform: translate(0); text-shadow: none; }
}
.gate-bottom { position: absolute; left: 28px; right: 28px; bottom: 26px; display: flex; align-items: center; gap: 16px; font-size: 11.5px; letter-spacing: .14em; }
.gate-bar { flex: 1; height: 2px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.gate-bar i { display: block; height: 100%; width: 0; background: var(--grad); box-shadow: 0 0 12px rgb(var(--c2-rgb) / .9); }
.gate-skip { position: absolute; right: 28px; bottom: 50px; pointer-events: auto; cursor: pointer; font: 500 12px var(--font-mono); letter-spacing: .1em; color: #a4a9bb;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 8px 16px; transition: color .2s, border-color .2s; }
.gate-skip:hover { color: #fff; border-color: rgba(255,255,255,.35); }
@media (max-width: 640px) {
  .gate-top, .gate-bottom { left: 16px; right: 16px; }
  .gate-skip { right: 16px; }
  .gate-center { top: 30%; }
  .sig-logo { height: 38px; }
}

/* ═════════════════════ HERO LAYOUT v2 (responsive, globe anchored) ═════════════════════ */
.hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 4vw, 64px); min-height: 0;
  padding-top: clamp(36px, 7vh, 88px); padding-bottom: clamp(56px, 9vh, 110px); align-items: center; }
.hero-copy { min-width: 0; }
.hero-visual { position: relative; width: 100%; max-width: 580px; justify-self: end; }
.globe-anchor { width: 100%; aspect-ratio: 1 / 1; }
.hero-visual .terminal { position: absolute; left: 20%; right: -3%; bottom: -9%; }
.hero-visual .term-body { min-height: 0; padding: 18px 20px 20px; font-size: 13px; }
.no-gl .globe-anchor { aspect-ratio: auto; height: 0; }
.no-gl .hero-visual .terminal { position: relative; left: auto; right: auto; bottom: auto; }
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; padding-bottom: 72px; }
  .hero-copy { max-width: 720px; }
  .hero-visual { justify-self: center; max-width: 540px; }
  .hero-visual .terminal { left: 8%; right: 8%; bottom: -12%; }
  .terminal.reveal.in { transform: none; }
  .stats { margin-top: 40px; }
}
@media (max-width: 640px) {
  .hero { gap: 8px; padding-bottom: 40px; }
  .hero-visual { max-width: 420px; }
  .hero-visual .terminal { position: relative; left: auto; right: auto; bottom: auto; margin-top: -26%; }
  .hero-visual .term-body { font-size: 12px; padding: 14px 16px 16px; }
  .stats { margin-top: 24px; }
}
/* Short laptop screens: scale headline and globe with viewport height too */
.hero h1 { font-size: clamp(38px, min(5.2vw, 8.4vh), 68px); }
.hero-visual { max-width: min(580px, 74vh); }
@media (max-width: 1100px) { .hero h1 { font-size: clamp(38px, 7.4vw, 64px); } .hero-visual { max-width: 540px; } }
@media (max-width: 640px) { .hero h1 { font-size: clamp(36px, 10.4vw, 46px); } .hero-visual { max-width: 420px; } }

/* Gate v2: phase colours + live security checks */
.gate-center { top: 50%; gap: 20px; width: min(600px, 90vw); }
.gate-sig { width: min(100%, 460px); }
.gate-status.red { color: #fca5a5; border-color: rgba(239,68,68,.55); box-shadow: 0 0 36px rgba(239,68,68,.28); }
.gate-status.red::before { background: #ef4444; animation: blink .5s steps(1) infinite; }
.gate-status.blue { color: #93c5fd; border-color: rgba(59,130,246,.55); box-shadow: 0 0 36px rgba(59,130,246,.25); }
.gate-status.blue::before { background: #3b82f6; }
.gate-status.green { color: #4ade80; border-color: rgba(74,222,128,.55); box-shadow: 0 0 44px rgba(74,222,128,.35); animation: glitch .45s steps(2) 1; }
.gate-status.green::before { background: #4ade80; animation: none; }
.gate-checks { list-style: none; margin: 0; padding: 14px 18px; width: 100%; border-radius: 14px; font-size: 12.5px; line-height: 1; display: grid; gap: 9px;
  background: rgba(5,6,10,.62); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: opacity .5s, transform .6s var(--ease), border-color .5s; }
.gate-checks:empty { display: none; }
.gate[data-phase="red"] .gate-checks { border-color: rgba(239,68,68,.25); }
.gate[data-phase="blue"] .gate-checks { border-color: rgba(59,130,246,.28); }
.gate[data-phase="green"] .gate-checks { border-color: rgba(74,222,128,.35); }
.gate-checks.away { opacity: 0; transform: translateY(16px); }
.gate-checks li { display: flex; align-items: baseline; gap: 10px; opacity: .18; transition: opacity .3s; white-space: nowrap; }
.gate-checks li.on { opacity: 1; }
.gate-checks .ck-name { color: #c9cde0; }
.gate-checks .ck-name::before { content: "▸ "; color: #3b82f6; }
.gate-checks .ck-dots { flex: 1; border-bottom: 1px dotted rgba(255,255,255,.18); transform: translateY(-3px); min-width: 12px; }
.gate-checks .ck-res { color: #6d7388; min-width: 0; }
.gate-checks li.on:not(.done) .ck-res { animation: blink .4s steps(1) infinite; }
.gate-checks li.done.ok .ck-res { color: #4ade80; }
.gate-checks li.done.warn .ck-res { color: #fbbf24; }
@media (max-width: 640px) {
  .gate-center { gap: 14px; }
  .gate-checks { font-size: 11px; padding: 12px 14px; gap: 8px; }
  .gate-status { font-size: 10.5px; letter-spacing: .18em; padding: 8px 14px; text-align: center; }
}
@media (max-height: 640px) { .gate-sig { width: min(100%, 320px); } .gate-checks { gap: 6px; } }

/* ═════════════════════ HERO v3: globe stands alone ═════════════════════ */
.hero-visual { display: grid; justify-items: center; gap: 6px; }
.globe-anchor { width: 100%; aspect-ratio: 1 / 1; }
.globe-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; font: 500 11.5px var(--font-mono); letter-spacing: .06em; color: var(--text-3); }
.lg-live { color: #f87171; padding: 3px 8px; border-radius: 6px; background: rgba(248,113,113,.12); letter-spacing: .14em; }
.lg-live::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #f87171; vertical-align: 1px; animation: blink 1.2s steps(1) infinite; }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.lg::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.lg-c2::before { background: #fb7185; box-shadow: 0 0 10px #fb7185; }
.lg-scan::before { background: #fbbf24; box-shadow: 0 0 10px #fbbf24; }
.lg-hub::before { background: #dbe4ff; }
.no-gl .globe-legend { display: none; }

/* ═════════════════════ PROFILE TERMINAL + LIVE FEED ═════════════════════ */
.intel { padding-top: 8px; padding-bottom: 24px; }
.intel-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; align-items: stretch; }
.intel .terminal { position: relative; inset: auto; width: auto; margin: 0; }
.intel .term-body { min-height: 320px; }
.feed { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); overflow: hidden; }
.feed-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.feed-head b { font: 600 16px var(--font-display); }
.feed-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #f87171; margin-right: 10px; box-shadow: 0 0 0 0 rgba(248,113,113,.6); animation: feedPing 1.6s infinite; vertical-align: 1px; }
@keyframes feedPing { 0% { box-shadow: 0 0 0 0 rgba(248,113,113,.55); } 100% { box-shadow: 0 0 0 10px rgba(248,113,113,0); } }
.feed-count { font-size: 12px; color: var(--text-3); }
.feed-list { display: grid; gap: 6px; min-height: 282px; align-content: start; }
.fr { display: grid; grid-template-columns: 64px 46px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; animation: frIn .5s var(--ease); }
.fr:first-child { border-color: color-mix(in srgb, var(--c1) 45%, transparent); }
@keyframes frIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.fr-time { color: var(--text-3); font-size: 11.5px; }
.fr-kind { font: 700 10px var(--font-mono); letter-spacing: .08em; text-align: center; padding: 3px 0; border-radius: 5px; }
.fr-c2 .fr-kind { color: #fb7185; background: rgba(251,113,133,.14); }
.fr-scan .fr-kind { color: #fbbf24; background: rgba(251,191,36,.14); }
.fr-main { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.fr-main b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-main small { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.fr-meta { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.fr-empty { color: var(--text-3); padding: 20px; text-align: center; }
.feed-stats { display: grid; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.fs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fs-row div { display: flex; align-items: baseline; gap: 8px; }
.fs-row b { font: 700 24px var(--font-display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fs-row span, .fs-label { font-size: 12.5px; color: var(--text-2); }
.fs-ports ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.fs-ports li { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; }
.fs-ports li b { font: 600 15px var(--font-mono); }
.fs-ports li span { color: var(--text-2); }
.fs-ports li em { font-style: normal; color: var(--c1); font-family: var(--font-mono); }
.feed-src { font-size: 11px; color: var(--text-3); line-height: 1.5; }
@media (max-width: 1100px) {
  .intel-grid { grid-template-columns: 1fr; }
  .intel .term-body { min-height: 0; }
}
@media (max-width: 640px) {
  .fr { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .fr-time { display: none; }
  .fs-ports ul { grid-template-columns: repeat(2, 1fr); }
  .feed { padding: 16px; }
  .feed-list { min-height: 0; }
}

/* ═════════════════════ COLOUR PALETTES ═════════════════════ */
:root { --c1-rgb: 34 211 238; --c2-rgb: 99 102 241; --c3-rgb: 168 85 247; --on-accent: #fff; }
:root[data-palette="emerald"] { --c1: #5eead4; --c2: #10b981; --c3: #0ea5e9; --c1-rgb: 94 234 212; --c2-rgb: 16 185 129; --c3-rgb: 14 165 233; }
:root[data-palette="crimson"] { --c1: #fda4af; --c2: #e11d48; --c3: #f97316; --c1-rgb: 253 164 175; --c2-rgb: 225 29 72; --c3-rgb: 249 115 22; }
:root[data-palette="gold"] { --c1: #fde68a; --c2: #f59e0b; --c3: #ea580c; --c1-rgb: 253 230 138; --c2-rgb: 245 158 11; --c3-rgb: 234 88 12; --on-accent: #1c1206; }
:root[data-palette="graphite"] { --c1: #f1f5f9; --c2: #94a3b8; --c3: #cbd5e1; --c1-rgb: 241 245 249; --c2-rgb: 148 163 184; --c3-rgb: 203 213 225; --on-accent: #0b0d17; }
:root[data-theme="light"][data-palette="emerald"] { --c1: #0d9488; --c2: #059669; --c3: #0369a1; --c1-rgb: 13 148 136; }
:root[data-theme="light"][data-palette="crimson"] { --c1: #e11d48; --c2: #be123c; --c3: #c2410c; --c1-rgb: 225 29 72; }
:root[data-theme="light"][data-palette="gold"] { --c1: #d97706; --c2: #b45309; --c3: #9a3412; --c1-rgb: 217 119 6; --on-accent: #fff; }
:root[data-theme="light"][data-palette="graphite"] { --c1: #334155; --c2: #0f172a; --c3: #475569; --c1-rgb: 51 65 85; --c2-rgb: 15 23 42; --c3-rgb: 71 85 105; --on-accent: #fff; }
:root[data-theme="light"]:not([data-palette]), :root[data-theme="light"][data-palette="aurora"] { --c1: #0891b2; --c1-rgb: 8 145 178; }
.btn-primary { color: var(--on-accent); }
.card-icon, .cert-badge, .lab-badge { color: var(--on-accent); }
#sigGrad stop:nth-child(1) { stop-color: var(--c1); }
#sigGrad stop:nth-child(2) { stop-color: var(--c2); }
#sigGrad stop:nth-child(3) { stop-color: var(--c3); }

/* Palette picker */
.palette { position: relative; }
.pal-btn .pal-swatch { width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(var(--c1), var(--c2), var(--c3), var(--c1)); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--border-strong); }
.pal-menu { position: absolute; top: calc(100% + 10px); right: 0; width: 248px; padding: 8px; border-radius: 16px; z-index: 60;
  background: color-mix(in srgb, var(--bg) 92%, transparent); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none; transition: opacity .2s, transform .25s var(--ease); }
.pal-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.pal-title { font: 600 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px 6px; }
.pal-opt { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; border: 0; background: none; color: var(--text); cursor: pointer; text-align: left; }
.pal-opt:hover { background: var(--surface-2); }
.pal-opt[aria-checked="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.pal-opt .dots { display: flex; }
.pal-opt .dots i { width: 14px; height: 14px; border-radius: 50%; margin-left: -4px; box-shadow: 0 0 0 2px var(--bg); }
.pal-opt .dots i:first-child { margin-left: 0; }
.pal-opt b { font-size: 14px; font-weight: 600; display: block; line-height: 1.2; }
.pal-opt small { font-size: 12px; color: var(--text-3); }
.pal-opt .tick { margin-left: auto; opacity: 0; color: var(--c1); }
.pal-opt[aria-checked="true"] .tick { opacity: 1; }
@media (max-width: 640px) { .pal-menu { right: -96px; } }

.pal-opt[data-pal="aurora"] .dots i:nth-child(1) { background: #22d3ee; }
.pal-opt[data-pal="aurora"] .dots i:nth-child(2) { background: #6366f1; }
.pal-opt[data-pal="aurora"] .dots i:nth-child(3) { background: #a855f7; }
.pal-opt[data-pal="emerald"] .dots i:nth-child(1) { background: #5eead4; }
.pal-opt[data-pal="emerald"] .dots i:nth-child(2) { background: #10b981; }
.pal-opt[data-pal="emerald"] .dots i:nth-child(3) { background: #0ea5e9; }
.pal-opt[data-pal="crimson"] .dots i:nth-child(1) { background: #fda4af; }
.pal-opt[data-pal="crimson"] .dots i:nth-child(2) { background: #e11d48; }
.pal-opt[data-pal="crimson"] .dots i:nth-child(3) { background: #f97316; }
.pal-opt[data-pal="gold"] .dots i:nth-child(1) { background: #fde68a; }
.pal-opt[data-pal="gold"] .dots i:nth-child(2) { background: #f59e0b; }
.pal-opt[data-pal="gold"] .dots i:nth-child(3) { background: #ea580c; }
.pal-opt[data-pal="graphite"] .dots i:nth-child(1) { background: #f1f5f9; }
.pal-opt[data-pal="graphite"] .dots i:nth-child(2) { background: #94a3b8; }
.pal-opt[data-pal="graphite"] .dots i:nth-child(3) { background: #475569; }

/* ═════════════════════ VISITOR PASS (before the firewall) ═════════════════════ */
.gate.pass-on #gateGl, .gate.pass-on .gate-ui > :not(.gate-skip) { opacity: 0; }
#gateGl, .gate-ui > * { transition: opacity .6s var(--ease); }
.pass { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; perspective: 1200px;
  background: radial-gradient(700px 420px at 50% 45%, rgba(34,211,238,.10), transparent 70%),
              repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 44px),
              repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 44px); }
.pass-card { --prx: 0deg; --pry: 0deg; position: relative; width: min(480px, 90vw); padding: 22px 24px 18px; border-radius: 22px; overflow: hidden;
  color: #e7ebf7; font-family: var(--font-mono);
  background: linear-gradient(150deg, rgba(20,24,40,.92), rgba(9,11,20,.96));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(34,211,238,.08), 0 0 80px -10px rgba(99,102,241,.45);
  transform: rotateX(var(--prx)) rotateY(var(--pry)); transform-style: preserve-3d;
  animation: passIn .9s cubic-bezier(.2,.9,.2,1) both; transition: transform .25s linear; }
@keyframes passIn { from { opacity: 0; transform: translateY(60px) rotateX(70deg) scale(.9); filter: blur(6px); } }
.pass-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--angle), transparent 0 50%, #22d3ee 65%, #6366f1 78%, #a855f7 90%, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 3.2s linear infinite; }
.pass-holo { position: absolute; inset: -40%; pointer-events: none; opacity: .5; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 38%, rgba(34,211,238,.18) 44%, rgba(168,85,247,.2) 50%, rgba(253,230,138,.12) 54%, transparent 60%);
  animation: holo 3.2s ease-in-out infinite; }
@keyframes holo { 0% { transform: translateX(-30%); } 100% { transform: translateX(30%); } }
.pass-top { position: relative; display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 1px dashed rgba(255,255,255,.12); }
.pass-sig { height: 30px; width: auto; aspect-ratio: 4871 / 1134; fill: url(#sigGrad); }
.pass-tag { font-size: 10.5px; letter-spacing: .24em; color: #8a90a8; padding: 4px 9px; border: 1px solid rgba(255,255,255,.14); border-radius: 6px; }
.pass-body { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 18px 0 14px; }
.pass-hello { margin: 0; font: 700 34px/1 var(--font-display); letter-spacing: -.03em; color: #fff;
  background: linear-gradient(120deg, #fff, #c7d2fe); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise .7s .25s var(--ease) both; }
.pass-label { margin: 14px 0 2px; font-size: 11px; letter-spacing: .26em; color: #8a90a8; text-transform: uppercase; }
.pass-num { margin: 0; font: 600 34px/1.1 var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: .02em; color: #fff; text-shadow: 0 0 22px rgba(34,211,238,.55); }
.pass-hash { color: #22d3ee; margin-right: 4px; }
.pass-guest { display: none; margin: 0; font: 600 20px var(--font-display); color: #fff; }
.pass.no-count .pass-num { display: none; }
.pass.no-count .pass-guest { display: block; }
.pass-fp-wrap { position: relative; width: 96px; height: 104px; border-radius: 14px; overflow: hidden; background: rgba(34,211,238,.05); border: 1px solid rgba(34,211,238,.18); }
.pass-fp { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
.pass-fp path { stroke: #22d3ee; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: fpDraw 1s var(--ease) forwards; filter: drop-shadow(0 0 3px rgba(34,211,238,.8)); transition: stroke .4s; }
@keyframes fpDraw { to { stroke-dashoffset: 0; } }
.pass-scan { position: absolute; left: 0; right: 0; height: 2px; top: 0; background: #22d3ee; box-shadow: 0 0 14px 3px rgba(34,211,238,.7); animation: fpScan 1.1s ease-in-out infinite alternate; }
@keyframes fpScan { from { transform: translateY(4px); } to { transform: translateY(98px); } }
.pass-meta { position: relative; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 10.5px; letter-spacing: .14em; color: #6d7388; padding-top: 12px; border-top: 1px dashed rgba(255,255,255,.12); }
.pass-meta b { color: #c9cde0; font-weight: 500; }
.pass-status { position: relative; margin-top: 12px; font-size: 11px; letter-spacing: .22em; color: #93c5fd; }
.pass-status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3b82f6; margin-right: 10px; vertical-align: 1px; animation: blink .5s steps(1) infinite; }
.pass.verified .pass-status { color: #4ade80; }
.pass.verified .pass-status::before { background: #4ade80; animation: none; }
.pass.verified .pass-fp path { stroke: #4ade80; filter: drop-shadow(0 0 4px rgba(74,222,128,.9)); }
.pass.verified .pass-scan { background: #4ade80; box-shadow: 0 0 14px 3px rgba(74,222,128,.7); animation-play-state: paused; opacity: 0; }
.pass.verified .pass-card { box-shadow: 0 40px 90px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(74,222,128,.35), 0 0 90px -10px rgba(74,222,128,.45); }
.pass.leave .pass-card { animation: passOut .6s cubic-bezier(.6,0,.4,1) forwards; }
.pass.leave { transition: opacity .6s .1s; opacity: 0; }
@keyframes passOut { to { opacity: 0; transform: translateZ(400px) scale(1.4); filter: blur(8px); } }
@media (max-width: 480px) {
  .pass-card { padding: 18px 18px 14px; }
  .pass-hello { font-size: 28px; }
  .pass-num { font-size: 26px; }
  .pass-fp-wrap { width: 78px; height: 86px; }
  @keyframes fpScan { from { transform: translateY(4px); } to { transform: translateY(80px); } }
  .pass-meta { font-size: 9.5px; letter-spacing: .1em; }
}

/* Visitor pass: enter with sound (browsers only allow audio after a click) */
.pass-choice { position: relative; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; animation: rise .5s var(--ease) both; }
.pass-choice[hidden] { display: none; }
.pass-btn { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  font: 600 13px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: #c9cde0;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.16); transition: transform .2s var(--ease), border-color .2s, background .2s, box-shadow .2s; }
.pass-btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.35); color: #fff; }
.pass-btn-primary { color: #052e16; background: linear-gradient(120deg, #4ade80, #22d3ee); border-color: transparent; box-shadow: 0 10px 30px -10px rgba(74,222,128,.8); }
.pass-btn-primary:hover { color: #052e16; box-shadow: 0 14px 36px -10px rgba(74,222,128,.95); }
.pass-btn-primary:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.pass-btn-primary::after { content: "⏎"; opacity: .6; font-size: 12px; }
.gate-mute { position: absolute; top: 18px; right: 28px; transform: translateY(26px); pointer-events: auto; cursor: pointer; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); color: #fff; font-size: 16px; }
.gate-mute[hidden] { display: none; }
.gate-mute:hover { border-color: rgba(255,255,255,.4); }
@media (max-width: 640px) { .gate-mute { right: 16px; } .pass-btn { height: 42px; font-size: 12px; } }
