/* ============================================================
   MUHAMMAD MUZAMMIL SHAH — PORTFOLIO
   Design system: "The Maker Canvas"
   Light theme grounded in the Power Platform designer surface:
   a dot-grid canvas, white cards on a real elevation ladder,
   Azure blue for all UI, Copilot magenta reserved for the hero.
   ============================================================ */

/* ─── Design Tokens ─────────────────────────────────────────── */
:root {
    /* Canvas & surfaces */
    --canvas: #F4F7FB;
    --canvas-grid: #DCE4EF;
    --surface: #FFFFFF;
    --surface-sunken: #EDF1F7;
    --surface-glass: rgba(255, 255, 255, 0.82);

    /* Lines */
    --line: #E3E9F2;
    --line-strong: #CBD6E5;
    --line-accent: rgba(11, 92, 173, 0.28);

    /* Ink */
    --ink: #0F1B2D;
    --ink-2: #475A73;
    --ink-3: #6B7C94;
    --ink-inverse: #FFFFFF;

    /* Accent — Azure carries the UI, magenta is hero-only */
    --azure: #0B5CAD;
    --azure-hover: #094C90;
    --azure-tint: rgba(11, 92, 173, 0.08);
    --azure-tint-2: rgba(11, 92, 173, 0.14);
    --magenta: #B4009E;
    --flow-grd: linear-gradient(120deg, #0B5CAD 0%, #6E3BC0 55%, #B4009E 100%);

    /* Status */
    --ok: #0E7A4B;
    --ok-tint: rgba(14, 122, 75, 0.10);
    --alert: #D93025;

    /* Elevation ladder — tight ambient + soft directional */
    --e1: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 3px rgba(15, 27, 45, .04);
    --e2: 0 2px 4px rgba(15, 27, 45, .06), 0 8px 16px rgba(15, 27, 45, .06);
    --e3: 0 4px 8px rgba(15, 27, 45, .07), 0 16px 32px rgba(15, 27, 45, .08);
    --e4: 0 8px 16px rgba(15, 27, 45, .09), 0 32px 64px rgba(15, 27, 45, .12);
    --focus-ring: 0 0 0 3px rgba(11, 92, 173, .22);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Layout */
    --content-max: 1180px;
    --gutter: clamp(20px, 4vw, 48px);
    --nav-width: 80px;

    /* Type */
    --font-main: 'Archivo', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-display: 'Archivo', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --t-xs: .75rem;
    --t-sm: .875rem;
    --t-base: 1rem;
    --t-md: 1.125rem;
    --t-lg: 1.375rem;
    --t-xl: 1.75rem;
    --t-2xl: clamp(2rem, 3.2vw, 2.75rem);
    --t-3xl: clamp(2.75rem, 6vw, 4.5rem);

    /* Legacy aliases — keep older rules resolving while they migrate */
    --bg-primary: var(--canvas);
    --bg-secondary: var(--surface-sunken);
    --bg-card: var(--surface);
    --bg-card-hover: var(--surface);
    --border: var(--line);
    --border-glow: var(--line-accent);
    --accent-1: var(--azure);
    --accent-2: #6E3BC0;
    --accent-3: var(--azure);
    --accent-grd: var(--flow-grd);
    --text-primary: var(--ink);
    --text-secondary: var(--ink-2);
    --text-muted: var(--ink-3);
    --shadow-glow: var(--e2);
    --shadow-card: var(--e2);
}

/* ─── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    font-variation-settings: 'wdth' 100;
    font-size: var(--t-base);
    background: var(--canvas);
    color: var(--ink);
    /* `clip`, never `hidden`: overflow-x: hidden computes to
       `overflow: hidden auto`, turns <body> into a scroll container and
       silently breaks every position: sticky on the page. `clip` trims
       the same way without creating one. */
    overflow-x: clip;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
}

/* Display type uses the width axis — no second family needed */
.hero-title,
.section-title,
.stat-value,
.nav-logo,
.footer-brand {
    font-family: var(--font-display);
    font-variation-settings: 'wdth' 112;
    letter-spacing: -.02em;
    line-height: 1.05;
}

/* Visible focus on every interactive element */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--azure);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--canvas);
}

::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 10px;
    border: 3px solid var(--canvas);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ink-3);
}

/* ─── Spinner ───────────────────────────────────────────────── */
#spinner {
    position: fixed;
    inset: 0;
    background: var(--canvas);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 1;
    visibility: visible;
    transition: opacity .5s ease, visibility 0s linear .5s;
}

#spinner.hide {
    opacity: 0;
    visibility: hidden;
    transition-delay: .5s, .5s;
}

.spinner-ring {
    width: 50px;
    height: 50px;
    border: 3px solid var(--line);
    border-top-color: var(--azure);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Side Navigation ────────────────────────────────────────── */
.side-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--nav-width);
    height: 100vh;
    background: var(--surface-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 1000;
}

.side-nav .nav-logo {
    position: absolute;
    top: 24px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 22px;
    color: var(--azure);
}

.side-nav .nav-item {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 16px;
    transition: all .3s ease;
    cursor: pointer;
}

.side-nav .nav-item:hover {
    background: var(--azure-tint);
    color: var(--azure);
}

.side-nav .nav-item.active {
    background: var(--azure);
    color: var(--ink-inverse);
    box-shadow: var(--e2);
}
.side-nav .nav-item.active::before {
    content: none;
}

.side-nav .nav-item .nav-tooltip {
    position: absolute;
    left: calc(100% + 12px);
    background: var(--ink);
    border: 1px solid var(--ink);
    box-shadow: var(--e3);
    color: var(--ink-inverse);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all .2s ease;
}

.side-nav .nav-item:hover .nav-tooltip {
    opacity: 1;
    transform: translateX(4px);
}

.side-nav .nav-social {
    position: absolute;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Prevent sidebar overlap on small heights */
@media (max-height: 750px) {
    .side-nav {
        justify-content: flex-start;
        padding-top: 80px;
        overflow-y: auto;
    }

    .side-nav::-webkit-scrollbar {
        width: 0;
    }

    .side-nav .nav-social {
        position: relative;
        bottom: auto;
        margin-top: 32px;
        margin-bottom: 24px;
    }
}

.side-nav .nav-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
    transition: all .3s ease;
}

.side-nav .nav-social a:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
    background: var(--azure-tint);
}

/* ─── Main Content Wrapper ───────────────────────────────────── */
.main-wrapper {
    margin-left: var(--nav-width);
    min-height: 100vh;
    position: relative;
}

/* ─── Maker-canvas dot grid ──────────────────────────────────────
   The Power Automate designer surface. Sits BEHIND content (z-index 0,
   not 9998 as the old noise overlay did) and is masked so it reads
   strongest at the hero and fades out down the page.               */
.main-wrapper::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(circle at 1px 1px, var(--canvas-grid) 1px, transparent 0);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 15%, transparent 78%);
    mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 15%, transparent 78%);
}

/* ─── Section Wrapper ─────────────────────────────────────────── */
.section {
    max-width: calc(var(--content-max) + 2 * var(--gutter));
    margin-inline: auto;
    padding: clamp(52px, 5.5vw, 84px) var(--gutter);
    position: relative;
    z-index: 1;
}

/* Sentence case, normal tracking — a tracked-out all-caps eyebrow
   above every heading is template chrome, not information. */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: var(--t-sm);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--azure);
    margin-bottom: 14px;
}

.section-label::before {
    content: '';
    width: 22px;
    height: 2px;
    background: var(--azure);
    border-radius: 2px;
}

.section-title {
    font-size: var(--t-2xl);
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 16px;
    text-wrap: balance;
}

.section-subtitle {
    font-size: var(--t-md);
    color: var(--ink-2);
    max-width: 62ch;
    line-height: 1.7;
}

/* ─── HERO SECTION ────────────────────────────────────────────── */
#hero {
    /* Height follows the content. A forced 100vh plus centring parked
       130-220px of dead space above the badge, and it grew with the
       viewport. */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(32px, 5vw, 72px);
    max-width: calc(var(--content-max) + 2 * var(--gutter));
    margin-inline: auto;
    padding: 48px var(--gutter) 88px;
    position: relative;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--e1);
    border-radius: 100px;
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 28px;
}

.hero-badge .dot {
    width: 7px;
    height: 7px;
    background: var(--ok);
    border-radius: 50%;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .5;
        transform: scale(.75);
    }
}

.hero-title {
    font-size: var(--t-3xl);
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--ink);
}

/* Solid, not gradient-clipped: accenting one word of a headline in a
   gradient is the treatment that reads as templated. The width axis
   carries the headline instead. */
.hero-title .highlight {
    color: inherit;
}

.hero-role {
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 22px;
    min-height: 2.2em;
}

.hero-role .typed-text {
    color: var(--azure);
    border-right: 2px solid var(--azure);
    padding-right: 4px;
    animation: blink .7s step-end infinite;
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.hero-desc {
    font-size: var(--t-md);
    color: var(--ink-2);
    line-height: 1.75;
    max-width: 62ch;
    margin-bottom: 36px;
}

.hero-desc strong {
    color: var(--ink);
    font-weight: 600;
}

.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 24px;
    background: var(--azure);
    color: var(--ink-inverse);
    font-size: var(--t-sm);
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    box-shadow: var(--e2);
    transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.btn-primary:hover {
    background: var(--azure-hover);
    transform: translateY(-2px);
    box-shadow: var(--e3);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 24px;
    background: var(--surface);
    color: var(--ink);
    font-size: var(--t-sm);
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    cursor: pointer;
    box-shadow: var(--e1);
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.btn-secondary:hover {
    border-color: var(--azure);
    color: var(--azure);
    transform: translateY(-2px);
    box-shadow: var(--e2);
}

.hero-stats {
    display: flex;
    gap: clamp(20px, 3vw, 40px);
    margin-top: 40px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
}

.stat-label {
    font-size: var(--t-xs);
    font-weight: 500;
    color: var(--ink-3);
    letter-spacing: 0;
    margin-top: 6px;
}

/* ═══ HERO 3D FLOW STAGE ══════════════════════════════════════════
   The one place boldness is spent. A Power Automate flow rendered as
   real CSS-3D planes at increasing translateZ, parallaxing to the
   pointer. The static composition reads complete on its own, because
   touch devices and reduced-motion users never see it move.        */
.hero-stage {
    position: relative;
    flex-shrink: 0;
    width: 460px;
    height: 520px;
    perspective: 1400px;
    z-index: 2;
}

.stage-inner {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    will-change: transform;
}

.flow-node,
.flow-portrait,
.flow-wires {
    position: absolute;
    transform: translateZ(var(--z, 0px));
    animation: planeIn .75s cubic-bezier(.2, .8, .2, 1) both;
}

.flow-node {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 11px 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--e3);
}

.flow-node i {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    background: var(--azure-tint);
    color: var(--azure);
    font-size: 14px;
}

.flow-node .node-name {
    display: block;
    font-weight: 600;
    font-size: var(--t-sm);
    color: var(--ink);
    line-height: 1.3;
}

.flow-node .node-body {
    min-width: 0;
}

/* The stack, named. Three nodes undersold the toolset. */
.flow-node .node-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.flow-node .node-chips span {
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 100px;
    background: var(--surface-sunken);
    color: var(--ink-2);
    white-space: nowrap;
}

.flow-node.is-ai .node-chips span {
    background: rgba(180, 0, 158, .07);
    color: #8A0079;
}

/* The Copilot step is the only magenta on the page */
.flow-node.is-ai i {
    background: rgba(180, 0, 158, .08);
    color: var(--magenta);
}

.flow-node.node-1 {
    top: 0;
    right: 0;
    width: 250px;
    --z: 70px;
    animation-delay: .48s;
}

.flow-node.node-2 {
    top: 118px;
    right: 24px;
    width: 262px;
    --z: 112px;
    animation-delay: .58s;
}

.flow-node.node-3 {
    top: 236px;
    right: 0;
    width: 254px;
    --z: 154px;
    animation-delay: .68s;
}

.flow-node.node-4 {
    top: 354px;
    right: 24px;
    width: 250px;
    --z: 196px;
    animation-delay: .78s;
}

.flow-wires {
    top: 0;
    left: 0;
    width: 460px;
    height: 520px;
    --z: 96px;
    overflow: visible;
    pointer-events: none;
    animation-delay: .58s;
}

.flow-wires .wire {
    fill: none;
    stroke: var(--line-strong);
    stroke-width: 2;
    stroke-linecap: round;
}

.flow-wires .wire-pulse {
    fill: none;
    stroke: var(--azure);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 26 300;
    animation: wireFlow 3s cubic-bezier(.6, 0, .4, 1) infinite;
}

.flow-wires .wire-pulse.d2 {
    animation-delay: 1s;
    stroke: var(--magenta);
}

.flow-wires .wire-pulse.d3 {
    animation-delay: 2s;
}

@keyframes wireFlow {
    0% {
        stroke-dashoffset: 326;
        opacity: 0;
    }

    12% {
        opacity: 1;
    }

    72% {
        opacity: 1;
    }

    100% {
        stroke-dashoffset: 0;
        opacity: 0;
    }
}

.flow-portrait {
    top: 56px;
    left: 0;
    width: 284px;
    height: 384px;
    --z: 20px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    box-shadow: var(--e4);
    animation-delay: .38s;
}

.flow-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 42%;
    display: block;
}

@keyframes planeIn {
    from {
        opacity: 0;
        transform: translateZ(calc(var(--z, 0px) - 150px)) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateZ(var(--z, 0px));
    }
}

/* ─── ABOUT SECTION ──────────────────────────────────────────── */
#about {
    background: var(--bg-secondary);
}

.about-grid {
    /* Full container width — the info cards moved to their own slider
       below, so nothing sits beside the prose any more. */
    max-width: 100%;
}

.about-text p {
    font-size: var(--t-md);
    color: var(--ink-2);
    /* Slightly more leading, since the lines are now long */
    line-height: 1.85;
    margin-bottom: 20px;
}

.info-item {
    flex: 0 0 268px;
    padding: 16px;
    background: var(--bg-card);
    box-shadow: var(--e1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all .3s ease;
}

.info-item:hover {
    border-color: var(--accent-1);
    background: var(--bg-card-hover);
}

.info-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.info-label i {
    color: var(--accent-1);
    font-size: 11px;
    flex-shrink: 0;
}

.info-value {
    overflow-wrap: anywhere;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.info-value a {
    color: var(--accent-1);
}

.info-value a:hover {
    text-decoration: underline;
}

/* Availability badge */
.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--ok-tint);
    border: 1px solid rgba(14, 122, 75, 0.28);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ok);
    margin-bottom: 24px;
}

/* ─── EXPERIENCE SECTION ─────────────────────────────────────── */
#experience {
    position: relative;
}

.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--azure), rgba(11, 92, 173, .35), rgba(11, 92, 173, 0));
    border-radius: 2px;
}

/* Sticky stack: each card pins near the top and the next one scrolls
   up over it, so the roles deal out like a deck as you read down.
   Each successive card pins slightly lower, leaving the edge of the one
   beneath visible. */
.timeline-item {
    position: sticky;
    padding: 0 0 24px 36px;
    top: 88px;
}

.timeline-item:nth-child(2) { top: 102px; }
.timeline-item:nth-child(3) { top: 116px; }
.timeline-item:nth-child(4) { top: 130px; }
.timeline-item:nth-child(5) { top: 144px; }
.timeline-item:nth-child(6) { top: 158px; }

/* Last card gets no follower, so let it scroll away normally */
.timeline-item:last-child {
    position: relative;
    top: auto;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 22px;
    z-index: 1;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-1);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 4px var(--azure-tint);
}

.timeline-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Commitment reads as metadata beside the dates, not as a badge */
.timeline-commitment {
    font-size: var(--t-xs);
    font-weight: 600;
    color: var(--ink-3);
    border: 1px solid var(--line-strong);
    padding: 4px 10px;
    border-radius: 100px;
    white-space: nowrap;
}

.timeline-period {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-size: var(--t-xs);
    font-weight: 600;
    color: var(--ink-2);
    background: var(--surface-sunken);
    padding: 5px 11px;
    border-radius: 100px;
    white-space: nowrap;
}

.timeline-card {
    padding: 20px 24px 22px;
    background: var(--surface);
    box-shadow: var(--e2);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    transition: box-shadow .3s ease, border-color .3s ease;
}

/* Card header: role and company on the left, dates right-aligned */
.timeline-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.timeline-heading {
    min-width: 0;
}

.timeline-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    box-shadow: var(--e3);
    transform: translateX(4px);
}

.timeline-role {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-company {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-3);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 7px;
}

/* External links inside a role line get a real affordance */
.timeline-company a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--line-accent);
    text-underline-offset: 3px;
    transition: text-decoration-color .2s ease;
}

.timeline-company a:hover {
    text-decoration-color: currentColor;
}

.timeline-company a i {
    font-size: .72em;
    margin-left: 3px;
    opacity: .7;
}

.timeline-desc {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.timeline-desc li {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
}

.timeline-desc li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-1);
    font-size: 12px;
}

/* ─── SKILLS SECTION ──────────────────────────────────────────── */
#skills {
    background: var(--bg-secondary);
    position: relative;
    /* clip, never hidden: `hidden` would make this a scroll container and
       break the sticky stack in #experience, as overflow-x: hidden on body
       already did once. */
    overflow: clip;
}

/* :not(.tool-field) matters — the field is also a direct child, and forcing
   it to position: relative collapsed it to zero height, so its own
   overflow: clip erased every logo. */
#skills > *:not(.tool-field) {
    position: relative;
    z-index: 1;
}

/* ─── Drifting tool field ─────────────────────────────────────────
   The toolkit as background texture. Monochrome at 7% so it never
   competes with the cards — a busy animated backdrop is the fastest
   way to undo everything else on this page. */
.tool-field {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: clip;
}

.tool-field img,
.tool-field span {
    position: absolute;
    opacity: .07;
    will-change: transform;
    animation-duration: var(--dur, 60s);
    animation-delay: var(--delay, 0s);
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

/* An animation name cannot be built from a custom property, so the three
   drift paths are assigned positionally instead (matching how the markup
   is generated). */
.tool-field > :nth-child(3n + 1) { animation-name: toolDriftA; }
.tool-field > :nth-child(3n + 2) { animation-name: toolDriftB; }
.tool-field > :nth-child(3n)     { animation-name: toolDriftC; }

.tool-field img {
    width: var(--s, 32px);
    height: auto;
}

.tool-field span {
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    letter-spacing: -.01em;
}

@keyframes toolDriftA {
    to { transform: translate3d(26px, -34px, 0) rotate(3deg); }
}

@keyframes toolDriftB {
    to { transform: translate3d(-30px, 28px, 0) rotate(-4deg); }
}

@keyframes toolDriftC {
    to { transform: translate3d(18px, 36px, 0) rotate(2deg); }
}

@media (max-width: 768px) {
    .tool-field img,
    .tool-field span { opacity: .05; }
}

@media (prefers-reduced-motion: reduce) {

    /* Must out-specify `.tool-field > :nth-child(...)` (0,2,0), which sets
       animation-name — a plain `.tool-field img` (0,1,1) loses to it. */
    .tool-field > :nth-child(n),
    .tool-field > :nth-child(n) {
        animation: none !important;
    }
}

/* Skills and projects are sliders now — these cards size themselves as
   slides. The track supplies the flex context and the 24px gap. */
.skill-category {
    flex: 0 0 300px;
    scroll-snap-align: start;
}

.skill-category {
    padding: 22px;
    background: var(--bg-card);
    box-shadow: var(--e1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all .3s ease;
}

.skill-category:hover {
    border-color: var(--border-glow);
    box-shadow: var(--e3);
    transform: translateY(-4px);
}

.skill-category-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 20px;
    margin-bottom: 16px;
}
/* Unique color per skill category */
.skill-category:nth-child(1) .skill-category-icon { background: rgba(11,92,173,.10); color: var(--azure); }
.skill-category:nth-child(2) .skill-category-icon { background: rgba(110,59,192,.10); color: #6E3BC0; }
.skill-category:nth-child(3) .skill-category-icon { background: rgba(14,122,75,.10); color: var(--ok); }
.skill-category:nth-child(4) .skill-category-icon { background: rgba(169,100,18,.10); color: #A96412; }
.skill-category:nth-child(5) .skill-category-icon { background: rgba(14,116,144,.10); color: #0E7490; }
.skill-category:nth-child(6) .skill-category-icon { background: rgba(67,56,202,.10); color: #4338CA; }

.skill-category-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    padding: 5px 12px;
    background: var(--azure-tint);
    border: 1px solid var(--line-accent);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all .2s ease;
}

.skill-tag:hover {
    background: var(--azure-tint-2);
    border-color: var(--accent-1);
    color: var(--accent-1);
}

/* ─── PROJECTS SECTION ───────────────────────────────────────── */

.projects-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--azure-tint-2);
    border-color: var(--accent-1);
    color: var(--accent-1);
}

.project-card {
    flex: 0 0 340px;
    scroll-snap-align: start;
}

.project-card {
    /* Four independent writers compose into ONE transform declaration:
       reveal (--rv-y), hover lift (--hv-y) and pointer tilt (--rx/--ry).
       Nothing ever assigns element.style.transform. */
    /* 0: these live in a horizontal slider, so they are never revealed
       by the vertical IntersectionObserver — the wrapper handles that. */
    --rv-y: 0px;
    --hv-y: 0px;
    --rx: 0deg;
    --ry: 0deg;
    padding: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--e1);
    transform: perspective(900px) translate3d(0, calc(var(--rv-y) + var(--hv-y)), 0) rotateX(var(--rx)) rotateY(var(--ry));
    transition: border-color .35s ease, background .35s ease, box-shadow .35s ease,
                opacity .45s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--azure);
    transform: scaleX(0);
    transition: transform .3s ease;
}

.project-card:hover::before {
    transform: scaleX(1);
}

@media (hover: hover) {
    .project-card:hover {
        border-color: var(--line-accent);
        box-shadow: var(--e3);
        --hv-y: -6px;
    }
}

/* Tilt tracks the pointer with no easing; release springs back. */
.project-card.is-tilting {
    transition: border-color .35s ease, box-shadow .35s ease, transform 0s;
    will-change: transform;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.project-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--azure-tint);
    border-radius: 12px;
    font-size: 18px;
    color: var(--accent-3);
}

.project-links {
    display: flex;
    gap: 8px;
}

.project-link {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
    transition: all .2s ease;
}

.project-link:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
    background: var(--azure-tint);
}

.project-name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.project-desc {
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.7;
    /* No flex: 1 — it stretched the description to absorb the whole card
       and shoved the tech tags to the bottom, leaving a hole in the middle
       of every short card. */
    margin-bottom: 20px;
}

.project-techs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tech-tag {
    color: var(--ink-2);
    padding: 3px 10px;
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-3);
    letter-spacing: .03em;
}

/* ─── EDUCATION SECTION ────────────────────────────────────────── */
#education {
    background: var(--bg-secondary);
}

.education-grid {
    display: grid;
    /* Two cards now that the pre-university entry is gone */
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    align-items: stretch;
}

.education-card {
    padding: 24px;
    background: var(--bg-card);
    box-shadow: var(--e1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
}

.education-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, var(--azure-tint) 0%, rgba(11, 92, 173, 0) 70%);
}

.education-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-4px);
    box-shadow: var(--e3);
}

.edu-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--azure-tint);
    border-radius: 14px;
    font-size: 22px;
    color: var(--accent-1);
    margin-bottom: 16px;
}

.edu-degree {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.edu-institution {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-1);
    margin-bottom: 8px;
}

.edu-period {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.edu-period i { color: var(--accent-1); font-size: 11px; }

.edu-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 12px;
}

/* ─── CERTIFICATIONS SECTION ────────────────────────────────────── */

/* ─── CONTACT SECTION ────────────────────────────────────────────── */
#contact {
    background: var(--bg-primary);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 36px;
}

.contact-info-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 32px;
}

.contact-info-item {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    box-shadow: var(--e1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all .3s ease;
}

.contact-info-item:hover {
    border-color: var(--accent-1);
    background: var(--bg-card-hover);
}

.contact-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--azure-tint);
    border-radius: 12px;
    font-size: 20px;
    color: var(--accent-1);
    flex-shrink: 0;
}

.contact-item-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.contact-item-value {
    overflow-wrap: anywhere;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ─── FOOTER ────────────────────────────────────────────────────── */
footer {
    padding: 40px 60px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--ink);
}

.footer-copy {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-socials {
    display: flex;
    gap: 12px;
}

.footer-socials a {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 15px;
    transition: all .3s ease;
}

.footer-socials a:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
    background: var(--azure-tint);
}

/* ─── Animations ───────────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .45s ease, transform .45s cubic-bezier(.2, .7, .2, 1);
}

.reveal.visible:not(.project-card) {
    opacity: 1;
    transform: none;
}

/* Cards drive their reveal through --rv-y instead, leaving transform free */
.project-card.reveal.visible {
    opacity: 1;
    --rv-y: 0px;
}

/* ─── RESPONSIVE ───────────────────────────────────────────────── */

/* ── Large Tablet / Small Desktop (≤ 1200px) ── */
@media (max-width: 1200px) {
    .hero-title {
        font-size: clamp(2.2rem, 5vw, 3.4rem);
    }

    .project-card {
        flex-basis: 320px;
    }
}

/* ── Tablet Landscape / Small Desktop (≤ 1024px) ── */
@media (max-width: 1024px) {
    :root {
        --nav-width: 70px;
    }

    #hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 48px;
        padding-top: 40px;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-stage {
        align-self: center;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .section {
        padding: clamp(64px, 8vw, 96px) var(--gutter);
    }

    #hero {
        padding: 80px 40px;
        min-height: 100vh;
    }

    .hero-stats {
        gap: 28px;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 11px;
    }

    .education-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* ── Tablet Portrait (≤ 768px) — Bottom Nav ── */
@media (max-width: 768px) {

    /* --- Side nav → bottom bar --- */
    .side-nav {
        width: 100%;
        height: 56px;
        top: auto;
        bottom: 0;
        left: 0;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        border-right: none;
        border-top: 1px solid var(--line);
        box-shadow: 0 -8px 24px rgba(15, 27, 45, .08);
        padding: 0 4px;
        gap: 0;
        overflow-x: auto;
        scrollbar-width: none;
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
    }
    .side-nav::-webkit-scrollbar { display: none; }

    .side-nav .nav-logo,
    .side-nav .nav-social {
        display: none;
    }

    .side-nav .nav-item {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        font-size: 14px;
        flex-shrink: 0;
    }

    .side-nav .nav-item .nav-tooltip {
        display: none;
    }

    /* --- Main wrapper --- */
    .main-wrapper {
        margin-left: 0;
        padding-bottom: 68px;
    }

    /* --- Sections --- */
    .section {
        padding: 64px 20px;
    }

    .hero-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px 16px;
    }

    /* The three-node flow needs horizontal room it no longer has.
       Drop to the portrait alone rather than shrinking it into mush. */
    .hero-stage {
        width: 268px;
        height: 362px;
        margin-inline: auto;
    }

    .flow-node,
    .flow-wires {
        display: none;
    }

    .flow-portrait {
        inset: 0;
        width: auto;
        height: auto;
        --z: 0px;
    }

    #hero {
        padding: 60px 20px 60px;
        min-height: auto;
    }

    footer {
        padding: 28px 20px;
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    /* --- Hero --- */
    .hero-title {
        font-size: clamp(2.4rem, 9vw, 3.4rem);
        letter-spacing: -0.02em;
    }

    .hero-role {
        font-size: clamp(1rem, 4vw, 1.3rem);
    }

    .hero-desc {
        font-size: 0.98rem;
    }

    .hero-badge {
        font-size: 12px;
        padding: 6px 14px;
    }

    .hero-cta {
        flex-direction: column;
        gap: 12px;
    }

    .hero-cta .btn-primary,
    .hero-cta .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        margin-top: 40px;
        padding-top: 32px;
    }

    .stat-item {
        text-align: center;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 10px;
    }

    /* --- Section typography --- */
    .section-title {
        font-size: clamp(1.7rem, 6vw, 2.4rem);
    }

    .section-subtitle {
        font-size: 0.95rem;
    }

    /* --- About --- */
    .about-grid {
        gap: 32px;
    }

    .about-info-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .info-item {
        padding: 12px;
    }

    .info-value {
        font-size: 13px;
    }

    .mlsa-badge {
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px 14px;
    }

    /* --- Timeline --- */
    .timeline {
        padding-left: 24px;
    }

    .timeline-item {
        padding: 0 0 36px 28px;
    }

    .timeline-card {
        padding: 20px;
    }

    .timeline-role {
        font-size: 1.05rem;
    }

    .timeline-desc li {
        font-size: 13px;
    }

    /* --- Skills --- */
    .skill-category {
        flex-basis: 280px;
    }

    .skill-category {
        padding: 20px;
    }

    /* --- Projects --- */
    .project-card {
        flex-basis: 300px;
    }

    .project-card {
        padding: 20px;
    }

    .projects-filter {
        gap: 6px;
    }

    .filter-btn {
        padding: 7px 14px;
        font-size: 12px;
    }

    /* --- Education --- */
    .education-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .education-card {
        padding: 24px;
    }

    /* --- Contact --- */
    .contact-grid {
        gap: 32px;
    }

            .contact-info-items {
        gap: 12px;
    }

    .contact-info-item {
        padding: 16px;
    }
}

/* ── Mobile (≤ 576px) ── */
@media (max-width: 576px) {
    .section {
        padding: 56px 16px;
    }

    #hero {
        padding: 70px 16px 50px;
    }

    .hero-title {
        font-size: clamp(2rem, 11vw, 3rem);
    }

    .hero-role {
        font-size: 1rem;
    }

    .hero-desc {
        font-size: 0.93rem;
        line-height: 1.7;
    }

    .hero-stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-top: 32px;
        padding-top: 24px;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    /* Near-full-width slides on phones */
    .skill-category {
        flex-basis: calc(100vw - 96px);
        max-width: 340px;
    }

    .project-card {
        flex-basis: calc(100vw - 96px);
        max-width: 340px;
    }

    /* About info 1 col */
    .about-info-grid {
        grid-template-columns: 1fr;
    }

    /* Timeline adjustments */
    .timeline::before {
        display: none;
    }

    .timeline {
        padding-left: 0;
    }

    .timeline-item {
        padding: 0 0 28px 0;
    }

    .timeline-item::before {
        display: none;
    }

    .timeline-period {
        background: var(--azure-tint);
        border: 1px solid var(--line-accent);
        border-radius: 8px;
        padding: 6px 12px;
        margin-bottom: 12px;
        font-size: 11px;
    }

    /* Project filter: wrap & smaller */
    .projects-filter {
        gap: 6px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    /* Footer stacked */
    footer {
        gap: 14px;
        padding: 24px 16px;
    }

    .footer-brand {
        font-size: 1.1rem;
    }

    .footer-copy {
        font-size: 12px;
    }

    /* Education */
    .education-grid {
        grid-template-columns: 1fr;
    }

    .education-card {
        padding: 20px;
    }

    .edu-degree {
        font-size: 1.05rem;
    }

    /* Side nav spacing adjustments */
    .side-nav {
        padding: 0 4px;
    }

    .side-nav .nav-item {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
}

/* ── Small Mobile (≤ 400px) ── */
@media (max-width: 400px) {
    .hero-title {
        font-size: clamp(1.8rem, 12vw, 2.6rem);
    }

    .hero-cta {
        gap: 10px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 14px;
    }

    .hero-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .section-title {
        font-size: clamp(1.5rem, 8vw, 2rem);
    }

    .section {
        padding: 50px 14px;
    }

    .side-nav .nav-item {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .timeline-card {
        padding: 16px;
    }

    .skill-tag {
        font-size: 11px;
        padding: 4px 10px;
    }

    .tech-tag {
        font-size: 10px;
        padding: 3px 8px;
    }
}

/* ─── CERTIFICATE SLIDER ─────────────────────────────────────── */
.slider-wrapper {
    position: relative;
}

.slider-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    /* No scroll-snap: mandatory snapping fights the slow auto-drift,
       pulling each sub-pixel step back to the nearest slide. Arrows and
       dots scroll by exact card offsets, so snap buys nothing here. */
    scrollbar-width: none;
    padding: 8px 4px 20px;
    cursor: grab;
}
.slider-track::-webkit-scrollbar { display: none; }
.slider-track.grabbing { cursor: grabbing; user-select: none; }

/* Cards tilt and lift inside the track, so give the shadows room and stop
   the 3D transforms being clipped by the scroll container. */
.slider-track {
    padding: 14px 6px 24px;
}

.cert-slide {
    flex: 0 0 280px;
    scroll-snap-align: start;
    background: var(--bg-card);
    box-shadow: var(--e1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color .3s, transform .3s, box-shadow .3s;
    cursor: pointer;
}
.cert-slide:hover {
    border-color: var(--border-glow);
    transform: translateY(-4px);
    box-shadow: var(--e3);
}
.cert-slide-img-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--surface-sunken);
}
.cert-slide-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    transition: transform .4s ease;
}
.cert-slide:hover .cert-slide-img-wrap img { transform: scale(1.06); }
.cert-slide-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 27, 45, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s;
}
.cert-slide:hover .cert-slide-overlay { opacity: 1; }
.cert-view-btn {
    padding: 10px 22px;
    background: var(--azure);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-main);
    transition: transform .2s;
}
.cert-view-btn:hover { transform: scale(1.05); }
.cert-slide-info { padding: 16px 18px; }
.cert-slide-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}
.cert-slide-issuer {
    font-size: 12px;
    color: var(--accent-1);
    font-weight: 600;
    margin-bottom: 6px;
}
.cert-slide-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--azure-tint);
    border: 1px solid var(--line-accent);
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-1);
    margin-bottom: 6px;
}
.cert-slide-date {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}


/* Slider dots */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}
.slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
    border: none;
    cursor: pointer;
    transition: all .3s;
    padding: 0;
}
.slider-dot.active {
    background: var(--accent-1);
    width: 22px;
    border-radius: 3px;
}

/* ─── LIGHTBOX ───────────────────────────────────────────────── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 27, 45, 0.82);
    z-index: 99990;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    padding: 24px;
}
.lightbox-overlay.open { display: flex; }
.lightbox-inner {
    position: relative;
    max-width: 860px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}
.lightbox-img-wrap {
    width: 100%;
    max-height: 72vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-img-wrap img {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.lightbox-info { text-align: center; }
.lightbox-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}
.lightbox-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    margin-top: 4px;
}
.lightbox-close {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 10;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-nav {
    position: absolute;
    top: 36%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.lightbox-nav:hover { background: var(--azure); border-color: var(--azure); }
.lb-prev { left: -60px; }
.lb-next { right: -60px; }
.lightbox-counter {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

/* ─── SESSIONS SECTION ───────────────────────────────────────── */
#sessions { background: var(--bg-secondary); }

.session-slide {
    flex: 0 0 300px;
    scroll-snap-align: start;
    background: var(--bg-card);
    box-shadow: var(--e1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    transition: border-color .3s, transform .3s, box-shadow .3s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.session-slide::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--session-accent, var(--azure));
    border-radius: 3px 3px 0 0;
}
.session-slide:hover {
    border-color: var(--border-glow);
    transform: translateY(-6px);
    box-shadow: var(--e3);
}
.session-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.session-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}
.session-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.75;
    flex: 1;
}
.session-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.session-meta i { color: var(--accent-1); }

/* ─── Responsive overrides for sliders ───────────────────────── */
@media (max-width: 768px) {
    .cert-slide { flex: 0 0 240px; }
    .cert-slide-img-wrap { height: 150px; }
    .session-slide { flex: 0 0 260px; }
    .lb-prev { left: -8px; }
    .lb-next { right: -8px; }
}
@media (max-width: 576px) {
    .cert-slide { flex: 0 0 210px; }
    .cert-slide-img-wrap { height: 130px; }
    .session-slide { flex: 0 0 230px; }
    .lb-prev, .lb-next { display: none; }
    .lightbox-img-wrap img { border-radius: 8px; }
}

/* ─── Featured project highlight ───────────────────────────────── */
.project-card.featured {
    border-color: var(--line-accent);
    background: var(--azure-tint);
}

.project-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--azure-tint);
    border: 1px solid var(--line-accent);
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-1);
    margin-top: 14px;
    align-self: flex-start;
}

/* ─── MLSA badge ─────────────────────────────────────────────── */
.mlsa-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--azure-tint);
    border: 1px solid var(--line-accent);
    border-radius: 12px;
    margin-top: 20px;
}

.mlsa-badge img {
    height: 20px;
}

.mlsa-badge span {
    font-size: 13px;
    font-weight: 700;
    color: var(--azure);
}
/* ═══════════════════════════════════════════════════════════════════
   CHATBOT
   Appended deliberately: the global responsive queries live earlier in
   this file, so the chatbot's own media queries must come after them to
   win at equal specificity.
   ═══════════════════════════════════════════════════════════════════ */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--azure);
    border: none;
    color: var(--ink-inverse);
    font-size: 22px;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 8px 28px rgba(11, 92, 173, .32);
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle:hover {
    background: var(--azure-hover);
    transform: scale(1.06);
    box-shadow: 0 12px 34px rgba(11, 92, 173, .42);
}

/* The ring is a page-coloured knockout, not a border */
.chatbot-toggle .chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    background: var(--alert);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--canvas);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 360px;
    max-height: 480px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    z-index: 10001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--e4);
    animation: chatSlideUp 0.35s ease;
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chatbot-window.open {
    display: flex;
}

.chatbot-header {
    background: var(--surface-sunken);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--surface);
    box-shadow: var(--e1);
    flex-shrink: 0;
}

.chatbot-avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 20%;
}

.chatbot-header-name {
    font-weight: 600;
    color: var(--ink);
    font-size: 13px;
}

.chatbot-header-status {
    font-size: 11px;
    color: var(--ink-3);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: var(--ok);
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.chatbot-close {
    background: transparent;
    border: none;
    color: var(--ink-3);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: background .2s, color .2s;
}

.chatbot-close:hover {
    background: rgba(15, 27, 45, .06);
    color: var(--ink);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 290px;
    min-height: 200px;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 10px;
}

.chat-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: msgFade 0.3s ease;
}

@keyframes msgFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--azure);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-inverse);
}

.chat-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 20%;
}

.chat-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 12px;
    line-height: 1.6;
    max-width: 80%;
    word-wrap: break-word;
}

/* Tinted vs saturated is what carries the bubble distinction on light —
   two near-white bubbles would read as one block. */
.bot-msg .chat-msg-bubble {
    background: var(--surface-sunken);
    color: var(--ink);
    border: 1px solid var(--line);
    border-bottom-left-radius: 4px;
}

.user-msg {
    flex-direction: row-reverse;
}

.user-msg .chat-msg-bubble {
    background: var(--azure);
    color: var(--ink-inverse);
    border-bottom-right-radius: 4px;
}

.user-msg .chat-msg-avatar {
    background: var(--ok);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--azure);
    border-radius: 50%;
    animation: typing-bounce 1.2s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.chatbot-input-area {
    padding: 10px 12px 12px;
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--line);
    background: var(--surface-sunken);
}

.chatbot-input-area input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--ink);
    font-size: 12px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    font-family: var(--font-main);
}

.chatbot-input-area input:focus {
    border-color: var(--azure);
    box-shadow: var(--focus-ring);
}

.chatbot-input-area input::placeholder {
    color: var(--ink-3);
}

.chatbot-input-area button {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--azure);
    color: var(--ink-inverse);
    cursor: pointer;
    font-size: 15px;
    transition: background .2s, transform .2s, box-shadow .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-input-area button:hover {
    background: var(--azure-hover);
    transform: scale(1.05);
    box-shadow: var(--e2);
}

.chatbot-input-area button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* Quick suggestion chips */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px;
}

.chat-chip {
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--azure-tint);
    border: 1px solid var(--line-accent);
    color: var(--azure);
    font-size: 11px;
    cursor: pointer;
    transition: background .2s, color .2s;
    white-space: nowrap;
}

.chat-chip:hover {
    background: var(--azure);
    color: var(--ink-inverse);
}

/* Mobile responsive */
@media (max-width: 480px) {
    .chatbot-window {
        right: 10px;
        left: 10px;
        bottom: 100px;
        width: auto;
        max-height: 70vh;
    }

    .chatbot-toggle {
        bottom: 80px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .chatbot-toggle {
        bottom: 80px;
        right: 24px;
    }

    .chatbot-window {
        bottom: 150px;
    }
}

/* ═══ Reduced motion ═══════════════════════════════════════════════
   The site had no guard at all before the 3D layer landed. Everything
   decorative stops; nothing that conveys state disappears.          */
@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }

    .stage-inner {
        transform: none !important;
    }

    .project-card {
        --rx: 0deg !important;
        --ry: 0deg !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .flow-node,
    .flow-portrait,
    .flow-wires {
        opacity: 1;
    }

    .flow-wires .wire-pulse {
        display: none;
    }
}

/* Cards get tall on narrow screens — taller than the viewport, which
   makes a sticky stack unreadable. Fall back to a plain list. */
@media (max-width: 992px), (max-height: 520px) {
    .timeline-item,
    .timeline-item:nth-child(2),
    .timeline-item:nth-child(3),
    .timeline-item:nth-child(4),
    .timeline-item:nth-child(5),
    .timeline-item:nth-child(6) {
        position: relative;
        top: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .timeline-item {
        position: relative !important;
        top: auto !important;
    }
}

/* Where the cards stack, the rail and its dots become clutter — the pinned
   dots bunch into a clump at the top. Each card already carries its own
   date, so drop the decoration and give the cards the full width. */
@media (min-width: 993px) and (min-height: 521px) {
    .timeline {
        padding-left: 0;
    }

    .timeline::before,
    .timeline-item::before {
        display: none;
    }

    .timeline-item {
        padding-left: 0;
    }

    /* Pinned cards sit above the ones they cover */
    .timeline-card {
        box-shadow: var(--e3);
    }
}

/* Equal-height cards. The dead space that used to sit inside them is gone
   for two other reasons: .project-desc no longer stretches, and the Featured
   badge now shares the tag row instead of adding a line of its own. */
#projectsGrid,
#skillTrack {
    align-items: stretch;
}

/* Badge sits with the tags, so it needs no margin of its own */
.project-techs .project-badge {
    margin-top: 0;
}

/* The form card is gone, so the contact details get the full width and
   lay out as a grid instead of one tall column. */
.contact-info-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
