/* ---------- Reset & base (dark-only) ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg: #0b1020;
    /* dark base */
    --surface: #11162a;
    /* card base */
    --muted: #cbd5e1;
    /* text secondary */
    --text: #e6edf6;
    /* text primary */
    --accent: #22d3ee;
    /* cyan 400 */
    --accent-2: #a855f7;
    /* violet 500 */
    --ring: rgba(56, 189, 248, 0.45);
    --card-glass: color-mix(in oklab, #0b1020 80%, white 20%);
    --shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
    --radius: 16px;
    --maxw: 1100px;
    /* responsive glow sizes */
    --spot-w: clamp(48rem, 42vw, 90rem);
    --spot-h: clamp(72rem, 78vh, 120rem);
    /* timeline layout tokens */
    --label-w: 3.8rem;
    /* width of the year column */
    --label-gap: .35rem;
    /* gap between year and line */
    --line-gap: 1rem;
    /* gap between year column and the vertical line */
    --dot: 14px;
    /* dot size */
    --content-indent: calc(var(--line-gap) + var(--dot));
    /* space for line+dot */
    --gutter-left: calc(var(--label-w) + var(--label-gap));
    /* start of line area */
    /* media heigh for thumbs */
    --thumb-h: 220px;
    --thumb-radius: 16px;
}

html {
    scroll-behavior: smooth;
}

#network-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Places it behind the text/content */
    pointer-events: none; /* Ensures you can still click links on the page */
    opacity: 0.5; /* Keeps it subtle so text remains readable */
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji';
    /* Layered gradients */
    background: radial-gradient(var(--spot-w) var(--spot-h) at -12% 50%, rgba(56, 189, 248, 0.14), transparent 100%),
        radial-gradient(var(--spot-w) var(--spot-h) at 112% 50%, rgba(139, 92, 246, 0.14), transparent 100%),
        linear-gradient(160deg, rgba(56, 189, 248, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%),
        var(--bg);
    color: var(--text);
    position: relative;
    background-attachment: fixed, fixed, fixed, scroll;
    background-size: auto, auto, 220% 220%, auto;
    background-position: -10% 50%, 110% 50%, 50% 50%, 0 0;
    animation: bg-pan 38s ease-in-out infinite alternate;
}

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

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

.container {
    width: min(100% - 2rem, var(--maxw));
    margin: 0 auto;
}

/* ---------- Background Bands ---------- */
.band {
    position: relative;
    background: rgba(189, 223, 240, 1);
    /* your requested color */
    width: 100vw;
    /* full-bleed background */
    margin-left: 50%;
    /* trick to escape container limits */
    transform: translateX(-50%);
    padding: 3.2rem 0;
    /* consistent vertical spacing */
    border: none;
    color: #000;
    /* all text inside band is black */
}

.band .h2 {
    color: #000;
    /* pure black title */
}

.band .muted {
    color: #111;
    /* optional: darker muted text for better contrast */
}

.band p {
    color: #222;
}

.band .chip {
    color: #fff;
    background: rgb(5, 39, 117);
    border: 1px solid rgba(0, 0, 0, 0.15);
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease;
}

.band .container {
    position: relative;
    z-index: 1;
}

/* ---------- Top Nav ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(10px);
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* home left, links right */
    padding: .75rem 0;
}

.home-link {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.home-link:hover {
    color: var(--accent);
}

.nav a {
    opacity: .9;
}

.nav a:hover {
    opacity: 1;
}

.links {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    /* ensures right alignment */
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .9rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
    background: linear-gradient(180deg, color-mix(in oklab, var(--surface), white 2%), color-mix(in oklab, var(--surface), black 2%));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 6px 18px rgba(2, 6, 23, 0.15);
}

.btn.primary {
    background:
        linear-gradient(135deg, var(--accent), var(--accent-2)) padding-box,
        linear-gradient(135deg,
            color-mix(in srgb, var(--accent) 60%, transparent),
            color-mix(in srgb, var(--accent-2) 60%, transparent)) border-box;
    border: 1px solid transparent;
    /* use the second gradient as the border */
    color: #fff;

    /* keep from your original */
    background-repeat: no-repeat;
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 6px 18px rgba(2, 6, 23, .25);

    /* NEW: add transitions here */
    transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

/* hover animation */
.btn.primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow:
        0 8px 20px rgba(56, 189, 248, 0.3),
        0 0 10px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* tap/click */
.btn.primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(56, 189, 248, 0.25);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    /* left copy / right identity */
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

/* LEFT column: headline + copy + CTAs */
.hero-title {
    margin: 0 0 1rem;
    font-weight: 800;
    line-height: .95;
    letter-spacing: -.5px;
    font-size: clamp(2.6rem, 6.8vw, 4.8rem);
    /* big + responsive */
    max-width: 16ch;
}

.hero-subtitle {
    color: var(--muted);
    font-size: clamp(1rem, 1.2vw + .6rem, 1.2rem);
    max-width: 65ch;
    margin: 0 0 1.6rem;
}

.hero .cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    /* left-aligned CTAs */
    margin-bottom: 2rem;
}

/* RIGHT column: photo + identity + stat counters */

.hero-aside {
    text-align: center;
    /* centers text */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* centers the photo + stats horizontally */
    justify-content: center;
}

.hero-aside .photo-wrap {
    margin-bottom: 1.25rem;
}

.photo-wrap {
    width: clamp(180px, 22vw, 280px);
    height: clamp(180px, 22vw, 280px);
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.hero-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--accent);
    box-shadow: var(--shadow);
}

.identity-name {
    text-align: center;
    margin: 0.5rem 0 0.25rem;
    font-weight: 800;
    letter-spacing: -.3px;
    line-height: 1.05;
    font-size: clamp(1.8rem, 3vw, 3rem);
}

.identity-role {
    text-align: center;
    margin: .25rem 0 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--muted);
    font-size: 1rem;
}

/* Place your existing stat cards under the identity block */
.hero .stats {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    /* two pills on the right */
    gap: 1rem;
    margin-top: .75rem;
}

/* Remove any leftover center alignment from older rules */
.hero h1,
.hero h2 {
    text-align: left;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .9rem;
    margin-top: 1rem;
    position: relative;
    isolation: isolate;
}

.stat {
    padding: 1rem;
    border-radius: 14px;
    background: linear-gradient(180deg,
            color-mix(in oklab, var(--surface), white 3%),
            color-mix(in oklab, var(--surface), black 4%));
    border: 1px solid color-mix(in srgb, var(--muted) 18%, transparent);
    text-align: center;
    position: relative;
    isolation: isolate;
}

.stat .num {
    font-size: 2rem;
    font-weight: 800;
}

.stat .lbl {
    font-size: 1.2rem;
    color: var(--muted);
}

@keyframes stat-pop {
    0% {
        transform: scale(1)
    }

    60% {
        transform: scale(1.06)
    }

    100% {
        transform: scale(1)
    }
}

.stat .num[data-animated="1"] {
    animation: stat-pop .35s ease-out;
}

/* Gradient border sweep layer */
.stat::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    padding: 1.5px;
    /* border thickness */
    background-size: 200% 100%;
    background-position: 0% 0;
    /* start on the left */
    -webkit-mask: linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    /* hidden initially -> will fade in */
}

.stats .stat:nth-child(1)::after {
    background-image: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.stats .stat:nth-child(2)::after {
    background-image: linear-gradient(90deg, var(--accent-2), var(--accent));
}

@keyframes stat-border-appear {
    0% {
        opacity: 0;
        background-position: 0% 0;
    }

    15% {
        opacity: .95;
        background-position: 10% 0;
    }

    100% {
        opacity: .95;
        background-position: 100% 0;
    }
}

.stat.is-animating::after {
    animation: stat-border-appear 5s ease-out forwards;
}

.stat:has(.num:hover)::after {
    animation: stat-border-appear 850ms cubic-bezier(.2, .8, .2, 1) forwards;
}

.stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 25%, transparent),
        0 8px 28px rgba(2, 6, 23, .55);
    border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 900px) {

    .nav-inner {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.5rem 0;
    }

    /* Slightly smaller "HOME" so it doesn't dominate */
    .home-link {
        font-size: 1.1rem;
    }

    /* Center the nav links and let them wrap neatly */
    .links {
        justify-content: center;
        flex-wrap: wrap;
        row-gap: 0.25rem;
    }

    /* Make the Contact button a bit more compact on mobile */
    .links .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .hero-grid {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    /* show photo + identity + stats first */
    .hero-aside {
        order: -1;
    }

    .hero .cta {
        justify-content: center;
    }

    .identity-name,
    .identity-role {
        text-align: center;
    }

    .hero .stats {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        margin-left: auto;
        margin-right: auto;
    }

    .photo-wrap {
        width: clamp(140px, 38vw, 220px);
        height: clamp(140px, 38vw, 220px);
    }

    .hero-copy {
        text-align: center !important;
        align-items: center !important;
        justify-items: center !important;
    }

    .hero-title,
    .hero-subtitle {
        text-align: center !important;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ---------- Sections ---------- */
section {
    padding: 3.2rem 0;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.3rem;
}

.h2 {
    font-size: clamp(1.4rem, 2.5vw + .4rem, 2rem);
    margin: 0;
}

.muted {
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 1rem;
}

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

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

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

    .grid.cols-2,
    .grid.cols-3 {
        grid-template-columns: 1fr;
    }
}

/* ---------- About Section ---------- */

#about {
    padding-top: 1rem;
    /* smaller top padding (optional) */
}

.about-text {
    max-width: 80ch;
    /* controls readable line length */
    margin: 0 auto 3rem;
    /* centers and adds bottom spacing */
    text-align: center;
    /* centers all text */
    line-height: 1.6;
    /* comfortable reading */
    font-size: 1.05rem;
    /* slightly larger body text */
    color: var(--muted);
}

.about-text strong {
    color: var(--text);
}

#about .section-head {
    justify-content: center;
    /* center the heading block */
    text-align: center;
    /* ensure text aligns center */
}


/* Cards */
.card {
    /* keep your new color/glow; tweak the two color-mix lines if desired */
    background: linear-gradient(180deg,
            color-mix(in oklab, var(--surface) 85%, var(--accent) 10%),
            color-mix(in oklab, var(--surface), black 5%));
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
    position: relative;
    overflow: clip;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.card::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent) inset;
}

.card .body {
    padding: 1.1rem;
}

.card .body p {
    margin: 0 0 .7rem;
    line-height: 1.6;
}

.card .body p:last-child {
    margin-bottom: 0;
}

.card .body ul {
    margin: .4rem 0 0;
    padding-left: 1.2rem;
}

.card .body li {
    margin: .25rem 0;
}

.card h3 {
    margin: .2rem 0 .5rem;
    font-size: 1.1rem;
    line-height: 1.25;
    font-weight: 700;
}

/* hover works whether the card is wrapped in <a> or not */
.card:hover,
.card-link-wrapper:hover .card {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(2, 6, 23, .75),
        0 0 12px color-mix(in srgb, var(--accent) 50%, transparent);
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

/* ---------- Featured Article (standalone card) ---------- */
.featured-card {
    position: relative;
    overflow: clip;
    border-radius: var(--radius);
    background: linear-gradient(180deg,
            color-mix(in oklab, var(--surface), white 1%),
            color-mix(in oklab, var(--surface), black 2%));
    border: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent) inset,
        0 8px 24px rgba(2, 6, 23, 0.55);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 40%, transparent),
        0 16px 36px rgba(2, 6, 23, .8);
    border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

.featured-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 0 25px color-mix(in srgb, var(--accent) 25%, transparent);
    opacity: .25;
}

.band .featured-title {
    color: #000;
    margin: 0 0 1rem;
    font-weight: 800;
}


/* layout */
.featured-grid {
    display: grid;
    grid-template-columns: 1.05fr 1.35fr;
    gap: 2rem;
    align-items: center;
}

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

/* Featured image area: make it taller and responsive */
.featured-grid .media {
    height: clamp(300px, 40vh, 350px);
    /* adjust to taste */
}

.featured-grid .thumb {
    height: 100%;
    overflow: hidden;
    border-radius: var(--radius);
}

.featured-grid .thumb img.card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Remove any leftover card styling */
.featured-card,
.band .card {
    border: none;
    box-shadow: none;
    background: none;
}

/* eyebrow + title rhythm */
.eyebrow {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    letter-spacing: .3px;
    color: var(--text);
    background: color-mix(in oklab, var(--surface), white 6%);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    margin-bottom: .55rem;
}

.featured-title {
    margin: 0 0 .6rem;
    font-size: clamp(1.2rem, 1.1rem + .9vw, 1.6rem);
    line-height: 1.2;
    font-weight: 800;
}

/* tighten meta chips a hair */
.featured-card .meta .chip {
    font-size: .75rem;
}

/* ensure internal padding matches the rest of the site */
.featured-card .body {
    padding: 1.2rem;
}

/* ---------- Media thumbnails on cards ---------- */
.thumb {
    position: relative;
    height: var(--thumb-h);
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(180deg, color-mix(in oklab, var(--surface) 70%, var(--accent) 30%), color-mix(in oklab, var(--surface), black 10%));
}

.thumb img.card-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform .45s ease, filter .45s ease;
}

.card:hover .thumb img.card-thumb {
    transform: scale(1.04);
    filter: saturate(1.05);
}

.thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, .45), rgba(2, 6, 23, 0));
    opacity: .6;
    transition: opacity .3s ease;
}

.card:hover .thumb::after {
    opacity: .35;
}

.thumb.no-img {
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    letter-spacing: .5px;
}

.thumb.no-img::before {
    content: "Media";
    opacity: .9;
}

/* Chips with subtle icons */
.chip {
    display: inline-flex;
    align-items: center;
    background: rgba(189, 223, 240, 1);
    gap: .4rem;
    border: 1.5px solid rgba(20, 60, 105, 0.35);
    padding: .25rem .55rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #000;
}

.chip svg {
    width: 16px;
    height: 16px;
    color: rgb(20, 60, 105);
    display: inline-block;
    flex: 0 0 auto;
    vertical-align: -2px;
    overflow: visible;
}

.chip.status.review {
    color: rgb(20, 60, 105);
    font-size: 0.8rem;
    font-weight: 600;
}

/* (if you need this row utility, keep it standalone – not nested) */
.row {
    display: flex;
    gap: .7rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ---------- Publications: distinct CARD style (light blue tint) ---------- */
#publications .grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* exactly two per row */
    gap: 1.5rem;
    align-items: stretch;
}

@media (max-width: 900px) {
    #publications .grid {
        grid-template-columns: 1fr;
        /* stack on smaller screens */
    }
}

#publications .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#publications .card .body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* ---------- Timeline (Talks/Teaching/Collab) ---------- */
.timeline {
    position: relative;
    margin-left: 0;
    padding-left: calc(var(--gutter-left) + var(--content-indent));
    color: rgb(20, 60, 105);
}

/* vertical line */
.timeline::before {
    content: "";
    position: absolute;
    left: calc(var(--gutter-left) + var(--line-gap));
    top: .25rem;
    bottom: .25rem;
    width: 2px;
    background: currentColor;
    opacity: .9;
}

.t-item {
    position: relative;
    margin: 1.1rem 0;
    /* this is the space for the line + dot */
    padding-left: calc(var(--line-gap) + var(--dot));
}

/* the dot */
.t-item::before {
    content: "";
    position: absolute;
    left: -1.25rem;
    top: .45rem;
    width: var(--dot);
    height: var(--dot);
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 60%, transparent),
        0 0 0 6px color-mix(in srgb, currentColor 15%, transparent);
    z-index: 1;
}

/* the year label (single year or range) */
.t-item::after {
    content: attr(data-date);
    position: absolute;
    left: -5rem;
    top: 0.32rem;
    width: var(--label-w);
    text-align: left;
    line-height: 1.1;
    color: color-mix(in srgb, currentColor 70%, #000);
    /* readable against band */
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

/* multi-line range (e.g., 2024–2025) */
.t-item.range::after {
    content: attr(data-from) "\a" "– " attr(data-to);
    white-space: pre;
    text-align: center;
}

/* ---------- Footer ---------- */
footer {
    margin-top: 6rem;
    border-top: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
    padding: 1.5rem 0 1.5rem;
}

.link {
    position: relative;
}

.link.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: .8rem;
    background: color-mix(in srgb, var(--muted) 20%, transparent);
    padding: .1rem .35rem;
    border-radius: .4rem;
}

.impact {
    margin-top: 1rem;
    padding: .8rem 1rem;
    border-left: 3px solid color-mix(in srgb, var(--accent) 50%, transparent);
    background: color-mix(in oklab, var(--surface), white 3%);
    border-radius: 8px;
}

.impact strong {
    color: var(--text);
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contact section — spotlight + fade-in + animated gradient title (no background override) */
.contact-full {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 4rem 0 0rem;
    /* breathing room */
    /* keep existing site background — no background property here */
    animation: fade-up 1s ease-out both;
}

/* keep content above the spotlight */
.contact-inner,
footer {
    position: relative;
    z-index: 1;
}

/* big inviting headline with animated gradient */
.contact-title {
    font-size: clamp(3rem, 5vw + 2rem, 4rem);
    font-weight: 800;
    line-height: 1.05;
    margin: 0 0 .8rem;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradient-pan 4s ease-in-out infinite alternate;
}

/* subtitle */
.contact-subtitle {
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 650px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* card stays centered and tidy */
.contact-card {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.contact-card .body {
    text-align: center;
}

/* links row */
.contact-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.4rem;
}


/* animations */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradient-pan {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

/* accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .contact-full {
        animation: none;
    }

    .contact-title {
        animation: none;
    }
}

.card.section-card {
    overflow: visible;
}

.to-top-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1rem;
    /* default for small & medium screens */

    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.75);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;

    opacity: 0;
    pointer-events: none;
    z-index: 999;

    transition: opacity 0.25s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.to-top-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.85),
        0 0 12px color-mix(in srgb, var(--accent) 60%, transparent);
}

.to-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 1200px) {
    .to-top-btn {
        right: calc((100vw - var(--maxw)) / 2 - 5rem);
        width: 3.25rem;
        height: 3.25rem;
        font-size: 1.6rem;
    }
}