@import url("https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    font-family: "Geist", -apple-system, BlinkMacSystemFont, sans-serif;
    font-optical-sizing: auto;
    line-height: 1.5;
    color-scheme: dark;
    color: #e9f2fb;
    background-color: var(--backgroundColor);
    --backgroundColor: #060e1c;
    --accentColor: #7aa6d0;
    --accentColorDim: #4d85b6;
    --text-primary: #e9f2fb;
    --text-secondary: #a6c5e4;
    --card-bg: rgba(255, 255, 255, 0.04);
    --border-color: rgba(255, 255, 255, 0.08);
    --cWidth: 94%;
    --cMaxWidth: 1400px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background-color: #060e1c;
}

body.page-loading {
    overflow: hidden;
}

/* —— Page intro: CA lockup, played once. Ice blue instead of the reference red. —— */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 80px 24px;
    overflow: hidden;
    background: #000;
    color: #7aa6d0;
    pointer-events: auto;
}

.page-loader .lockup {
    width: min(100%, 320px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    text-align: center;
}

.page-loader .monogram {
    position: relative;
    margin: 0;
    overflow: hidden;
    font-family: "Antonio", sans-serif;
    font-weight: 700;
    font-size: 341.5px;
    line-height: 1;
    color: #7aa6d0;
}

.page-loader .monogram span,
.page-loader .name {
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 48%, transparent 58%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 48%, transparent 58%, transparent 100%);
    -webkit-mask-size: 300% 100%;
    mask-size: 300% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
}

.page-loader .monogram span {
    position: relative;
    display: block;
    color: #7aa6d0;
    transform-origin: left center;
    animation: caWipe 2.6s cubic-bezier(.45, 0, .15, 1) 0.2s forwards;
}

.page-loader .name {
    width: 100%;
    margin: 0;
    font-family: "Oswald", sans-serif;
    font-weight: 400;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: #7aa6d0;
    transform-origin: left center;
    animation: caWipe 1.8s cubic-bezier(.45, 0, .15, 1) 2.15s forwards;
}

@keyframes caWipe {
    0% {
        -webkit-mask-position: 100% 0;
        mask-position: 100% 0;
    }
    100% {
        -webkit-mask-position: 0% 0;
        mask-position: 0% 0;
    }
}

@media (max-width: 1199px) {
    .page-loader .lockup { max-width: 280px; }
    .page-loader .monogram { font-size: 298.8px; }
    .page-loader .name { font-size: 22px; letter-spacing: 4px; }
}

@media (max-width: 809px) {
    .page-loader { padding: 48px 24px; }
    .page-loader .lockup { max-width: 220px; gap: 24px; }
    .page-loader .monogram { font-size: min(234.8px, 65vw); }
    .page-loader .name { font-size: 18px; letter-spacing: 3px; }
}

@media (prefers-reduced-motion: reduce) {
    .page-loader .monogram span,
    .page-loader .name {
        animation: none;
        clip-path: none;
        -webkit-mask-image: none;
        mask-image: none;
        color: #7aa6d0;
        filter: none;
        opacity: 1;
        transform: none;
    }
}

/* —— 3D background —— */
.scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.scene-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
}
.orb-1 {
    top: -10%;
    left: -10%;
    width: 320px;
    height: 320px;
    background: #4d85b6;
    box-shadow: inset -50px 40px 50px rgba(31, 72, 116, 0.5);
    animation: orbFloat 8s ease-in-out infinite;
}
.orb-2 {
    top: 50%;
    right: -5%;
    width: 280px;
    height: 280px;
    background: #7aa6d0;
    box-shadow: inset -40px 30px 40px rgba(31, 72, 116, 0.4);
    animation: orbFloat 10s ease-in-out infinite 1s;
}
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.05); }
}

/* —— Nav (moncy.dev style) —— */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    backdrop-filter: blur(12px);
    background: rgba(6, 14, 28, 0.6);
    border-bottom: 1px solid var(--border-color);
}

.nav-logo {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-logo:hover { color: var(--accentColor); }

.nav-email {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
}

.nav-email:hover { color: var(--accentColor); }

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-link:hover { color: var(--accentColor); }

.nav-link--cta {
    color: var(--accentColor);
}

@media (max-width: 768px) {
    .nav { padding: 16px 20px; }
    .nav-email { display: none; }
    .nav-links { gap: 20px; }
}

/* —— Vertical social bar (left) —— */
.social-bar {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.social-bar-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    transition: color 0.2s, border-color 0.2s;
}

.social-bar-link:hover {
    color: var(--accentColor);
    border-color: rgba(122, 166, 208, 0.4);
}

@media (max-width: 900px) {
    .social-bar { left: 12px; gap: 12px; }
    .social-bar-link { width: 36px; height: 36px; font-size: 11px; }
}

/* —— Content wrap —— */
.content-wrap {
    position: relative;
    z-index: 2;
    min-height: 100vh;
}

/* —— Scroll reveal (fade + slide up when in view) —— */
.scroll-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.scroll-reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* —— Hero / Landing —— */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 40px 60px;
    position: relative;
}

.hero-inner {
    width: 100%;
    max-width: var(--cMaxWidth);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 40px;
}

/* Intro on the left, robot on the right */
.hero-inner--split {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
    align-items: center;
    gap: 12px 28px;
    width: min(100%, 1180px);
    overflow: visible;
}

.hero-copy {
    position: relative;
    z-index: 2;
    text-align: left;
    padding-left: 72px;
    max-width: 640px;
}

.hero-robot-row {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
}

.hero-kicker {
    margin: 18px 0 0;
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}

.hero-tagline {
    margin: 14px 0 0;
    max-width: 460px;
    text-align: left;
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.5;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.01em;
}

.proof-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 18px 28px;
    width: 100%;
    max-width: 560px;
    margin-top: 28px;
}

.proof-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 120px;
}

.proof-value {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-primary);
}

.proof-label {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.hero-left {
    text-align: right;
}

.hero-greeting {
    font-size: clamp(18px, 2.5vw, 24px);
    color: var(--accentColor);
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.hero-name {
    font-size: clamp(52px, 7.2vw, 96px);
    font-weight: 650;
    line-height: 0.92;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.hero-name-accent {
    color: var(--accentColor);
}

.hero-center {
    position: relative;
    width: clamp(100px, 14vw, 140px);
    height: clamp(110px, 18vh, 160px);
    min-width: 90px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spline robot sits in the right column */
.hero-inner--split .hero-center:has(#hero-3d-anchor[data-spline-scene]),
.hero-center:has(#hero-3d-anchor[data-spline-scene]) {
    width: min(100%, 520px);
    height: min(72vh, 640px);
    min-width: 260px;
    min-height: 420px;
}

.hero-logo-wrap {
    width: 100%;
    height: 100%;
    min-width: 80px;
    min-height: 90px;
    overflow: visible;
    position: relative;
    background: transparent;
    pointer-events: none;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.hero-logo-css {
    display: none;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    animation: none;
}

/* Spline hero: never show the spinning CA fallback */
#hero-3d-anchor[data-spline-scene] .hero-logo-css {
    display: none !important;
    animation: none !important;
}

.hero-logo-css-text {
    font-family: var(--fontFamily), sans-serif;
    font-size: clamp(36px, 10vw, 72px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: #ffffff;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.25),
        0 0 24px rgba(122, 166, 208, 0.35),
        0 -1px 0 rgba(255, 255, 255, 0.6),
        0 0 40px rgba(255, 255, 255, 0.12);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

@keyframes hero-logo-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-logo-wrap canvas,
.hero-spline-canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Wider stage so the arms aren't sliced off, then fade only the left and right
   so there is no hard box. The feet stay solid. */
@media (min-width: 901px) {
    .hero-inner--split .hero-center:has(#hero-3d-anchor[data-spline-scene]) {
        width: min(132%, 700px);
        margin-left: -14%;
        margin-right: -6%;
        overflow: visible;
    }
    #hero-3d-anchor.hero-spline-ready,
    .hero-spline-canvas {
        -webkit-mask-image: linear-gradient(
            90deg,
            transparent 0%,
            #000 7%,
            #000 93%,
            transparent 100%
        );
        mask-image: linear-gradient(
            90deg,
            transparent 0%,
            #000 7%,
            #000 93%,
            transparent 100%
        );
    }
}

/* Pointer events handled globally in spline-hero.js so Look at tracks full viewport */
.hero-spline-canvas {
    pointer-events: none;
}

.hero-right {
    text-align: left;
}

.hero-role {
    display: flex;
    flex-direction: column;
    gap: 0;
    font-size: clamp(28px, 4vw, 52px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-role-dim {
    color: var(--accentColorDim);
    opacity: 0.85;
}

.hero-role-bold {
    color: var(--text-primary);
    margin-left: 8px;
}

.hero-scroll-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: var(--text-secondary);
    text-decoration: none;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

@media (max-width: 900px) {
    .hero-scroll-hint {
        display: none;
    }
    .hero {
        padding: 96px 20px 48px;
        align-items: flex-start;
    }
    .hero-inner,
    .hero-inner--split {
        grid-template-columns: 1fr;
        text-align: left;
        gap: 8px;
    }
    .hero-copy {
        padding-left: 48px;
        order: 2;
    }
    .hero-robot-row {
        order: 1;
        overflow: visible;
        width: 100%;
        max-width: 100vw;
    }
    .hero-center { margin: 0 auto; }
    .hero-tagline,
    .proof-row {
        padding-left: 0;
    }
    .proof-item {
        align-items: flex-start;
    }

    /* Spline: soften the WebGL card so it merges with the starfield */
    .hero-inner--split .hero-center:has(#hero-3d-anchor[data-spline-scene]),
    .hero-center:has(#hero-3d-anchor[data-spline-scene]) {
        width: min(100vw - 32px, 420px);
        height: min(52vh, 460px);
        min-width: 0;
        min-height: 280px;
        max-height: 480px;
        background: transparent;
        box-shadow: none;
    }
    #hero-3d-anchor.hero-spline-ready {
        background: transparent;
        overflow: visible;
        -webkit-mask-image: radial-gradient(
            ellipse 95% 90% at 50% 42%,
            #000 50%,
            rgba(0, 0, 0, 0.65) 72%,
            transparent 100%
        );
        mask-image: radial-gradient(
            ellipse 95% 90% at 50% 42%,
            #000 50%,
            rgba(0, 0, 0, 0.65) 72%,
            transparent 100%
        );
    }
    .hero-spline-canvas {
        background: transparent !important;
    }
    .hero-tagline {
        padding: 0 16px;
    }
    .proof-row {
        padding: 0 12px;
        gap: 16px 20px;
    }
}

@media (max-width: 480px) {
    .hero-center {
        width: min(100px, 32vw);
        height: min(110px, 36vw);
    }
    .hero-center:has(#hero-3d-anchor[data-spline-scene]) {
        width: min(100vw - 24px, 340px);
        height: min(46vh, 360px);
        min-height: 200px;
    }
    .hero-text-row {
        gap: 12px 10px;
        padding: 0 4px;
    }
    .hero-greeting {
        font-size: clamp(13px, 3.2vw, 18px);
        letter-spacing: 1px;
        margin-bottom: 6px;
    }
    .hero-name {
        font-size: clamp(44px, 12vw, 72px);
        letter-spacing: -0.03em;
    }
    .hero-role {
        font-size: clamp(16px, 3.9vw, 28px);
        letter-spacing: 1px;
    }
}

/* —— Section common —— */
.section {
    padding: 80px 40px 100px;
    max-width: var(--cMaxWidth);
    margin: 0 auto;
}

.section-inner {
    width: var(--cWidth);
    max-width: var(--cMaxWidth);
    margin: 0 auto;
}

.section-heading {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accentColor);
    margin-bottom: 32px;
}

.section-kicker {
    margin: -18px 0 28px;
    font-size: 15px;
    color: var(--text-secondary);
}

/* —— About —— */
.about-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 60px;
}

.about-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-3d-placeholder {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* About CA logo block — no circular frame */
.about-ca-visual {
    position: relative;
    overflow: visible;
}

.about-ca-visual.about-3d-placeholder {
    display: block;
}

.about-content .about-text {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 480px;
}

.about-content .about-text a {
    color: var(--accentColor);
    text-decoration: none;
    border-bottom: 1px solid rgba(122, 166, 208, 0.35);
}

.about-content .about-text a:hover {
    color: #cfe0f2;
    border-bottom-color: #cfe0f2;
}

.about-3d-placeholder .about-ca-wrap {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
}

.about-ca-wrap {
    position: relative;
    pointer-events: none;
}

.about-ca-wrap .ca-logo-css-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.about-ca-wrap .ca-logo-css-fallback .hero-logo-css-text {
    font-size: clamp(36px, 12vw, 56px);
}

.about-ca-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

@media (max-width: 900px) {
    .about-inner { grid-template-columns: 1fr; gap: 40px; }
    .about-visual { order: -1; }
}

/* —— What I Do (cards like moncy's DEVELOP/DESIGN) —— */
.what-i-do {
    padding-top: 60px;
}

.what-i-do-inner {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 60px;
    align-items: start;
}

.what-i-do-title {
    position: sticky;
    top: 120px;
}

.what-i-do-what {
    display: block;
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.what-i-do-i-do {
    display: block;
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 600;
    color: var(--accentColor);
    letter-spacing: 2px;
}

.what-i-do-cards {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.do-card-frame {
    padding: 28px 32px;
    border-radius: 4px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.do-card .star-border-container .star-border-inner.do-card-frame {
    border: 1px solid var(--border-color);
    padding: 28px 32px;
}

.do-card:hover .do-card-frame {
    border-color: rgba(122, 166, 208, 0.3);
    box-shadow: 0 0 40px rgba(122, 166, 208, 0.08);
}

.do-card-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.do-card-desc {
    font-size: 14px;
    color: var(--accentColor);
    margin-bottom: 12px;
}

.do-card-text {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-secondary);
}

@media (max-width: 900px) {
    .what-i-do-inner { grid-template-columns: 1fr; gap: 32px; }
    .what-i-do-title { position: static; }
}

/* —— Work / Projects —— */
.work {
    padding-top: 40px;
}

.work-inner .section-heading {
    margin-bottom: 28px;
}

.projects-list-wrap {
    width: 100%;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.projects-featured {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.project-card-wrap--featured {
    height: 100%;
}

.project-card--featured {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    height: 100%;
}

.project-preview {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
}

video.project-preview {
    display: block;
    pointer-events: none;
}

.project-preview--car {
    object-position: 80% 50%;
}

.project-card-row {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.project-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-2px);
    border-color: rgba(122, 166, 208, 0.4);
    box-shadow: 0 8px 32px rgba(122, 166, 208, 0.15);
    background: rgba(122, 166, 208, 0.06);
}

.project-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(19, 31, 58, 0.8);
    padding: 6px;
    flex-shrink: 0;
}

.project-logo--wide {
    width: 118px;
    height: 52px;
    background: #f2f2f2;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.project-content { flex: 1; }

.project-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.project-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.project-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-style: italic;
}

.certificate-link {
    display: inline-block;
    font-size: 13px;
    color: var(--accentColor);
    text-decoration: none;
    margin-top: 4px;
}

.certificate-link:hover { text-decoration: underline; color: #cfe0f2; }

.project-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    transition: transform 0.3s, color 0.3s;
    flex-shrink: 0;
}

.project-link:hover {
    transform: translateX(4px);
    color: var(--accentColor);
}

.link-arrow { font-size: 20px; }

.view-more-wrap {
    width: 100%;
    margin-top: 16px;
}

.view-more-btn {
    width: 100%;
    margin-top: 0;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.view-more-btn:hover {
    background: rgba(122, 166, 208, 0.08);
    border-color: rgba(122, 166, 208, 0.4);
}

/* —— Tech —— */
.tech-section .section-inner {
    max-width: 980px;
}

.stack-stage {
    position: relative;
    margin-top: 4px;
}

.stack-keyboard {
    width: 100%;
    height: clamp(420px, 62vw, 640px);
}

.stack-keyboard canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.stack-key-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 2px 0 8px;
    min-height: 36px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
    pointer-events: none;
}

.stack-key-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
}

.stack-key-mark svg {
    display: block;
    width: 26px;
    height: 26px;
}

.stack-key-mark--word {
    width: auto;
    flex-basis: auto;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: lowercase;
}

.tech-list[hidden] {
    display: none;
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tech-item {
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    backdrop-filter: blur(12px);
    transition: border-color 0.2s, background 0.2s;
}

.tech-item:hover {
    border-color: rgba(122, 166, 208, 0.3);
    background: rgba(122, 166, 208, 0.06);
}

.tech-item-wrap {
    display: inline-block;
    border-radius: 8px;
}

.star-border-inner.tech-item {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 8px;
}

/* —— Contact —— */
.contact-section .section-inner.contact-inner {
    text-align: center;
}

.contact-lead {
    max-width: 440px;
    margin: -12px auto 28px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.contact-link {
    display: block;
    padding: 14px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    backdrop-filter: blur(12px);
}

.contact-link:hover {
    background: rgba(122, 166, 208, 0.08);
    border-color: rgba(122, 166, 208, 0.4);
    transform: translateY(-2px);
}

.contact-link-wrap {
    display: block;
    text-decoration: none;
    color: inherit;
}

.star-border-inner.contact-link {
    display: block;
    text-align: center;
    padding: 14px 20px;
}

/* —— Footer with centered Resume CTA —— */
.site-footer {
    padding: 48px 24px 60px;
    text-align: center;
}

.footer-resume-wrap {
    display: inline-block;
}

.footer-resume-wrap.star-border-container {
    padding: 1px 0;
}

.star-border-inner.resume-cta {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid #222;
    background: var(--card-bg);
    transition: border-color 0.2s, color 0.2s;
}

.star-border-inner.resume-cta:hover {
    border-color: rgba(122, 166, 208, 0.4);
    color: var(--accentColor);
}

.resume-cta-arrow { font-size: 12px; }

/* —— Resume modal (fixed overlay) —— */
.resume-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.resume-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.resume-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
}

.resume-modal-box {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: min(90vh, 920px);
    background: var(--backgroundColor);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.resume-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.resume-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.resume-modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.resume-modal-download {
    padding: 8px 16px;
    background: var(--accentColor);
    color: #050b16;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.resume-modal-download:hover {
    background: #eaf2fb;
    color: #050b16;
}

.resume-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.resume-modal-close:hover {
    color: var(--text-primary);
    border-color: rgba(122, 166, 208, 0.4);
}

.resume-modal-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #10182a;
    padding: 12px;
}

.resume-page {
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
    border-radius: 6px;
}

.resume-status {
    margin: 24px 8px;
    color: var(--text-secondary);
    font-size: 15px;
}

/* —— StarBorder: thin glowing layer (reference-style) —— */
.star-border-container {
    display: inline-block;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    padding: 1px 0;
    --star-color: var(--accentColor);
    --star-speed: 6s;
}

/* Only a thin slice of the orb is visible: orbs sit mostly outside, tight gradient */
.star-border-container .border-gradient-bottom {
    position: absolute;
    width: 300%;
    height: 50%;
    opacity: 0.6;
    bottom: -48%;
    right: -250%;
    border-radius: 50%;
    animation: star-movement-bottom linear infinite alternate;
    z-index: 0;
    background: radial-gradient(circle, var(--star-color) 0%, var(--star-color) 4%, transparent 8%);
    animation-duration: var(--star-speed);
}

.star-border-container .border-gradient-top {
    position: absolute;
    opacity: 0.6;
    width: 300%;
    height: 50%;
    top: -48%;
    left: -250%;
    border-radius: 50%;
    animation: star-movement-top linear infinite alternate;
    z-index: 0;
    background: radial-gradient(circle, var(--star-color) 0%, var(--star-color) 4%, transparent 8%);
    animation-duration: var(--star-speed);
}

.star-border-container .star-border-inner {
    position: relative;
    border: 1px solid #222;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 16px;
    padding: 16px 26px;
    border-radius: 20px;
    z-index: 1;
}

@keyframes star-movement-bottom {
    0% { transform: translate(0%, 0%); opacity: 0.8; }
    100% { transform: translate(-100%, 0%); opacity: 0.2; }
}

@keyframes star-movement-top {
    0% { transform: translate(0%, 0%); opacity: 0.8; }
    100% { transform: translate(100%, 0%); opacity: 0.2; }
}

.project-card-wrap {
    width: 100%;
}

.star-border-inner.project-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
    font-size: inherit;
}

.star-border-inner.project-card--featured {
    flex-direction: column;
    align-items: stretch;
}

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

@media (max-width: 480px) {
    .section { padding: 50px 20px 70px; }
    .nav-links { gap: 16px; }
}
