:root {
    color-scheme: light;
    --bg: #f5efe6;
    --bg-soft: #fffaf5;
    --surface: rgba(255, 252, 246, 0.74);
    --surface-strong: rgba(255, 250, 242, 0.92);
    --surface-dark: #0f1926;
    --surface-dark-2: #132131;
    --line: rgba(18, 30, 43, 0.11);
    --line-strong: rgba(255, 255, 255, 0.12);
    --text: #13202b;
    --muted: #5f6b74;
    --muted-light: rgba(237, 242, 245, 0.72);
    --accent: #ff4f6f;
    --accent-2: #2bd4b3;
    --accent-3: #8a6bff;
    --navy: #0e1a27;
    --white: #fff;
    --shadow-lg: 0 28px 90px rgba(11, 18, 30, 0.14);
    --shadow-md: 0 16px 38px rgba(11, 18, 30, 0.1);
    --shadow-sm: 0 10px 24px rgba(11, 18, 30, 0.08);
    --radius-xl: 34px;
    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --container: min(1220px, calc(100vw - 2rem));
    --body-background:
        radial-gradient(circle at 12% 18%, rgba(216, 108, 57, 0.12), transparent 18rem),
        radial-gradient(circle at 88% 14%, rgba(34, 167, 139, 0.14), transparent 22rem),
        radial-gradient(circle at 78% 72%, rgba(111, 119, 255, 0.08), transparent 18rem),
        linear-gradient(180deg, #fbf5ec 0%, #f7f0e7 50%, #f8f4ee 100%);
    --header-scrolled-bg: rgba(248, 241, 232, 0.84);
    --secondary-button-bg: rgba(255, 255, 255, 0.68);
    --secondary-button-border: rgba(19, 32, 43, 0.12);
    --pill-bg: rgba(255, 255, 255, 0.55);
    --pill-border: rgba(19, 32, 43, 0.1);
    --pill-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    --stage-background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 249, 240, 0.88)),
        linear-gradient(135deg, rgba(216, 108, 57, 0.08), rgba(34, 167, 139, 0.08));
    --stage-outline: rgba(255, 255, 255, 0.45);
    --note-bg: rgba(255, 255, 255, 0.84);
    --note-border: rgba(18, 30, 43, 0.1);
    --note-text: #13202b;
    --shot-bg: rgba(255, 255, 255, 0.76);
    --shot-border: rgba(18, 30, 43, 0.1);
    --control-bg: rgba(255, 255, 255, 0.62);
    --control-border: rgba(19, 32, 43, 0.08);
    --mobile-nav-bg: rgba(255, 250, 242, 0.96);
    --mobile-nav-border: rgba(19, 32, 43, 0.08);
    --form-shell-background:
        linear-gradient(180deg, rgba(255, 251, 246, 0.92), rgba(255, 245, 235, 0.94)),
        linear-gradient(135deg, rgba(216, 108, 57, 0.06), rgba(34, 167, 139, 0.08));
    --field-bg: rgba(255, 255, 255, 0.86);
    --field-border: rgba(19, 32, 43, 0.1);
    --field-focus: rgba(216, 108, 57, 0.5);
    --field-ring: rgba(216, 108, 57, 0.12);
    --visual-card-background: rgba(255, 250, 242, 0.92);
    --inline-code-bg: rgba(14, 26, 39, 0.08);
    --toggle-track-bg: linear-gradient(135deg, #ffd973, #ff9f65);
    --toggle-thumb-bg: linear-gradient(135deg, #fffef9, #ffe9cc);
    --toggle-glow: 0 12px 28px rgba(216, 108, 57, 0.18);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --surface: rgba(10, 18, 28, 0.78);
    --surface-strong: rgba(10, 18, 28, 0.94);
    --line: rgba(255, 255, 255, 0.08);
    --text: #edf4fb;
    --muted: #99a9ba;
    --muted-light: rgba(231, 239, 246, 0.78);
    --navy: #edf4fb;
    --shadow-lg: 0 28px 90px rgba(0, 0, 0, 0.38);
    --shadow-md: 0 16px 38px rgba(0, 0, 0, 0.26);
    --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.22);
    --body-background:
        radial-gradient(circle at 12% 18%, rgba(216, 108, 57, 0.14), transparent 19rem),
        radial-gradient(circle at 88% 14%, rgba(34, 167, 139, 0.14), transparent 24rem),
        radial-gradient(circle at 78% 72%, rgba(111, 119, 255, 0.14), transparent 20rem),
        linear-gradient(180deg, #060812 0%, #0c0b18 52%, #130a15 100%);
    --header-scrolled-bg: rgba(7, 12, 20, 0.8);
    --secondary-button-bg: rgba(10, 18, 28, 0.8);
    --secondary-button-border: rgba(255, 255, 255, 0.08);
    --pill-bg: rgba(10, 18, 28, 0.78);
    --pill-border: rgba(255, 255, 255, 0.08);
    --pill-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --stage-background:
        linear-gradient(180deg, rgba(11, 18, 27, 0.88), rgba(8, 14, 22, 0.97)),
        linear-gradient(135deg, rgba(216, 108, 57, 0.14), rgba(34, 167, 139, 0.1));
    --stage-outline: rgba(255, 255, 255, 0.08);
    --note-bg: rgba(11, 19, 29, 0.88);
    --note-border: rgba(255, 255, 255, 0.08);
    --note-text: #edf4fb;
    --shot-bg: rgba(10, 18, 28, 0.84);
    --shot-border: rgba(255, 255, 255, 0.08);
    --control-bg: rgba(10, 18, 28, 0.82);
    --control-border: rgba(255, 255, 255, 0.08);
    --mobile-nav-bg: rgba(10, 18, 28, 0.96);
    --mobile-nav-border: rgba(255, 255, 255, 0.08);
    --form-shell-background:
        linear-gradient(180deg, rgba(10, 18, 28, 0.94), rgba(8, 14, 22, 0.97)),
        linear-gradient(135deg, rgba(216, 108, 57, 0.08), rgba(34, 167, 139, 0.1));
    --field-bg: rgba(10, 18, 28, 0.9);
    --field-border: rgba(255, 255, 255, 0.08);
    --field-focus: rgba(34, 167, 139, 0.55);
    --field-ring: rgba(34, 167, 139, 0.14);
    --visual-card-background: rgba(10, 18, 28, 0.92);
    --inline-code-bg: rgba(255, 255, 255, 0.08);
    --toggle-track-bg: linear-gradient(135deg, #1b2a3d, #111b28);
    --toggle-thumb-bg: linear-gradient(135deg, #dce9fb, #9ab6d8);
    --toggle-glow: 0 12px 28px rgba(36, 54, 82, 0.34);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
}

body {
    margin: 0;
    min-width: 320px;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background: var(--body-background);
    line-height: 1.65;
    overflow-x: hidden;
    transition: background 0.35s ease, color 0.35s ease;
    --music-energy: 0;
    --music-bass: 0;
    --music-tilt: 0deg;
}

.music-reactive-layer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -8vh;
    height: 32vh;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(168, 85, 247, 0.34), transparent 62%),
        radial-gradient(ellipse at 20% 100%, rgba(34, 211, 238, 0.2), transparent 58%),
        radial-gradient(ellipse at 80% 100%, rgba(16, 185, 129, 0.18), transparent 54%);
    transform: translateY(calc(var(--music-energy) * -14px)) scale(1.03);
    transition: opacity 0.35s ease;
    filter: blur(24px);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: var(--navy);
    color: var(--white);
    z-index: 30;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
}

.background-orb,
.background-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
}

.background-orb {
    filter: blur(70px);
    opacity: 0.85;
}

.orb-1 {
    inset: 6% auto auto -8%;
    width: 26rem;
    height: 26rem;
    border-radius: 50%;
    background: rgba(216, 108, 57, 0.17);
    animation: floatOrb 16s ease-in-out infinite;
}

.orb-2 {
    inset: auto -8% 8% auto;
    width: 24rem;
    height: 24rem;
    border-radius: 50%;
    background: rgba(34, 167, 139, 0.16);
    animation: floatOrb 18s ease-in-out infinite reverse;
}

body.music-active .music-reactive-layer {
    opacity: 0.88;
    animation: musicLayerFlow 4.2s ease-in-out infinite;
}

body.music-active .orb-1,
body.music-active .orb-2 {
    animation-duration: 7.5s;
}

body.music-active .hero--cinematic .hero-focal {
    transform:
        translate3d(0, calc(var(--sfy, 0px) - var(--music-energy) * 8px), 0)
        perspective(1000px)
        rotateX(calc(var(--rx, 0deg) + var(--music-tilt)))
        rotateY(var(--ry, 0deg))
        rotateZ(calc(var(--sfr, 0deg) - var(--music-tilt)));
    box-shadow:
        0 24px 62px rgba(0, 0, 0, 0.55),
        0 0 calc(24px + var(--music-energy) * 34px) rgba(168, 85, 247, 0.36);
}

body.music-active .stack-node {
    transform:
        translateY(calc(-2px - var(--music-energy) * 6px))
        rotateX(calc(var(--music-energy) * 8deg))
        rotateZ(calc(var(--music-tilt) * -1));
    box-shadow:
        0 18px 32px rgba(0, 0, 0, 0.44),
        0 0 calc(16px + var(--music-energy) * 24px) color-mix(in srgb, var(--node-accent) 55%, transparent);
}

@keyframes musicLayerFlow {
    0%, 100% {
        transform: translateY(calc(var(--music-energy) * -10px)) rotateZ(-1.2deg) scale(1.02);
    }
    50% {
        transform: translateY(calc(var(--music-energy) * -18px)) rotateZ(1.2deg) scale(1.05);
    }
}

.background-grid {
    z-index: -3;
    opacity: 0.25;
    background-image:
        linear-gradient(rgba(19, 32, 43, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(19, 32, 43, 0.04) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 92%);
}

.container {
    width: var(--container);
    margin: 0 auto;
}

.section {
    padding: 5.8rem 0;
}

.section-stack {
    display: grid;
    gap: 2.3rem;
    position: relative;
}

.section-stack::before {
    content: "";
    position: absolute;
    inset: -0.35rem;
    border-radius: 1.1rem;
    pointer-events: none;
    opacity: 0;
    border: 1px solid rgba(121, 150, 255, 0.18);
    box-shadow:
        0 0 calc(14px + var(--music-bass) * 26px) rgba(96, 165, 250, 0.24),
        0 0 calc(18px + var(--music-energy) * 30px) rgba(168, 85, 247, 0.2);
    transform: scale(calc(1 + var(--music-bass) * 0.018));
    transition: opacity 0.26s ease;
}

body.music-active .section-stack::before {
    opacity: calc(0.24 + var(--music-bass) * 0.45);
}

body.music-active .service-card,
body.music-active .project-card,
body.music-active .timeline-card,
body.music-active .contact-card {
    transform:
        translateY(calc(-2px - var(--music-bass) * 6px))
        rotateZ(calc(var(--music-tilt) * 0.14));
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.36),
        0 0 calc(10px + var(--music-bass) * 20px) rgba(94, 159, 255, 0.22);
}

.section-head {
    max-width: 50rem;
}

.section-head-light h2,
.section-head-light p {
    color: var(--white);
}

.section-head-light .section-copy {
    color: var(--muted-light);
}

.eyebrow,
.card-label {
    margin: 0 0 0.85rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

h1,
h2,
h3 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    line-height: 1.02;
    letter-spacing: -0.04em;
}

h1 {
    font-size: clamp(3rem, 6vw, 5.8rem);
    max-width: 11ch;
}

h2 {
    font-size: clamp(2.1rem, 4vw, 3.8rem);
}

.section-head h2,
[data-projects-title],
[data-services-title],
[data-education-title],
[data-about-title] {
    font-size: clamp(1.55rem, 2.6vw, 2.35rem);
    line-height: 1.18;
    max-width: 24ch;
    letter-spacing: -0.03em;
}

.section-head .section-copy {
    margin-top: 0.85rem;
    max-width: 42rem;
    line-height: 1.65;
    font-size: 1rem;
    color: var(--muted);
}

h3 {
    font-size: clamp(1.25rem, 2vw, 1.8rem);
}

p {
    margin: 0;
}

.section-copy,
.hero-lead,
.story-card p,
.capability-card p,
.timeline-card p,
.project-copy,
.project-points li,
.deploy-copy p,
.contact-copy p,
.contact-card span,
.visual-copy p,
.form-head p,
.form-footnote {
    color: var(--muted);
    font-size: 1.02rem;
}

.hero {
    padding-top: 5rem;
    padding-bottom: 4.6rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    gap: 1.5rem;
    align-items: stretch;
}

.hero-copy {
    display: grid;
    align-content: start;
}

.hero-lead {
    margin-top: 1.4rem;
    max-width: 43rem;
}

.hero-actions,
.social-row,
.signal-strip-inner,
.chip-group {
    display: flex;
    flex-wrap: wrap;
}

.hero-actions {
    gap: 0.9rem;
    margin-top: 2rem;
}

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.4rem;
    padding: 0 1.3rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 800;
    overflow: hidden;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease,
        background-color 0.3s ease;
}

.btn::after {
    content: "";
    position: absolute;
    inset: -120%;
    background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.24), transparent 65%);
    transform: translateX(-60%);
    transition: transform 0.6s ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-3px);
}

.btn:hover::after,
.btn:focus-visible::after {
    transform: translateX(45%);
}

.btn-primary {
    color: var(--white);
    background: linear-gradient(135deg, var(--accent), #f19b53);
    box-shadow: 0 22px 40px rgba(216, 108, 57, 0.22);
}

.btn-secondary {
    color: var(--navy);
    border-color: var(--secondary-button-border);
    background: var(--secondary-button-bg);
    box-shadow: var(--shadow-sm);
}

.btn-block {
    width: 100%;
}

.social-row {
    gap: 0.75rem;
    margin-top: 1.35rem;
}

.social-pill,
.signal-strip-inner span,
.chip-group span {
    padding: 0.62rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--pill-border);
    background: var(--pill-bg);
    box-shadow: var(--pill-shadow);
    font-size: 0.92rem;
}

.social-pill {
    transition:
        transform 0.28s ease,
        border-color 0.28s ease,
        background-color 0.28s ease;
}

.social-pill:hover,
.social-pill:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(216, 108, 57, 0.26);
    background: color-mix(in srgb, var(--pill-bg) 82%, white 18%);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.metric-card,
.story-card,
.capability-card,
.timeline-card,
.visual-card,
.contact-card,
.deploy-copy,
.code-card,
.contact-form-shell,
.hero-stage-panel {
    border: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-md);
}

.metric-card {
    padding: 1.2rem;
    border-radius: var(--radius-md);
}

.metric-card strong {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.15rem;
}

.metric-card span {
    display: block;
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.94rem;
}

[data-shine] {
    position: relative;
    overflow: hidden;
}

[data-scroll-float] {
    --sfy: 0px;
    --sfr: 0deg;
    transform: translate3d(0, var(--sfy), 0) rotateZ(var(--sfr));
    transition: transform 0.22s ease-out;
    will-change: transform;
}

[data-shine]::after {
    content: "";
    position: absolute;
    inset: -25%;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.36), transparent 25%);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}

[data-shine]:hover::after,
[data-shine]:focus-within::after {
    opacity: 1;
}

.hero-stage {
    min-width: 0;
}

.panel-surface,
.hero-stage-panel {
    position: relative;
    height: 100%;
    padding: 1.4rem;
    border-radius: 36px;
    background: var(--stage-background);
    box-shadow: var(--shadow-lg);
}

.hero-stage-panel {
    min-height: 44rem;
    transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.22s ease;
}

.hero-stage-panel::before {
    content: "";
    position: absolute;
    inset: 1rem;
    border-radius: 28px;
    border: 1px solid var(--stage-outline);
    pointer-events: none;
}

.floating-note {
    position: absolute;
    z-index: 3;
    display: grid;
    gap: 0.3rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--note-border);
    background: var(--note-bg);
    color: var(--note-text);
    box-shadow: var(--shadow-sm);
}

.floating-note span,
.stage-mini-card span,
.timeline-date,
.project-meta span,
.code-card-top span:last-child {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.floating-note strong {
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--note-text);
}

.note-top {
    top: 1rem;
    right: 1rem;
    max-width: 15rem;
}

.note-bottom {
    left: 1rem;
    bottom: 8.7rem;
    max-width: 14rem;
}

.hero-shot {
    position: absolute;
    overflow: hidden;
    margin: 0;
    border-radius: 28px;
    border: 1px solid var(--shot-border);
    background: var(--shot-bg);
    box-shadow: 0 18px 42px rgba(11, 18, 30, 0.16);
}

.hero-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-shot figcaption {
    padding: 0.8rem 1rem 1rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.hero-shot-main {
    left: 1.4rem;
    top: 4.8rem;
    width: min(52%, 23rem);
}

.hero-shot-side {
    right: 1.4rem;
    top: 9.6rem;
    width: min(48%, 20rem);
}

.stage-mini-grid {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    z-index: 3;
}

.stage-mini-card {
    padding: 1rem 1.05rem;
    border-radius: 20px;
    border: 1px solid rgba(18, 30, 43, 0.1);
    background: rgba(12, 23, 35, 0.9);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.stage-mini-card span,
.timeline-date,
.code-card-top span:last-child {
    color: rgba(125, 255, 227, 0.88);
}

.stage-mini-card p {
    margin-top: 0.5rem;
    color: rgba(245, 247, 250, 0.84);
    font-size: 0.96rem;
}

.signal-strip {
    padding-bottom: 1rem;
}

.signal-strip-inner {
    gap: 0.8rem;
}

.visuals-section {
    display: none;
}

.visual-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: 1rem;
}

.visual-stack {
    display: grid;
    gap: 1rem;
}

.visual-card {
    position: relative;
    overflow: hidden;
    border-radius: 32px;
    background: var(--visual-card-background);
}

.visual-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.visual-card-wide img {
    aspect-ratio: 16 / 10;
}

.visual-stack .visual-card:first-child img,
.hero-shot-main img {
    aspect-ratio: 4 / 5;
}

.visual-stack .visual-card:last-child img {
    aspect-ratio: 4 / 5;
}

.visual-copy {
    padding: 1.15rem 1.2rem 1.3rem;
}

.visual-copy h3 {
    margin-bottom: 0.7rem;
}

.about-layout {
    display: grid;
    gap: 1.4rem;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
    align-items: start;
}

.about-main {
    display: grid;
    gap: 1.4rem;
}

.resume-card {
    position: sticky;
    top: 6.5rem;
    padding: 1.2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px);
}

.resume-card-head h3 {
    margin: 0.35rem 0 0.5rem;
    font-size: 1.05rem;
    line-height: 1.35;
}

.resume-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.resume-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.85rem 0 1rem;
    padding: 0;
    list-style: none;
}

.resume-tags li {
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent-teal) 35%, transparent);
    background: color-mix(in srgb, var(--accent-teal) 10%, transparent);
    font-size: 0.72rem;
    line-height: 1.2;
}

.resume-frame {
    margin: 0;
    padding: 0.55rem;
    border-radius: 1.35rem;
    background: linear-gradient(160deg, #1a1f2b, #0d1118);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 18px 40px rgba(0, 0, 0, 0.28);
    overflow: auto;
    max-height: 560px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.resume-frame img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: top center;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: zoom-in;
}

.about-grid,
.deploy-grid,
.contact-grid {
    display: grid;
    gap: 1.4rem;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.98fr);
    align-items: start;
}

.story-card,
.deploy-copy,
.contact-form-shell {
    padding: 1.8rem;
    border-radius: var(--radius-xl);
}

.story-card h3,
.deploy-copy h2,
.contact-copy h2,
.form-head h3 {
    margin-bottom: 1rem;
}

.capability-grid,
.timeline-grid,
.services-grid,
.projects-grid,
.contact-rail,
.form-grid {
    display: grid;
    gap: 1rem;
}

.capability-grid,
.services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.capability-card,
.timeline-card,
.contact-card {
    padding: 1.35rem;
    border-radius: var(--radius-lg);
}

.timeline-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.timeline-date {
    display: inline-block;
    margin-bottom: 0.75rem;
    color: var(--accent-2);
}

.projects-section {
    position: relative;
}

.services-section {
    position: relative;
}

.service-card {
    position: relative;
    display: grid;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 30px;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--surface) 84%, white 16%), var(--surface-strong)),
        linear-gradient(135deg, rgba(216, 108, 57, 0.06), rgba(34, 167, 139, 0.08));
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.service-card h3 {
    max-width: 18ch;
}

.service-image,
.project-image {
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    object-fit: cover;
    background: rgba(255, 255, 255, 0.04);
    cursor: zoom-in;
    transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.32s cubic-bezier(0.22, 0.61, 0.36, 1), filter 0.32s ease;
}

.service-image {
    aspect-ratio: 16 / 10;
}

.project-image {
    aspect-ratio: 16 / 9;
}

.service-image:hover,
.project-image:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.38),
        0 0 24px rgba(96, 165, 250, 0.24);
    filter: saturate(1.06);
}

.media-lightbox {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background:
        radial-gradient(circle at 50% 24%, rgba(90, 114, 255, 0.2), rgba(3, 6, 14, 0.92) 42%),
        rgba(2, 4, 10, 0.94);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 120;
}

.media-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.media-lightbox-stage {
    margin: 0;
    width: min(1100px, 96vw);
    max-height: 90vh;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(180deg, rgba(12, 19, 34, 0.86), rgba(7, 11, 20, 0.94));
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.62),
        0 0 36px rgba(96, 165, 250, 0.22);
    transform: scale(0.9) translateY(14px);
    transition: transform 0.26s ease;
}

.media-lightbox.is-open .media-lightbox-stage {
    transform: scale(1) translateY(0);
}

.media-lightbox-stage img {
    width: 100%;
    max-height: calc(90vh - 3.2rem);
    object-fit: contain;
    background: rgba(3, 6, 14, 0.8);
    transition: transform 0.32s ease, filter 0.32s ease;
}

.media-lightbox-stage img:hover {
    transform: scale(1.015);
    filter: saturate(1.05);
}

.media-lightbox-stage figcaption {
    padding: 0.7rem 0.9rem 0.8rem;
    font-size: 0.84rem;
    color: rgba(221, 232, 255, 0.86);
}

.media-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    background: rgba(9, 14, 26, 0.7);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
}

.service-card p:not(.card-label) {
    color: var(--muted);
}

.service-card .chip-group {
    gap: 0.65rem;
}

.service-accent {
    position: absolute;
    inset: -20% auto auto -8%;
    width: 10rem;
    height: 10rem;
    border-radius: 50%;
    filter: blur(14px);
    opacity: 0.24;
    pointer-events: none;
}

.service-accent-orange {
    background: radial-gradient(circle, var(--accent), transparent 70%);
}

.service-accent-teal {
    background: radial-gradient(circle, var(--accent-2), transparent 70%);
}

.service-accent-violet {
    background: radial-gradient(circle, var(--accent-3), transparent 70%);
}

.projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
    position: relative;
    display: grid;
    gap: 1rem;
    padding: 1.6rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(18, 30, 43, 0.96), rgba(13, 23, 35, 0.96)),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 40%);
    color: var(--white);
    box-shadow: var(--shadow-lg);
    transition:
        transform 0.26s ease,
        box-shadow 0.26s ease,
        border-color 0.26s ease;
}

.project-card:hover,
.project-card:focus-within {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 32px 84px rgba(7, 12, 20, 0.26);
}

.project-card .card-label,
.project-card .project-copy,
.project-card .project-points li {
    color: rgba(241, 245, 248, 0.82);
}

.project-card .chip-group span {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.84);
}

.project-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.project-meta span {
    color: rgba(255, 255, 255, 0.44);
}

.project-glow {
    position: absolute;
    inset: -20% auto auto -10%;
    width: 12rem;
    height: 12rem;
    border-radius: 50%;
    filter: blur(12px);
    opacity: 0.22;
    pointer-events: none;
}

.project-glow-orange {
    background: radial-gradient(circle, var(--accent), transparent 70%);
}

.project-glow-teal {
    background: radial-gradient(circle, var(--accent-2), transparent 70%);
}

.project-glow-violet {
    background: radial-gradient(circle, var(--accent-3), transparent 70%);
}

.project-points {
    margin: 0;
    padding-left: 1.15rem;
    display: grid;
    gap: 0.55rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: fit-content;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
    font-weight: 800;
    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        background-color 0.25s ease;
}

.project-link:hover,
.project-link:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.1);
}

.stack-shell {
    position: relative;
    overflow: hidden;
    padding: 2rem;
    border-radius: 36px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(15, 25, 38, 0.96), rgba(10, 18, 27, 0.97)),
        radial-gradient(circle at 15% 15%, rgba(216, 108, 57, 0.12), transparent 22rem),
        radial-gradient(circle at 85% 12%, rgba(34, 167, 139, 0.14), transparent 24rem);
    box-shadow: var(--shadow-lg);
}

.stack-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 14% 10%, rgba(168, 85, 247, 0.22), transparent 36%),
        linear-gradient(140deg, rgba(10, 10, 18, 0.76), rgba(4, 6, 12, 0.86)),
        url("/assets/6b5740bc-6452-4fef-aef1-607c93a6af18.jpg") center/cover no-repeat;
    opacity: 0.34;
}

.stack-shell > * {
    position: relative;
    z-index: 1;
}

:root[data-theme="light"] .stack-shell {
    border-color: rgba(18, 30, 43, 0.1);
    background:
        linear-gradient(180deg, rgba(255, 252, 248, 0.96), rgba(247, 241, 232, 0.98)),
        radial-gradient(circle at 15% 15%, rgba(216, 108, 57, 0.08), transparent 22rem),
        radial-gradient(circle at 85% 12%, rgba(34, 167, 139, 0.1), transparent 24rem);
}

.stack-3d-hint {
    margin: 0.35rem 0 0;
    text-align: center;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    color: rgba(237, 242, 245, 0.5);
}

:root[data-theme="light"] .stack-3d-hint {
    color: var(--muted);
}

.stack-3d-viewport {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2.3rem 0.9rem 2.7rem;
    min-height: 23rem;
    overflow-x: auto;
    overflow-y: visible;
}

.stack-3d-viewport::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.5;
    background-image:
        radial-gradient(1px 1px at 6% 18%, rgba(255, 255, 255, 0.4) 50%, transparent 52%),
        radial-gradient(1px 1px at 18% 72%, rgba(255, 255, 255, 0.22) 50%, transparent 52%),
        radial-gradient(1.5px 1.5px at 42% 12%, rgba(255, 255, 255, 0.35) 50%, transparent 52%),
        radial-gradient(1px 1px at 78% 38%, rgba(255, 255, 255, 0.18) 50%, transparent 52%),
        radial-gradient(1px 1px at 88% 84%, rgba(255, 255, 255, 0.28) 50%, transparent 52%),
        radial-gradient(1px 1px at 31% 44%, rgba(255, 255, 255, 0.15) 50%, transparent 52%),
        radial-gradient(1px 1px at 63% 66%, rgba(255, 255, 255, 0.2) 50%, transparent 52%),
        radial-gradient(1px 1px at 94% 12%, rgba(255, 255, 255, 0.25) 50%, transparent 52%);
}

:root[data-theme="light"] .stack-3d-viewport::before {
    opacity: 0.12;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(19, 32, 43, 0.35) 50%, transparent 52%),
        radial-gradient(1px 1px at 80% 60%, rgba(19, 32, 43, 0.2) 50%, transparent 52%);
}

.stack-macropad {
    position: relative;
    z-index: 1;
    transform-style: preserve-3d;
    --stack-rx: 62deg;
    --stack-rz: -36deg;
    --stack-ty: 0px;
    transform: translate3d(0, var(--stack-ty), 0) rotateX(var(--stack-rx)) rotateZ(var(--stack-rz)) scale(1);
    filter: drop-shadow(0 44px 70px rgba(0, 0, 0, 0.62));
    transition: transform 0.25s ease;
    animation: stackDrift 5.6s ease-in-out infinite;
}

.stack-macropad::before,
.stack-macropad::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.stack-macropad::before {
    top: 16px;
    right: -24px;
    width: 26px;
    height: calc(100% - 34px);
    background: linear-gradient(180deg, rgba(18, 23, 33, 0.8), rgba(8, 10, 15, 0.95));
    transform: skewY(-40deg);
    border-radius: 0 10px 10px 0;
}

.stack-macropad::after {
    left: 18px;
    right: 8px;
    bottom: -18px;
    height: 18px;
    background: linear-gradient(90deg, rgba(18, 23, 33, 0.9), rgba(8, 10, 15, 0.95));
    transform: skewX(-42deg);
    border-radius: 0 0 12px 12px;
}

:root[data-theme="light"] .stack-macropad {
    filter: drop-shadow(0 26px 36px rgba(11, 18, 30, 0.22));
}

.stack-macropad-inner {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 3.9rem);
    gap: 0.56rem;
    padding: 1.15rem;
    border-radius: 18px;
    background: linear-gradient(155deg, #3a3d48 0%, #22242c 45%, #16171d 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -2px 0 rgba(0, 0, 0, 0.35),
        0 2px 0 rgba(0, 0, 0, 0.25),
        0 18px 30px rgba(0, 0, 0, 0.32);
    transform-style: preserve-3d;
    overflow: hidden;
}

.stack-macropad-inner::after {
    content: "";
    position: absolute;
    inset: -22% -10%;
    background: linear-gradient(
        115deg,
        transparent 0%,
        rgba(255, 255, 255, 0.04) 36%,
        rgba(255, 255, 255, 0.24) 50%,
        rgba(255, 255, 255, 0.05) 62%,
        transparent 100%
    );
    transform: translateX(-115%);
    animation: stackScan 4.8s linear infinite;
    pointer-events: none;
}

:root[data-theme="light"] .stack-macropad-inner {
    background: linear-gradient(155deg, #eceef3 0%, #d4d8e2 45%, #c8ccd8 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.75),
        inset 0 -2px 0 rgba(11, 18, 30, 0.08),
        0 2px 0 rgba(11, 18, 30, 0.06);
}

.stack-key-pad {
    width: 3.9rem;
    height: 3.9rem;
    visibility: hidden;
    pointer-events: none;
}

.stack-key {
    --depth: 14px;
    position: relative;
    width: 3.9rem;
    height: 3.9rem;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transform-style: preserve-3d;
    border-radius: 8px;
    transition: transform 0.14s ease;
}

.stack-key::before,
.stack-key::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.stack-key::before {
    left: 7px;
    right: 4px;
    bottom: -12px;
    height: 12px;
    border-radius: 0 0 7px 7px;
    background: color-mix(in srgb, var(--key-accent) 34%, #050607);
    transform: skewX(-38deg);
    filter: brightness(0.7);
}

.stack-key::after {
    top: 6px;
    right: -10px;
    width: 10px;
    height: calc(100% - 14px);
    border-radius: 0 6px 6px 0;
    background: color-mix(in srgb, var(--key-accent) 28%, #050607);
    transform: skewY(-38deg);
    filter: brightness(0.68);
}

.stack-key:focus-visible {
    outline: none;
}

.stack-key:focus-visible .stack-key-face {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
}

.stack-key-face {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(
        162deg,
        color-mix(in srgb, var(--key-accent) 86%, white 14%),
        var(--key-accent)
    );
    color: #fff;
    font-weight: 800;
    font-size: 0.62rem;
    line-height: 1.15;
    text-align: center;
    padding: 0.28rem;
    letter-spacing: 0.03em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
    transform: translateZ(var(--depth));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15),
        0 2px 0 rgba(255, 255, 255, 0.15),
        0 calc(var(--depth) - 4px) 0 color-mix(in srgb, var(--key-accent) 36%, #0a0a0c),
        0 calc(var(--depth) + 10px) 18px rgba(0, 0, 0, 0.48);
    transition:
        box-shadow 0.14s ease,
        transform 0.14s ease,
        filter 0.14s ease;
}

.stack-key-logo {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.22));
    pointer-events: none;
}

.stack-key-face::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--key-accent) 66%, white 34%);
}

.stack-key--dark-fg .stack-key-face {
    color: #12131a;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}

.stack-key:hover .stack-key-face {
    filter: brightness(1.03);
}

.stack-key:active .stack-key-face,
.stack-key.is-active .stack-key-face {
    transform: translateY(calc(var(--depth) * 0.62));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 calc(var(--depth) * 0.28) 0 color-mix(in srgb, var(--key-accent) 36%, #0a0a0c),
        0 7px 11px rgba(0, 0, 0, 0.34);
}

.stack-key-pop .stack-key-face::after {
    animation: stackKeyImpact 0.5s ease-out;
}

.stack-key.is-active .stack-key-face {
    filter: brightness(1.12);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.22),
        0 calc(var(--depth) * 0.35) 0 color-mix(in srgb, var(--key-accent) 36%, #0a0a0c),
        0 8px 14px rgba(0, 0, 0, 0.32);
}

.stack-3d-readout {
    margin: 1rem auto 0;
    max-width: 42rem;
    min-height: 3.4rem;
    text-align: center;
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(237, 242, 245, 0.76);
}

.stack-3d-readout {
    animation: stackReadoutGlow 2.2s ease-in-out infinite;
}

:root[data-theme="light"] .stack-3d-readout {
    color: var(--muted);
}

@media (max-width: 720px) {
    .stack-macropad {
        transform: translate3d(0, var(--stack-ty), 0) rotateX(var(--stack-rx)) rotateZ(var(--stack-rz)) scale(0.8);
    }

    .stack-3d-viewport {
        min-height: 20rem;
        padding: 1.7rem 0.3rem 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-scroll-float] {
        transform: none;
        transition: none;
    }

    .stack-key,
    .stack-key-face,
    .stack-macropad,
    .stack-3d-readout {
        transition: none;
        animation: none;
    }
}

@keyframes stackDrift {
    0%,
    100% {
        transform: translate3d(0, var(--stack-ty), 0) rotateX(var(--stack-rx)) rotateZ(var(--stack-rz));
    }
    50% {
        transform: translate3d(0, calc(var(--stack-ty) - 4px), 0) rotateX(calc(var(--stack-rx) - 1.5deg))
            rotateZ(calc(var(--stack-rz) + 1.2deg));
    }
}

@keyframes stackScan {
    to {
        transform: translateX(115%);
    }
}

@keyframes stackKeyImpact {
    0% {
        opacity: 0.55;
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--key-accent) 66%, white 34%);
    }
    100% {
        opacity: 0;
        box-shadow: 0 0 0 18px transparent;
    }
}

@keyframes stackReadoutGlow {
    0%,
    100% {
        text-shadow: 0 0 0 rgba(167, 139, 250, 0);
    }
    50% {
        text-shadow: 0 0 18px rgba(167, 139, 250, 0.28);
    }
}

.deploy-grid {
    align-items: stretch;
}

.deploy-steps {
    margin: 1.35rem 0 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.8rem;
    color: var(--muted);
}

.code-card {
    overflow: hidden;
    border-radius: 30px;
}

.code-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(12, 21, 32, 0.94);
    color: var(--white);
    font-size: 0.92rem;
}

pre {
    margin: 0;
    padding: 1.4rem;
    overflow-x: auto;
    background: #0e1824;
    color: #eef5fb;
    font-size: 0.94rem;
    line-height: 1.7;
}

code {
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
}

p code,
span code,
li code {
    padding: 0.16rem 0.42rem;
    border-radius: 0.45rem;
    background: var(--inline-code-bg);
    color: var(--text);
    font-size: 0.95em;
}

.contact-grid {
    align-items: start;
}

.contact-rail {
    margin-top: 1.4rem;
    grid-template-columns: 1fr;
}

.contact-card {
    display: grid;
    gap: 0.55rem;
}

.contact-card a,
.contact-card span:first-of-type {
    font-weight: 800;
}

.contact-form-shell {
    background: var(--form-shell-background);
}

.form-grid {
    margin-top: 1.2rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field span {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid var(--field-border);
    border-radius: 16px;
    background: var(--field-bg);
    color: var(--text);
    outline: none;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--muted);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--field-focus);
    box-shadow: 0 0 0 4px var(--field-ring);
    transform: translateY(-1px);
}

.field textarea {
    min-height: 10rem;
    resize: vertical;
}

.field-full {
    grid-column: 1 / -1;
}

.field-file input {
    padding: 0.8rem 1rem;
}

.form-footnote {
    margin-top: 0.9rem;
    font-size: 0.95rem;
}

.form-footnote a {
    font-weight: 800;
    color: var(--accent);
}

.form-status {
    min-height: 1.5rem;
    margin-top: 0.8rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.form-status[data-state="loading"] {
    color: var(--text);
}

.form-status[data-state="success"] {
    color: #12795f;
}

.form-status[data-state="error"] {
    color: #af3f23;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 0.75rem 0;
    transition: padding 0.25s ease;
}

.site-header.is-scrolled {
    padding: 0.5rem 0;
}

.header-bar {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem 1.25rem;
    padding: 0.55rem 0.75rem 0.55rem 0.85rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--control-border));
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--surface) 90%, transparent), color-mix(in srgb, var(--surface) 72%, transparent)),
        color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: blur(20px) saturate(150%);
    box-shadow:
        0 10px 32px rgba(7, 4, 14, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition:
        background-color 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

.site-header.is-scrolled .header-bar {
    background: var(--header-scrolled-bg);
    box-shadow: 0 14px 34px rgba(7, 4, 14, 0.22);
    border-color: color-mix(in srgb, var(--accent) 18%, var(--control-border));
}

.header-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.95rem;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    color: var(--white);
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 10px 22px rgba(216, 108, 57, 0.28);
}

.brand-copy {
    display: grid;
    gap: 0.1rem;
}

.brand-copy strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
}

.brand-copy small,
.brand-meta {
    color: var(--muted);
    font-size: 0.72rem;
    max-width: 14rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin: 0 auto;
    padding: 0.22rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.header-tools {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.45rem;
    justify-self: end;
}

.header-quick-links {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
}

.quick-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.3rem;
    height: 2rem;
    padding: 0 0.52rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: #ffe1ef;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    transition: transform 0.24s ease, background-color 0.24s ease, border-color 0.24s ease;
}

.quick-link:hover,
.quick-link:focus-visible {
    transform: translateY(-2px);
    background: rgba(255, 120, 176, 0.22);
    border-color: rgba(255, 160, 200, 0.45);
}

.quick-link svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 1.8;
}

@media (max-width: 1280px) {
    .header-bar {
        grid-template-columns: auto 1fr auto;
        gap: 0.65rem;
    }

    .brand-meta {
        display: none;
    }

    .header-quick-links {
        display: none;
    }

    .site-nav {
        gap: 0.15rem;
        padding: 0.18rem;
    }

    .nav-link {
        padding: 0.45rem 0.55rem;
        font-size: 0.74rem;
    }
}

.language-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem;
    border-radius: 999px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    box-shadow: var(--shadow-sm);
}

.lang-button {
    min-width: 2.55rem;
    height: 2.25rem;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transition:
        transform 0.25s ease,
        background-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease;
}

.lang-button:hover,
.lang-button:focus-visible {
    transform: translateY(-1px);
    color: var(--text);
}

.lang-button.is-active {
    color: var(--white);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 24px rgba(216, 108, 57, 0.18);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.72rem;
    min-height: 2.9rem;
    padding: 0.34rem 0.42rem 0.34rem 0.48rem;
    border-radius: 999px;
    border: 1px solid var(--control-border);
    background: var(--control-bg);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--toggle-glow);
}

.theme-toggle-track {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 3.6rem;
    height: 2.05rem;
    padding: 0.2rem;
    border-radius: 999px;
    background: var(--toggle-track-bg);
}

.theme-toggle-track::before,
.theme-toggle-track::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 0.62rem;
    height: 0.62rem;
    transform: translateY(-50%);
}

.theme-toggle-track::before {
    left: 0.48rem;
    border-radius: 50%;
    background: #ffd86f;
    box-shadow: 0 0 0 0.12rem rgba(255, 245, 194, 0.28);
}

.theme-toggle-track::after {
    right: 0.5rem;
    border-radius: 50%;
    box-shadow: -0.16rem 0.1rem 0 0.02rem #cfe0ff;
}

.theme-toggle-thumb {
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    background: var(--toggle-thumb-bg);
    box-shadow: 0 10px 20px rgba(7, 12, 20, 0.14);
    transition: transform 0.28s ease;
}

:root[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(1.55rem);
}

.theme-toggle-text {
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.nav-link {
    padding: 0.5rem 0.72rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    transition:
        color 0.25s ease,
        background-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--text);
    background: var(--pill-bg);
    transform: translateY(-1px);
}

.nav-link.is-active {
    color: var(--white);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 20px rgba(216, 108, 57, 0.2);
    transform: none;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.8rem;
    border: 1px solid var(--control-border);
    border-radius: 14px;
    background: var(--control-bg);
}

.menu-toggle span {
    width: 1.25rem;
    height: 2px;
    background: var(--text);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle.is-open span:nth-child(1) {
    transform: translateY(0.32rem) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-0.32rem) rotate(-45deg);
}

.site-footer {
    padding: 2.1rem 0 3rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(19, 32, 43, 0.1);
    color: var(--muted);
    font-size: 0.96rem;
}

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 0.75s ease,
        transform 0.75s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes floatOrb {
    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(0, 24px, 0);
    }
}

@media (max-width: 1120px) {
    .hero-grid,
    .visual-grid,
    .about-layout,
    .about-grid,
    .deploy-grid,
    .contact-grid,
    .timeline-grid,
    .services-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .hero-stage-panel {
        min-height: 38rem;
    }

    .resume-card {
        position: static;
        max-width: 360px;
        margin: 0 auto;
    }
}

@media (max-width: 900px) {
    .section {
        padding: 4.8rem 0;
    }

    .metrics-grid,
    .capability-grid,
    .services-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .hero-stage-panel {
        min-height: auto;
        padding-bottom: 1.3rem;
    }

    .hero-shot,
    .floating-note,
    .stage-mini-grid {
        position: static;
    }

    .hero-shot {
        width: 100%;
    }

    .hero-shot + .hero-shot {
        margin-top: 1rem;
    }

    .floating-note + .hero-shot {
        margin-top: 3.8rem;
    }

    .note-bottom {
        margin-top: 1rem;
    }

    .stage-mini-grid {
        margin-top: 1rem;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 840px) {
    html {
        scroll-padding-top: 20px;
    }

    .header-bar {
        grid-template-columns: 1fr auto;
        border-radius: 22px;
        padding: 0.5rem 0.55rem 0.5rem 0.7rem;
    }

    .site-nav {
        left: 0;
        right: 0;
    }

    .theme-toggle-text {
        display: none;
    }

    .hero {
        padding-top: 4rem;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: absolute;
        left: 1rem;
        right: 1rem;
        top: calc(100% + 0.6rem);
        display: grid;
        gap: 0.4rem;
        padding: 0.8rem;
        border-radius: var(--radius-lg);
        border: 1px solid var(--mobile-nav-border);
        background: var(--mobile-nav-bg);
        box-shadow: var(--shadow-md);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition:
            opacity 0.25s ease,
            visibility 0.25s ease,
            transform 0.25s ease;
    }

    .site-nav.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 2.8rem;
    }

    h2 {
        font-size: 2rem;
    }

    .panel-surface,
    .hero-stage-panel,
    .visual-card,
    .story-card,
    .capability-card,
    .timeline-card,
    .project-card,
    .stack-shell,
    .deploy-copy,
    .code-card,
    .contact-card,
    .contact-form-shell {
        border-radius: 24px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-tools {
        gap: 0.45rem;
    }

    .header-quick-links {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .theme-toggle-text {
        display: none;
    }

    .theme-toggle {
        padding-right: 0.45rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* Premium visual upgrade layer */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 97, 140, 0.12), transparent 22rem),
        radial-gradient(circle at 82% 16%, rgba(43, 212, 179, 0.12), transparent 20rem),
        radial-gradient(circle at 80% 78%, rgba(138, 107, 255, 0.12), transparent 22rem);
    animation: ambientShift 14s ease-in-out infinite;
}

h1 {
    background: linear-gradient(130deg, var(--text), color-mix(in srgb, var(--accent) 55%, var(--text)));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-stage-panel {
    animation: stageFloat 6s ease-in-out infinite;
}

.service-card,
.project-card,
.visual-card,
.metric-card,
.timeline-card {
    transform-style: preserve-3d;
    transition: transform 0.34s ease, box-shadow 0.34s ease, border-color 0.34s ease;
}

.service-card:hover,
.visual-card:hover,
.timeline-card:hover,
.metric-card:hover {
    transform: translateY(-6px) rotateX(1.6deg) rotateY(-1.6deg);
    border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
    box-shadow: 0 30px 65px rgba(11, 18, 30, 0.2);
}

.project-card:hover,
.project-card:focus-within {
    transform: translateY(-8px) rotateX(1.2deg) rotateY(-1.8deg);
}

.btn-primary {
    background-size: 180% 180%;
    animation: buttonFlow 4s ease infinite;
}

@keyframes stageFloat {
    0%,
    100% {
        transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(0);
    }
    50% {
        transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px);
    }
}

@keyframes ambientShift {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(0, 10px, 0) scale(1.03);
    }
}

@keyframes buttonFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Entry wow effects */
.wow-preloader {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 79, 111, 0.22), transparent 24rem),
        radial-gradient(circle at 80% 20%, rgba(43, 212, 179, 0.2), transparent 24rem),
        linear-gradient(180deg, #05070f 0%, #090d16 100%);
    transition: opacity 0.65s ease, visibility 0.65s ease;
}

.wow-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.wow-preloader-inner {
    display: grid;
    gap: 1rem;
    text-align: center;
}

.wow-title {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2rem, 5vw, 4.4rem);
    letter-spacing: 0.04em;
    color: #f5f9ff;
    text-transform: uppercase;
    text-shadow:
        0 0 20px rgba(255, 79, 111, 0.45),
        0 0 30px rgba(43, 212, 179, 0.3);
    animation: wowPulse 1.8s ease-in-out infinite;
}

.wow-sub {
    color: rgba(231, 240, 250, 0.8);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.wow-progress {
    width: min(24rem, 75vw);
    height: 0.38rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
}

.wow-progress > span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
    transform: translateX(-100%);
    animation: wowLoad 1.5s ease forwards;
}

.cursor-glow {
    position: fixed;
    width: 14rem;
    height: 14rem;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(32px);
    opacity: 0.34;
    transition: transform 0.12s linear;
}

.cursor-glow-a {
    background: radial-gradient(circle, rgba(255, 79, 111, 0.55), transparent 70%);
}

.cursor-glow-b {
    width: 11rem;
    height: 11rem;
    background: radial-gradient(circle, rgba(43, 212, 179, 0.55), transparent 70%);
    opacity: 0.28;
}

@keyframes wowLoad {
    to {
        transform: translateX(0);
    }
}

@keyframes wowPulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

/* Full premium neon-red redesign pass */
:root[data-theme="dark"] {
    color-scheme: dark;
    --text: #f5f0ff;
    --muted: #bdaecf;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.18);
    --surface: rgba(33, 8, 28, 0.72);
    --surface-strong: rgba(30, 7, 24, 0.9);
    --accent: #ff4d7a;
    --accent-2: #ff7f66;
    --accent-3: #a15dff;
    --body-background:
        radial-gradient(circle at 15% 12%, rgba(255, 78, 134, 0.22), transparent 22rem),
        radial-gradient(circle at 86% 16%, rgba(164, 78, 255, 0.2), transparent 26rem),
        radial-gradient(circle at 56% 74%, rgba(255, 110, 88, 0.18), transparent 24rem),
        linear-gradient(180deg, #05040b 0%, #130513 48%, #12040a 100%);
    --header-scrolled-bg: rgba(18, 5, 16, 0.86);
    --pill-bg: rgba(255, 255, 255, 0.06);
    --pill-border: rgba(255, 255, 255, 0.14);
    --secondary-button-bg: rgba(255, 255, 255, 0.08);
    --secondary-button-border: rgba(255, 255, 255, 0.14);
    --stage-background:
        radial-gradient(circle at 82% 12%, rgba(255, 88, 146, 0.24), transparent 30%),
        radial-gradient(circle at 22% 82%, rgba(159, 90, 255, 0.26), transparent 32%),
        linear-gradient(180deg, rgba(22, 7, 21, 0.96), rgba(12, 5, 14, 0.98));
    --note-bg: rgba(25, 9, 23, 0.88);
    --note-border: rgba(255, 255, 255, 0.12);
    --shot-bg: rgba(15, 6, 14, 0.82);
    --shot-border: rgba(255, 255, 255, 0.12);
    --visual-card-background: rgba(22, 8, 21, 0.84);
    --form-shell-background:
        radial-gradient(circle at 80% 14%, rgba(255, 95, 146, 0.22), transparent 28rem),
        linear-gradient(180deg, rgba(24, 8, 22, 0.94), rgba(14, 6, 15, 0.97));
    --field-bg: rgba(255, 255, 255, 0.04);
    --field-border: rgba(255, 255, 255, 0.14);
    --field-focus: rgba(255, 112, 160, 0.7);
    --field-ring: rgba(255, 110, 156, 0.18);
}

body {
    background-attachment: fixed;
}

.site-header.is-scrolled {
    border-bottom-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.32);
}

.hero-stage-panel,
.project-card,
.service-card,
.visual-card,
.stack-shell,
.contact-form-shell,
.story-card,
.capability-card,
.timeline-card,
.metric-card {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hero-stage-panel::after,
.project-card::after,
.service-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.08);
    mask-image: linear-gradient(160deg, rgba(0, 0, 0, 1), transparent 75%);
}

.service-card,
.project-card {
    overflow: hidden;
}

.service-card:hover,
.project-card:hover,
.visual-card:hover {
    box-shadow:
        0 28px 78px rgba(0, 0, 0, 0.42),
        0 0 0 1px rgba(255, 127, 170, 0.28),
        0 0 36px rgba(255, 86, 150, 0.2);
}

.btn-primary {
    box-shadow:
        0 18px 40px rgba(255, 65, 141, 0.34),
        0 0 28px rgba(255, 118, 94, 0.2);
}

.social-pill,
.chip-group span,
.signal-strip-inner span {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
}

.project-card {
    background:
        radial-gradient(circle at 84% 8%, rgba(255, 100, 162, 0.2), transparent 36%),
        radial-gradient(circle at 16% 82%, rgba(161, 93, 255, 0.24), transparent 44%),
        linear-gradient(180deg, rgba(22, 7, 20, 0.96), rgba(12, 5, 13, 0.98));
}

:root[data-theme="dark"] .stack-shell {
    background:
        radial-gradient(circle at 14% 14%, rgba(255, 86, 150, 0.24), transparent 26rem),
        radial-gradient(circle at 86% 20%, rgba(161, 93, 255, 0.2), transparent 24rem),
        linear-gradient(180deg, rgba(18, 7, 19, 0.96), rgba(11, 6, 12, 0.98));
}

.contact-card a,
.project-link,
.form-footnote a {
    color: #ffc6de;
}

.wow-title {
    text-shadow:
        0 0 26px rgba(255, 87, 152, 0.58),
        0 0 46px rgba(161, 93, 255, 0.35);
}

/* Reel-like card structure upgrade */
.service-card-pro,
.project-card-pro {
    display: grid;
    gap: 0.95rem;
    padding: 1.25rem;
    border-radius: 26px;
    background:
        radial-gradient(circle at 86% 8%, rgba(255, 108, 168, 0.18), transparent 36%),
        linear-gradient(180deg, rgba(34, 10, 31, 0.92), rgba(16, 7, 17, 0.96));
}

.card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.card-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 20px rgba(0, 0, 0, 0.25);
}

.card-icon-orange {
    background: radial-gradient(circle at 30% 30%, #ffb076, #ff4d7a);
}

.card-icon-teal {
    background: radial-gradient(circle at 30% 30%, #84ffe8, #3aa8ff);
}

.card-icon-violet {
    background: radial-gradient(circle at 30% 30%, #d8a5ff, #8c5bff);
}

.card-id {
    padding: 0.42rem 0.68rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 237, 247, 0.9);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    font-weight: 800;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.card-action {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #ffe2ee;
    border-radius: 999px;
    min-height: 2rem;
    padding: 0 0.82rem;
    font-size: 0.78rem;
    font-weight: 700;
    transition: transform 0.24s ease, background-color 0.24s ease, border-color 0.24s ease;
}

.card-action:hover,
.card-action:focus-visible {
    transform: translateY(-2px);
    background: rgba(255, 122, 171, 0.2);
    border-color: rgba(255, 160, 196, 0.45);
}

.project-card-pro .project-points {
    margin-top: -0.2rem;
}

.projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.project-card-showcase {
    position: relative;
    display: grid;
    gap: 0.72rem;
    padding: 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background:
        radial-gradient(circle at 84% 6%, rgba(255, 95, 157, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(33, 9, 30, 0.9), rgba(15, 6, 16, 0.96));
}

.project-card-showcase h3 {
    font-size: 1.05rem;
    line-height: 1.2;
}

.project-card-showcase .project-copy {
    font-size: 0.86rem;
    line-height: 1.45;
}

.project-card-showcase .project-points {
    padding-left: 1rem;
    gap: 0.4rem;
}

.project-card-showcase .project-points li {
    font-size: 0.82rem;
    color: rgba(241, 224, 248, 0.86);
}

.project-card-showcase .project-image {
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.project-card-showcase .card-actions {
    margin-top: 0.15rem;
    gap: 0.42rem;
}

.project-card-showcase .card-action {
    min-height: 1.85rem;
    font-size: 0.72rem;
    padding: 0 0.68rem;
}

.card-action-live {
    color: var(--white);
    background: linear-gradient(135deg, #1f9d8f, #2ec4b6);
    border-color: transparent;
}

.card-action-cta {
    color: var(--white);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
    font-weight: 800;
}

.projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Screenshot-like structure refinement */
.container {
    width: min(1320px, calc(100vw - 1.2rem));
}

.hero {
    padding-top: 3.4rem;
}

.hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    gap: 1.1rem;
}

.hero-copy,
.hero-stage-panel {
    border-radius: 26px;
}

.hero-copy {
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        radial-gradient(circle at 86% 10%, rgba(255, 98, 156, 0.16), transparent 30%),
        linear-gradient(180deg, rgba(31, 9, 30, 0.82), rgba(16, 6, 17, 0.88));
}

.hero-stage-panel {
    min-height: 32rem;
}

.site-nav {
    padding: 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.nav-link {
    font-size: 0.85rem;
}

.services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card-showcase {
    position: relative;
    display: grid;
    gap: 0.72rem;
    padding: 1.05rem;
    min-height: 100%;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background:
        radial-gradient(circle at 84% 6%, rgba(255, 95, 157, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(33, 9, 30, 0.9), rgba(15, 6, 16, 0.96));
}

.service-card-showcase .service-image {
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.service-card-showcase h3 {
    font-size: 1.05rem;
    line-height: 1.2;
}

.service-card-showcase p {
    font-size: 0.86rem;
    line-height: 1.45;
}

.service-card-showcase .card-actions {
    margin-top: auto;
    gap: 0.42rem;
}

.service-card-showcase .card-action {
    min-height: 1.85rem;
    font-size: 0.72rem;
    padding: 0 0.68rem;
}

.card-actions {
    margin-top: 0.4rem;
}

.card-action {
    text-decoration: none;
}

.card-action-tag {
    opacity: 0.8;
    pointer-events: none;
}

.contact-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
}

.contact-copy,
.contact-form-shell {
    padding: 1.35rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        radial-gradient(circle at 88% 12%, rgba(255, 96, 146, 0.15), transparent 34%),
        linear-gradient(180deg, rgba(26, 8, 24, 0.88), rgba(14, 6, 14, 0.92));
}

.contact-rail .contact-card {
    border-radius: 14px;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
}

.contact-section {
    padding-top: 3.1rem;
}

.contact-copy {
    display: grid;
    gap: 0.9rem;
}

.contact-copy h2 {
    font-size: clamp(1.6rem, 3.2vw, 2.3rem);
}

.contact-copy .section-copy {
    font-size: 0.9rem;
    max-width: 48ch;
}

.contact-rail {
    margin-top: 0.2rem;
    gap: 0.55rem;
}

.contact-card {
    display: grid;
    gap: 0.2rem;
}

.contact-card .card-label {
    margin: 0;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
}

.contact-card a {
    font-size: 0.9rem;
    color: #ffd6e8;
}

.contact-card span {
    font-size: 0.78rem;
    color: rgba(235, 219, 246, 0.72);
}

.form-grid {
    gap: 0.75rem;
}

.contact-form-shell {
    border-radius: 20px;
    padding: 1.05rem;
}

.form-head {
    margin-bottom: 0.25rem;
}

.form-head h3 {
    font-size: 1.05rem;
}

.form-head .section-copy {
    font-size: 0.82rem;
}

.field span {
    font-size: 0.8rem;
    font-weight: 600;
}

.field input,
.field textarea,
.field select {
    border-radius: 10px;
    min-height: 2.35rem;
    padding: 0.7rem 0.82rem;
    font-size: 0.84rem;
    background: rgba(255, 255, 255, 0.03);
}

.field textarea {
    min-height: 6.7rem;
}

.btn-block {
    min-height: 2.55rem;
    font-size: 0.84rem;
}

.form-footnote {
    margin-top: 0.55rem;
    font-size: 0.8rem;
}

.form-status {
    margin-top: 0.4rem;
    font-size: 0.8rem;
}

@media (max-width: 1120px) {
    .services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .services-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Hero cinematic: split headline, purple halo, 3D tilt + depth */
.hero--cinematic {
    padding-top: 1.75rem;
    padding-bottom: 2.5rem;
}

.hero--cinematic .container {
    width: min(1450px, calc(100vw - 1rem));
}

.hero--cinematic .hero-grid {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 1.25rem 1.1rem 1.5rem;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        radial-gradient(ellipse 85% 60% at 50% -12%, rgba(168, 85, 247, 0.38), transparent 58%),
        radial-gradient(circle at 84% 18%, rgba(255, 102, 162, 0.12), transparent 38%),
        linear-gradient(185deg, #020206 0%, #0a0612 48%, #05040c 100%);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

:root[data-theme="light"] .hero--cinematic .hero-grid {
    background:
        radial-gradient(ellipse 75% 55% at 50% -8%, rgba(168, 85, 247, 0.22), transparent 58%),
        linear-gradient(185deg, #faf7ff 0%, #f3eefb 50%, #ebe6f7 100%);
    border-color: rgba(19, 32, 43, 0.12);
    box-shadow: 0 18px 50px rgba(11, 18, 30, 0.1);
}

.hero--cinematic .hero-cinematic {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) minmax(0, 1fr);
    gap: 1rem 1.5rem;
    align-items: center;
}

.hero--cinematic .hero-cine-left {
    text-align: right;
    padding-right: 0.25rem;
}

.hero--cinematic .hero-cine-right {
    text-align: left;
    padding-left: 0.25rem;
}

.hero--cinematic .hero-greeting {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(245, 240, 255, 0.52);
}

:root[data-theme="light"] .hero--cinematic .hero-greeting {
    color: var(--muted);
}

.hero--cinematic .hero-nameplate {
    margin: 0;
    font-size: clamp(1.75rem, 3.2vw, 2.75rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    max-width: none;
    color: #fff;
}

:root[data-theme="light"] .hero--cinematic .hero-nameplate {
    color: var(--text);
}

.hero--cinematic .hero-role-eyebrow {
    margin: 0 0 0.5rem;
}

.hero--cinematic .hero-role-line {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: clamp(1.1rem, 2.1vw, 1.6rem);
    font-weight: 800;
    line-height: 1.12;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(252, 248, 255, 0.92);
}

:root[data-theme="light"] .hero--cinematic .hero-role-line {
    color: var(--text);
}

.hero--cinematic .hero-role-lead {
    display: block;
    color: rgba(255, 255, 255, 0.52);
    font-weight: 600;
    letter-spacing: 0.14em;
    font-size: 0.72em;
}

:root[data-theme="light"] .hero--cinematic .hero-role-lead {
    color: var(--muted);
}

.hero--cinematic .hero-role-accent {
    display: block;
    background: linear-gradient(115deg, #faf5ff 0%, #c084fc 40%, #a855f7 70%, rgba(255, 255, 255, 0.2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 28px rgba(168, 85, 247, 0.55));
}

:root[data-theme="light"] .hero--cinematic .hero-role-accent {
    background: linear-gradient(115deg, #4c1d95 0%, #7c3aed 55%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.hero--cinematic .hero-cine-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero--cinematic .hero-focal {
    position: relative;
    width: 100%;
    max-width: 270px;
    transform-style: preserve-3d;
    transform: translate3d(0, var(--sfy, 0px), 0) perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) rotateZ(var(--sfr, 0deg));
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 24px;
    padding: 0.35rem;
}

.hero--cinematic .hero-focal-aura {
    position: absolute;
    inset: -20%;
    background: radial-gradient(
        circle at 50% 45%,
        rgba(216, 180, 254, 0.65) 0%,
        rgba(168, 85, 247, 0.28) 42%,
        transparent 68%
    );
    filter: blur(32px);
    opacity: 0.92;
    z-index: 0;
    pointer-events: none;
}

.hero--cinematic .hero-focal-plate {
    position: relative;
    z-index: 1;
    border-radius: 22px;
    padding: 5px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(24, 12, 32, 0.55));
    box-shadow:
        0 22px 55px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transform: translateZ(14px);
}

.hero--cinematic .hero-focal-depth {
    --tdx: 0px;
    --tdy: 0px;
    transform: translate3d(var(--tdx), var(--tdy), 22px);
    transition: transform 0.14s ease-out;
    border-radius: 18px;
    transform-style: preserve-3d;
}

.hero--cinematic .hero-shot-focal {
    position: static;
    width: 100%;
    margin: 0;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.42),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.35);
}

.hero--cinematic .hero-shot-focal img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1.08;
    object-fit: cover;
    transform: scale(1.02);
}

.hero--cinematic .hero-shot-focal figcaption {
    padding: 0.5rem 0.65rem 0.75rem;
    font-size: 0.72rem;
    color: rgba(235, 225, 250, 0.68);
}

.hero--cinematic .hero-lower {
    display: grid;
    gap: 0.85rem;
    padding-top: 0.15rem;
}

.hero--cinematic .hero-strap {
    margin: 0;
    font-size: clamp(1rem, 1.55vw, 1.18rem);
    line-height: 1.45;
    color: rgba(237, 228, 250, 0.8);
    max-width: 54rem;
}

:root[data-theme="light"] .hero--cinematic .hero-strap {
    color: var(--muted);
}

.hero--cinematic .hero-lower .hero-lead {
    margin: 0;
    font-size: 0.9rem;
    max-width: 48rem;
    color: rgba(200, 188, 220, 0.75);
}

.hero--cinematic .hero-lower .hero-actions {
    margin-top: 0.2rem;
}

.hero--cinematic .hero-lower-rails {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.2rem 0;
}

.hero--cinematic .hero-icon-rail {
    display: flex;
    gap: 0.55rem;
    align-items: center;
}

.hero--cinematic .hero-icon-link {
    display: grid;
    place-items: center;
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(250, 245, 255, 0.88);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.hero--cinematic .hero-icon-link:hover,
.hero--cinematic .hero-icon-link:focus-visible {
    transform: translateY(-5px) perspective(400px) rotateX(10deg);
    border-color: rgba(196, 181, 253, 0.5);
    background: rgba(168, 85, 247, 0.14);
    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.38),
        0 0 26px rgba(168, 85, 247, 0.28);
}

.hero--cinematic .hero-icon-link svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: currentColor;
}

.hero--cinematic .hero-resume-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: rgba(250, 245, 255, 0.72);
    padding: 0.45rem 0.7rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.hero--cinematic .hero-resume-link:hover,
.hero--cinematic .hero-resume-link:focus-visible {
    transform: translateY(-4px);
    color: #fff;
    border-color: rgba(196, 181, 253, 0.45);
}

.hero--cinematic .hero-metrics {
    margin-top: 0.35rem;
}

.hero--cinematic .metric-card-3d {
    transform: translate3d(0, var(--sfy, 0px), 0) perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) rotateZ(var(--sfr, 0deg));
    transition: transform 0.18s ease;
}

.hero--cinematic .stage-mini-card-3d {
    transform: translate3d(0, var(--sfy, 0px), 0) perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) rotateZ(var(--sfr, 0deg));
    transition: transform 0.18s ease;
}

.hero--cinematic .hero-stage-foot {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.2rem;
}

.hero--cinematic .hero-stage-foot .stage-mini-card {
    position: static;
}

.hero--cinematic .hero-media-offscreen {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .hero--cinematic .hero-focal,
    .hero--cinematic .hero-focal-depth,
    .hero--cinematic .metric-card-3d,
    .hero--cinematic .stage-mini-card-3d,
    .hero--cinematic .hero-icon-link,
    .hero--cinematic .hero-resume-link {
        transition: none;
    }

    .hero--cinematic .hero-icon-link:hover,
    .hero--cinematic .hero-icon-link:focus-visible,
    .hero--cinematic .hero-resume-link:hover,
    .hero--cinematic .hero-resume-link:focus-visible {
        transform: none;
    }
}

@media (max-width: 900px) {
    .hero--cinematic .hero-cinematic {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero--cinematic .hero-cine-left,
    .hero--cinematic .hero-cine-right {
        text-align: center;
        padding: 0;
    }

    .hero--cinematic .hero-cine-left {
        order: 1;
    }

    .hero--cinematic .hero-cine-center {
        order: 2;
    }

    .hero--cinematic .hero-cine-right {
        order: 3;
    }

    .hero--cinematic .hero-focal {
        max-width: 248px;
        margin: 0 auto;
    }

    .hero--cinematic .hero-lower-rails {
        flex-direction: column;
        align-items: stretch;
    }

    .hero--cinematic .hero-icon-rail {
        justify-content: center;
    }

    .hero--cinematic .hero-resume-link {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .hero--cinematic .hero-metrics {
        grid-template-columns: 1fr;
    }

    .hero--cinematic .hero-grid {
        border-radius: 20px;
        padding: 0.9rem 0.7rem 1rem;
        gap: 1rem;
    }

    .hero--cinematic .hero-nameplate {
        font-size: clamp(1.45rem, 8.8vw, 2rem);
    }

    .hero--cinematic .hero-role-line {
        font-size: clamp(1rem, 6vw, 1.35rem);
        letter-spacing: 0.06em;
    }

    .hero--cinematic .hero-focal {
        max-width: 220px;
    }

    .hero--cinematic .hero-lower {
        gap: 0.65rem;
    }

    .hero--cinematic .hero-lower .hero-lead,
    .hero--cinematic .hero-strap {
        font-size: 0.82rem;
        line-height: 1.46;
    }

    .hero--cinematic .hero-actions {
        width: 100%;
        gap: 0.55rem;
    }

    .hero--cinematic .hero-actions .btn {
        width: 100%;
        min-height: 2.9rem;
        font-size: 0.82rem;
    }

    .hero--cinematic .hero-icon-link {
        width: 2.3rem;
        height: 2.3rem;
        border-radius: 10px;
    }

    .hero--cinematic .hero-stage-foot {
        grid-template-columns: 1fr;
    }
}

/* Stack v5 premium 3D keyboard */
.stack-3d-viewport {
    min-height: auto;
    padding: 1.6rem 0.35rem 1.2rem;
    overflow: visible;
    perspective: 1280px;
    perspective-origin: 50% 28%;
}

.stack-macropad {
    --kbd-tilt-x: 58deg;
    --kbd-tilt-z: -28deg;
    width: min(100%, 680px);
    margin: 0 auto;
    padding: 1.1rem 1.15rem 1.35rem;
    border-radius: 1.8rem;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(var(--kbd-tilt-x)) rotateZ(var(--kbd-tilt-z));
    background: linear-gradient(172deg, #121a29 0%, #0a101a 46%, #070b12 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -18px 28px rgba(0, 0, 0, 0.4),
        0 16px 24px rgba(0, 0, 0, 0.36),
        0 50px 58px rgba(0, 0, 0, 0.48);
    filter: drop-shadow(0 24px 24px rgba(0, 0, 0, 0.5));
    animation: none;
}

.stack-macropad::before,
.stack-macropad::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.stack-macropad::before {
    inset: -1.25rem -1rem -1.55rem;
    border-radius: 2.2rem;
    z-index: -2;
    background:
        radial-gradient(circle at 24% 36%, rgba(140, 107, 255, 0.28), transparent 58%),
        radial-gradient(circle at 74% 62%, rgba(0, 225, 255, 0.2), transparent 62%);
    filter: blur(18px);
}

.stack-macropad::after {
    left: 0.85rem;
    right: 0.85rem;
    bottom: -1rem;
    height: 1.2rem;
    border-radius: 0 0 1rem 1rem;
    z-index: -1;
    background: linear-gradient(180deg, #090f18, #06090f);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.55);
}

.stack-macropad-inner {
    --key-size: 4.25rem;
    --key-gap: 0.62rem;
    display: grid;
    grid-template-columns: repeat(5, var(--key-size));
    gap: var(--key-gap);
    justify-content: center;
    padding: 0.35rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)),
        radial-gradient(circle at 30% 0%, rgba(129, 156, 255, 0.09), transparent 54%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: visible;
}

.stack-macropad-inner::after {
    display: none;
}

.stack-node {
    --node-y: 0px;
    --node-z: 15px;
    --row-offset: 0px;
    position: relative;
    min-height: var(--key-size);
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.34rem;
    border: 0;
    border-radius: 1rem;
    cursor: pointer;
    transform-style: preserve-3d;
    transform: translate3d(var(--row-offset), var(--node-y), var(--node-z));
    background:
        linear-gradient(160deg, color-mix(in srgb, var(--node-accent) 82%, #ffffff 10%), color-mix(in srgb, var(--node-accent) 88%, #121722 12%) 72%);
    box-shadow:
        0 12px 14px rgba(0, 0, 0, 0.42),
        0 5px 10px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        inset 0 -8px 14px rgba(0, 0, 0, 0.24);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    isolation: isolate;
}

.stack-node::before,
.stack-node::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

.stack-node::before {
    background:
        linear-gradient(162deg, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0.12) 36%, transparent 62%),
        radial-gradient(88% 55% at 50% 0%, rgba(255, 255, 255, 0.24), transparent 70%);
    mix-blend-mode: screen;
}

.stack-node::after {
    left: 0.55rem;
    right: 0.55rem;
    top: 0.38rem;
    height: 0.42rem;
    border-radius: 999px;
    inset: unset;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.04));
    opacity: 0.9;
}

.stack-node:nth-child(n + 6):nth-child(-n + 10) { --row-offset: 0.52rem; }
.stack-node:nth-child(n + 11):nth-child(-n + 15) { --row-offset: 1rem; }
.stack-node:nth-child(n + 16):nth-child(-n + 20) { --row-offset: 0.6rem; }
.stack-node:nth-child(n + 21):nth-child(-n + 25) { --row-offset: 0.2rem; }

.stack-node:hover,
.stack-node.is-active {
    --node-y: -3px;
    --node-z: 20px;
    box-shadow:
        0 18px 18px rgba(0, 0, 0, 0.44),
        0 7px 12px rgba(0, 0, 0, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -8px 12px rgba(0, 0, 0, 0.28),
        0 0 20px color-mix(in srgb, var(--node-accent) 48%, transparent);
    filter: saturate(1.06) brightness(1.04);
}

.stack-node-pop {
    animation: stackNodePop 0.28s ease;
}

@keyframes stackNodePop {
    0% { transform: translate3d(var(--row-offset), 0, 15px) scale(1); }
    50% { transform: translate3d(var(--row-offset), -2px, 11px) scale(0.985); }
    100% { transform: translate3d(var(--row-offset), -3px, 20px) scale(1); }
}

.stack-node-cap {
    width: 2.05rem;
    height: 2.05rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(8, 14, 22, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transform: translateZ(1px);
}

.stack-node-logo {
    width: 1.6rem;
    height: 1.6rem;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.stack-node-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(248, 251, 255, 0.94);
    text-align: center;
    transform: translateZ(1px);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.32);
}

.stack-node--dark-fg .stack-node-label {
    color: rgba(11, 16, 24, 0.92);
    text-shadow: none;
}

@media (max-width: 980px) {
    .stack-macropad {
        transform: rotateX(58deg) rotateZ(-28deg) scale(0.92);
        transform-origin: center;
    }

    .stack-macropad-inner {
        --key-size: 3.65rem;
    }
}

@media (max-width: 860px) {
    .stack-macropad {
        transform: rotateX(58deg) rotateZ(-28deg) scale(0.84);
    }

    .stack-macropad-inner {
        --key-size: 3.25rem;
        --key-gap: 0.5rem;
    }

    .stack-node-cap {
        width: 1.72rem;
        height: 1.72rem;
    }

    .stack-node-logo {
        width: 1.32rem;
        height: 1.32rem;
    }

    .stack-node-label {
        font-size: 0.56rem;
    }
}

@media (max-width: 640px) {
    .stack-macropad {
        transform: rotateX(56deg) rotateZ(-27deg) scale(0.74);
        width: min(100%, 560px);
    }

    .stack-macropad-inner {
        --key-size: 2.85rem;
        --key-gap: 0.42rem;
    }
}

/* Hero audio-reactive premium background */
.hero-audio-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    transform-style: preserve-3d;
    --ha-mx: 0;
    --ha-my: 0;
}

.hero-audio-ambient {
    position: absolute;
    inset: -12%;
    background:
        radial-gradient(circle at 18% 22%, rgba(133, 92, 255, 0.26), transparent 54%),
        radial-gradient(circle at 82% 66%, rgba(42, 208, 255, 0.2), transparent 58%),
        radial-gradient(circle at 56% 34%, rgba(94, 124, 255, 0.14), transparent 62%);
    filter: blur(12px);
    opacity: calc(0.58 + var(--music-energy) * 0.32);
    transform: translate3d(calc(var(--ha-mx) * 8px), calc(var(--ha-my) * 8px), 0);
    transition: transform 220ms ease-out;
}

.hero-audio-beam {
    position: absolute;
    width: 48%;
    height: 12%;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(115, 135, 255, 0.24), rgba(55, 208, 255, 0.2), transparent);
    filter: blur(16px);
    opacity: calc(0.18 + var(--music-energy) * 0.35);
}

.hero-audio-beam-a { top: 20%; left: -15%; transform: rotate(-18deg); animation: heroBeamMoveA 13s linear infinite; }
.hero-audio-beam-b { top: 62%; right: -16%; transform: rotate(16deg); animation: heroBeamMoveB 16s linear infinite; }

.hero-audio-grid {
    position: absolute;
    left: -14%;
    right: -14%;
    bottom: -32%;
    height: 58%;
    background:
        linear-gradient(rgba(146, 167, 214, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(146, 167, 214, 0.08) 1px, transparent 1px);
    background-size: 48px 48px;
    transform: rotateX(72deg) translateZ(-20px);
    transform-origin: bottom;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 86%);
    opacity: 0.42;
}

.hero-audio-objects { position: absolute; inset: 0; }
.hero-glass-panel, .hero-audio-ring, .hero-audio-cube { position: absolute; border-radius: 16px; opacity: calc(0.28 + var(--music-energy) * 0.32); }

.hero-glass-panel {
    border: 1px solid rgba(175, 203, 255, 0.24);
    background: linear-gradient(150deg, rgba(198, 222, 255, 0.14), rgba(123, 157, 255, 0.03));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 16px 26px rgba(0, 0, 0, 0.34), 0 0 calc(10px + var(--music-energy) * 20px) rgba(108, 151, 255, 0.34);
}

.hero-glass-panel-a { width: 10.5rem; height: 6.2rem; top: 14%; left: 8%; transform: translate3d(calc(var(--ha-mx) * -14px), calc(var(--ha-my) * -10px), 0) rotate(-10deg); }
.hero-glass-panel-b { width: 9.4rem; height: 5.6rem; top: 24%; right: 10%; transform: translate3d(calc(var(--ha-mx) * 12px), calc(var(--ha-my) * -8px), 0) rotate(14deg); }
.hero-glass-panel-c { width: 8.6rem; height: 5rem; bottom: 18%; left: 20%; transform: translate3d(calc(var(--ha-mx) * -9px), calc(var(--ha-my) * 8px), 0) rotate(8deg); }

.hero-audio-ring {
    border-radius: 999px;
    border: 1px solid rgba(110, 198, 255, 0.42);
    box-shadow: 0 0 calc(10px + var(--music-energy) * 24px) rgba(88, 186, 255, 0.28);
    animation: heroRingPulse 3.2s ease-in-out infinite;
}

.hero-audio-ring-a { width: 10rem; height: 10rem; bottom: 14%; right: 12%; }
.hero-audio-ring-b { width: 7.8rem; height: 7.8rem; bottom: 26%; right: 24%; animation-delay: -1.3s; }

.hero-audio-cube {
    width: 2.8rem;
    height: 2.8rem;
    border: 1px solid rgba(175, 205, 255, 0.3);
    background: linear-gradient(140deg, rgba(145, 168, 255, 0.22), rgba(10, 16, 31, 0.08));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 10px 20px rgba(0, 0, 0, 0.3);
    animation: heroCubeSpin 9s linear infinite;
}

.hero-audio-cube-a { top: 18%; left: 46%; }
.hero-audio-cube-b { bottom: 16%; left: 64%; width: 2.1rem; height: 2.1rem; animation-duration: 7s; animation-direction: reverse; }

.hero-code-cloud { position: absolute; inset: 0; }
.hero-code-cloud span {
    position: absolute;
    color: rgba(190, 212, 255, 0.25);
    text-shadow: 0 0 calc(6px + var(--music-energy) * 14px) rgba(89, 176, 255, 0.32);
    font-weight: 700;
    letter-spacing: 0.05em;
    animation: heroCodeFloat 9s linear infinite;
}

.hero-code-cloud span:nth-child(1) { left: 7%; top: 26%; font-size: 0.88rem; animation-delay: -0.5s; }
.hero-code-cloud span:nth-child(2) { left: 13%; top: 49%; font-size: 0.82rem; animation-delay: -2.1s; }
.hero-code-cloud span:nth-child(3) { left: 24%; top: 72%; font-size: 0.8rem; animation-delay: -3.3s; }
.hero-code-cloud span:nth-child(4) { right: 23%; top: 20%; font-size: 0.84rem; animation-delay: -1.2s; }
.hero-code-cloud span:nth-child(5) { right: 12%; top: 42%; font-size: 0.76rem; animation-delay: -4s; }
.hero-code-cloud span:nth-child(6) { right: 8%; top: 63%; font-size: 0.9rem; animation-delay: -2.8s; }
.hero-code-cloud span:nth-child(7) { left: 41%; top: 13%; font-size: 0.74rem; animation-delay: -5.2s; }
.hero-code-cloud span:nth-child(8) { left: 52%; top: 79%; font-size: 0.78rem; animation-delay: -6.1s; }
.hero-code-cloud span:nth-child(9) { left: 66%; top: 28%; font-size: 0.72rem; animation-delay: -7.4s; }
.hero-code-cloud span:nth-child(10) { left: 35%; top: 58%; font-size: 0.72rem; animation-delay: -1.7s; }

.hero-audio-eq {
    position: absolute;
    left: 50%;
    bottom: 8%;
    width: min(24rem, 56%);
    height: 4.8rem;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    gap: 0.22rem;
    align-items: end;
    opacity: 0.54;
}

.hero-audio-eq span {
    border-radius: 0.5rem 0.5rem 0.28rem 0.28rem;
    background: linear-gradient(180deg, rgba(82, 203, 255, 0.95), rgba(112, 98, 255, 0.28) 82%, rgba(10, 16, 32, 0.08));
    box-shadow: 0 0 calc(6px + var(--music-energy) * 12px) rgba(76, 181, 255, 0.42);
    animation: heroEqPulse 1.2s ease-in-out infinite;
}

.hero-audio-eq span:nth-child(1) { animation-delay: -0.2s; height: 36%; }
.hero-audio-eq span:nth-child(2) { animation-delay: -0.45s; height: 54%; }
.hero-audio-eq span:nth-child(3) { animation-delay: -0.65s; height: 28%; }
.hero-audio-eq span:nth-child(4) { animation-delay: -0.1s; height: 66%; }
.hero-audio-eq span:nth-child(5) { animation-delay: -0.83s; height: 42%; }
.hero-audio-eq span:nth-child(6) { animation-delay: -0.33s; height: 52%; }
.hero-audio-eq span:nth-child(7) { animation-delay: -0.93s; height: 72%; }
.hero-audio-eq span:nth-child(8) { animation-delay: -0.5s; height: 38%; }
.hero-audio-eq span:nth-child(9) { animation-delay: -0.19s; height: 64%; }
.hero-audio-eq span:nth-child(10) { animation-delay: -0.71s; height: 40%; }
.hero-audio-eq span:nth-child(11) { animation-delay: -0.27s; height: 58%; }
.hero-audio-eq span:nth-child(12) { animation-delay: -0.41s; height: 34%; }
.hero-audio-eq span:nth-child(13) { animation-delay: -0.88s; height: 62%; }
.hero-audio-eq span:nth-child(14) { animation-delay: -0.54s; height: 46%; }
.hero-audio-eq span:nth-child(15) { animation-delay: -0.26s; height: 52%; }
.hero-audio-eq span:nth-child(16) { animation-delay: -0.72s; height: 26%; }
.hero-audio-eq span:nth-child(17) { animation-delay: -0.37s; height: 56%; }
.hero-audio-eq span:nth-child(18) { animation-delay: -0.62s; height: 36%; }

.hero--cinematic .hero-cinematic,
.hero--cinematic .hero-lower { position: relative; z-index: 2; }

@keyframes heroBeamMoveA { from { transform: translateX(-24vw) rotate(-18deg); } to { transform: translateX(44vw) rotate(-18deg); } }
@keyframes heroBeamMoveB { from { transform: translateX(22vw) rotate(16deg); } to { transform: translateX(-36vw) rotate(16deg); } }
@keyframes heroRingPulse { 0%, 100% { transform: scale(0.94); opacity: 0.22; } 50% { transform: scale(1.08); opacity: 0.56; } }
@keyframes heroCubeSpin { from { transform: rotateX(16deg) rotateY(0deg) rotateZ(0deg); } to { transform: rotateX(16deg) rotateY(360deg) rotateZ(360deg); } }
@keyframes heroCodeFloat { 0%, 100% { transform: translateY(6px); opacity: 0; } 20%, 80% { opacity: 1; } 50% { transform: translateY(-14px); } }
@keyframes heroEqPulse { 0%, 100% { transform: scaleY(0.28); } 45% { transform: scaleY(calc(0.42 + var(--music-energy) * 1.2)); } 70% { transform: scaleY(calc(0.34 + var(--music-energy) * 0.86)); } }

@media (max-width: 900px) {
    .hero-glass-panel { display: none; }
    .hero-audio-eq { width: min(19rem, 68%); height: 3.9rem; }
}

@media (max-width: 640px) {
    .hero-audio-cube, .hero-audio-ring-b, .hero-code-cloud span:nth-child(n + 7) { display: none; }
    .hero-audio-eq { width: min(14rem, 72%); height: 3.3rem; grid-template-columns: repeat(12, 1fr); }
    .hero-audio-eq span:nth-child(n + 13) { display: none; }
}

/* Stack v8 hologram constellation (not keyboard) */
.stack-3d-viewport {
    perspective: 1200px;
    perspective-origin: 50% 24%;
}

.stack-macropad {
    width: min(100%, 780px);
    border-radius: 30px;
    padding: 1.2rem;
    transform: rotateX(36deg) rotateZ(-11deg) !important;
    transform-style: preserve-3d;
    background:
        radial-gradient(circle at 50% 45%, rgba(99, 102, 241, 0.14), transparent 60%),
        radial-gradient(circle at 20% 16%, rgba(34, 211, 238, 0.12), transparent 42%),
        radial-gradient(circle at 84% 76%, rgba(168, 85, 247, 0.12), transparent 44%),
        linear-gradient(176deg, #101725 0%, #090f19 58%, #060a12 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -16px 30px rgba(0, 0, 0, 0.42),
        0 30px 52px rgba(0, 0, 0, 0.52);
}

.stack-macropad::before {
    content: "";
    position: absolute;
    inset: -14px;
    border-radius: 34px;
    background: radial-gradient(circle at 50% 50%, rgba(110, 140, 255, 0.18), transparent 62%);
    filter: blur(14px);
    z-index: -1;
}

.stack-macropad-inner {
    --key-size: 3.7rem;
    --key-gap: 0.74rem;
    grid-template-columns: repeat(5, var(--key-size));
    gap: var(--key-gap);
    justify-content: center;
    padding: 0.85rem;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.1), transparent 60%),
        linear-gradient(150deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
}

.stack-node {
    --float-y: 0px;
    --float-z: 9px;
    position: relative;
    min-height: var(--key-size);
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--node-accent) 44%, rgba(255, 255, 255, 0.24));
    background:
        radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--node-accent) 66%, white 12%), color-mix(in srgb, var(--node-accent) 72%, #0c1322 28%) 62%),
        radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.28), transparent 42%);
    box-shadow:
        0 10px 14px rgba(0, 0, 0, 0.42),
        0 0 0 1px color-mix(in srgb, var(--node-accent) 36%, transparent),
        0 0 16px color-mix(in srgb, var(--node-accent) 46%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        inset 0 -8px 12px rgba(0, 0, 0, 0.2);
    transform: translate3d(0, var(--float-y), var(--float-z));
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.stack-node::after {
    content: "";
    position: absolute;
    left: 20%;
    right: 20%;
    top: 8%;
    height: 14%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.04));
}

.stack-node:nth-child(2n) { --float-z: 13px; }
.stack-node:nth-child(3n) { --float-z: 7px; }

.stack-node:hover,
.stack-node.is-active {
    --float-y: -4px;
    --float-z: 16px;
    filter: saturate(1.08) brightness(1.04);
    box-shadow:
        0 16px 18px rgba(0, 0, 0, 0.5),
        0 0 22px color-mix(in srgb, var(--node-accent) 62%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.44),
        inset 0 -10px 14px rgba(0, 0, 0, 0.28);
}

.stack-node-cap {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(5, 10, 18, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stack-shell {
    position: relative;
    overflow: visible;
}

.stack-edge-stars {
    position: absolute;
    top: 0.3rem;
    bottom: 0.3rem;
    width: 1.4rem;
    pointer-events: none;
    z-index: 3;
}

.stack-edge-stars-left { left: -0.95rem; }
.stack-edge-stars-right { right: -0.95rem; }

.edge-star {
    --sz: 0.32rem;
    --alpha: 0.75;
    --dur: 7.8s;
    --delay: 0s;
    --offset: 0px;
    position: absolute;
    left: 50%;
    width: var(--sz);
    height: var(--sz);
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.98), rgba(165, 209, 255, 0.8) 58%, transparent 72%);
    box-shadow:
        0 0 calc(6px + var(--music-bass) * 12px) rgba(131, 192, 255, 0.56),
        0 0 calc(10px + var(--music-energy) * 18px) rgba(168, 85, 247, 0.28);
    opacity: var(--alpha);
    transform: translateX(calc(-50% + var(--offset)));
    animation: edgeStarFall var(--dur) linear infinite;
    animation-delay: var(--delay);
}

.stack-edge-stars .edge-star:nth-child(1) { top: 3%; --sz: 0.28rem; --dur: 8.2s; --delay: -1.1s; --offset: -4px; }
.stack-edge-stars .edge-star:nth-child(2) { top: 11%; --sz: 0.38rem; --dur: 9.1s; --delay: -2.8s; --offset: 3px; }
.stack-edge-stars .edge-star:nth-child(3) { top: 19%; --sz: 0.26rem; --dur: 7.3s; --delay: -0.7s; --offset: -1px; }
.stack-edge-stars .edge-star:nth-child(4) { top: 27%; --sz: 0.34rem; --dur: 8.9s; --delay: -3.9s; --offset: 5px; }
.stack-edge-stars .edge-star:nth-child(5) { top: 35%; --sz: 0.23rem; --dur: 7.6s; --delay: -2.4s; --offset: -5px; }
.stack-edge-stars .edge-star:nth-child(6) { top: 44%; --sz: 0.41rem; --dur: 9.8s; --delay: -4.7s; --offset: 2px; }
.stack-edge-stars .edge-star:nth-child(7) { top: 52%; --sz: 0.24rem; --dur: 8.3s; --delay: -0.9s; --offset: -2px; }
.stack-edge-stars .edge-star:nth-child(8) { top: 60%; --sz: 0.35rem; --dur: 9.4s; --delay: -5.3s; --offset: 4px; }
.stack-edge-stars .edge-star:nth-child(9) { top: 69%; --sz: 0.27rem; --dur: 7.2s; --delay: -1.8s; --offset: -3px; }
.stack-edge-stars .edge-star:nth-child(10) { top: 77%; --sz: 0.39rem; --dur: 10.2s; --delay: -6.1s; --offset: 2px; }
.stack-edge-stars .edge-star:nth-child(11) { top: 86%; --sz: 0.22rem; --dur: 8.1s; --delay: -2.9s; --offset: -4px; }
.stack-edge-stars .edge-star:nth-child(12) { top: 94%; --sz: 0.31rem; --dur: 9.6s; --delay: -4.2s; --offset: 3px; }

.stack-shell:hover .stack-edge-stars-left .edge-star {
    transform: translateX(calc(-50% - 22px));
    opacity: 0.96;
}

.stack-shell:hover .stack-edge-stars-right .edge-star {
    transform: translateX(calc(-50% + 22px));
    opacity: 0.96;
}

@keyframes edgeStarFall {
    0% {
        transform: translateX(calc(-50% + var(--offset))) translateY(-14px) scale(0.86);
        opacity: calc(0.35 + var(--music-bass) * 0.35);
    }
    50% {
        transform: translateX(calc(-50% + var(--offset) * 0.5)) translateY(10px) scale(1.06);
        opacity: calc(0.72 + var(--music-bass) * 0.32);
    }
    100% {
        transform: translateX(calc(-50% + var(--offset))) translateY(26px) scale(0.9);
        opacity: calc(0.28 + var(--music-bass) * 0.25);
    }
}

.stack-code-side {
    position: absolute;
    top: 1.2rem;
    bottom: 1.2rem;
    width: min(14rem, 22%);
    display: grid;
    align-content: center;
    gap: 0.55rem;
    pointer-events: none;
    z-index: 0;
}

.stack-code-side-left { left: 0.55rem; justify-items: start; }
.stack-code-side-right { right: 0.55rem; justify-items: end; }

.stack-code-side::before {
    content: "";
    position: absolute;
    top: 8%;
    bottom: 8%;
    width: 0.85rem;
    border-radius: 999px;
    opacity: calc(0.25 + var(--music-bass) * 0.65);
    background:
        repeating-linear-gradient(
            to top,
            rgba(52, 211, 255, 0.14) 0 6%,
            rgba(52, 211, 255, 0.66) 6% 12%,
            rgba(166, 95, 255, 0.2) 12% 18%
        );
    box-shadow:
        0 0 calc(12px + var(--music-bass) * 26px) rgba(96, 165, 250, 0.42),
        inset 0 0 8px rgba(255, 255, 255, 0.2);
    transform: scaleY(calc(0.72 + var(--music-bass) * 0.56));
    transform-origin: center bottom;
    animation: stackBassColumn 1.2s ease-in-out infinite;
}

.stack-code-side::after {
    content: "";
    position: absolute;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    border: 1px solid rgba(120, 170, 255, 0.5);
    box-shadow:
        0 0 calc(8px + var(--music-bass) * 20px) rgba(120, 170, 255, 0.6),
        0 0 calc(10px + var(--music-bass) * 16px) rgba(168, 85, 247, 0.4);
    opacity: calc(0.2 + var(--music-bass) * 0.6);
    animation: stackBassPulse 1.05s ease-in-out infinite;
}

.stack-code-side-left::before { left: 0.25rem; }
.stack-code-side-left::after { left: -0.2rem; bottom: 0.8rem; }
.stack-code-side-right::before { right: 0.25rem; }
.stack-code-side-right::after { right: -0.2rem; bottom: 0.8rem; }

.stack-code-side span {
    display: inline-flex;
    max-width: 100%;
    padding: 0.34rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(135, 159, 255, 0.24);
    background: linear-gradient(135deg, rgba(34, 52, 96, 0.24), rgba(16, 24, 42, 0.14));
    color: rgba(208, 224, 255, 0.7);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 0 calc(8px + var(--music-energy) * 16px) rgba(99, 102, 241, 0.25);
    animation: stackCodeDrift 6.2s ease-in-out infinite;
}

.stack-code-side span:nth-child(2n) { animation-delay: -1.2s; }
.stack-code-side span:nth-child(3n) { animation-delay: -2.6s; }

@keyframes stackCodeDrift {
    0%, 100% { transform: translateY(0); opacity: 0.62; }
    50% { transform: translateY(-7px); opacity: 0.95; }
}

@keyframes stackBassColumn {
    0%, 100% { transform: scaleY(calc(0.66 + var(--music-bass) * 0.42)); }
    50% { transform: scaleY(calc(0.84 + var(--music-bass) * 0.72)); }
}

@keyframes stackBassPulse {
    0%, 100% {
        transform: scale(calc(0.82 + var(--music-bass) * 0.24));
        opacity: calc(0.18 + var(--music-bass) * 0.48);
    }
    50% {
        transform: scale(calc(1 + var(--music-bass) * 0.35));
        opacity: calc(0.38 + var(--music-bass) * 0.58);
    }
}

.stack-node-label {
    font-size: 0.6rem;
    letter-spacing: 0.09em;
}

@media (max-width: 860px) {
    .stack-macropad {
        transform: rotateX(34deg) rotateZ(-9deg) scale(0.9) !important;
    }

    .stack-macropad-inner {
        --key-size: 3.1rem;
        --key-gap: 0.52rem;
    }

    .stack-code-side,
    .stack-edge-stars { display: none; }
}

/* Premium smooth hover pass for cards */
.service-card-showcase,
.project-card-showcase,
.timeline-card,
.contact-card,
.contact-copy,
.contact-form-shell,
.metric-card-3d,
.stage-mini-card-3d {
    transition:
        transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1),
        box-shadow 0.32s cubic-bezier(0.22, 0.61, 0.36, 1),
        border-color 0.32s cubic-bezier(0.22, 0.61, 0.36, 1),
        filter 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

.service-card-showcase:hover,
.service-card-showcase:focus-within,
.project-card-showcase:hover,
.project-card-showcase:focus-within,
.timeline-card:hover,
.timeline-card:focus-within,
.contact-card:hover,
.contact-card:focus-within,
.contact-copy:hover,
.contact-copy:focus-within,
.contact-form-shell:hover,
.contact-form-shell:focus-within,
.metric-card-3d:hover,
.stage-mini-card-3d:hover {
    border-color: rgba(146, 178, 255, 0.42);
    box-shadow:
        0 26px 44px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(156, 188, 255, 0.2),
        0 0 26px rgba(124, 146, 255, 0.2);
    filter: saturate(1.04);
}

/* Extra hover strength for about/services/projects cards */
.story-card,
.capability-card,
.service-card,
.project-card,
.contact-copy,
.contact-form-shell,
.service-card-showcase,
.project-card-showcase {
    transition:
        transform 0.34s cubic-bezier(0.22, 0.61, 0.36, 1),
        box-shadow 0.34s cubic-bezier(0.22, 0.61, 0.36, 1),
        border-color 0.34s cubic-bezier(0.22, 0.61, 0.36, 1),
        filter 0.34s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.service-card-showcase,
.project-card-showcase,
.story-card,
.capability-card,
.contact-copy,
.contact-form-shell {
    transform:
        perspective(920px)
        translateY(var(--sfy, 0px))
        rotateX(var(--rx, 0deg))
        rotateY(var(--ry, 0deg))
        rotateZ(var(--sfr, 0deg));
}

.story-card:hover,
.capability-card:hover,
.service-card:hover,
.project-card:hover,
.contact-copy:hover,
.contact-form-shell:hover,
.service-card-showcase:hover,
.project-card-showcase:hover,
.story-card:focus-within,
.capability-card:focus-within,
.service-card:focus-within,
.project-card:focus-within,
.contact-copy:focus-within,
.contact-form-shell:focus-within,
.service-card-showcase:focus-within,
.project-card-showcase:focus-within {
    transform:
        perspective(920px)
        translateY(calc(-6px + var(--sfy, 0px)))
        rotateX(calc(var(--rx, 0deg) + 1.4deg))
        rotateY(calc(var(--ry, 0deg) + 1.4deg))
        rotateZ(var(--sfr, 0deg))
        scale(1.006);
    border-color: rgba(168, 195, 255, 0.42);
    box-shadow:
        0 24px 46px rgba(0, 0, 0, 0.36),
        0 0 0 1px rgba(168, 195, 255, 0.22),
        0 0 32px rgba(124, 146, 255, 0.24);
    filter: saturate(1.06);
}

body.music-active .story-card:hover,
body.music-active .capability-card:hover,
body.music-active .service-card:hover,
body.music-active .project-card:hover,
body.music-active .contact-copy:hover,
body.music-active .contact-form-shell:hover,
body.music-active .service-card-showcase:hover,
body.music-active .project-card-showcase:hover {
    filter: saturate(1.085) brightness(1.03);
}

/* Stack v9: modern creative tech cloud (no keyboard) */
.stack-code-side,
.stack-edge-stars {
    display: none !important;
}

.stack-3d-viewport {
    padding: 1rem 0.2rem 0.8rem;
    perspective: 1000px;
}

.stack-macropad {
    width: min(100%, 920px);
    margin: 0 auto;
    border-radius: 28px;
    padding: 1rem;
    transform: rotateX(8deg) rotateZ(-2deg) !important;
    background:
        radial-gradient(circle at 14% 12%, rgba(56, 189, 248, 0.15), transparent 42%),
        radial-gradient(circle at 84% 84%, rgba(168, 85, 247, 0.14), transparent 46%),
        linear-gradient(165deg, rgba(13, 20, 36, 0.9), rgba(8, 13, 24, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 28px 56px rgba(0, 0, 0, 0.46),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.stack-macropad-inner {
    position: relative;
    grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 20px;
    background:
        radial-gradient(circle at 20% 18%, rgba(56, 189, 248, 0.1), transparent 32%),
        radial-gradient(circle at 80% 72%, rgba(168, 85, 247, 0.12), transparent 34%),
        rgba(8, 14, 25, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.stack-macropad-inner::before {
    content: "";
    position: absolute;
    inset: -30%;
    background:
        radial-gradient(circle at 30% 40%, rgba(59, 130, 246, 0.2), transparent 28%),
        radial-gradient(circle at 70% 60%, rgba(168, 85, 247, 0.2), transparent 30%);
    filter: blur(26px);
    opacity: calc(0.24 + var(--music-energy) * 0.5);
    animation: stackCloudShift 8s ease-in-out infinite;
    pointer-events: none;
}

.stack-node {
    min-height: 5.2rem;
    border-radius: 16px;
    background:
        linear-gradient(155deg, color-mix(in srgb, var(--node-accent) 22%, white 8%), rgba(12, 18, 32, 0.88)),
        rgba(14, 22, 40, 0.86);
    border: 1px solid color-mix(in srgb, var(--node-accent) 35%, rgba(255, 255, 255, 0.2));
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
    transform: translateY(0);
}

.stack-node::after {
    display: none;
}

.stack-node:hover,
.stack-node.is-active {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 16px 32px rgba(0, 0, 0, 0.44),
        0 0 24px color-mix(in srgb, var(--node-accent) 55%, transparent);
}

.stack-node-cap {
    width: 2.1rem;
    height: 2.1rem;
    background: rgba(255, 255, 255, 0.1);
}

@keyframes stackCloudShift {
    0%, 100% { transform: translateX(-1%) translateY(0); }
    50% { transform: translateX(1%) translateY(-2%); }
}

@media (max-width: 860px) {
    .section-stack {
        gap: 1.4rem;
    }

    .stack-shell {
        padding: 1.4rem;
        border-radius: 24px;
        overflow: visible;
    }

    .stack-macropad {
        transform: none !important;
        width: 100%;
        padding: 0.9rem;
        border-radius: 22px;
    }

    .stack-macropad-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        --key-size: 2.8rem;
        --key-gap: 0.5rem;
        gap: 0.6rem;
        padding: 0.7rem;
    }

    .stack-node {
        min-height: 4.2rem;
        transform: none;
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
    }
}

@media (hover: hover) and (pointer: fine) {
    .story-card[data-tilt],
    .capability-card[data-tilt],
    .service-card-showcase[data-tilt],
    .project-card-showcase[data-tilt],
    .contact-copy[data-tilt],
    .contact-form-shell[data-tilt],
    .timeline-card[data-tilt],
    .contact-card[data-tilt] {
        transform:
            perspective(980px)
            translateY(var(--sfy, 0px))
            rotateX(var(--rx, 0deg))
            rotateY(var(--ry, 0deg))
            rotateZ(var(--sfr, 0deg)) !important;
        transform-style: preserve-3d;
    }

    .story-card[data-tilt]:hover,
    .capability-card[data-tilt]:hover,
    .service-card-showcase[data-tilt]:hover,
    .project-card-showcase[data-tilt]:hover,
    .contact-copy[data-tilt]:hover,
    .contact-form-shell[data-tilt]:hover,
    .timeline-card[data-tilt]:hover,
    .contact-card[data-tilt]:hover {
        transform:
            perspective(980px)
            translateY(calc(-10px + var(--sfy, 0px)))
            rotateX(calc(var(--rx, 0deg) + 2deg))
            rotateY(calc(var(--ry, 0deg) + 2deg))
            rotateZ(var(--sfr, 0deg))
            scale(1.01) !important;
    }
}

@media (hover: none), (pointer: coarse), (max-width: 860px) {
    .story-card,
    .capability-card,
    .service-card,
    .project-card,
    .contact-copy,
    .contact-form-shell,
    .service-card-showcase,
    .project-card-showcase,
    .timeline-card,
    .contact-card,
    .metric-card-3d,
    .stage-mini-card-3d {
        transition: none !important;
        transform: none !important;
        filter: none !important;
        box-shadow: var(--shadow-md);
    }

    .service-card:hover,
    .project-card:hover,
    .contact-copy:hover,
    .contact-form-shell:hover,
    .service-card-showcase:hover,
    .project-card-showcase:hover,
    .story-card:hover,
    .capability-card:hover {
        transform: none !important;
        box-shadow: var(--shadow-md) !important;
        filter: none !important;
    }

    .stack-edge-stars,
    .stack-code-side,
    .hero-audio-bg,
    .music-reactive-layer,
    .cursor-glow {
        display: none !important;
    }
}

/* Performance mode: mobile + touch — fewer paints, no heavy effects */
html.perf-lite .background-orb,
html.perf-lite .background-grid,
html.perf-lite .music-reactive-layer,
html.perf-lite [data-background-youtube],
html.perf-lite .hero-audio-bg,
html.perf-lite .stack-edge-stars,
html.perf-lite .stack-code-side {
    display: none !important;
}

html.perf-lite .site-header,
html.perf-lite .metric-card,
html.perf-lite .story-card,
html.perf-lite .service-card,
html.perf-lite .project-card,
html.perf-lite .contact-card,
html.perf-lite .hero-stage-panel {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html.perf-lite [data-scroll-float] {
    transform: none !important;
    will-change: auto !important;
}

html.perf-lite .stack-macropad {
    animation: none !important;
    filter: none !important;
    transform: none !important;
}

html.perf-lite main section {
    content-visibility: auto;
    contain-intrinsic-size: auto 600px;
}

html.perf-lite img {
    max-width: 100%;
    height: auto;
}

html.perf-lite .project-image {
    max-height: 220px;
    object-fit: cover;
}

html.perf-lite .resume-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html.perf-lite .resume-frame {
    max-height: 480px;
}

html.perf-lite * {
    scroll-behavior: auto !important;
}
