:root {
    --bg: #f5f5f7;
    --ink: #000000;
    --muted: #6e6e73;
    --grid: rgba(0, 0, 0, 0.05);
    --line: rgba(0, 0, 0, 0.1);
    --chip: #ffffff;
    --violet: #8e44ad;
    --accent: #ff4757;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background-color: var(--bg);
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    cursor: none;
    user-select: none;
    /* Prevent text selection */
    -webkit-user-select: none;
}

.scene {
    position: relative;
    min-height: 100svh;
    height: 330vh;
    /* Reduced for tighter flow */
    width: 100%;
    padding: 1rem;
    isolation: isolate;
    perspective: 1000px;
}

.meta,
.collab,
.hero,
.hero-copy,
.tag,
.cta,
.scroll-hint,
.section {
    position: absolute;
    margin: 0;
    will-change: transform, opacity;
}

.meta {
    left: 2rem;
    top: 2rem;
}

.meta p {
    margin: 0;
    font-size: clamp(.72rem, .72vw, .82rem);
    line-height: 1.4;
    color: var(--muted);
    letter-spacing: -.01em;
}

.collab {
    right: 2rem;
    top: 2rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: white;
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.collab::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #2ecc71;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}

.hero {
    left: 12.5%;
    top: 15vh;
    width: 75vw;
}

.hero-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5rem;
    width: 100%;
}

.name {
    margin: 0;
    font-size: clamp(3.5rem, 9vw, 10rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

.name .line {
    display: block;
}

/* ── Hero Text Column ── */
.hero-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}


/* Aurora Name Effect — full-width block, aurora clipped inside */
.aurora-name {
    position: relative;
    overflow: hidden;
    background: transparent;
    color: var(--ink);
    display: inline-block;
    /* full width */
    white-space: nowrap;
    /* RIAZUL I. on one line */
    padding: 0.04em 0.1em;
    line-height: 0.95;
    border-radius: 0;
}

/* Description below name */
.hero-desc {
    margin: 0;
    font-size: clamp(1.05rem, 1.5vw, 1.5rem);
    line-height: 1.6;
    color: #4b5263;
    font-weight: 400;
    max-width: 50ch;
    letter-spacing: -0.01em;
}

.aurora {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    mix-blend-mode: lighten;
    /* KEY: enlightens dark (black) letters with aurora color, invisible on light bg */
    pointer-events: none;
}

.aurora__item {
    overflow: hidden;
    position: absolute;
    width: 60vw;
    height: 60vw;
    background-color: #00c2ff;
    border-radius: 37% 29% 27% 27% / 28% 25% 41% 37%;
    filter: blur(1.5rem);
    mix-blend-mode: normal;
    opacity: 0.92;
}

.aurora__item:nth-of-type(1) {
    top: -50%;
    animation: aurora-border 6s ease-in-out infinite, aurora-1 12s ease-in-out infinite alternate;
}

.aurora__item:nth-of-type(2) {
    background-color: #ffc640;
    right: 0;
    top: 0;
    animation: aurora-border 6s ease-in-out infinite, aurora-2 12s ease-in-out infinite alternate;
}

.aurora__item:nth-of-type(3) {
    background-color: #33ff8c;
    left: 0;
    bottom: 0;
    animation: aurora-border 6s ease-in-out infinite, aurora-3 8s ease-in-out infinite alternate;
}

.aurora__item:nth-of-type(4) {
    background-color: #e54cff;
    right: 0;
    bottom: -50%;
    animation: aurora-border 6s ease-in-out infinite, aurora-4 24s ease-in-out infinite alternate;
}

@keyframes aurora-1 {
    0% {
        top: 0;
        right: 0;
    }

    50% {
        top: 100%;
        right: 75%;
    }

    75% {
        top: 100%;
        right: 25%;
    }

    100% {
        top: 0;
        right: 0;
    }
}

@keyframes aurora-2 {
    0% {
        top: -50%;
        left: 0%;
    }

    60% {
        top: 100%;
        left: 75%;
    }

    85% {
        top: 100%;
        left: 25%;
    }

    100% {
        top: -50%;
        left: 0%;
    }
}

@keyframes aurora-3 {
    0% {
        bottom: 0;
        left: 0;
    }

    40% {
        bottom: 100%;
        left: 75%;
    }

    65% {
        bottom: 40%;
        left: 50%;
    }

    100% {
        bottom: 0;
        left: 0;
    }
}

@keyframes aurora-4 {
    0% {
        bottom: -50%;
        right: 0;
    }

    50% {
        bottom: 0%;
        right: 40%;
    }

    90% {
        bottom: 50%;
        right: 25%;
    }

    100% {
        bottom: -50%;
        right: 0;
    }
}

@keyframes aurora-border {
    0% {
        border-radius: 37% 29% 27% 27% / 28% 25% 41% 37%;
    }

    25% {
        border-radius: 47% 29% 39% 49% / 61% 19% 66% 26%;
    }

    50% {
        border-radius: 57% 23% 47% 72% / 63% 17% 66% 33%;
    }

    75% {
        border-radius: 28% 49% 29% 100% / 93% 20% 64% 25%;
    }

    100% {
        border-radius: 37% 29% 27% 27% / 28% 25% 41% 37%;
    }
}

/* ── Cursor-following Black Aurora ── */
.cursor-aurora {
    position: fixed;
    pointer-events: none;
    z-index: 9990;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(15, 27, 71, 0.18) 0%,
            rgba(40, 20, 80, 0.12) 35%,
            transparent 70%);
    transform: translate(-50%, -50%);
    mix-blend-mode: multiply;
    filter: blur(30px);
    transition: width 0.4s ease, height 0.4s ease;
    will-change: transform;
}

.hero-image-wrapper {
    position: relative;
    width: 320px;
    height: 420px;
    flex-shrink: 0;
    perspective: 2000px;
}

.hero-image-mask {
    width: 100%;
    height: 100%;
    overflow: hidden;
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
    background: #e2e4eb;
    position: relative;
    z-index: 2;
    transform: rotateY(-8deg) rotateX(4deg);
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.1);
    transition: filter 0.8s cubic-bezier(0.23, 1, 0.32, 1), transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.hero-image-wrapper:hover .hero-image-mask {
    transform: rotateY(0) rotateX(0);
}

.hero-image-wrapper:hover .hero-img {
    filter: grayscale(0%) contrast(1);
    transform: scale(1.1);
}

.hero-image-border {
    position: absolute;
    inset: -15px;
    border: 1px solid var(--line);
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
    pointer-events: none;
    z-index: 1;
}

.hero-image-wrapper::before {
    content: "RI-2026 / SYS_IMG_01";
    position: absolute;
    top: -30px;
    right: 0;
    font-size: 9px;
    font-family: monospace;
    color: var(--muted);
    letter-spacing: 0.15em;
    font-weight: 700;
}

.hero-image-wrapper::after {
    content: "";
    position: absolute;
    bottom: -25px;
    left: -20px;
    width: 60px;
    height: 1px;
    background: var(--violet);
}

.title {
    margin: 1.12rem 0 0;
    font-size: clamp(.92rem, .98vw, 1.08rem);
    line-height: 1.45;
    color: var(--muted);
}

.hero-copy {
    left: 58.5%;
    top: 13.4vh;
    width: min(33ch, 30vw);
}

.hero-copy p {
    margin: 0;
    font-size: clamp(1.12rem, 2.22vw, 2.1rem);
    line-height: 1.28;
    letter-spacing: -.025em;
    color: #3f4553;
}

.tag {
    left: 71%;
    top: 35.5vh;
    border: 0;
    border-radius: 999px;
    background: var(--violet);
    color: #efeeff;
    font-size: clamp(.72rem, .76vw, .84rem);
    font-weight: 600;
    padding: .2rem .7rem .26rem;
    box-shadow: 0 6px 15px rgba(110, 99, 237, .28);
}

/* ── CTA Button with Black Aurora ── */
.cta {
    left: 50%;
    top: 77.4vh;
    transform: translateX(-50%);
    border: 0;
    border-radius: 999px;
    background: #0f1b47;
    color: #f3f5fa;
    font-size: clamp(1.02rem, 1.14vw, 1.25rem);
    font-weight: 500;
    letter-spacing: -.018em;
    padding: .95rem 1.72rem 1.03rem;
    box-shadow: 0 7px 16px rgba(16, 27, 71, .24);
    position: absolute;
    /* keeps the scene positioning */
    overflow: hidden;
    /* clips the aurora inside */
}

.aurora-pill {
    position: relative;
    overflow: hidden;
    display: inline-block;
    isolation: isolate;
}

.aurora-pill-text {
    position: relative;
    z-index: 2;
    display: inline-block;
    background-image:
        radial-gradient(circle at 15% 25%, #2a4cdc 0%, transparent 42%),
        radial-gradient(circle at 85% 30%, #5b1ba0 0%, transparent 45%),
        radial-gradient(circle at 40% 85%, #0f3460 0%, transparent 45%),
        linear-gradient(110deg, #0f1b47 0%, #2a4cdc 28%, #5b1ba0 52%, #0f3460 78%, #0f1b47 100%);
    background-size: 180% 180%, 180% 180%, 180% 180%, 220% 220%;
    background-position: 0% 50%, 100% 40%, 50% 100%, 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: text-aurora-shift 9s ease-in-out infinite;
}

.aurora-pill .btn-aurora {
    display: none;
}

@keyframes text-aurora-shift {
    0% {
        background-position: 0% 50%, 100% 40%, 50% 100%, 0% 50%;
    }

    50% {
        background-position: 100% 55%, 0% 45%, 60% 0%, 100% 50%;
    }

    100% {
        background-position: 0% 50%, 100% 40%, 50% 100%, 0% 50%;
    }
}

.btn-aurora {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    mix-blend-mode: screen;
    /* screen on dark bg = lighter aurora */
    overflow: hidden;
}

.btn-aurora__item {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 37% 29% 27% 27% / 28% 25% 41% 37%;
    filter: blur(20px);
    opacity: 0.55;
    mix-blend-mode: normal;
}

.btn-aurora__item:nth-of-type(1) {
    background-color: #2a4cdc;
    top: -60%;
    left: -20%;
    animation: aurora-border 6s ease-in-out infinite, aurora-btn-1 8s ease-in-out infinite alternate;
}

.btn-aurora__item:nth-of-type(2) {
    background-color: #5b1ba0;
    right: -20%;
    top: -40%;
    animation: aurora-border 6s ease-in-out infinite, aurora-btn-2 10s ease-in-out infinite alternate;
}

.btn-aurora__item:nth-of-type(3) {
    background-color: #0f3460;
    left: 20%;
    bottom: -60%;
    animation: aurora-border 6s ease-in-out infinite, aurora-btn-3 7s ease-in-out infinite alternate;
}

@keyframes aurora-btn-1 {
    0% {
        top: -60%;
        left: -20%;
    }

    50% {
        top: 20%;
        left: 60%;
    }

    100% {
        top: -60%;
        left: -20%;
    }
}

@keyframes aurora-btn-2 {
    0% {
        right: -20%;
        top: -40%;
    }

    50% {
        right: 50%;
        top: 30%;
    }

    100% {
        right: -20%;
        top: -40%;
    }
}

@keyframes aurora-btn-3 {
    0% {
        left: 20%;
        bottom: -60%;
    }

    50% {
        left: 70%;
        bottom: 20%;
    }

    100% {
        left: 20%;
        bottom: -60%;
    }
}

.scroll-hint {
    left: 50%;
    top: calc(77.4vh + 4.2rem);
    transform: translateX(-50%);
    color: #6d7380;
    font-size: clamp(.82rem, .85vw, .95rem);
}

.section {
    left: 12.5%;
    width: 75%;
}

.about {
    top: 85vh;
    /* Reduced spacing */
}

.about>p:not(.section-index) {
    width: 100% !important;
    max-width: none !important;
}

.skills {
    top: 130vh;
    /* Reduced spacing */
}

.work {
    top: 200vh;
    /* Reduced spacing */
}

.contact {
    top: 280vh;
    /* Reduced spacing */
    padding-top: 4rem;
    padding-bottom: 50px;
}

.section-index {
    margin: 0 0 1rem;
    color: #717785;
    font-size: clamp(.68rem, .71vw, .78rem);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.section h2 {
    margin: 0;
    font-size: clamp(2.2rem, 5.1vw, 5rem);
    font-weight: 400;
    line-height: .95;
    letter-spacing: -.05em;
}

.section>p:not(.section-index) {
    margin: 1.3rem 0 0;
    max-width: 62ch;
    font-size: clamp(1.01rem, 1.15vw, 1.28rem);
    line-height: 1.57;
    letter-spacing: -.015em;
    color: #3f4553;
}

.skills-grid {
    position: relative;
    margin-top: 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-block {
    width: 100%;
    position: relative;
    border: 1px dashed var(--line);
    border-radius: 0;
    padding: 2.2rem;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Centered */
    text-align: center;
    /* Centered */
    justify-content: flex-start;
    transition:
        border-color 0.4s ease,
        transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.4s ease;
    transform-style: preserve-3d;
}

.skill-icon-container {
    width: 60px;
    height: 60px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
}

.skill-icon {
    width: 100%;
    height: 100%;
}

.skill-block:hover {
    border-color: var(--violet);
    box-shadow: 0 20px 40px rgba(142, 68, 173, 0.1);
    z-index: 100 !important;
}

.skill-block:hover .handle {
    background: var(--violet) !important;
    border-color: var(--violet) !important;
}

.skill-block:hover .skill-icon-container {
    color: var(--violet);
}

.skill-block h3 {
    margin: 0;
    font-size: clamp(1.1rem, 1.3vw, 1.4rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: none;
    /* Match image case */
}

.skill-block p {
    margin: 1rem 0 0;
    font-size: clamp(0.9rem, 1vw, 1.05rem);
    line-height: 1.5;
    color: var(--muted);
}

.work-table {
    position: relative;
    margin-top: 3rem;
    border-top: 1px solid var(--line);
}

.work-row {
    position: relative;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 180px 1fr 100px;
    gap: 3rem;
    align-items: baseline;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.work-row:hover {
    background-color: rgba(0, 0, 0, 0.015);
}

.work-kind {
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.work-row h3 {
    margin: 0;
    font-size: clamp(1.6rem, 3.5vw, 3.2rem);
    line-height: 1;
    letter-spacing: -0.04em;
    font-weight: 700;
}

.work-desc {
    margin: 0.8rem 0 0;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.5;
    color: var(--muted);
    max-width: 55ch;
}

.work-row a {
    justify-self: end;
    display: inline-block;
    text-decoration: none;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1.5px solid var(--ink);
    padding-bottom: 2px;
}

.work-meta {
    margin-top: 0.6rem;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Contact Upgrades */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
    align-items: flex-end;
}

.contact-info p {
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--muted);
    max-width: 30ch;
    margin: 0;
}

.email-link {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.03em;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-end;
}

.social-link {
    width: 60px;
    height: 60px;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    transition: all 0.3s ease;
    background: white;
}

.social-link:hover {
    background: var(--ink);
    color: white;
    transform: translateY(-5px);
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .social-links {
        justify-content: flex-start;
    }
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    pointer-events: none;
    z-index: 10005;
    /* Above everything */
    display: flex;
    align-items: center;
    gap: 8px;
    mix-blend-mode: difference;
    color: white;
}

.cursor-arrow {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid currentColor;
    transform: rotate(45deg);
}

.cursor-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: currentColor;
    color: black;
    padding: 1px 4px;
    border-radius: 2px;
}

/* Blueprint Styles Handles */
.skill-block .handle {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    border: 1px solid var(--line);
    z-index: 2;
    transition: all 0.3s ease;
}

.skill-block::before,
.skill-block::after,
.skill-block .handle-tl,
.skill-block .handle-tr,
.skill-block .handle-bl,
.skill-block .handle-br {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    border: 1px solid var(--line);
    z-index: 2;
}

.skill-block .handle-tl {
    top: -3px;
    left: -3px;
}

.skill-block .handle-tr {
    top: -3px;
    right: -3px;
}

.skill-block .handle-bl {
    bottom: -3px;
    left: -3px;
}

.skill-block .handle-br {
    bottom: -3px;
    right: -3px;
}

[data-reveal] {
    opacity: 0;
}

/* Creative Enhancements */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3%3Ffilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
}

.menu-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    background: white;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-toggle .line {
    width: 20px;
    height: 1.5px;
    background: var(--ink);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-toggle.is-active .line:first-child {
    transform: translateY(4px) rotate(45deg);
}

.menu-toggle.is-active .line:last-child {
    transform: translateY(-4px) rotate(-45deg);
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: #f5f5f7;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.menu-links {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
    position: relative;
    z-index: 10002;
}

.menu-link {
    font-size: clamp(3rem, 8vw, 6.5rem);
    font-weight: 800;
    text-decoration: none;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: -0.04em;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(30px);
}

.menu-overlay.is-active .menu-link {
    opacity: 1;
    transform: translateY(0);
}

.menu-overlay.is-active .menu-link:nth-child(1) {
    transition-delay: 0.1s;
}

.menu-overlay.is-active .menu-link:nth-child(2) {
    transition-delay: 0.2s;
}

.menu-overlay.is-active .menu-link:nth-child(3) {
    transition-delay: 0.3s;
}

.menu-overlay.is-active .menu-link:nth-child(4) {
    transition-delay: 0.4s;
}

.menu-link::before {
    content: attr(data-index);
    position: absolute;
    left: -2.5rem;
    top: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--muted);
}

.menu-link:hover {
    transform: translateX(20px);
    color: var(--violet);
}

.grid-toggle {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    background: white;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
    color: var(--muted);
    transition: all 0.3s ease;
}

.grid-toggle.is-active {
    background: var(--ink);
    color: white;
}

body.hide-grid {
    background-image: none !important;
}

.magnetic {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}


@media (max-width: 1024px) {
    .scene {
        height: auto;
        min-height: 100vh;
        padding: 4rem 1.5rem 6rem;
        display: flex;
        flex-direction: column;
        gap: 5rem;
    }

    /* Robustly unset absolute positioning for mobile flow */
    .meta,
    .hero,
    .hero-copy,
    .cta,
    .scroll-hint,
    .section,
    .tag,
    .skill-block {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        transform: none !important;
        margin: 0 !important;
        opacity: 1 !important;
    }

    /* ── Hero Mobile Fix ── */
    .hero {
        margin-top: 2rem !important;
        order: 1;
    }

    .hero-main {
        flex-direction: column;
        /* stack text then image */
        align-items: flex-start;
        gap: 2.5rem;
    }

    .hero-text {
        width: 100% !important;
        gap: 1.2rem;
    }

    .hero-image-wrapper {
        display: none;
        /* hide image on mobile — avoids overflow */
    }

    .aurora-name {
        white-space: normal;
        /* allow wrapping on small screens */
    }

    .name {
        font-size: clamp(3rem, 18vw, 6rem);
    }

    .hero-desc {
        font-size: clamp(1rem, 4.5vw, 1.3rem);
        max-width: 100%;
    }

    .hero-copy {
        order: 2;
        margin-top: 1.5rem !important;
    }

    .hero-copy p {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
        line-height: 1.3;
        color: var(--ink);
    }

    .cta {
        order: 3;
        width: fit-content !important;
        margin: 3rem auto 0 !important;
        display: block;
    }

    .scroll-hint {
        order: 4;
        margin: 1.5rem auto 0 !important;
        text-align: center;
    }

    /* Section Handling */
    .about {
        order: 5;
    }

    .skills {
        order: 6;
    }

    .work {
        order: 7;
    }

    .contact {
        order: 8;
    }

    .skills-grid {
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 2rem;
        margin-top: 2rem;
    }

    .skill-block {
        border: 1px dashed var(--line);
        padding: 2rem;
        background: white;
    }

    .work-table {
        margin-top: 2rem;
    }

    .work-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem 0;
    }

    .work-row h3 {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
    }

    .work-row a {
        justify-self: start;
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    body {
        cursor: auto !important;
        background-size: 20px 20px;
        /* Denser grid for mobile */
    }

    .custom-cursor {
        display: none !important;
    }

    .meta {
        font-size: 0.8rem;
    }
}

/* Back to Top */
.back-to-top {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    width: 48px;
    height: 48px;
    background: #0f1b47;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 999;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--violet);
    transform: translateY(-5px);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 40, 0.55);
    /* darker backdrop so white modal pops */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 10000;
    padding: 1.5rem;
}

.modal.is-active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background:
        radial-gradient(circle at 12% 10%, rgba(110, 99, 237, 0.14), transparent 36%),
        radial-gradient(circle at 90% 18%, rgba(42, 76, 220, 0.12), transparent 32%),
        #ffffff;
    backdrop-filter: none;
    width: 100%;
    max-width: 540px;
    padding: 2.4rem;
    position: relative;
    transform: translateY(40px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 32px;
    /* Soft glow around the modal edges */
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.25),
        0 0 40px 8px rgba(255, 255, 255, 0.2),
        0 60px 120px rgba(0, 0, 0, 0.25);
}

.modal-content::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 24px;
    border: 1px dashed rgba(110, 99, 237, 0.28);
    pointer-events: none;
}

.modal.is-active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--muted);
    line-height: 1;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--ink);
}

.modal-header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(120deg, #0f1b47, #2a4cdc 45%, #5b1ba0 75%, #0f1b47);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.modal-header p {
    margin: 0.5rem 0 2.5rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.contact-form {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: grid;
    gap: 0.55rem;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 14px;
    font-family: inherit;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.78);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 4px rgba(110, 99, 237, 0.14);
    transform: translateY(-1px);
    background: #fff;
}

.submit-btn {
    margin-top: 1rem;
    padding: 0.95rem 1.5rem;
    background: linear-gradient(130deg, #0f1b47 0%, #2a4cdc 50%, #5b1ba0 100%);
    color: white;
    border: 1px solid rgba(15, 27, 71, 0.2);
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.45) 48%, transparent 75%);
    transform: translateX(-130%);
    transition: transform 0.7s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(42, 76, 220, 0.24);
}

.submit-btn:hover::before {
    transform: translateX(130%);
}

.submit-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}