/* Spatial + neon layer (desktop only): ambient red/blue light, glass cards that float and light up, depth-parallax hero,
   floating nav capsule. Scoped to html:not(.phone-mode) so the phone UI is untouched. Palette token: --neon (r, g, b). */
:root { --neon: 255, 30, 45; --neon-tube: 0 0 6px rgba(255, 30, 45, .85), 0 0 18px rgba(255, 30, 45, .55), 0 0 38px rgba(255, 30, 45, .35); --glass: rgba(18, 25, 52, .46); --glass-hi: rgba(255, 255, 255, .14); }
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spatialIn { from { opacity: 0; transform: perspective(1100px) translate3d(0, 46px, -120px) rotateX(9deg); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes edgeSpin { to { --a: 360deg; } }
@keyframes ambientDrift { from { transform: translate3d(-2%, 1.5%, 0) scale(1.05); } to { transform: translate3d(2.5%, -2%, 0) scale(1); } }
@keyframes livePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--neon), .55); } 60% { box-shadow: 0 0 0 8px rgba(var(--neon), 0); } }

/* ---------- ambient light: a red lamp bottom-left, a blue one top-right (element is created by spatial.js) ---------- */
html:not(.phone-mode) .ambient { position: fixed; inset: -18%; z-index: -3; pointer-events: none; animation: ambientDrift 26s ease-in-out infinite alternate;
  background: radial-gradient(50% 42% at 8% 92%, rgba(var(--neon), .27), transparent 70%), radial-gradient(46% 40% at 90% 8%, rgba(92, 142, 255, .2), transparent 70%), radial-gradient(36% 30% at 72% 78%, rgba(180, 108, 255, .13), transparent 70%); }
html:not(.phone-mode) body.light { --glass: rgba(255, 255, 255, .62); --glass-hi: rgba(255, 255, 255, .95); }
html:not(.phone-mode) body.light .ambient { opacity: .45; }
html:not(.phone-mode) .cursor-glow { background: radial-gradient(circle, rgba(var(--neon), .5) 0%, rgba(92, 142, 255, .28) 38%, transparent 66%); opacity: .16; }
html:not(.phone-mode) .progress { background: linear-gradient(90deg, rgb(var(--neon)), #ff5a3c 40%, #b46cff 72%, #5c8eff); box-shadow: 0 0 12px rgba(var(--neon), .6); }
html:not(.phone-mode) ::selection { background: rgb(var(--neon)); color: #fff; }
html:not(.phone-mode) ::-webkit-scrollbar-thumb { background: linear-gradient(rgb(var(--neon)), #8f0f22); }
/* ---------- neon red accents ---------- */
html:not(.phone-mode) .hero__hello::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .6rem; border-radius: 50%; vertical-align: middle; background: #ff2a36; box-shadow: 0 0 10px 2px rgba(var(--neon), .8); animation: livePulse 2s ease-out infinite; }
html:not(.phone-mode) .hero__title .grad { background-image: linear-gradient(90deg, #5c8eff, #00e5ff, #b46cff, rgb(var(--neon)), #5c8eff); }
html:not(.phone-mode) .btn--primary { background: linear-gradient(120deg, #ff1e2d, #ff3b3b 55%, #ff5a2d); box-shadow: 0 10px 36px -8px rgba(var(--neon), .75), 0 0 22px -6px rgba(var(--neon), .6), inset 0 1px 0 rgba(255, 255, 255, .3); }
html:not(.phone-mode) .btn--outline { border-color: rgba(var(--neon), .6); }
html:not(.phone-mode) .btn--outline::before { background: rgb(var(--neon)); }
html:not(.phone-mode) .stat__pre { color: #ff4d55; text-shadow: var(--neon-tube); }
html:not(.phone-mode) .section__title .mono { color: #ff4d55; text-shadow: var(--neon-tube); }
html:not(.phone-mode) .tags li:hover { background: rgb(var(--neon)); color: #fff; }
html:not(.phone-mode) .marquee__track span:hover { color: rgb(var(--neon)); }
html:not(.phone-mode) .to-top { background: linear-gradient(120deg, #ff1e2d, #ff4a3d); box-shadow: 0 12px 30px -8px rgba(var(--neon), .7); }
html:not(.phone-mode) .term-fab:hover { border-color: rgb(var(--neon)); box-shadow: 0 0 24px -4px rgba(var(--neon), .6); }
/* ---------- spatial hero: the window, portrait, ornament and nameplate sit at different depths and drift with the mouse (vars set on .hero by spatial.js) ---------- */
html:not(.phone-mode) .hero__visual { position: relative; }
html:not(.phone-mode) .hero__visual::before { content: ""; position: absolute; width: 150%; aspect-ratio: 1; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(47, 107, 255, .3), rgba(47, 107, 255, .1) 55%, transparent 72%); filter: blur(30px); }
html:not(.phone-mode) .win__bg { translate: calc(var(--px, 0) * -6px) calc(var(--py, 0) * -5px); }
html:not(.phone-mode) .flip { translate: calc(var(--px, 0) * 7px) calc(var(--py, 0) * 5px); }
html:not(.phone-mode) .orn { translate: calc(var(--px, 0) * 16px) calc(var(--py, 0) * 11px); }
html:not(.phone-mode) .nameplate { translate: calc(var(--px, 0) * 10px) calc(var(--py, 0) * 9px); }
html:not(.phone-mode) .hero__text { translate: calc(var(--px, 0) * -5px) calc(var(--py, 0) * -4px); }
/* ---------- spatial cards: frosted glass that floats, lights up on hover, with a travelling neon edge ---------- */
html:not(.phone-mode) .card { -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5); border-color: rgba(255, 255, 255, .09);
  background: radial-gradient(circle 300px at 0% 0%, rgba(var(--c1), var(--g)), transparent 72%), radial-gradient(circle 260px at 100% 100%, rgba(var(--c2), calc(var(--g) * .7)), transparent 72%), var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px rgba(255, 255, 255, .03), 0 28px 50px -26px rgba(0, 0, 0, .7), 0 18px 46px -28px rgba(var(--c1), .55); }
html:not(.phone-mode) .card:hover { border-color: rgba(var(--neon), .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 40px 70px -26px rgba(0, 0, 0, .75), 0 22px 60px -22px rgba(var(--neon), .6); }
html:not(.phone-mode) .card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: conic-gradient(from var(--a), transparent 0 58%, rgba(var(--neon), .35) 72%, rgba(var(--neon), .95) 90%, #ffb3b3 97%, #fff 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: edgeSpin 4.5s linear infinite paused; }
html:not(.phone-mode) .card:hover::after { opacity: 1; animation-play-state: running; }
html:not(.phone-mode) body.light .card { border-color: rgba(15, 27, 61, .1); box-shadow: inset 0 1px 0 var(--glass-hi), 0 24px 44px -26px rgba(40, 60, 120, .35), 0 16px 40px -28px rgba(var(--c1), .4); }
/* ---------- sections enter from depth (plays once; the tilt on hover keeps working because the animation does not fill forwards) ---------- */
html:not(.phone-mode) .reveal { transform: none; filter: none; }
html:not(.phone-mode) .reveal.visible { animation: spatialIn .95s cubic-bezier(.2, .7, .2, 1) var(--d, 0s) backwards; }
/* ---------- floating glass navigation capsule (desktop widths only; the mobile drawer keeps its own look) ---------- */
@media (min-width: 961px) {
  html:not(.phone-mode) .header { padding-top: 1rem; pointer-events: none; }
  html:not(.phone-mode) .header > * { pointer-events: auto; }
  html:not(.phone-mode) .header.scrolled { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 1rem 4vw .9rem; }
  html:not(.phone-mode) .nav { background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px; padding: .3rem .4rem; box-shadow: inset 0 1px 0 var(--glass-hi), 0 16px 40px -14px rgba(0, 0, 0, .6), 0 0 40px -12px rgba(var(--neon), .25); }
  html:not(.phone-mode) .logo { padding: .35rem .85rem; border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); border: 1px solid rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 var(--glass-hi), 0 16px 40px -14px rgba(0, 0, 0, .6); }
  html:not(.phone-mode) .nav__list { gap: .1rem; }
  html:not(.phone-mode) .nav__link { padding: .5rem 1rem; border-radius: 999px; transition: color .25s, background .25s, box-shadow .25s; }
  html:not(.phone-mode) .nav__link::after { display: none; }
  html:not(.phone-mode) .nav__link:hover { background: rgba(255, 255, 255, .07); }
  html:not(.phone-mode) .nav__link.active { color: #fff; background: rgba(var(--neon), .2); box-shadow: inset 0 0 0 1px rgba(var(--neon), .6), 0 0 20px -3px rgba(var(--neon), .75); }
  html:not(.phone-mode) body.light .nav__link.active { color: var(--fg-strong); }
}
@media (prefers-reduced-motion: reduce) {
  html:not(.phone-mode) .ambient,
  html:not(.phone-mode) .hero__hello::before,
  html:not(.phone-mode) .card::after { animation: none; }
  html:not(.phone-mode) .reveal.visible { animation: none; }
}
