/* ===== Design tokens ===== */
:root {
    --bg: #0F1926;
    --bg-soft: #16222f;
    --text: #e6edf3;
    --text-muted: #8b9bb0;
    --accent: #4fc3f7;
    --accent-hover: #81d4fa;
    --accent-soft: rgba(79, 195, 247, 0.12);
    --border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(22, 34, 47, 0.42);
    --glass-bg-strong: rgba(15, 25, 38, 0.62);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-highlight: rgba(255, 255, 255, 0.22);
    --glass-blur: 24px;
    --glass-shadow:
        0 8px 32px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    --container: 72rem;
    --header-h: 4.5rem;
    --radius: 0.75rem;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --space-2xs: 0.5rem;
    --space-xs: 0.75rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
}

/* ===== Reset & base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    position: relative;
    font-family: 'Saira', sans-serif;
    background:
        radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 28px 28px,
        var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

ul {
    list-style: none;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

[id] {
    scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

/* ===== Ambient watermarks ===== */
.ambient-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.ambient-bg::before,
.ambient-bg::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    pointer-events: none;
}

.ambient-bg::before {
    width: clamp(18rem, 35vw, 28rem);
    height: clamp(18rem, 35vw, 28rem);
    top: 28%;
    right: 8%;
    background: radial-gradient(circle, rgba(79, 195, 247, 0.22) 0%, transparent 70%);
}

.ambient-bg::after {
    width: clamp(14rem, 28vw, 22rem);
    height: clamp(14rem, 28vw, 22rem);
    bottom: 12%;
    right: 18%;
    background: radial-gradient(circle, rgba(129, 212, 250, 0.16) 0%, transparent 70%);
}

.ambient-bg .ambient-glow-contact {
    position: absolute;
    width: clamp(12rem, 24vw, 20rem);
    height: clamp(12rem, 24vw, 20rem);
    bottom: 8%;
    right: 6%;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.35;
    background: radial-gradient(circle, rgba(147, 112, 219, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.watermark {
    position: absolute;
    font-weight: 300;
    font-size: clamp(7rem, 15vw, 13rem);
    line-height: 1;
    letter-spacing: 0.03em;
    color: rgba(79, 195, 247, 0.035);
    white-space: nowrap;
    user-select: none;
}

.watermark-top-right {
    top: clamp(4rem, 8vw, 7rem);
    right: clamp(6rem, 12vw, 11rem);
}

.watermark-bottom-left {
    bottom: clamp(10rem, 16vw, 15rem);
    left: clamp(1rem, 3vw, 2.5rem);
    font-size: clamp(2.5rem, 6vw, 4.75rem);
}

/* ===== Layout utilities ===== */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

.section {
    padding-block: clamp(3rem, 7vw, 5.5rem);
}

.section-inner {
    width: 100%;
}

/* ===== Staggered two-column layout ===== */
:root {
    --hero-min-h: clamp(28rem, 52vh, 36rem);
    --hero-pad: clamp(2rem, 4.5vw, 3.25rem);
    --section-gap: clamp(2.25rem, 5vh, 3.5rem);
    --section-pad: clamp(1.75rem, 3.5vw, 2.75rem);
    --grid-gap: var(--section-gap);
    --stagger: var(--section-gap);
    --work-offset: 0px;
    --about-offset: 0px;
    --contact-offset: 0px;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--grid-gap);
    row-gap: var(--grid-gap);
    padding-block: var(--stagger);
    align-items: start;
}

/* Each section occupies its own row and is 25% wider than its column,
   extending toward the center gap to form a non-overlapping zig-zag. */
.main-grid > .section {
    padding-block: var(--section-pad);
    width: 125%;
}

.main-grid > .hero {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    padding-block: var(--hero-pad);
    min-height: var(--hero-min-h);
    display: flex;
    align-items: center;
}

.main-grid > .work {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
}

.main-grid > .about {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
}

.main-grid > .contact {
    grid-column: 2;
    grid-row: 4;
    justify-self: end;
}

.section-head {
    max-width: 100%;
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.work .section-head {
    text-align: center;
}

.section-index {
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.section-desc {
    margin-top: 0.75rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.25s var(--ease), background 0.25s ease,
        color 0.25s ease, border-color 0.25s ease;
}

.btn-primary {
    background: var(--accent);
    color: #0a1119;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-ghost {
    border-color: var(--border);
    color: var(--text);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    display: flex;
    align-items: center;
    transition: background 0.3s ease, border-color 0.3s ease;
    border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
    background: rgba(15, 25, 38, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header .brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: -1.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-logo {
    height: 3.5rem;
    width: auto;
    max-height: calc(var(--header-h) - 1rem);
}

.brand:hover .brand-logo {
    opacity: 0.85;
}

.nav {
    display: flex;
    gap: 1.75rem;
}

.nav-link {
    position: relative;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.35rem;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease);
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--text);
}

.nav-link.is-active::after {
    transform: scaleX(1);
}

/* ===== Hero ===== */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-inner {
    position: relative;
}

.eyebrow {
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-md);
}

.hero-title {
    max-width: 14ch;
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.hero-lead {
    max-width: 100%;
    margin-top: var(--space-md);
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    color: var(--text-muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-lg);
    justify-content: flex-end;
}

.hero-actions .btn {
    padding: 0.7rem 1.25rem;
    font-size: 0.9rem;
}

.flow-arrow-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-lg);
}

.flow-arrow-wrap-left {
    justify-content: flex-start;
}

.flow-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    color: var(--accent);
    font-size: 1.5rem;
    animation: arrow-blink 1.8s var(--ease) infinite;
    transition: color 0.25s ease;
}

.flow-arrow:hover,
.flow-arrow:focus-visible {
    color: var(--accent-hover);
}

.flow-arrow.is-activated {
    animation: none;
    opacity: 0.3;
}

.flow-arrow.is-activated:hover,
.flow-arrow.is-activated:focus-visible {
    color: var(--accent);
    opacity: 0.3;
}

@keyframes arrow-blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flow-arrow {
        animation: none;
    }
}

/* ===== Text reveal ===== */
.js [data-text-reveal] {
    visibility: hidden;
}

.js [data-text-reveal].is-prepared {
    visibility: visible;
}

.text-reveal-word {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    line-height: 1.05;
}

.text-reveal-inner {
    display: inline-block;
    transform: translateY(115%);
    opacity: 0;
    transition: transform 0.8s var(--ease), opacity 0.6s ease;
    transition-delay: var(--reveal-delay, 0s);
}

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

/* ===== Scroll reveal ===== */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s var(--ease);
    pointer-events: none;
}

.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

/* ===== Glass surfaces ===== */
.glass-surface {
    background:
        linear-gradient(
            168deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(79, 195, 247, 0.05) 28%,
            rgba(15, 25, 38, 0.35) 100%
        ),
        var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass-surface {
        background: var(--glass-bg-strong);
    }

    .contact {
        background: var(--bg-soft);
    }
}

/* ===== Work / Carousel ===== */
.carousel {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
}

.carousel-viewport {
    perspective: 1200px;
    height: clamp(260px, 38vh, 340px);
    width: 100%;
    overflow: visible;
    grid-column: 2;
    grid-row: 1;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.carousel-card {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(22rem, 88%);
    height: calc(100% - 1.25rem);
    border-radius: calc(var(--radius) + 0.35rem);
    overflow: hidden;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.55s var(--ease), filter 0.55s ease, opacity 0.55s ease, box-shadow 0.55s ease;
    will-change: transform, filter;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 16px 40px -20px rgba(0, 0, 0, 0.45);
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}

.carousel-image-right {
    object-position: right center;
}

.carousel-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-md);
    background:
        linear-gradient(
            to top,
            rgba(15, 25, 38, 0.88) 0%,
            rgba(15, 25, 38, 0.4) 38%,
            transparent 68%
        );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.carousel-tag {
    align-self: flex-start;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(79, 195, 247, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(79, 195, 247, 0.25);
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    margin-bottom: var(--space-xs);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.carousel-item-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
}

.carousel-item-desc {
    font-size: 0.82rem;
    margin-top: 0.35rem;
    color: rgba(230, 237, 243, 0.85);
    max-width: 100%;
}

.carousel-card.is-active {
    transform: translate(-50%, -50%) scale(1) translateZ(0);
    filter: none;
    z-index: 3;
    opacity: 1;
    cursor: pointer;
    box-shadow:
        0 0 24px rgba(79, 195, 247, 0.16),
        0 0 48px rgba(79, 195, 247, 0.08),
        0 10px 24px rgba(0, 0, 0, 0.3),
        0 28px 56px -4px rgba(0, 0, 0, 0.48),
        0 48px 96px -20px rgba(0, 0, 0, 0.32);
}

.carousel-card.is-prev {
    transform: translate(-50%, -50%) translateX(-38%) scale(0.85) translateZ(-120px) rotateY(18deg);
    filter: blur(3px);
    z-index: 2;
    opacity: 0.72;
}

.carousel-card.is-next {
    transform: translate(-50%, -50%) translateX(38%) scale(0.85) translateZ(-120px) rotateY(-18deg);
    filter: blur(3px);
    z-index: 2;
    opacity: 0.72;
}

.carousel-card.is-hidden {
    transform: translate(-50%, -50%) scale(0.75) translateZ(-240px);
    filter: blur(5px);
    z-index: 1;
    opacity: 0;
    pointer-events: none;
}

.carousel-card.is-active .carousel-overlay {
    opacity: 1;
}

.carousel-arrow {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: var(--text);
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    grid-row: 1;
}

.carousel-arrow:hover,
.carousel-arrow:focus-visible {
    background: rgba(79, 195, 247, 0.85);
    border-color: rgba(129, 212, 250, 0.6);
    color: #0a1119;
    box-shadow:
        0 4px 16px rgba(79, 195, 247, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.carousel-arrow-prev {
    grid-column: 1;
}

.carousel-arrow-next {
    grid-column: 3;
}

.carousel-arrow[hidden] {
    display: none;
}

/* ===== Counter module (231) ===== */
.counter-module {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
    max-width: 18rem;
    padding-inline: var(--section-pad);
    cursor: pointer;
}

.js .counter-module {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s var(--ease);
}

.counter-module.is-visible {
    opacity: 1;
    transform: none;
}

.counter-label {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: lowercase;
    color: var(--accent);
    opacity: 0.8;
}

.counter-digits {
    display: inline-flex;
    gap: 0.12em;
}

.counter-module:hover .counter-digit,
.counter-module:focus-visible .counter-digit {
    text-shadow:
        0 0 6px rgba(230, 237, 243, 0.35),
        0 0 18px rgba(79, 195, 247, 0.15);
}

.counter-digit {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: clamp(3.2rem, 7.2vw, 5.2rem);
    line-height: 1;
    color: var(--text);
    text-shadow:
        0 0 5px rgba(230, 237, 243, 0.28),
        0 0 14px rgba(230, 237, 243, 0.1);
    min-width: 0.55em;
    text-align: center;
    transition: color 0.45s ease, text-shadow 0.45s ease;
}

.counter-digit.is-dim {
    color: rgba(230, 237, 243, 0.1);
    text-shadow: none;
}

.counter-caption {
    font-size: 0.76rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
    .js .counter-module {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

@media (max-width: 900px) {
    .counter-module {
        grid-column: 1;
        grid-row: auto;
        justify-self: center;
        align-self: auto;
        align-items: center;
        text-align: center;
        max-width: none;
        margin-top: var(--space-lg);
    }

    .down-arrow-watermark {
        display: none;
    }
}

/* ===== Down arrow watermark (about) ===== */
.down-arrow-watermark {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
    align-self: end;
    padding-inline-end: var(--section-pad);
    margin-bottom: calc(var(--grid-gap) * -0.4);
    pointer-events: none;
    user-select: none;
    font-size: clamp(7.5rem, 17vw, 13rem);
    line-height: 1;
    color: rgba(79, 195, 247, 0.045);
    opacity: 0;
    transform: translateY(-1.5rem);
    transition: opacity 0.75s ease, transform 0.75s var(--ease);
}

.down-arrow-watermark.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .down-arrow-watermark {
        transition: none;
        transform: none;
    }
}

/* ===== About ===== */
.about-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: start;
}

.about-text p {
    font-size: 0.98rem;
    color: var(--text-muted);
}

.about-text p + p {
    margin-top: var(--space-sm);
}

.skills-title {
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
}

.skills-list li {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    font-size: 0.85rem;
    color: var(--text);
    transition: border-color 0.25s ease, color 0.25s ease;
}

.skills-list li:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== Contact ===== */
.contact {
    position: relative;
    isolation: isolate;
    overflow: visible;
    border-radius: 1.5rem;
    padding-inline: clamp(1.75rem, 3.5vw, 2.75rem);
    background:
        linear-gradient(
            145deg,
            #151f2d 0%,
            #121c28 55%,
            #0f1926 100%
        );
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.28),
        0 20px 48px rgba(0, 0, 0, 0.38);
    transition: transform 0.55s var(--ease), box-shadow 0.55s ease;
}

.contact:hover {
    transform: scale(1.02);
    box-shadow:
        0 0 24px rgba(79, 195, 247, 0.16),
        0 0 48px rgba(79, 195, 247, 0.08),
        0 10px 24px rgba(0, 0, 0, 0.3),
        0 28px 56px -4px rgba(0, 0, 0, 0.48),
        0 48px 96px -20px rgba(0, 0, 0, 0.32);
}

.contact-inner {
    position: relative;
    z-index: 1;
    text-align: right;
    max-width: 100%;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-height: inherit;
}

.contact-title {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-top: var(--space-xs);
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.28);
}

.contact-lead {
    margin-top: var(--space-xs);
    color: rgba(230, 237, 243, 0.72);
    font-size: 0.98rem;
}

.contact-email {
    width: fit-content;
    display: inline-block;
    margin-top: var(--space-md);
    font-size: clamp(1.05rem, 2.5vw, 1.45rem);
    font-weight: 500;
    color: var(--accent);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.contact-email:hover,
.contact-email:focus-visible {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
}

.social-links {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.contact .social-link {
    background: rgba(15, 25, 38, 0.85);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 1.1rem;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.social-link:hover,
.social-link:focus-visible {
    background: rgba(79, 195, 247, 0.85);
    border-color: rgba(129, 212, 250, 0.6);
    color: #0a1119;
    box-shadow:
        0 6px 20px rgba(79, 195, 247, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transform: translateY(-3px);
}

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid var(--border);
    padding-block: 2rem;
}

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

.footer-copy {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-brand {
    margin-left: 1rem;
}

.footer-logo {
    height: 1.75rem;
    width: auto;
    display: block;
}

.footer-brand:hover .footer-logo {
    opacity: 0.85;
}

/* ===== Accessibility ===== */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

@media (prefers-contrast: high) {
    .social-link,
    .carousel-arrow,
    .skills-list li {
        border-width: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .social-link,
    .carousel-card,
    .carousel-overlay,
    .carousel-arrow,
    .contact,
    .text-reveal-inner,
    .js [data-reveal] {
        transition: none;
    }

    .text-reveal-inner {
        transform: none;
        opacity: 1;
    }

    .js [data-reveal] {
        opacity: 1;
        transform: none;
    }

    .contact:hover {
        transform: none;
    }

    .carousel-card.is-prev,
    .carousel-card.is-next {
        filter: none;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .glass-surface,
    .carousel-arrow,
    .social-link,
    .carousel-tag {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .glass-surface {
        background: var(--glass-bg-strong);
    }

    .contact {
        background: var(--bg-soft);
    }

    .carousel-arrow,
    .social-link {
        background: var(--bg-soft);
    }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        row-gap: var(--section-gap);
        padding-block: var(--section-gap);
    }

    .main-grid > .section {
        width: 100%;
        justify-self: stretch;
        grid-column: 1;
        grid-row: auto;
    }

    .main-grid > .hero {
        min-height: auto;
        padding-block: var(--section-pad);
    }

    .hero-title {
        max-width: 18ch;
        font-size: clamp(2.25rem, 7vw, 3.5rem);
    }

    .hero-lead {
        font-size: clamp(1rem, 1.6vw, 1.15rem);
    }

    .about-body {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .about-body {
        grid-template-columns: 1fr;
    }

    .carousel {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 0.75rem;
    }

    .carousel-viewport {
        height: 320px;
        grid-column: 1;
        grid-row: 1;
    }

    .carousel-card {
        width: min(22rem, 82vw);
        height: 280px;
    }

    .carousel-card.is-prev {
        transform: translate(-50%, -50%) translateX(-30%) scale(0.85) translateZ(-120px) rotateY(18deg);
    }

    .carousel-card.is-next {
        transform: translate(-50%, -50%) translateX(30%) scale(0.85) translateZ(-120px) rotateY(-18deg);
    }

    .carousel-arrow {
        width: 2.5rem;
        height: 2.5rem;
    }

    .carousel-arrow-prev {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
    }

    .carousel-arrow-next {
        grid-column: 1;
        grid-row: 2;
        justify-self: end;
    }
}

@media (max-width: 540px) {
    .nav {
        gap: 1.1rem;
    }

    .hero-actions .btn {
        flex: 1 1 auto;
    }
}
