/* Personal homepage: AI security leader. Cyan → indigo → violet "cyber" palette, light and dark. */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --edge: #e2e8f0;
  --grid: rgba(99, 102, 241, 0.08);
  --c1: #0891b2;           /* cyan */
  --c2: #4f46e5;           /* indigo */
  --c3: #9333ea;           /* violet */
  --label: #4f46e5;
  --threat: #be123c;
  --threat-bg: #ffe4e9;
  --ok: #047857;
  --ok-bg: #d1fae5;
  --chip: #eef2ff;
  --chip-text: #3730a3;
  --link: #4338ca;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --glow: rgba(99, 102, 241, 0.35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #050914; --surface: #0c1324; --text: #e2e8f0; --muted: #94a3b8; --edge: #1e293b;
    --grid: rgba(34, 211, 238, 0.07); --c1: #22d3ee; --c2: #818cf8; --c3: #c084fc; --label: #67e8f9;
    --threat: #fb7185; --threat-bg: #3b0d1a; --ok: #34d399; --ok-bg: #062a1f; --chip: #131c36; --chip-text: #a5b4fc;
    --link: #67e8f9; --shadow: 0 10px 30px rgba(0, 0, 0, 0.5); --glow: rgba(34, 211, 238, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #050914; --surface: #0c1324; --text: #e2e8f0; --muted: #94a3b8; --edge: #1e293b;
  --grid: rgba(34, 211, 238, 0.07); --c1: #22d3ee; --c2: #818cf8; --c3: #c084fc; --label: #67e8f9;
  --threat: #fb7185; --threat-bg: #3b0d1a; --ok: #34d399; --ok-bg: #062a1f; --chip: #131c36; --chip-text: #a5b4fc;
  --link: #67e8f9; --shadow: 0 10px 30px rgba(0, 0, 0, 0.5); --glow: rgba(34, 211, 238, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
img { max-width: 100%; height: auto; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--c1); outline-offset: 3px; border-radius: 6px; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ navigation */
.nav {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px;
  padding: 12px max(16px, calc((100% - 1140px) / 2));
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--edge);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #fff;
  background: linear-gradient(135deg, #0e7490, #4f46e5 55%, #9333ea); }
.brand-mark svg { width: 20px; height: 20px; }
.nav nav { display: flex; gap: 20px; margin-left: auto; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 600; }
.nav nav a:hover { color: var(--text); }
.theme { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--edge); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--text); }
.theme svg { width: 20px; height: 20px; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: none; }
  :root:not([data-theme="light"]) .theme .moon { display: block; }
}

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: 24px;
  width: min(1140px, calc(100% - 32px)); margin: 28px auto 0; padding: 60px 52px;
  background: var(--surface); border: 1px solid var(--edge); border-radius: 30px; box-shadow: var(--shadow);
}
.grid-bg {
  position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 36px 36px; animation: pan 18s linear infinite;
  mask-image: radial-gradient(ellipse at 75% 45%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 75% 45%, #000 0%, transparent 75%);
}
.scan { position: absolute; left: 0; right: 0; height: 120px; top: 0; transform: translateY(-100%);
  background: linear-gradient(transparent, color-mix(in srgb, var(--c1) 18%, transparent), transparent);
  animation: scan 5s ease-in-out infinite; }
.hero-text, .hero-art { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 14px; border-radius: 999px;
  background: var(--chip); color: var(--chip-text); font-size: 13px; font-weight: 750; letter-spacing: .4px;
  animation: rise .7s ease-out both; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: ping 1.8s ease-out infinite; }
h1 { margin: 14px 0 6px; font-size: clamp(46px, 7.4vw, 78px); line-height: 1.02; letter-spacing: -1.5px; animation: rise .7s .1s ease-out both; }
.flow { background: linear-gradient(90deg, var(--c1), var(--c2) 33%, var(--c3) 66%, var(--c1)) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: slide 6s linear infinite; }
.roles { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0 0 14px; font-size: clamp(18px, 2.4vw, 23px);
  font-weight: 650; animation: rise .7s .2s ease-out both; }
.roles-fixed { color: var(--muted); }
.roles-window { display: inline-block; height: 1.45em; overflow: hidden; vertical-align: bottom; }
.roles-list { display: flex; flex-direction: column; animation: roles 10s cubic-bezier(.7,0,.3,1) infinite; }
.roles-list span { height: 1.45em; line-height: 1.45em; white-space: nowrap; color: var(--c2); }
.lede { margin: 0 0 22px; max-width: 560px; color: var(--muted); animation: rise .7s .3s ease-out both; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 28px; padding: 0; list-style: none; }
.chips li { padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; background: var(--chip); color: var(--chip-text);
  border: 1px solid color-mix(in srgb, var(--c2) 25%, transparent);
  animation: chipin .5s cubic-bezier(.2,.8,.2,1) both, wave 5s ease-in-out infinite; }
.chips li:nth-child(1) { animation-delay: .5s, 1.2s; }
.chips li:nth-child(2) { animation-delay: .6s, 1.4s; }
.chips li:nth-child(3) { animation-delay: .7s, 1.6s; }
.chips li:nth-child(4) { animation-delay: .8s, 1.8s; }
.chips li:nth-child(5) { animation-delay: .9s, 2s; }
.chips li:nth-child(6) { animation-delay: 1s, 2.2s; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; padding: 12px 20px; border-radius: 12px; font-weight: 700; font-size: 15px;
  text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--edge);
  transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn.primary { color: #fff; border-color: transparent; background: linear-gradient(135deg, #0e7490, #4f46e5 55%, #9333ea);
  box-shadow: 0 8px 24px var(--glow); }

/* hero art: shield, radar, orbits and blocked-threat tags */
.hero-art { height: 380px; display: grid; place-items: center; }
.hero-art > * { grid-area: 1 / 1; }
.ring { width: 180px; height: 180px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--c1) 40%, transparent);
  animation: pulse 3.6s ease-out infinite; }
.r2 { animation-delay: 1.2s; }
.r3 { animation-delay: 2.4s; }
.radar { width: 300px; height: 300px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, color-mix(in srgb, var(--c1) 32%, transparent) 50deg, transparent 62deg);
  animation: spin 4s linear infinite; }
.orbit { position: relative; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--c2) 40%, transparent); }
.o1 { width: 230px; height: 230px; animation: spin 10s linear infinite; }
.o2 { width: 290px; height: 290px; animation: spin 16s linear infinite reverse; }
.o3 { width: 350px; height: 350px; border-style: dotted; animation: spin 22s linear infinite; }
.orbit i { position: absolute; width: 12px; height: 12px; border-radius: 50%; }
.orbit .threat { background: var(--threat); box-shadow: 0 0 12px var(--threat); animation: blink 2.4s ease-in-out infinite; }
.orbit .node { background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 0 12px var(--glow); }
.o1 .threat { top: -6px; left: calc(50% - 6px); }
.o2 .threat { right: -6px; top: calc(50% - 6px); animation-delay: .8s; }
.o2 .node { left: -6px; top: calc(50% - 6px); }
.o3 .node { bottom: -6px; left: calc(50% - 6px); }
.o3 .threat { top: 14%; left: 14%; animation-delay: 1.6s; }
.shield { width: 150px; height: 175px; filter: drop-shadow(0 18px 34px var(--glow)); animation: bob 3s ease-in-out infinite; }
.shield .net { stroke-dasharray: 120; animation: trace 3s ease-in-out infinite; }
.tag { align-self: start; justify-self: start; padding: 6px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 750; white-space: nowrap;
  color: var(--text); background: var(--surface); border: 1px solid var(--edge); box-shadow: var(--shadow); opacity: 0;
  animation: tag 9s ease-in-out infinite; }
.tag::before { content: "✓ "; color: var(--ok); }
.t1 { margin: 26px 0 0 0; }
.t2 { align-self: end; justify-self: end; margin: 0 0 70px 0; animation-delay: 3s; }
.t3 { align-self: end; margin: 0 0 12px 30px; animation-delay: 6s; }

/* ------------------------------------------------------------------ sections */
.section { width: min(1140px, calc(100% - 32px)); margin: 0 auto; padding: 88px 0 8px; }
.kicker { margin: 0 0 6px; color: var(--label); font-size: 13px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase; }
.section h2 { margin: 0 0 26px; font-size: clamp(28px, 4vw, 38px); letter-spacing: -.6px; line-height: 1.15; }
.section h2::after { content: ""; display: block; width: 64px; height: 5px; margin-top: 12px; border-radius: 3px;
  background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3)); }
.intro { max-width: 760px; margin: -6px 0 28px; color: var(--muted); }
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.shown { opacity: 1; transform: none; }

/* impact stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat { position: relative; overflow: hidden; padding: 22px 22px 20px; border-radius: 20px; background: var(--surface);
  border: 1px solid var(--edge); box-shadow: var(--shadow); }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3)); }
.stat b { display: block; font-size: clamp(32px, 3.6vw, 42px); line-height: 1.1; letter-spacing: -1px; color: var(--c2); }
.stat span { display: block; margin-top: 6px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.reveal.shown .stat { animation: chipin .6s cubic-bezier(.2,.8,.2,1) both; }
.reveal.shown .stat:nth-child(2) { animation-delay: .08s; }
.reveal.shown .stat:nth-child(3) { animation-delay: .16s; }
.reveal.shown .stat:nth-child(4) { animation-delay: .24s; }
.reveal.shown .stat:nth-child(5) { animation-delay: .32s; }
.reveal.shown .stat:nth-child(6) { animation-delay: .4s; }
.reveal.shown .stat:nth-child(7) { animation-delay: .48s; }
.reveal.shown .stat:nth-child(8) { animation-delay: .56s; }

/* AI threat → control */
.defence { display: grid; gap: 12px; padding: 22px; border-radius: 24px; background: var(--surface); border: 1px solid var(--edge); box-shadow: var(--shadow); }
.row { display: grid; grid-template-columns: 240px 1fr 40px 350px; align-items: center; gap: 14px; }
.threat-chip, .control { padding: 9px 14px; border-radius: 12px; font-size: 14.5px; font-weight: 700; }
.threat-chip { background: var(--threat-bg); color: var(--threat); border: 1px solid color-mix(in srgb, var(--threat) 35%, transparent); }
.control { background: var(--ok-bg); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
  animation: lit 7s ease-in-out infinite; }
.lane { position: relative; height: 4px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--edge) 0 8px, transparent 8px 14px); }
.lane i { position: absolute; top: -5px; left: 0; width: calc(100% - 14px); height: 14px; opacity: 0;
  animation: packet 7s cubic-bezier(.5,0,.6,1) infinite; }
.lane i::before { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--threat);
  box-shadow: 0 0 14px var(--threat); }
.guard { position: relative; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #0e7490, #4f46e5, #9333ea);
  animation: block 7s ease-out infinite; }
.guard::after { content: ""; position: absolute; left: 12px; right: 12px; top: 10px; bottom: 9px; border: 2.4px solid #fff;
  border-radius: 3px 3px 10px 10px; }
.row:nth-child(2) .lane i, .row:nth-child(2) .guard, .row:nth-child(2) .control { animation-delay: .5s; }
.row:nth-child(3) .lane i, .row:nth-child(3) .guard, .row:nth-child(3) .control { animation-delay: 1s; }
.row:nth-child(4) .lane i, .row:nth-child(4) .guard, .row:nth-child(4) .control { animation-delay: 1.5s; }
.row:nth-child(5) .lane i, .row:nth-child(5) .guard, .row:nth-child(5) .control { animation-delay: 2s; }
.row:nth-child(6) .lane i, .row:nth-child(6) .guard, .row:nth-child(6) .control { animation-delay: 2.5s; }
.row:nth-child(7) .lane i, .row:nth-child(7) .guard, .row:nth-child(7) .control { animation-delay: 3s; }

/* expertise cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { padding: 24px; border-radius: 22px; background: var(--surface); border: 1px solid var(--edge); box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease; }
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c2) 55%, transparent); }
.ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #fff;
  background: linear-gradient(135deg, #0e7490, #4f46e5 60%, #9333ea); box-shadow: 0 8px 20px var(--glow); }
.ic svg { width: 24px; height: 24px; }
.card h3 { margin: 16px 0 8px; font-size: 19px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.reveal.shown .card { animation: chipin .6s cubic-bezier(.2,.8,.2,1) both; }
.reveal.shown .card:nth-child(2) { animation-delay: .1s; }
.reveal.shown .card:nth-child(3) { animation-delay: .2s; }
.reveal.shown .card:nth-child(4) { animation-delay: .3s; }
.reveal.shown .card:nth-child(5) { animation-delay: .4s; }
.reveal.shown .card:nth-child(6) { animation-delay: .5s; }
.frameworks { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; }
.frameworks li { padding: 7px 14px; border-radius: 10px; background: var(--chip); color: var(--chip-text); font-size: 14px; font-weight: 700; }

/* journey: arcs of growing scope rising from a base line, labels stacked on the peaks + chapters */
.journey { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 40px; }
.rings { width: 100%; max-width: 600px; justify-self: center; align-self: start; position: sticky; top: 120px; overflow: visible; }
.rings text { font: 700 12.5px -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; fill: var(--chip-text); stroke: none; }
.base { stroke: var(--edge); stroke-width: 2; }
.rings .base-lbl { fill: var(--muted); }
.rg { fill: none; stroke: var(--c2); stroke-opacity: .32; stroke-width: 2; stroke-dasharray: 100; stroke-dashoffset: 0;
  animation: hot 8.4s ease-in-out infinite; }
.r2 { animation-delay: 1.2s; } .r3 { animation-delay: 2.4s; } .r4 { animation-delay: 3.6s; }
.r5 { animation-delay: 4.8s; } .r6 { animation-delay: 6s; } .r7 { animation-delay: 7.2s; stroke: url(#rg); stroke-opacity: 1; stroke-width: 3; }
.core { fill: url(#rg); animation: corepulse 8.4s ease-in-out infinite; }
.core-ic { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lbl rect { fill: var(--surface); stroke: var(--edge); stroke-width: 1.2; }
.l7 rect { fill: var(--chip); stroke: color-mix(in srgb, var(--c3) 50%, transparent); }
.js .reveal .rg { stroke-dashoffset: 100; }
.js .reveal .lbl { opacity: 0; }
.reveal.shown .rg { animation: drawring 1s cubic-bezier(.2,.8,.2,1) forwards, hot 8.4s ease-in-out infinite; }
.reveal.shown .r2 { animation-delay: .15s, 1.2s; } .reveal.shown .r3 { animation-delay: .3s, 2.4s; }
.reveal.shown .r4 { animation-delay: .45s, 3.6s; } .reveal.shown .r5 { animation-delay: .6s, 4.8s; }
.reveal.shown .r6 { animation-delay: .75s, 6s; } .reveal.shown .r7 { animation-delay: .9s, 7.2s; }
.reveal.shown .lbl { animation: chipin .5s cubic-bezier(.2,.8,.2,1) both; transform-box: fill-box; transform-origin: center; }
.reveal.shown .l2 { animation-delay: .5s; } .reveal.shown .l3 { animation-delay: .65s; } .reveal.shown .l4 { animation-delay: .8s; }
.reveal.shown .l5 { animation-delay: .95s; } .reveal.shown .l6 { animation-delay: 1.1s; } .reveal.shown .l7 { animation-delay: 1.25s; }

.chapters { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column-reverse; gap: 10px; }
.ch { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start; padding: 14px 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--edge); transition: border-color .2s ease, transform .2s ease;
  animation: chhot 8.4s ease-in-out infinite; }
.ch .yr { padding: 3px 0; border-radius: 8px; text-align: center; background: var(--chip); color: var(--chip-text); font-size: 13px; font-weight: 800; }
.ch h3 { margin: 0 0 2px; font-size: 17px; }
.ch p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.ch:hover { transform: translateX(4px); border-color: var(--c1); }
.c2 { animation-delay: 1.2s; } .c3 { animation-delay: 2.4s; } .c4 { animation-delay: 3.6s; }
.c5 { animation-delay: 4.8s; } .c6 { animation-delay: 6s; } .c7 { animation-delay: 7.2s; }
.c7 .yr { color: #fff; background: linear-gradient(135deg, #0e7490, #4f46e5, #9333ea); }
/* hovering a chapter highlights its ring */
.journey:has(.c1:hover) .core { transform: scale(1.12); transform-box: fill-box; transform-origin: center; }
.journey:has(.c2:hover) .r2, .journey:has(.c3:hover) .r3, .journey:has(.c4:hover) .r4,
.journey:has(.c5:hover) .r5, .journey:has(.c6:hover) .r6, .journey:has(.c7:hover) .r7 { stroke-opacity: 1; stroke-width: 6; }

/* certifications */
.certs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.cert { display: flex; flex-direction: column; gap: 6px; padding: 20px 18px; border-radius: 20px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--edge); box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease; }
.cert:hover { transform: translateY(-4px); border-color: var(--c1); }
.seal { display: grid; place-items: center; width: 74px; height: 74px; margin-bottom: 8px; border-radius: 50%; color: #fff;
  font-size: 13px; font-weight: 900; letter-spacing: .5px; background: linear-gradient(135deg, #0e7490, #4f46e5 55%, #9333ea);
  box-shadow: 0 8px 22px var(--glow), inset 0 0 0 5px rgba(255, 255, 255, .25); }
.cert:hover .seal { animation: wobble .6s ease; }
.cert b { font-size: 15px; line-height: 1.3; }
.cert small { color: var(--muted); font-size: 13.5px; }
.cert em { margin-top: auto; padding-top: 6px; font-style: normal; font-weight: 750; font-size: 14px; color: var(--link); }
.reveal.shown .cert { animation: chipin .6s cubic-bezier(.2,.8,.2,1) both; }
.reveal.shown .cert:nth-child(2) { animation-delay: .1s; }
.reveal.shown .cert:nth-child(3) { animation-delay: .2s; }
.reveal.shown .cert:nth-child(4) { animation-delay: .3s; }
.reveal.shown .cert:nth-child(5) { animation-delay: .4s; }

/* open source */
.project { overflow: hidden; background: var(--surface); border: 1px solid var(--edge); border-radius: 24px; box-shadow: var(--shadow); }
.project-art { display: block; padding: 18px 18px 0; }
.project-art img { width: 100%; }
.project-body { padding: 18px 28px 28px; }
.project-body h3 { margin: 0 0 8px; font-size: 22px; }
.project-body p { margin: 0 0 18px; color: var(--muted); }
.only-dark { display: none; }
:root[data-theme="dark"] .only-light { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-light { display: none; }
  :root:not([data-theme="light"]) .only-dark { display: block; }
}

/* contact */
.links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.link-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 18px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--edge); box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease; }
.link-card:hover { transform: translateY(-3px); border-color: var(--c1); }
.link-card svg { flex: none; width: 46px; height: 46px; padding: 11px; border-radius: 13px; color: #fff;
  background: linear-gradient(135deg, #0e7490, #4f46e5, #9333ea); }
.link-card b { display: block; }
.link-card small { color: var(--muted); font-size: 14px; }
.where { margin: 18px 0 0; color: var(--muted); }
.footer { width: min(1140px, calc(100% - 32px)); margin: 80px auto 0; padding: 24px 0 40px; border-top: 1px solid var(--edge);
  color: var(--muted); font-size: 14px; text-align: center; }

/* ------------------------------------------------------------------ motion */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes slide { to { background-position: -300% 0; } }
@keyframes roles { 0%, 20% { transform: translateY(0); } 25%, 45% { transform: translateY(-1.45em); } 50%, 70% { transform: translateY(-2.9em); }
                   75%, 95% { transform: translateY(-4.35em); } 100% { transform: translateY(-5.8em); } }
@keyframes chipin { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes wave { 0%, 100% { translate: 0 0; } 6% { translate: 0 -5px; } 12% { translate: 0 0; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes pan { to { background-position: 36px 36px; } }
@keyframes scan { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(900%); } }
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.1); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-10deg) scale(1.06); } 60% { transform: rotate(8deg); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes trace { 0% { stroke-dashoffset: 120; } 50%, 100% { stroke-dashoffset: 0; } }
@keyframes tag { 0%, 4% { opacity: 0; transform: translateY(8px); } 8%, 28% { opacity: 1; transform: none; } 33%, 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes packet { 0% { transform: translateX(0); opacity: 0; } 4% { opacity: 1; } 22% { transform: translateX(100%); opacity: 1; }
                    26%, 100% { transform: translateX(100%); opacity: 0; } }
@keyframes block { 0%, 21% { box-shadow: 0 0 0 0 var(--glow); transform: scale(1); } 24% { box-shadow: 0 0 0 12px transparent; transform: scale(1.15); }
                   30%, 100% { box-shadow: 0 0 0 0 transparent; transform: scale(1); } }
@keyframes lit { 0%, 22%, 100% { box-shadow: none; } 26% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 35%, transparent); } 40% { box-shadow: none; } }
@keyframes drawring { to { stroke-dashoffset: 0; } }
@keyframes hot { 0%, 12%, 100% { stroke-width: 2; } 4% { stroke-width: 6; stroke-opacity: 1; } }
@keyframes corepulse { 0%, 100% { opacity: 1; } 4% { opacity: .75; } 12% { opacity: 1; } }
@keyframes chhot { 0%, 100% { box-shadow: none; } 4% { box-shadow: 0 0 0 2px var(--c1), 0 10px 26px var(--glow); } 12% { box-shadow: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .js .reveal .rg { stroke-dashoffset: 0; }
  .js .reveal .lbl { opacity: 1; }
  .lane i, .tag { display: none; }
}

/* ------------------------------------------------------------------ small screens */
@media (max-width: 1000px) {
  .journey { grid-template-columns: 1fr; }
  .rings { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 1fr 34px; grid-template-areas: "threat guard" "control control"; gap: 8px 12px; }
  .row .threat-chip { grid-area: threat; }
  .row .guard { grid-area: guard; width: 34px; height: 34px; }
  .row .guard::after { left: 10px; right: 10px; top: 8px; bottom: 7px; }
  .row .control { grid-area: control; }
  .row .lane { display: none; }
  .row + .row { padding-top: 12px; border-top: 1px dashed var(--edge); }
}
@media (max-width: 760px) {
  .nav nav { display: none; }
  .theme { margin-left: auto; }
  .hero { grid-template-columns: 1fr; padding: 32px 22px 30px; }
  .hero-art { height: 300px; order: -1; margin: -16px 0 -10px; }
  .o3 { width: 290px; height: 290px; }
  .o2 { width: 240px; height: 240px; }
  .o1 { width: 196px; height: 196px; }
  .radar { width: 260px; height: 260px; }
  .shield { width: 124px; height: 145px; }
  .tag { font-size: 11.5px; }
  .roles-window { height: auto; }
  .roles-list { animation: none; }
  .roles-list span { height: auto; white-space: normal; }
  .roles-list span:not(:first-child) { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 16px 14px; }
  .stat span { font-size: 13.5px; }
  .stat b { font-size: 28px; }
  .cards, .links { grid-template-columns: 1fr; }
  .rings .lbl, .rings .base-lbl { display: none; }
}

/* ------------------------------------------------------------------ 404 */
.notfound { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 32px 16px; text-align: center; }
.nf-shield { width: 120px; height: 140px; margin-bottom: 14px; filter: drop-shadow(0 18px 34px var(--glow)); animation: bob 3s ease-in-out infinite; }
.notfound h1 { margin: 0; font-size: clamp(32px, 6vw, 52px); letter-spacing: -1px; }
.nf-text { margin: 4px 0 22px; color: var(--muted); max-width: 520px; }
.notfound .cta { justify-content: center; }
