/*
 * Public site — "Night-world": dark-first, CSS-3D, with a full light mode.
 * Colours, fonts and radii come from tokens.css; components never hard-code a colour.
 * Idle motion is transform/opacity only; everything is switched off when the visitor pauses motion (html.motion-off).
 */

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
    font: 400 1rem/1.65 var(--font-body); overflow-x: hidden;
    transition: background-color .5s ease, color .5s ease;
}
img, svg { max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--cyan); color: var(--ink); }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 100; padding: 10px 18px; border-radius: 999px; background: var(--amber); color: var(--ink); font-weight: 700; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.i { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.accent { color: var(--cyan); }
.label, .eyebrow, .card-label {
    font: 500 .78rem/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--cyan);
}

/* ===== Ambient background: stars (dark only), breathing glows ===== */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); transition: background-color .5s ease; }
.stars {
    position: absolute; inset: 0; opacity: var(--star); transition: opacity .5s ease;
}
.stars::before, .stars::after {
    content: ''; position: absolute; inset: 0; background-repeat: repeat;
    animation: twinkle 5s ease-in-out infinite;
}
.stars::before {
    background-size: 340px 340px;
    background-image:
        radial-gradient(1.2px 1.2px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 90px 140px, #cfe8ff, transparent),
        radial-gradient(1.4px 1.4px at 160px 60px, #fff, transparent), radial-gradient(1px 1px at 230px 210px, #fff, transparent),
        radial-gradient(1.2px 1.2px at 290px 110px, #d8ccff, transparent), radial-gradient(1px 1px at 60px 260px, #fff, transparent),
        radial-gradient(1.4px 1.4px at 310px 300px, #cfe8ff, transparent);
}
.stars::after {
    background-size: 270px 270px; animation-delay: -2.5s; animation-duration: 7s;
    background-image:
        radial-gradient(1px 1px at 40px 90px, #fff, transparent), radial-gradient(1.4px 1.4px at 120px 200px, #fff, transparent),
        radial-gradient(1px 1px at 200px 20px, #cfe8ff, transparent), radial-gradient(1.2px 1.2px at 250px 150px, #fff, transparent),
        radial-gradient(1px 1px at 80px 230px, #d8ccff, transparent);
}
.glow { position: absolute; border-radius: 50%; opacity: var(--glow-opacity); animation: breathe 14s ease-in-out infinite; transition: opacity .5s ease; }
.glow-1 { width: 64vmax; height: 64vmax; left: -20vmax; top: -24vmax; background: radial-gradient(closest-side, var(--violet-glow), transparent); }
.glow-2 { width: 52vmax; height: 52vmax; right: -18vmax; top: 18vh; background: radial-gradient(closest-side, var(--cyan-soft), transparent); animation-delay: -5s; }
.glow-3 { width: 46vmax; height: 46vmax; left: 20vw; bottom: -26vmax; background: radial-gradient(closest-side, var(--amber-soft), transparent); animation-delay: -9s; }
@keyframes twinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* ===== Buttons ===== */
.btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55em;
    min-height: 48px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent;
    font: 700 .95rem/1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: transform .25s ease, background-color .3s ease, border-color .3s ease, box-shadow .3s ease, color .3s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-amber { background: var(--amber); color: var(--ink); box-shadow: 0 10px 30px -12px var(--amber); }
.btn-amber:hover { box-shadow: 0 16px 36px -12px var(--amber); }
.btn-ghost { background: var(--panel); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--cyan-line); background: var(--panel-strong); }
.btn-cyan { background: var(--cyan); color: var(--ink); }
[data-theme="light"] .btn-cyan { color: #fff; }
.btn-sm { min-height: 44px; padding: 0 20px; font-size: .9rem; }
.btn-pulse::after {
    content: ''; position: absolute; inset: -1px; border-radius: inherit; border: 2px solid var(--amber);
    animation: pulse-ring 3.2s ease-out infinite; pointer-events: none;
}
@keyframes pulse-ring-sm { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(1.04, 1.35); opacity: 0; } }
@keyframes pulse-ring { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(1.22, 1.5); opacity: 0; } }
.text-link { display: inline-flex; align-items: center; gap: .45em; color: var(--cyan); font-weight: 700; text-decoration: none; min-height: 44px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ===== Header ===== */
.site-header {
    position: sticky; top: 0; z-index: 50; background: var(--header-bg); border-bottom: 1px solid transparent;
    backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
    transition: border-color .4s ease, background-color .5s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.nav-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; min-height: var(--header-h); padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-height: 44px; }
.brand-mark { width: 34px; height: 34px; color: var(--cyan); transition: transform .4s ease; }
.brand:hover .brand-mark { transform: rotateY(180deg); }
.brand-mark-bar { fill: var(--amber); }
.brand-logo { height: 36px; width: auto; }
.brand-name { font: 700 1rem/1 var(--font-display); letter-spacing: -.01em; }
.nav { margin-left: auto; }
.nav-links { display: flex; flex-wrap: wrap; gap: 2px; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: .95rem; text-decoration: none; transition: color .3s, background-color .3s; }
.nav-links a:hover, .nav-links a.is-active, .nav-links a[aria-current] { color: var(--text); background: var(--panel-strong); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font-size: 1.2rem;
    transition: border-color .3s, background-color .3s, transform .3s;
}
.icon-btn:hover { border-color: var(--cyan-line); transform: rotate(14deg); }
.motion-toggle .i-play, .motion-off .motion-toggle .i-pause { display: none; }
.motion-off .motion-toggle .i-play { display: block; }
.theme-toggle .i-sun { display: none; }
[data-theme="light"] .theme-toggle .i-sun { display: block; }
[data-theme="light"] .theme-toggle .i-moon { display: none; }
@media (max-width: 859px) {
    .nav-bar { gap: 4px 12px; }
    .nav-actions { margin-left: auto; }
    .nav { order: 3; flex-basis: 100%; margin-left: 0; }
    .nav-links { margin-inline: -8px; }
    .nav-links a { padding: 0 10px; font-size: .88rem; }
}
/* logo + pause + theme + "Hire me" must fit one row on phones */
@media (max-width: 480px) {
    .nav-bar { gap: 4px 8px; }
    .brand { gap: 8px; }
    .brand-name { font-size: .92rem; }
    .nav-actions { gap: 6px; }
    .nav-actions .icon-btn { width: 38px; height: 38px; }
    .nav-actions .btn-sm { padding-inline: 14px; }
}

/* ===== Hero ===== */
.hero { position: relative; padding-block: clamp(36px, 7vw, 88px) clamp(48px, 6vw, 88px); isolation: isolate; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: clamp(24px, 5vw, 64px); }
.hero-copy > * { animation: fade-up .8s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 110ms + 80ms); }
.status {
    display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--panel); font: 500 .85rem/1 var(--font-mono); color: var(--text);
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #34d399; position: relative; }
.status-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #34d399; animation: ping 2s ease-out infinite; }
.hero-title { margin-top: 22px; font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3.1rem); font-weight: 700; line-height: 1.14; letter-spacing: -.025em; text-wrap: balance; }
.hero-sub { margin-top: 22px; max-width: 54ch; font-size: clamp(1rem, .95rem + .3vw, 1.18rem); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
@keyframes fade-up { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes ping { 0% { transform: scale(1); opacity: .8; } 80%, 100% { transform: scale(2.8); opacity: 0; } }

/* grid floor */
.hero-floor { position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 56%; perspective: 480px; overflow: hidden; pointer-events: none;
    -webkit-mask-image: linear-gradient(to top, #000 15%, transparent 95%); mask-image: linear-gradient(to top, #000 15%, transparent 95%); }
.floor-plane { position: absolute; left: -50%; right: -50%; top: 0; height: 100%; transform-origin: 50% 100%; transform: rotateX(62deg); overflow: hidden; }
.floor-grid {
    --cell: 64px; position: absolute; left: 0; right: 0; top: calc(var(--cell) * -1); height: calc(100% + var(--cell));
    background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: var(--cell) var(--cell); animation: floor-run 2.4s linear infinite;
}
@keyframes floor-run { to { transform: translateY(var(--cell)); } }

/* 3D world */
.world-wrap { container-type: inline-size; width: 100%; max-width: 560px; margin-inline: auto; aspect-ratio: 1; position: relative;
    cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.world-wrap.is-dragging { cursor: grabbing; }
.world { position: absolute; inset: 0; perspective: 120cqw; perspective-origin: 50% 42%; }
.stage {
    --tx: 0deg; --ty: 0deg; --sx: calc(var(--tx) - 10deg); --sy: var(--ty); --mx: 0; --my: 0;
    position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--sx)) rotateY(var(--sy));
}
.stage > * { position: absolute; left: 50%; top: 50%; transform-style: preserve-3d; }
.ground {
    width: 76cqw; height: 76cqw; margin: -38cqw 0 0 -38cqw; border-radius: 50%; transform: translateY(30cqw) rotateX(90deg);
    background: radial-gradient(closest-side, var(--cyan-soft), transparent 72%); border: 1px solid var(--cyan-line);
    box-shadow: 0 0 6cqw var(--cyan-soft) inset;
}
.ground::after { content: ''; position: absolute; inset: 14%; border-radius: 50%; border: 1px dashed var(--line); }

.core { width: 18cqw; height: 18cqw; margin: -9cqw 0 0 -9cqw; animation: spin-core 18s linear infinite; }
.core .face { position: absolute; inset: 0; border: 1px solid var(--cyan); background: linear-gradient(135deg, var(--cyan-soft), var(--violet-glow)); box-shadow: 0 0 5cqw var(--cyan-soft) inset, 0 0 3cqw var(--cyan-soft); }
.core .f1 { transform: translateZ(9cqw); } .core .f2 { transform: rotateY(90deg) translateZ(9cqw); }
.core .f3 { transform: rotateY(180deg) translateZ(9cqw); } .core .f4 { transform: rotateY(-90deg) translateZ(9cqw); }
.core .f5 { transform: rotateX(90deg) translateZ(9cqw); } .core .f6 { transform: rotateX(-90deg) translateZ(9cqw); }
.core-glow { translate: calc(var(--mx) * 5cqw) calc(var(--my) * 5cqw); width: 38cqw; height: 38cqw; margin: -19cqw 0 0 -19cqw; border-radius: 50%; background: radial-gradient(closest-side, var(--cyan-soft), transparent); animation: breathe 6s ease-in-out infinite; }
@keyframes spin-core { from { transform: rotateX(20deg) rotateY(0); } to { transform: rotateX(380deg) rotateY(360deg); } }

.orbit-ring { border-radius: 50%; border: 2px solid var(--cyan-line); }
.orbit-ring::after { content: ''; position: absolute; width: 3cqw; height: 3cqw; top: -1.6cqw; left: calc(50% - 1.5cqw); border-radius: 50%; background: var(--amber); box-shadow: 0 0 2cqw var(--amber); }
.orbit-ring-1 { width: 46cqw; height: 46cqw; margin: -23cqw 0 0 -23cqw; animation: ring-a 16s linear infinite; }
.orbit-ring-2 { width: 62cqw; height: 62cqw; margin: -31cqw 0 0 -31cqw; border-color: var(--line); animation: ring-b 22s linear infinite; }
.orbit-ring-3 { width: 78cqw; height: 78cqw; margin: -39cqw 0 0 -39cqw; border-style: dashed; animation: ring-c 30s linear infinite; }
.orbit-ring-2::after { background: var(--cyan); box-shadow: 0 0 2cqw var(--cyan); }
.orbit-ring-3::after { display: none; }
@keyframes ring-a { from { transform: rotateX(72deg) rotateZ(0); } to { transform: rotateX(72deg) rotateZ(360deg); } }
@keyframes ring-b { from { transform: rotateX(68deg) rotateY(18deg) rotateZ(360deg); } to { transform: rotateX(68deg) rotateY(18deg) rotateZ(0); } }
@keyframes ring-c { from { transform: rotateX(78deg) rotateY(-14deg) rotateZ(0); } to { transform: rotateX(78deg) rotateY(-14deg) rotateZ(360deg); } }

.orbit { width: 0; height: 0; animation: orbit 34s linear infinite; }
@keyframes orbit { to { transform: rotateY(360deg); } }
.slot { position: absolute; left: 0; top: 0; transform-style: preserve-3d; transform: rotateY(var(--a)) translateZ(35cqw); }
.undo { position: absolute; transform-style: preserve-3d; transform: rotateY(calc(var(--a) * -1)); }
.counter { position: absolute; transform-style: preserve-3d; animation: counter-orbit 34s linear infinite; }
@keyframes counter-orbit { to { transform: rotateY(-360deg); } }
/* keeps the chip facing the camera while the whole stage tilts with the mouse */
.chip3d {
    position: absolute; transform: translate(-50%, -50%) rotateY(calc(var(--sy) * -1)) rotateX(calc(var(--sx) * -1));
    padding: 1.1cqw 2.6cqw; border-radius: 999px; white-space: nowrap; font: 700 max(11px, 2.7cqw)/1.2 var(--font-body);
    background: var(--chip-bg); color: var(--chip-text); border: 1px solid var(--chip-line);
    box-shadow: 0 0 3cqw var(--cyan-soft), 0 1.2cqw 3cqw -1cqw rgba(0, 0, 0, .35);
}
.chip3d.amber { background: var(--amber-soft); border-color: var(--amber); }
[data-theme="light"] .chip3d.amber { background: var(--amber); color: var(--ink); }

.cube { width: calc(var(--s) * 1cqw); height: calc(var(--s) * 1cqw); margin: calc(var(--s) * -.5cqw) 0 0 calc(var(--s) * -.5cqw);
    transform: translate3d(calc(var(--x) * 1cqw), calc(var(--y) * 1cqw), calc(var(--z) * 1cqw)); }
/* individual `translate` composes with the transform above: deeper cubes drift further with the cursor */
.cube { translate: calc(var(--mx) * (var(--z) + 40) * .16cqw) calc(var(--my) * (var(--z) + 40) * .16cqw); }
.cube-in { position: absolute; inset: 0; transform-style: preserve-3d; animation: tumble var(--d, 20s) linear infinite, bob 6s ease-in-out infinite; animation-delay: var(--delay, 0s); }
.cube-in i { position: absolute; inset: 0; border: 1px solid var(--cyan-line); background: linear-gradient(135deg, var(--cyan-soft), var(--panel)); }
.cube-in i:nth-child(1) { transform: translateZ(calc(var(--s) * .5cqw)); } .cube-in i:nth-child(2) { transform: rotateY(90deg) translateZ(calc(var(--s) * .5cqw)); }
.cube-in i:nth-child(3) { transform: rotateY(180deg) translateZ(calc(var(--s) * .5cqw)); } .cube-in i:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--s) * .5cqw)); }
.cube-in i:nth-child(5) { transform: rotateX(90deg) translateZ(calc(var(--s) * .5cqw)); } .cube-in i:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--s) * .5cqw)); }
@keyframes tumble { from { transform: rotateX(0) rotateY(0) rotateZ(0); } to { transform: rotateX(360deg) rotateY(720deg) rotateZ(360deg); } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -2cqw; } }

/* 3D scene is paused off-screen / on hidden tab (class set by site.js) */
.is-paused, .is-paused * , .is-paused *::before, .is-paused *::after { animation-play-state: paused !important; }
/* static fallback: low-power devices keep the scene but drop the heavy parts */
.lite .cube, .lite .orbit-ring-3, .lite .floor-grid { display: none; }
.lite .floor-grid { display: block; animation: none; }

/* ===== Marquee ===== */
.marquee { border-block: 1px solid var(--line); background: var(--panel); overflow: hidden; padding-block: 18px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
.marquee-list { display: flex; flex: none; }
.marquee-list li { display: inline-flex; align-items: center; gap: 22px; padding-right: 22px; font: 500 1rem/1 var(--font-mono); color: var(--muted); white-space: nowrap; }
.marquee-list li::after { content: '◆'; font-size: .6rem; color: var(--cyan); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===== Sections ===== */
.section { padding-block: clamp(36px, 5vw, 64px); position: relative; }
.section-head { max-width: 720px; margin-bottom: clamp(24px, 3.5vw, 40px); }
.section-title { margin-top: 14px; font-size: clamp(1.6rem, 1.1rem + 2vw, 2.7rem); font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.section-lead { margin-top: 14px; color: var(--muted); font-size: 1.05rem; }

.card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--card-shadow);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    transition: background-color .5s ease, border-color .5s ease;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 6px 14px; border-radius: 999px; font: 500 .82rem/1.3 var(--font-mono); background: var(--pill-bg); border: 1px solid var(--line); color: var(--text); transition: transform .25s ease, border-color .25s ease; }
.chips li:hover { transform: translateY(-3px); border-color: var(--cyan-line); }

/* scroll reveal (only when JS is running, so no-JS visitors still see everything) */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--d, 0) * 90ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* 3D tilt cards */
.tilt-grid { perspective: 1200px; }
.tilt { transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2, .7, .2, 1), border-color .3s, box-shadow .4s; }
.tilt .pop { transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
@media (hover: hover) {
    .tilt:hover, .tilt:focus-within { transform: rotateX(7deg) rotateY(-9deg) translateZ(24px); border-color: var(--cyan-line); }
    .tilt:hover .pop, .tilt:focus-within .pop { transform: translateZ(46px) scale(1.06); }
}

/* Stats */
.stats { padding-block: clamp(28px, 4vw, 48px); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { display: flex; flex-direction: column; padding: 28px 24px; text-align: left; }
.stat-value { order: -1; margin: 0; }
.stat-value { font: 800 clamp(1.9rem, 1.2rem + 2.4vw, 3rem)/1 var(--font-display); color: var(--cyan); letter-spacing: -.03em; }
.stat-label { margin-top: 10px; color: var(--muted); font-size: .95rem; }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service { padding: 30px; }
.icon-tile { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--radius-tile); background: var(--cyan-soft); border: 1px solid var(--cyan-line); color: var(--cyan); font-size: 1.6rem; }
.service h3 { margin-top: 22px; font-size: 1.12rem; }
.service p { margin-top: 10px; color: var(--muted); font-size: .96rem; }

/* Projects */
.project { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: clamp(24px, 5vw, 64px); }
.project + .project { margin-top: clamp(36px, 5vw, 64px); }
.project:nth-child(even) .project-visual { order: 2; }
.project-body h3 { margin-top: 12px; font-size: clamp(1.4rem, 1rem + 1.4vw, 2.1rem); }
.project-body p.desc { margin-top: 14px; color: var(--muted); }
.project-body .chips { margin-top: 20px; }
.project-body .text-link { margin-top: 18px; }
.project-visual { perspective: 1400px; }
.device {
    --rot-y: -14deg; position: relative; border-radius: 20px; background: var(--screen-bg); border: 1px solid var(--screen-line);
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .7), 0 0 0 6px var(--panel); color: var(--screen-text); overflow: hidden; aspect-ratio: 16 / 10;
    transform: rotateY(var(--rot-y)) rotateX(6deg); transition: transform .8s cubic-bezier(.2, .7, .2, 1);
    animation: float-device 7s ease-in-out infinite;
}
.project:nth-child(even) .device { --rot-y: 14deg; }
@media (hover: hover) { .project-visual:hover .device { transform: rotateY(0) rotateX(0) scale(1.02); animation-play-state: paused; } }
@keyframes float-device { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.device-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--screen-line); font: 500 .72rem/1 var(--font-mono); color: var(--screen-text); opacity: .85; }
.device-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--screen-line); }
.device-bar i:nth-child(1) { background: var(--screen-amber); }
.device-bar span { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen { position: absolute; inset: 37px 0 0; container-type: size; display: grid; place-items: center; overflow: hidden; }
.screen svg, .screen img { width: 100%; height: 100%; object-fit: cover; }
.screen picture { display: block; width: 100%; height: 100%; }
.screen-cover { font: 800 1.6rem/1.2 var(--font-display); text-align: center; padding: 20px; color: var(--screen-cyan); }

.route-road { fill: none; stroke: var(--screen-line); stroke-width: 10; stroke-linecap: round; }
.route-line { fill: none; stroke: var(--screen-cyan); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 8 10; animation: dash 1.6s linear infinite; }
.route-pin { fill: var(--screen-amber); }
.route-car { fill: var(--screen-cyan); stroke: var(--screen-bg); stroke-width: 2; }
.route-ping { fill: none; stroke: var(--screen-amber); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ping-svg 2.4s ease-out infinite; }
.route-ping.p2 { animation-delay: 1.1s; stroke: var(--screen-cyan); }
@keyframes dash { to { stroke-dashoffset: -36; } }
@keyframes ping-svg { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(3); opacity: 0; } }

.box-scene { width: 100%; height: 100%; display: grid; place-items: center; perspective: 700px; }
.box3d { --b: 32cqh; width: var(--b); height: var(--b); position: relative; transform-style: preserve-3d; animation: spin-box 11s linear infinite; }
.box3d i { position: absolute; inset: 0; border: 1px solid var(--screen-amber); background: linear-gradient(135deg, rgba(255, 190, 80, .22), rgba(255, 190, 80, .06)); }
.box3d i::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--screen-amber); opacity: .5; }
.box3d i:nth-child(1) { transform: translateZ(calc(var(--b) / 2)); } .box3d i:nth-child(2) { transform: rotateY(90deg) translateZ(calc(var(--b) / 2)); }
.box3d i:nth-child(3) { transform: rotateY(180deg) translateZ(calc(var(--b) / 2)); } .box3d i:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--b) / 2)); }
.box3d i:nth-child(5) { transform: rotateX(90deg) translateZ(calc(var(--b) / 2)); } .box3d i:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--b) / 2)); }
@keyframes spin-box { from { transform: rotateX(-22deg) rotateY(0); } to { transform: rotateX(-22deg) rotateY(360deg); } }
.box-hint { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font: 500 .7rem/1 var(--font-mono); color: var(--screen-text); opacity: .6; }

.net-link { stroke: var(--screen-line); stroke-width: 1.5; }
.net-flow { stroke: var(--screen-cyan); stroke-width: 2; stroke-dasharray: 4 14; animation: dash 1.4s linear infinite; }
.net-node { fill: var(--screen-bg); stroke: var(--screen-cyan); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: pulse-node 2.8s ease-in-out infinite; animation-delay: var(--n, 0s); }
.net-node.hub { stroke: var(--screen-amber); }
@keyframes pulse-node { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .55; } }

/* Experience timeline */
.timeline { position: relative; display: grid; gap: 28px; padding-left: 38px; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--cyan), var(--violet-glow), transparent); box-shadow: 0 0 14px var(--cyan-soft); }
.job { position: relative; perspective: 1000px; }
.job-node { position: absolute; left: -34px; top: 30px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan); box-shadow: 0 0 12px var(--cyan-soft); }
.job.is-current .job-node { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 14px var(--amber); }
.job.is-current .job-node::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--amber); animation: ping 2.2s ease-out infinite; }
.job-card { padding: 26px 28px; transition: transform .5s cubic-bezier(.2, .7, .2, 1), border-color .3s; transform-origin: left center; }
@media (hover: hover) { .job-card:hover { transform: rotateY(-5deg) rotateX(2deg) translateX(8px); border-color: var(--cyan-line); } }
.job-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 18px; }
.job-card h3 { font-size: 1.15rem; }
.job-period { font: 500 .85rem/1.4 var(--font-mono); color: var(--cyan); }
.job-company { margin-top: 6px; color: var(--muted); }
.job-company strong { color: var(--text); font-weight: 700; }
.badge-current { margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--amber-soft); color: var(--text); border: 1px solid var(--amber); font: 500 .72rem/1.6 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.job-points { margin-top: 14px; display: grid; gap: 8px; color: var(--muted); font-size: .96rem; }
.job-points li { position: relative; padding-left: 20px; }
.job-points li::before { content: ''; position: absolute; left: 0; top: .7em; width: 8px; height: 2px; background: var(--cyan); }
.job .chips { margin-top: 16px; }

/* Stack */
.stack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stack-card { padding: 28px; }
.stack-card h3 { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-size: 1.05rem; }
.stack-card h3 .no { font: 500 .78rem/1 var(--font-mono); color: var(--cyan); }

/* Clients */
.quotes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.quote { padding: 32px; margin: 0; display: flex; flex-direction: column; gap: 22px; }
.quote:only-child { grid-column: 1 / -1; width: 100%; max-width: 820px; justify-self: center; }
.quote-mark { width: 34px; height: 26px; fill: var(--cyan); opacity: .85; }
.quote blockquote { margin: 0; font-size: 1.05rem; line-height: 1.7; }
.quote figcaption { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.quote figcaption strong { font-family: var(--font-display); font-size: .95rem; }
.quote figcaption span { color: var(--muted); font-size: .9rem; }

/* Contact CTA */
.cta { position: relative; overflow: hidden; isolation: isolate; padding: clamp(32px, 6vw, 72px); text-align: center; }
.cta h2 { font-size: clamp(1.7rem, 1.1rem + 2.6vw, 3.2rem); font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 28px; }
.cta-form { margin: clamp(32px, 5vw, 52px) auto 0; max-width: 640px; text-align: left; display: grid; gap: 16px; padding: clamp(20px, 4vw, 32px); background: var(--panel-strong); border-radius: var(--radius-card); border: 1px solid var(--line); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; margin-bottom: 6px; font: 500 .8rem/1.4 var(--font-mono); letter-spacing: .04em; color: var(--muted); }
.field .optional { opacity: .8; }
.field input, .field textarea {
    width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line);
    background: var(--bg); color: var(--text); font: inherit; transition: border-color .3s, box-shadow .3s, background-color .5s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.field [aria-invalid="true"] { border-color: #f87171; }
.field-error { margin-top: 6px; color: #f87171; font-size: .85rem; }
[data-theme="light"] .field-error { color: #b91c1c; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 12px 16px; border-radius: 14px; font-size: .95rem; border: 1px solid var(--line); }
.notice-success { background: rgba(52, 211, 153, .14); border-color: #34d399; }
.notice-error { background: rgba(248, 113, 113, .14); border-color: #f87171; }
.cta-meta { margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; }

/* Blog list (home + /blog) */
.posts { display: grid; gap: 14px; }
.post { display: grid; grid-template-columns: 170px 1fr auto; gap: 20px; align-items: center; padding: 22px 26px; border-radius: var(--radius-card); background: var(--panel); border: 1px solid var(--line); text-decoration: none; transition: transform .35s ease, border-color .3s, background-color .5s; }
.post:hover { transform: translateX(6px); border-color: var(--cyan-line); }
.post-meta { display: grid; gap: 2px; font: 500 .8rem/1.5 var(--font-mono); color: var(--muted); }
.post-text { display: grid; gap: 4px; }
.post-text strong { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; }
.post-text span { color: var(--muted); font-size: .94rem; }
.post-arrow { color: var(--cyan); font-size: 1.3rem; }
.more-link { margin-top: 18px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(48px, 6vw, 72px) 28px; background: var(--panel); transition: background-color .5s; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.footer-about { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.footer-tagline { max-width: 36ch; color: var(--muted); }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; }
.footer-heading { margin-bottom: 8px; font: 600 .78rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text); }
.footer-col > a:not(.btn), .footer-top { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); text-decoration: none; transition: color .2s; }
.footer-col > a:not(.btn):hover, .footer-top:hover { color: var(--cyan); }
.footer-email { overflow-wrap: anywhere; }
.footer-social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.footer-social a { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); transition: color .2s, border-color .2s, transform .2s; }
.footer-social a:hover { color: var(--cyan); border-color: var(--cyan-line); transform: translateY(-2px); }
.footer-cta { margin-top: 16px; }
.footer-base { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; color: var(--muted); font-size: .9rem; }
.footer-top { min-height: 44px; gap: 6px; }

/* ===== Inner pages (blog) ===== */
.page { padding-block: clamp(40px, 7vw, 88px); }
.page-head { max-width: 720px; margin-bottom: 40px; }
.page-title { margin-top: 12px; font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.2rem); font-weight: 800; text-wrap: balance; }
.page-intro { margin-top: 14px; color: var(--muted); font-size: 1.08rem; }
.eyebrow-dot { display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: var(--amber); }
.empty-state { padding: 40px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-card); }
.article { max-width: 780px; }
.article-wide { max-width: 1080px; }
.back-link { margin-bottom: 24px; }
.article-meta { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font: 500 .85rem/1.5 var(--font-mono); }
.article-image { width: 100%; border-radius: var(--radius-card); margin-top: 28px; border: 1px solid var(--line); }
.prose { margin-top: 32px; font-size: 1.08rem; line-height: 1.8; }
.prose > * + * { margin-top: 1.2em; }
.prose h2, .prose h3 { margin-top: 1.8em; font-size: 1.4rem; }
.prose a { color: var(--cyan); }
.prose pre { overflow-x: auto; padding: 18px; border-radius: 16px; background: var(--screen-bg); color: var(--screen-text); font: .88rem/1.6 var(--font-mono); }
.prose code { font-family: var(--font-mono); font-size: .9em; }
.prose :not(pre) > code { padding: 2px 6px; border-radius: 6px; background: var(--pill-bg); }
.prose blockquote { margin-inline: 0; padding-left: 20px; border-left: 3px solid var(--cyan); color: var(--muted); }
.prose img { border-radius: 16px; height: auto; }
.related { margin-top: 56px; }
.page-navigation { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 32px; }
.page-navigation a, .page-navigation span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; }
.page-navigation [aria-current] { background: var(--cyan); color: var(--ink); border-color: var(--cyan); }
.page-navigation [aria-disabled] { opacity: .5; }
.page-summary { border: 0 !important; background: none !important; color: var(--muted); }

/* ===== Blog article ===== */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 80; pointer-events: none; }
.read-progress i { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--cyan), var(--amber)); }
.article-head { max-width: 820px; }
.article-lead { margin-top: 18px; color: var(--muted); font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); line-height: 1.6; max-width: 60ch; }
.article-byline { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.byline-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); overflow: hidden; flex: none; }
.byline-mark .brand-mark, .byline-mark .brand-logo { width: 28px; height: 28px; }
.byline-mark .brand-name { display: none; }
.byline-mark-lg { width: 64px; height: 64px; }
.byline-mark-lg .brand-mark, .byline-mark-lg .brand-logo { width: 38px; height: 38px; }
.byline-text { display: grid; gap: 2px; }
.byline-text strong { font-family: var(--font-display); font-size: .95rem; }
.byline-text .article-meta { margin-top: 0; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px 56px; margin-top: 40px; align-items: start; }
.article-main { min-width: 0; max-width: 740px; }
.article-main .prose { margin-top: 0; }
.toc { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius-tile); background: var(--panel); }
.toc ol { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 6px 0 6px 14px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; font-size: .92rem; line-height: 1.4; transition: color .2s, border-color .2s; }
.toc .toc-l3 a { padding-left: 28px; }
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--cyan); border-left-color: var(--cyan); }
@media (min-width: 1000px) {
    .article-layout { grid-template-columns: minmax(0, 1fr) 250px; }
    .toc { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header-h) + 24px); }
    .article-main { grid-column: 1; grid-row: 1; }
}
.prose h2, .prose h3 { scroll-margin-top: calc(var(--header-h) + 24px); }
.prose h2 { padding-top: .6em; border-top: 1px solid var(--line); font-size: 1.55rem; }
.prose h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .5em; }
.prose pre { position: relative; border: 1px solid var(--screen-line); box-shadow: var(--card-shadow); tab-size: 4; }
.prose pre code { font-size: .86rem; line-height: 1.65; font-variant-ligatures: none; }
.copy-code { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--screen-line); background: rgba(255, 255, 255, .06); color: var(--screen-text); font: 600 .72rem/1.4 var(--font-mono); cursor: pointer; opacity: 0; transition: opacity .2s; }
.prose pre:hover .copy-code, .copy-code:focus-visible { opacity: 1; }
@media (hover: none) { .copy-code { opacity: 1; } }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); }
.share-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 600 .85rem/1 var(--font-body); text-decoration: none; cursor: pointer; transition: border-color .2s, transform .2s; }
.share-btn:hover { border-color: var(--cyan-line); transform: translateY(-2px); }
.author-card { display: flex; gap: 20px; align-items: flex-start; margin-top: 32px; padding: 26px; }
.author-name { font-family: var(--font-display); font-weight: 700; }
.author-bio { margin: 6px 0 16px; color: var(--muted); font-size: .96rem; }
.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 56px; }
.post-nav-link { display: grid; gap: 8px; padding: 22px 24px; text-decoration: none; }
.post-nav-link strong { font-family: var(--font-display); font-size: 1rem; line-height: 1.35; }
.post-nav-next { text-align: right; grid-column: 2; }
@media (max-width: 640px) {
    .post-nav { grid-template-columns: 1fr; }
    .post-nav-next { grid-column: 1; text-align: left; }
    .author-card { flex-direction: column; }
}
[data-theme="light"] .toc, [data-theme="light"] .share-btn, [data-theme="light"] .byline-mark { background: #fff; }

/* ===== Creative touches ===== */
/* cursor spotlight on every card (position comes from --px/--py set by site.js) */
.card { background-image: radial-gradient(360px circle at var(--px, -60%) var(--py, -60%), oklch(0.84 0.14 200 / .13), transparent 62%); }
[data-theme="light"] .card { background-image: radial-gradient(360px circle at var(--px, -60%) var(--py, -60%), oklch(0.5 0.19 258 / .09), transparent 62%); }
/* tilt cards lean toward the cursor instead of a fixed angle */
@media (hover: hover) {
    .tilt:hover, .tilt:focus-within { transform: rotateX(var(--rx, 7deg)) rotateY(var(--ry, -9deg)) translateZ(24px); transition-duration: .14s, .3s, .4s; }
}
/* magnetic buttons */
.btn { translate: var(--mgx, 0) var(--mgy, 0); transition-property: transform, translate, background-color, border-color, box-shadow, color; }
.btn:not(:hover) { transition-duration: .25s, .45s, .3s, .3s, .3s, .3s; }
/* word-by-word title reveal */
.js [data-split] .w { display: inline-block; opacity: 0; transform: translateY(.55em) rotateX(-50deg); transform-origin: 50% 100%; transition: opacity .6s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-split].is-split-in .w { opacity: 1; transform: none; }
/* cursor glow */
.cursor-glow { position: fixed; top: 0; left: 0; z-index: 1; width: 440px; height: 440px; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .5s ease;
    background: radial-gradient(closest-side, oklch(0.84 0.14 200 / .1), oklch(0.83 0.14 75 / .035) 55%, transparent); }
.cursor-glow.is-on { opacity: 1; }
[data-theme="light"] .cursor-glow { background: radial-gradient(closest-side, oklch(0.5 0.19 258 / .07), transparent); }
/* sparks thrown by clicking the hero scene */
.spark { position: absolute; z-index: 5; width: 10px; height: 10px; border-radius: 50%; pointer-events: none; background: var(--cyan); box-shadow: 0 0 14px 2px var(--cyan); }
.spark.amber { background: var(--amber); box-shadow: 0 0 14px 2px var(--amber); }
/* generative article cover */
.cover { --cx: 0; --cy: 0; position: relative; margin-top: 32px; border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--screen-line); background: #090b16; box-shadow: var(--card-shadow); aspect-ratio: 4 / 1; }
.cover svg { display: block; width: 100%; height: 100%; }
.cv-layer { transition: transform .35s ease-out; transform: translate(calc(var(--cx) * var(--depth, 10) * -1px), calc(var(--cy) * var(--depth, 10) * -1px)); }
.cv-ring { transform-box: fill-box; transform-origin: center; animation: cv-spin 60s linear infinite; }
.cv-ring.rev { animation-direction: reverse; animation-duration: 90s; }
.cv-node { transform-box: fill-box; transform-origin: center; animation: cv-pulse 3.4s ease-in-out infinite; animation-delay: calc(var(--n, 0) * .45s); }
.cv-flow { stroke-dasharray: 5 9; animation: cv-flow 4s linear infinite; }
@keyframes cv-spin { to { transform: rotate(360deg); } }
@keyframes cv-pulse { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.6); opacity: 1; } }
@keyframes cv-flow { to { stroke-dashoffset: -28; } }
@media (max-width: 640px) { .cover { aspect-ratio: 2 / 1; } }
.motion-off .cursor-glow, .motion-off .spark { display: none; }
.motion-off [data-split] .w { opacity: 1 !important; transform: none !important; }

/* ===== Light-mode refinements (tokens carry the palette; these fix what tokens alone can't) ===== */
[data-theme="light"] .ambient {
    background: radial-gradient(120% 70% at 50% -10%, #E9EEFF 0%, transparent 60%), linear-gradient(180deg, #F5F7FC, #EEF1FA);
}
[data-theme="light"] .card:not(.cta),
[data-theme="light"] .post { background-color: #fff; }
[data-theme="light"] .card { backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-theme="light"] .tilt:hover, [data-theme="light"] .tilt:focus-within { box-shadow: 0 1px 0 #fff inset, 0 28px 50px -22px rgba(40, 50, 120, .4); }
[data-theme="light"] .site-header.is-scrolled { box-shadow: 0 8px 24px -18px rgba(40, 50, 120, .35); }
[data-theme="light"] .btn-amber { box-shadow: 0 10px 26px -12px oklch(0.7 0.16 70); }
[data-theme="light"] .btn-ghost { background: #fff; }
[data-theme="light"] .marquee, [data-theme="light"] .site-footer { background: #fff; }
[data-theme="light"] .nav-links a:hover, [data-theme="light"] .nav-links a.is-active, [data-theme="light"] .nav-links a[aria-current] { background: var(--cyan-soft); color: var(--cyan); }
[data-theme="light"] .icon-btn { background: #fff; }
[data-theme="light"] .status { background: #fff; }
[data-theme="light"] .chips li { background: #fff; }
[data-theme="light"] .chip3d { box-shadow: 0 6px 16px -6px rgba(40, 50, 120, .45); }
[data-theme="light"] .core .face, [data-theme="light"] .cube-in i { background: linear-gradient(135deg, oklch(0.5 0.19 258 / .16), oklch(0.78 0.12 290 / .3)); }
[data-theme="light"] .ground { background: radial-gradient(closest-side, oklch(0.5 0.19 258 / .14), transparent 72%); }
[data-theme="light"] .job-node { background: #fff; }
[data-theme="light"] .badge-current { background: var(--amber); border-color: transparent; color: var(--ink); }
[data-theme="light"] .cta-form { background: #fff; box-shadow: var(--card-shadow); }
[data-theme="light"] .field input, [data-theme="light"] .field textarea { background: #F5F7FC; }
[data-theme="light"] .field input:focus, [data-theme="light"] .field textarea:focus { background: #fff; }
[data-theme="light"] .device { box-shadow: 0 30px 60px -28px rgba(30, 40, 110, .5), 0 0 0 6px #fff, 0 0 0 7px var(--line); }
[data-theme="light"] .notice-success { background: #e8f8f1; color: #065f46; }
[data-theme="light"] .notice-error { background: #fdecec; color: #991b1b; }
[data-theme="light"] .page-navigation a, [data-theme="light"] .page-navigation span { background: #fff; }
/* alternating soft bands give the long light page rhythm instead of one flat sheet */
[data-theme="light"] #projects, [data-theme="light"] #stack, [data-theme="light"] #contact {
    background: linear-gradient(180deg, transparent, #EAEFFB 14%, #EAEFFB 86%, transparent);
}
[data-theme="light"] .section-title, [data-theme="light"] .hero-title { color: #0A0D22; }
[data-theme="light"] .label { color: oklch(0.5 0.19 258); }
[data-theme="light"] .card:not(.cta) { border-color: rgba(28, 34, 80, .09); }
[data-theme="light"] .quote { border-top: 3px solid var(--cyan); }
[data-theme="light"] .job-card { background-color: #fff; }
[data-theme="light"] .stat { background-color: #fff; }

/* ===== Light mode, richer: deeper blues, strong glass 3D, and dark bands for contrast ===== */
[data-theme="light"] .ambient {
    background:
        radial-gradient(70% 55% at 8% 0%, rgba(99, 102, 241, .26), transparent 70%),
        radial-gradient(60% 50% at 100% 30%, rgba(34, 211, 238, .2), transparent 70%),
        radial-gradient(60% 50% at 40% 100%, rgba(251, 191, 36, .22), transparent 70%),
        linear-gradient(180deg, #E7ECFB, #DCE3F6);
}
[data-theme="light"] #projects, [data-theme="light"] #stack, [data-theme="light"] #contact {
    background: linear-gradient(180deg, transparent, rgba(60, 80, 190, .1) 14%, rgba(60, 80, 190, .1) 86%, transparent);
}
[data-theme="light"] .card:not(.cta) { border-color: rgba(28, 34, 90, .16); }
[data-theme="light"] .tilt:hover, [data-theme="light"] .tilt:focus-within { border-color: var(--cyan); box-shadow: 0 1px 0 #fff inset, 0 32px 56px -22px rgba(40, 50, 160, .55); }
[data-theme="light"] .core .face, [data-theme="light"] .cube-in i {
    background: linear-gradient(135deg, oklch(0.5 0.22 262 / .34), oklch(0.62 0.2 290 / .5));
    border-color: oklch(0.4 0.22 262 / .9);
}
[data-theme="light"] .core .face { box-shadow: 0 0 5cqw oklch(0.5 0.22 262 / .35) inset, 0 0 4cqw oklch(0.5 0.22 262 / .3); }
[data-theme="light"] .orbit-ring { border-color: oklch(0.46 0.22 262 / .75); }
[data-theme="light"] .orbit-ring-2 { border-color: rgba(28, 34, 90, .4); }
[data-theme="light"] .ground { background: radial-gradient(closest-side, oklch(0.5 0.22 262 / .3), transparent 72%); border-color: oklch(0.46 0.22 262 / .6); }
[data-theme="light"] .core-glow { background: radial-gradient(closest-side, oklch(0.55 0.22 270 / .35), transparent); }
[data-theme="light"] .stat { border-top: 3px solid var(--cyan); }
[data-theme="light"] .btn-ghost { border-color: rgba(28, 34, 90, .28); }
[data-theme="light"] .chips li { border-color: rgba(28, 34, 90, .22); }

/* dark bands: the marquee, the contact card and the footer keep the night look */
[data-theme="light"] .marquee, [data-theme="light"] .site-footer, [data-theme="light"] .card.cta {
    --text: #EEF0F8; --muted: #B4BAD6; --line: rgba(255, 255, 255, .16); --cyan: oklch(0.84 0.14 200);
    --panel: rgba(255, 255, 255, .06); --panel-strong: rgba(255, 255, 255, .1); --pill-bg: rgba(255, 255, 255, .08);
    color: var(--text);
}
[data-theme="light"] .marquee { background: #0E1230; border-color: transparent; }
[data-theme="light"] .site-footer { background: #0B0E24; border-top-color: transparent; }
[data-theme="light"] .site-footer .btn-ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .25); }
[data-theme="light"] .site-footer .status { background: rgba(255, 255, 255, .07); }
[data-theme="light"] .site-footer .brand-mark { color: var(--cyan); }
[data-theme="light"] .card.cta {
    border-color: transparent;
    background-image: radial-gradient(360px circle at var(--px, -60%) var(--py, -60%), rgba(255, 255, 255, .16), transparent 62%), linear-gradient(135deg, #171B55, #2A2A8E 55%, #4B2FA3);
    box-shadow: 0 34px 64px -26px rgba(40, 40, 150, .65);
}
[data-theme="light"] .card.cta .label { color: oklch(0.84 0.14 200); }
[data-theme="light"] .card.cta .btn-ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .35); color: #fff; }
[data-theme="light"] .cta-form {
    --text: #0A0D22; --muted: #3A4163; --line: rgba(28, 34, 90, .2); --cyan: oklch(0.46 0.22 262);
    background: #fff; color: var(--text);
}

/* ===== Responsive ===== */
@media (max-width: 1020px) {
    .services-grid, .stack-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 859px) {
    .hero-grid, .project { grid-template-columns: 1fr; }
    .project:nth-child(even) .project-visual { order: 0; }
    .world-wrap { max-width: 440px; }
    .post { grid-template-columns: 1fr auto; }
    .post-meta { grid-column: 1 / -1; display: flex; gap: 14px; }
    .quotes { grid-template-columns: 1fr; }
}
@media (max-width: 599px) {
    .nav-links a { padding: 0 9px; font-size: .84rem; }
    .btn-pulse::after { animation-name: pulse-ring-sm; }
    .services-grid, .stack-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
    .footer-col:last-child { grid-column: 1 / -1; }
    .stat { padding: 20px 16px; }
    .hero-actions .btn { flex: 1 1 100%; }
    .timeline { padding-left: 30px; }
    .job-node { left: -28px; }
    .job-card { padding: 22px 20px; }
}

/* ===== Motion paused (header button; class set on <html>): no animation, static values ===== */
html.motion-off { scroll-behavior: auto; }
.motion-off *, .motion-off *::before, .motion-off *::after { animation: none !important; transition-duration: .01ms !important; }
.motion-off.js [data-reveal] { opacity: 1; transform: none; }
.motion-off .stage { --tx: 0deg !important; --ty: 0deg !important; }
.motion-off .marquee-track { width: auto; flex-wrap: wrap; }
.motion-off .marquee-list[aria-hidden="true"] { display: none; }
.motion-off .tilt:hover, .motion-off .tilt:focus-within, .motion-off .job-card:hover { transform: none !important; }
