/* ==========================================================================
   ASIKUR RAHMAN — PORTFOLIO
   Design system: "Build Log" — an ink-black editor canvas, warm copper
   signal accent, cool circuit-teal counterpoint, editorial serif display
   paired with a monospace utility voice. The profile photo lives inside a
   floating "editor window" that travels and reorients itself as the page
   scrolls, threading through every section like a persistent cursor.
   ========================================================================== */

/* ---------------------------------- Tokens ---------------------------------- */
:root {
    /* Surfaces */
    --ink: #0b0b0d;
    --ink-2: #111114;
    --panel: #17161a;
    --panel-2: #1d1c21;
    --hairline: rgba(237, 231, 218, 0.09);
    --hairline-strong: rgba(237, 231, 218, 0.16);

    /* Text */
    --paper: #edeadf;
    --paper-dim: rgba(237, 234, 223, 0.66);
    --paper-faint: rgba(237, 231, 223, 0.4);

    /* Accents */
    --signal: #dd9a3b;
    --signal-strong: #f0b25a;
    --signal-dim: rgba(221, 154, 59, 0.14);
    --circuit: #5fb3a3;
    --circuit-dim: rgba(95, 179, 163, 0.14);
    --rose: #c97b84;
    --rose-dim: rgba(201, 123, 132, 0.14);
    --iris: #9d8cff;
    --iris-dim: rgba(157, 140, 255, 0.16);

    /* Glass (frosted surfaces used site-wide) */
    --glass: rgba(23, 22, 28, 0.55);
    --glass-2: rgba(29, 28, 35, 0.64);
    --glass-border: rgba(237, 231, 218, 0.12);
    --glass-highlight: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
    --glass-blur: 14px;

    /* Status */
    --ok: #7fb87f;
    --warn: #e0b054;
    --err: #d97d7d;

    /* Type */
    --font-display: 'Fraunces', 'Georgia', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Rhythm */
    --edge: clamp(1.25rem, 4vw, 3rem);
    --radius-s: 6px;
    --radius-m: 14px;
    --radius-l: 24px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --nav-h: 76px;
}

html.light-mode {
    /* "Lavender mist" — a calm, professional light theme: pale violet canvas,
       crisp white glass cards, deep ink-violet text. Copper + teal accents are
       kept for brand continuity, joined by a soft iris violet. */
    --ink: #eeecf6;
    --ink-2: #e6e3f3;
    --panel: #ffffff;
    --panel-2: #f3f1fb;
    --hairline: rgba(40, 33, 74, 0.10);
    --hairline-strong: rgba(40, 33, 74, 0.18);
    --paper: #1c1a2b;
    --paper-dim: rgba(28, 26, 43, 0.70);
    --paper-faint: rgba(28, 26, 43, 0.46);
    --signal: #b9741e;
    --signal-strong: #9c5f12;
    --signal-dim: rgba(185, 116, 30, 0.14);
    --circuit: #2f8272;
    --circuit-dim: rgba(47, 130, 114, 0.14);
    --rose: #b5566b;
    --rose-dim: rgba(181, 86, 107, 0.14);
    --iris: #6d5bd0;
    --iris-dim: rgba(109, 91, 208, 0.14);
    --glass: rgba(255, 255, 255, 0.58);
    --glass-2: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(40, 33, 74, 0.10);
    --glass-highlight: rgba(255, 255, 255, 0.75);
    --glass-shadow: 0 20px 50px rgba(60, 50, 110, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    margin: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

body.menu-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

::selection {
    background: var(--signal);
    color: #0b0b0d;
}

.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 var(--edge);
}

.full-bleed {
    width: 100vw;
    margin-left: calc(50% - 50vw);
}

/* ---------------------------------- Tilt / magnetic ---------------------------------- */
.tilt-card {
    transition: transform 0.5s var(--ease);
    transform-style: preserve-3d;
    will-change: transform;
}

.btn,
.theme-toggle {
    transition: transform 0.25s var(--ease), background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* ---------------------------------- Split-text heading reveal ---------------------------------- */
.split-word {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding-bottom: 0.08em;
    margin-bottom: -0.08em;
}

.split-word>span {
    display: inline-block;
    transform: translateY(112%);
    transition: transform 0.85s var(--ease);
}

.reveal.split-text.visible .split-word>span {
    transform: translateY(0);
}

/* ---------------------------------- Marquee strip ---------------------------------- */
.marquee-strip {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    overflow: hidden;
    background: var(--panel);
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
    padding: 1.05rem 0;
    transform: rotate(-1deg);
    position: relative;
    z-index: 1;
}

.marquee-track {
    display: flex;
    width: max-content;
    gap: 2.5rem;
    animation: marquee 24s linear infinite;
}

.marquee-strip:hover .marquee-track {
    animation-play-state: paused;
}

.marquee-track span {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.09em;
    color: var(--paper-dim);
    white-space: nowrap;
}

.marquee-track .marquee-dot {
    color: var(--signal);
}

@keyframes marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .marquee-track {
        animation: none;
    }
}

/* ==========================================================================
   UNIFIED PAGE BACKGROUND
   One fixed backdrop for the whole site (the hero's own radial gradient),
   so the hero, About, Experience … Contact all sit on exactly the same
   canvas. The old grain / vignette / cursor-glow layers are switched off
   because they made some sections look different from others.
   ========================================================================== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at 50% 58%, var(--hero-bg-1, #211f26) 0%, var(--hero-bg-2, #08080a) 82%);
}

body::after {
    content: none;
}

.interactive-bg {
    display: none;
}

html.light-mode body::before {
    background: radial-gradient(circle at 50% 58%, var(--hero-bg-1, #fcfbff) 0%, var(--hero-bg-2, #d6d1ec) 82%);
}

/* Lenis smooth-scroll helpers (same as the reference site's setup) */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-smooth iframe {
    pointer-events: none;
}

/* Eyebrow / mono labels used as "code comments" throughout */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: var(--signal);
    text-transform: none;
    margin-bottom: 1rem;
}

.eyebrow::before {
    content: '//';
    color: var(--paper-faint);
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.08;
    margin: 0;
}

h2 {
    font-size: clamp(2rem, 4vw, 2.9rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.3rem;
}

p {
    color: var(--paper-dim);
}

.section {
    position: relative;
    z-index: 1;
    padding: clamp(4rem, 9vw, 7.5rem) 0;
    scroll-margin-top: var(--nav-h);
}

.section>.container>h2 {
    margin-bottom: 2.75rem;
}

.section-kicker {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 2.75rem;
    flex-wrap: wrap;
}

.section-kicker h2 {
    margin: 0;
}

.section-kicker .rule {
    flex: 1;
    height: 1px;
    background: var(--hairline-strong);
    min-width: 40px;
}

.section-kicker .count {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--paper-faint);
}

/* ---------------------------------- Scroll progress ---------------------------------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--signal), var(--circuit));
    z-index: 2000;
    transform: scaleX(0);
    transform-origin: left;
    will-change: transform;
}

/* ---------------------------------- Theme toggle ---------------------------------- */
.theme-toggle {
    position: fixed;
    bottom: 1.6rem;
    left: 1.6rem;
    z-index: 1500;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--panel);
    border: 1px solid var(--hairline-strong);
    color: var(--paper);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.3s var(--ease), border-color 0.3s ease;
}

.theme-toggle:hover {
    transform: translateY(-3px);
    border-color: var(--signal);
}

.theme-toggle::before {
    content: '\f186';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.05rem;
}

html.light-mode .theme-toggle::before {
    content: '\f185';
    color: var(--signal);
}

.theme-indicator {
    position: fixed;
    bottom: 1.9rem;
    left: 4.6rem;
    z-index: 1500;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--paper-faint);
    background: var(--panel);
    border: 1px solid var(--hairline);
    padding: 0.35rem 0.6rem;
    border-radius: 20px;
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.theme-toggle:hover+.theme-indicator {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 899px) {
    .theme-toggle {
        bottom: auto;
        top: calc(var(--nav-h) + 0.8rem);
        left: auto;
        right: 1rem;
        width: 40px;
        height: 40px;
        z-index: 1100;
    }

    .theme-indicator {
        display: none;
    }
}

/* Inline variant: JS moves the toggle into the nav bar on small screens so it
   never floats over hero/section content. */
.theme-toggle.theme-toggle--inline {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 38px;
    height: 38px;
    box-shadow: none;
    margin: 0;
    flex-shrink: 0;
}

/* ---------------------------------- Nav ---------------------------------- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    height: var(--nav-h);
    background: rgba(11, 11, 13, 0.72);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--hairline);
    transition: background 0.4s ease, border-color 0.4s ease;
}

html.light-mode nav {
    background: rgba(238, 236, 246, 0.72);
}

nav>div {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-content h1 {
    font-family: var(--font-mono);
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.nav-content h1::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 12px var(--signal);
}

.hamburger-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.visible-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.visible-links a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--paper-dim);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.25s ease;
    position: relative;
    padding: 0.3rem 0;
}

.visible-links a:hover {
    color: var(--signal);
}

.visible-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    height: 1px;
    width: 0;
    background: var(--signal);
    transition: width 0.3s var(--ease);
}

.visible-links a:hover::after {
    width: 100%;
}

.visible-links a i {
    font-size: 0.8rem;
}

.hamburger-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--hairline-strong);
    color: var(--paper);
    cursor: pointer;
    transition: all 0.3s ease;
}

.hamburger-toggle:hover {
    border-color: var(--signal);
    color: var(--signal);
}

.dropdown-links {
    display: none;
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    background: var(--panel);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--radius-m);
    padding: 0.6rem;
    min-width: 230px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    z-index: 1300;
}

.dropdown-links.active {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    animation: dropIn 0.25s var(--ease);
}

@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    color: var(--paper);
    border-radius: var(--radius-s);
    font-size: 0.92rem;
    transition: all 0.2s ease;
}

.dropdown-links a i {
    width: 16px;
    color: var(--paper-faint);
    font-size: 0.85rem;
}

.dropdown-links a:hover {
    background: var(--signal-dim);
    color: var(--signal);
    transform: translateX(4px);
}

.dropdown-links a:hover i {
    color: var(--signal);
}

@media (min-width: 900px) {
    .hamburger-toggle {
        display: none;
    }

    .dropdown-links {
        display: none !important;
    }
}

@media (max-width: 899px) {
    .visible-links {
        display: none;
    }

    .hamburger-menu {
        gap: 0.6rem;
    }
}

/* Mobile slide-in nav — Liquid Glass */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 7, 12, 0.6);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 1400;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: min(84vw, 320px);
    height: 100%;
    z-index: 1500;
    overflow: hidden;
    background: var(--lg-bg);
    border-right: 1px solid var(--lg-border);
    border-radius: 0 28px 28px 0;
    box-shadow: var(--lg-shadow);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    padding: 1.5rem 1.3rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.mobile-nav-sidebar .glass-blob.blob-a {
    width: 220px;
    height: 220px;
    top: -10%;
    left: -25%;
}

.mobile-nav-sidebar .glass-blob.blob-b {
    width: 200px;
    height: 200px;
    bottom: -12%;
    left: -15%;
    animation-delay: -6s;
}

.mobile-nav-sidebar.active {
    left: 0;
}

.mobile-nav-header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.3rem;
    border-bottom: 1px solid var(--lg-border);
}

.mobile-nav-title .eyebrow {
    margin: 0;
}

.mobile-close-btn {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--lg-border);
    color: var(--paper);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.mobile-close-btn:hover {
    background: var(--signal);
    border-color: transparent;
    color: #fff;
    transform: rotate(90deg);
}

.mobile-nav-links {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    overflow-y: auto;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    color: var(--paper);
    font-size: 0.98rem;
    border: 1px solid transparent;
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.mobile-nav-links a i {
    width: 18px;
    text-align: center;
    color: var(--paper-faint);
    font-size: 0.9rem;
    transition: color 0.25s var(--ease);
}

.mobile-nav-links a:hover,
.mobile-nav-links a:focus-visible {
    background: var(--signal-dim);
    border-color: var(--lg-border);
    color: var(--signal);
    transform: translateX(4px);
}

.mobile-nav-links a:hover i,
.mobile-nav-links a:focus-visible i {
    color: var(--signal);
}

/* ---------------------------------- Reveal-on-scroll ---------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.visible .stagger-item {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.stagger-item:nth-child(1) {
    transition-delay: 0.02s;
}

.stagger-item:nth-child(2) {
    transition-delay: 0.09s;
}

.stagger-item:nth-child(3) {
    transition-delay: 0.16s;
}

.stagger-item:nth-child(4) {
    transition-delay: 0.23s;
}

.stagger-item:nth-child(5) {
    transition-delay: 0.3s;
}

.stagger-item:nth-child(6) {
    transition-delay: 0.37s;
}

/* ---------------------------------- Experience (new) ---------------------------------- */
.experience-list {
    display: flex;
    flex-direction: column;
}

.experience-item {
    display: grid;
    /* Media column widened — it grows toward the left (into the gap next
       to the text body) since it's pinned to the row's right edge. */
    grid-template-columns: 130px 1fr 270px;
    gap: 2rem;
    padding: 2.4rem 0;
    border-top: 1px solid var(--hairline);
    position: relative;
    align-items: start;
    overflow: hidden;
    transition: padding 0.3s ease;
}

.experience-item::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
    background: radial-gradient(360px circle at var(--px, 50%) var(--py, 50%), var(--signal-dim), transparent 70%);
    transition: opacity 0.4s ease;
}

.experience-item:hover::before {
    opacity: 1;
}

.experience-item:hover {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
}

.experience-item>* {
    position: relative;
    z-index: 1;
}

.experience-item:last-child {
    border-bottom: 1px solid var(--hairline);
}

.experience-period {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--paper-faint);
    padding-top: 0.2rem;
}

.experience-period .status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    color: var(--ok);
    font-size: 0.72rem;
}

.experience-period .status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 8px var(--ok);
    animation: pulse 2s infinite;
}

.experience-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.experience-role-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.experience-role {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
}

.experience-org {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--signal);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.experience-org i {
    font-size: 0.7rem;
}

.experience-body p {
    max-width: 62ch;
    margin: 0;
}

.experience-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.experience-tags span {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    padding: 0.28rem 0.65rem;
    border-radius: 6px;
    background: var(--circuit-dim);
    color: var(--circuit);
    display: inline-block;
    transition: transform 0.3s var(--ease), background 0.3s ease, color 0.3s ease;
}

.experience-item:hover .experience-tags span {
    transform: translateY(-3px);
    background: var(--signal-dim);
    color: var(--signal);
}

.experience-media {
    position: relative;
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    margin: 0;
    min-height: 156px;
    border-radius: var(--radius-m);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: linear-gradient(135deg, var(--panel-2), var(--ink-2));
    /* Cinematic vignette via inset shadow, so it layers independently of
       the existing ::before (fallback icon) and ::after (glare) on this
       element rather than needing a third pseudo-element. */
    box-shadow: inset 0 0 46px rgba(2, 2, 4, 0.55);
}

.experience-media::before {
    content: '\f5c3';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--paper-faint);
}

.experience-media img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(22%) contrast(1.03);
    transition: transform 0.6s var(--ease), filter 0.4s ease;
}

.experience-item:hover .experience-media img {
    filter: grayscale(0%);
}

.experience-media {
    transform-style: preserve-3d;
    /* Snappy while the cursor is actively tilting it; JS swaps this to a
       slower, springy ease for the "release" back to resting position. */
    transition: transform 0.12s ease-out;
}

/* A soft light that follows the cursor across the tilted photo, like light
   catching glossy card stock — the "playful" part of the interaction. */
.experience-media::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(180px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.35), transparent 60%);
    mix-blend-mode: overlay;
    transition: opacity 0.3s ease;
}

.experience-media.is-tilting::after {
    opacity: 1;
}

.experience-media figcaption {
    position: absolute;
    z-index: 2;
    left: 0.6rem;
    bottom: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.03em;
    color: #fff;
    background: rgba(10, 8, 20, 0.6);
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

@media (max-width: 899px) {
    .experience-item {
        grid-template-columns: 120px 1fr;
    }

    .experience-media {
        grid-column: 1 / -1;
        min-height: 200px;
    }
}

@media (max-width: 700px) {
    .experience-item {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .experience-media {
        min-height: 180px;
    }
}

/* ---------------------------------- Achievements ---------------------------------- */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.achievement-card {
    /* each card gets its own accent (amber / teal / rose), like the language cards */
    --ach-accent: var(--signal);
    --ach-glow: var(--signal-dim);
    --card-accent-bg: linear-gradient(90deg, var(--ach-accent), transparent 82%) top / 100% 3px no-repeat,
        radial-gradient(circle at 100% 0%, var(--ach-glow), transparent 62%);
    background: var(--card-accent-bg), var(--lg-bg);
    border: 1px solid var(--lg-border);
    border-radius: var(--radius-m);
    padding: 1.9rem;
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
    box-shadow: var(--lg-shadow);
    transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.achievement-card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
    background: radial-gradient(220px circle at var(--px, 50%) var(--py, 0%), var(--ach-glow), transparent 70%);
    transition: opacity 0.4s ease;
}

.achievement-card:hover::after {
    opacity: 1;
}

.achievement-card::before {
    content: '\f091';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 1rem;
    right: 1.1rem;
    font-size: 1.3rem;
    color: var(--ach-accent);
    opacity: 0.6;
    transition: opacity 0.4s ease, transform 0.15s ease-out;
    transform: translate(calc(var(--iconx, 0) * 1px), calc(var(--icony, 0) * 1px)) rotate(var(--iconr, 0deg)) scale(var(--icons, 1));
}

.achievement-card:nth-child(3n+2) {
    --ach-accent: #5fb3a3;
    --ach-glow: rgba(95, 179, 163, 0.16);
}

.achievement-card:nth-child(3n+3) {
    --ach-accent: var(--rose);
    --ach-glow: var(--rose-dim);
}

.achievement-card:hover {
    border-color: var(--ach-accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    transform: translateY(-4px);
}

.achievement-card:hover::before {
    opacity: 1;
}

.achievement-card h3,
.achievement-card p {
    position: relative;
    z-index: 1;
}

.achievement-card h3 {
    font-size: 1.02rem;
    font-family: var(--font-body);
    font-weight: 700;
    margin-bottom: 0.7rem;
    padding-right: 1.5rem;
}

.achievement-card p {
    font-size: 0.92rem;
    margin: 0;
}

/* ---------------------------------- Skills (right-to-left marquee) ---------------------------------- */
.skills-marquee {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
}

.skills-marquee::before,
.skills-marquee::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: clamp(3rem, 10vw, 9rem);
    z-index: 2;
    pointer-events: none;
}

.skills-marquee::before {
    left: 0;
    background: linear-gradient(90deg, var(--ink), transparent);
}

.skills-marquee::after {
    right: 0;
    background: linear-gradient(270deg, var(--ink), transparent);
}

.skills-marquee-row {
    overflow: hidden;
}

.skills-marquee-track {
    display: flex;
    width: max-content;
    gap: 1rem;
    animation: marquee 44s linear infinite;
    will-change: transform;
}

.skills-marquee:hover .skills-marquee-track {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .skills-marquee {
        margin-left: 0;
        width: 100%;
    }

    .skills-marquee-track {
        animation: none;
        flex-wrap: wrap;
        justify-content: center;
    }

    .skills-marquee-track .skill-tile[aria-hidden="true"] {
        display: none;
    }

    .skills-marquee::before,
    .skills-marquee::after {
        display: none;
    }
}

.skill-tile {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-m);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-shadow);
    transition: border-color 0.3s ease, transform 0.3s var(--ease);
}

.skill-tile:hover {
    border-color: var(--signal);
    transform: translateY(-3px);
}

.skill-tile-icon {
    font-size: 1.5rem;
    color: var(--signal);
    width: 1.6rem;
    text-align: center;
    flex-shrink: 0;
}

.skill-tile-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 130px;
}

.skill-tile-name {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--paper);
    white-space: nowrap;
}

.skill-tile-meter {
    position: relative;
    height: 4px;
    border-radius: 999px;
    background: var(--hairline-strong);
    overflow: hidden;
}

.skill-tile-meter>span {
    position: absolute;
    inset: 0 auto 0 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--signal), var(--circuit));
}

.skill-disclaimer {
    font-size: 0.78rem;
    color: var(--paper-faint);
    margin-top: 1.9rem;
    font-style: italic;
    text-align: center;
}

/* ---------------------------------- Languages (sticky photo + scroll-revealed cards) ---------------------------------- */
.languages-layout {
    display: grid;
    grid-template-columns: 1.18fr 0.82fr;
    gap: clamp(1.8rem, 4.5vw, 4rem);
    align-items: start;
}

/* Photo sits on the right — the mirror image of the About section's
   left-hand portrait, so the two scrolly-style sections read as a pair. */
.languages-aside {
    position: sticky;
    top: calc(var(--nav-h) + 3.2vh);
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
    order: 2;
}

.languages-track {
    order: 1;
}

.lang-photo {
    position: relative;
    border-radius: var(--radius-l);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    background: linear-gradient(155deg, var(--panel-2), var(--ink-2));
    display: grid;
    place-items: center;
}

/* A cinematographer's viewfinder frame — four corner brackets in the
   signal accent, rather than a flag-coloured border. The active language's
   flag now lives only in the small emoji badge, so the flag never has to
   be approximated in CSS. */
.lang-photo-corner {
    position: absolute;
    z-index: 6;
    width: 22px;
    height: 22px;
    pointer-events: none;
    border-color: var(--signal);
    opacity: 0.85;
}

.lang-photo-corner.tl {
    top: 14px;
    left: 14px;
    border-top: 2px solid;
    border-left: 2px solid;
    border-radius: 4px 0 0 0;
}

.lang-photo-corner.tr {
    top: 14px;
    right: 14px;
    border-top: 2px solid;
    border-right: 2px solid;
    border-radius: 0 4px 0 0;
}

.lang-photo-corner.bl {
    bottom: 14px;
    left: 14px;
    border-bottom: 2px solid;
    border-left: 2px solid;
    border-radius: 0 0 0 4px;
}

.lang-photo-corner.br {
    bottom: 14px;
    right: 14px;
    border-bottom: 2px solid;
    border-right: 2px solid;
    border-radius: 0 0 4px 0;
}

/* Cinematic vignette across the still — darkens the edges so the subject
   (and the caption over it) reads clearly, like a graded film frame. */
.lang-photo-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(120% 90% at 50% 38%, transparent 45%, rgba(5, 4, 8, 0.55) 100%),
        linear-gradient(180deg, rgba(5, 4, 8, 0.28) 0%, transparent 22%, transparent 68%, rgba(5, 4, 8, 0.6) 100%);
}

/* Flag badge — an actual national flag emoji in a small medallion, so the
   country is always correct rather than approximated with CSS colour
   bands. */
.lang-photo-flag {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    z-index: 6;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(8, 7, 12, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.32);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
}

.lang-photo-flag-emoji {
    font-size: 1.35rem;
    line-height: 1;
    transform: translateY(0.5px);
}

.lang-photo-flag.is-swapping {
    transform: scale(0.55) rotate(-12deg);
    opacity: 0;
}

.lang-photo::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 26% 20%, var(--iris-dim), transparent 58%),
        radial-gradient(circle at 82% 84%, var(--signal-dim), transparent 55%);
}

.lang-photo-ph {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    padding: 1.6rem;
}

.lang-photo-ph .globe {
    font-size: 2.9rem;
    color: var(--circuit);
}

.lang-photo-ph .scripts {
    display: flex;
    gap: 0.55rem;
    font-size: 1.75rem;
    color: var(--paper-dim);
    line-height: 1;
}

.lang-photo-ph .scripts [lang="bn"] {
    font-family: 'Noto Sans Bengali', var(--font-display);
}

.lang-photo-ph .scripts [lang="hi"] {
    font-family: 'Noto Sans Devanagari', var(--font-display);
}

.lang-photo-ph .scripts [lang="ur"] {
    font-family: 'Noto Nastaliq Urdu', var(--font-display);
}

.lang-photo-ph code {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.02em;
    color: var(--paper-faint);
}

.lang-photo img {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(12%) contrast(1.03);
}

.lang-photo-scan {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    mix-blend-mode: overlay;
    background: linear-gradient(180deg, transparent 0%, rgba(221, 154, 59, 0.22) 50%, transparent 100%);
    background-size: 100% 220%;
    animation: langScan 6.5s linear infinite;
}

@keyframes langScan {
    0% {
        background-position: 0 -110%;
    }

    100% {
        background-position: 0 210%;
    }
}

/* Top progress rail — the same "story so far" idea as the about section's
   rail, but laid horizontally across the passport-style photo frame. */
.lang-photo-rail {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 4;
    background: rgba(255, 255, 255, 0.14);
}

.lang-photo-rail-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--signal), var(--circuit));
    transition: width 0.55s var(--ease);
}

/* Signature element: a rotating postmark that "stamps" the currently active
   language's greeting onto the photo — a different visual language from the
   about section's cinematic scan-frame, but the same sticky, story-led idea. */
.lang-stamp {
    position: absolute;
    z-index: 5;
    left: 1rem;
    top: 0.9rem;
    width: clamp(118px, 24vw, 150px);
    height: clamp(118px, 24vw, 150px);
    display: grid;
    place-items: center;
    pointer-events: none;
}

.lang-stamp-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: stampSpin 22s linear infinite;
}

.stamp-track {
    fill: none;
    stroke: rgba(237, 234, 223, 0.55);
    stroke-width: 1;
    stroke-dasharray: 2 5;
}

.stamp-text {
    font-family: var(--font-mono);
    font-size: 8.6px;
    letter-spacing: 0.14em;
    fill: rgba(31, 28, 20, 0.75);
}

@keyframes stampSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.lang-stamp-greeting {
    position: relative;
    z-index: 1;
    max-width: 84%;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(0.92rem, 2vw, 1.2rem);
    line-height: 1.22;
    color: #271111;
    text-shadow: 0 3px 18px rgba(247, 244, 244, 0.616);
    transition: opacity 0.35s ease, transform 0.35s var(--ease);
}

.lang-stamp-greeting.is-swapping {
    opacity: 0;
    transform: scale(0.9) rotate(-4deg);
}

.lang-stamp-greeting[lang="bn"] {
    font-family: 'Noto Sans Bengali', var(--font-display);
}

.lang-stamp-greeting[lang="hi"] {
    font-family: 'Noto Sans Devanagari', var(--font-display);
}

.lang-stamp-greeting[lang="ur"] {
    font-family: 'Noto Nastaliq Urdu', var(--font-display);
    font-size: clamp(1rem, 2.3vw, 1.3rem);
}

.lang-photo-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 2.4rem 1.3rem 1.1rem;
    background: linear-gradient(180deg, transparent, rgba(10, 8, 20, 0.84));
}

.lang-photo-chapter {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: var(--signal-strong);
}

.lang-photo-caption-text {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1rem;
    color: #fff;
    transition: opacity 0.3s ease;
}

.lang-tale {
    position: relative;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-shadow);
    padding: 1.35rem 1.5rem 1.5rem;
}

.lang-tale-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--signal);
    display: block;
    margin-bottom: 0.6rem;
}

.lang-tale-label::before {
    content: '// ';
    color: var(--paper-faint);
}

.lang-tale p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0;
    color: var(--paper-dim);
}

.languages-track {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
}

.lang-card {
    --lang-accent: var(--signal);
    position: relative;
    overflow: hidden;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-shadow);
    padding: 1.5rem 1.6rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.lang-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--lang-accent), transparent 82%);
}

.lang-card::after {
    content: '';
    position: absolute;
    top: -42%;
    right: -32%;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--lang-accent), transparent 70%);
    opacity: 0.10;
    pointer-events: none;
    transition: opacity 0.35s var(--ease);
}

.lang-card:hover {
    border-color: var(--lang-accent);
    box-shadow: 0 26px 55px rgba(0, 0, 0, 0.34);
    transform: translateY(-4px);
}

.lang-card:hover::after {
    opacity: 0.22;
}

.lang-card-top {
    display: flex;
    align-items: center;
    gap: 1.15rem;
}

.lang-ring-wrap {
    position: relative;
    width: 84px;
    height: 84px;
    flex-shrink: 0;
}

.lang-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.lang-ring .ring-track {
    fill: none;
    stroke: var(--hairline-strong);
    stroke-width: 8;
}

.lang-ring .ring-fill {
    fill: none;
    stroke: var(--lang-accent);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 327;
    stroke-dashoffset: 327;
    transition: stroke-dashoffset 1.6s var(--ease);
}

.lang-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--paper);
    line-height: 1;
}

.lang-ring-pct {
    font-size: 1.1rem;
}

.lang-ring-unit {
    font-size: 0.7rem;
    color: var(--paper-faint);
}

.lang-headline {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    min-width: 0;
}

.lang-headline h3 {
    font-size: 1.2rem;
}

.lang-level {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    padding: 0.24rem 0.62rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--hairline-strong);
    background: color-mix(in srgb, var(--lang-accent) 15%, transparent);
    color: var(--lang-accent);
    border: 1px solid color-mix(in srgb, var(--lang-accent) 30%, transparent);
}

.lang-level-learning i {
    font-size: 0.66rem;
}

.lang-desc {
    font-size: 0.9rem;
    margin: 0;
    color: var(--paper-dim);
}

/* Greeting chip — the "say hello" line requested for every language card */
.lang-greet {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.92rem;
    color: var(--paper);
    padding-top: 0.15rem;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}

.lang-greet::before {
    content: '“';
    color: var(--lang-accent);
    font-size: 1.1em;
}

.lang-greet::after {
    content: '”';
    color: var(--lang-accent);
    font-size: 1.1em;
}

.lang-greet[lang="bn"] {
    font-family: 'Noto Sans Bengali', var(--font-display);
    font-style: normal;
}

.lang-greet[lang="hi"] {
    font-family: 'Noto Sans Devanagari', var(--font-display);
    font-style: normal;
}

.lang-greet[lang="ur"] {
    font-family: 'Noto Nastaliq Urdu', var(--font-display);
    font-style: normal;
    font-size: 1.05rem;
}

.lang-greet[lang="ru"] {
    font-style: normal;
}

/* Desktop/web view — pin the greeting to the card's top-right corner.
   Mobile keeps the original inline placement inside the headline. */
@media (min-width: 900px) {
    .lang-card-top {
        padding-right: 8.5rem;
    }

    .lang-greet {
        position: absolute;
        top: 1.55rem;
        right: 1.7rem;
        max-width: 11rem;
        padding-top: 0;
        text-align: right;
        justify-content: flex-end;
        white-space: normal;
        z-index: 2;
    }
}

/* Focus state — the card nearest the viewport centre pops slightly while
   its neighbours settle back, tying the track to the sticky passport panel. */
.lang-card {
    transform: translateY(0) scale(0.985);
    opacity: 0.72;
}

.lang-card.reveal.visible {
    transform: translateY(0) scale(0.985);
    opacity: 0.72;
}

.lang-card.is-focused.reveal.visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    border-color: var(--lang-accent);
    box-shadow: 0 26px 55px rgba(0, 0, 0, 0.34);
}

@media (max-width: 899px) {

    .lang-card.reveal.visible,
    .lang-card {
        opacity: 1;
        transform: none;
    }
}

/* Line-mask reveal for language cards — the same "story" effect used in the
   About section: each card's headline/description/favourite-word rises into
   place, one line at a time, as it becomes the focused card while scrolling. */
.lang-mask {
    overflow: hidden;
    display: block;
}

.lang-mask>span {
    display: inline-block;
    transform: translateY(60%);
    opacity: 0;
    transition: transform 0.75s var(--ease), opacity 0.75s var(--ease);
}

.lang-card.is-focused .lang-mask>span {
    transform: translateY(0);
    opacity: 1;
}

.lang-card.is-focused h3.lang-mask>span {
    transition-delay: 0.04s;
}

.lang-card.is-focused p.lang-mask>span {
    transition-delay: 0.12s;
}

.lang-card.is-focused .lang-fav-native.lang-mask>span,
.lang-card.is-focused .lang-fav-latin.lang-mask>span {
    transition-delay: 0.2s;
}

.lang-fav {
    margin-top: 0.1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--hairline-strong);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.lang-fav-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--paper-faint);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.lang-fav-label i {
    color: var(--rose);
    font-size: 0.72rem;
}

.lang-fav-native {
    font-family: var(--font-display);
    font-size: 2.1rem;
    line-height: 1.3;
    color: var(--paper);
    transition: color 0.3s ease;
}

.lang-card:hover .lang-fav-native {
    color: var(--lang-accent);
}

.lang-fav-latin {
    font-size: 0.8rem;
    color: var(--paper-dim);
    font-style: italic;
}

/* native-script fonts for favourite words */
.lang-fav-native[lang="bn"] {
    font-family: 'Noto Sans Bengali', var(--font-display);
}

.lang-fav-native[lang="hi"] {
    font-family: 'Noto Sans Devanagari', var(--font-display);
}

.lang-fav-native[lang="ur"] {
    font-family: 'Noto Nastaliq Urdu', var(--font-display);
    font-size: 1.75rem;
    line-height: 1.9;
}

@media (prefers-reduced-motion: reduce) {
    .lang-photo-scan {
        animation: none;
        display: none;
    }
}

@media (max-width: 899px) {
    .languages-layout {
        grid-template-columns: 1fr;
        gap: 1.7rem;
    }

    .languages-aside {
        position: static;
        order: initial;
    }

    .languages-track {
        order: initial;
    }

    .lang-photo {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .lang-fav-native {
        font-size: 1.85rem;
    }

    .lang-card-top {
        gap: 0.9rem;
    }

    .lang-ring-wrap {
        width: 72px;
        height: 72px;
    }
}

/* ---------------------------------- Cross-page teaser cards (playful) ---------------------------------- */
.teaser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.75rem;
}

.teaser-card {
    position: relative;
    border-radius: var(--radius-l);
    overflow: hidden;
    border: 1px solid var(--lg-border);
    background: var(--lg-bg);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    backdrop-filter: blur(24px) saturate(170%);
    box-shadow: var(--lg-shadow);
    padding: 2.4rem;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    isolation: isolate;
    transition: transform 0.5s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.teaser-card:nth-child(odd) {
    --teaser-accent: var(--signal);
}

.teaser-card:nth-child(even) {
    --teaser-accent: var(--circuit);
}

.teaser-card:hover {
    transform: translateY(-8px) rotate(-0.6deg);
    border-color: var(--teaser-accent);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.teaser-card:nth-child(even):hover {
    transform: translateY(-8px) rotate(0.6deg);
}

.teaser-tag {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--teaser-accent);
    background: color-mix(in srgb, var(--teaser-accent) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--teaser-accent) 30%, transparent);
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
}

.teaser-card i.bg-icon {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2.6rem;
    color: var(--hairline-strong);
    transition: color 0.4s ease, transform 0.4s var(--ease);
}

.teaser-card:hover i.bg-icon {
    color: color-mix(in srgb, var(--teaser-accent) 35%, transparent);
    transform: rotate(-8deg) scale(1.08);
}

.teaser-emoji {
    position: absolute;
    bottom: 1.5rem;
    right: 1.6rem;
    font-size: 2.4rem;
    line-height: 1;
    transform: rotate(-8deg);
    transition: transform 0.45s var(--ease);
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
}

.teaser-card:hover .teaser-emoji {
    transform: rotate(8deg) scale(1.15) translateY(-4px);
}

.teaser-card h3 {
    margin-bottom: 0.5rem;
    padding-right: 3rem;
}

.teaser-card p {
    font-size: 0.92rem;
    margin-bottom: 1.3rem;
    padding-right: 2rem;
}

.teaser-btn {
    align-self: flex-start;
    transition: transform 0.35s var(--ease), border-color 0.3s ease, color 0.3s ease, gap 0.3s ease;
}

.teaser-card:hover .teaser-btn {
    border-color: var(--teaser-accent);
    color: var(--teaser-accent);
}

.teaser-card:hover .teaser-btn i {
    transform: translateX(4px);
}

.teaser-btn i {
    transition: transform 0.3s var(--ease);
}

@media (prefers-reduced-motion: reduce) {

    .teaser-card,
    .teaser-card i.bg-icon,
    .teaser-emoji,
    .teaser-btn i {
        transition: none;
    }

    .teaser-card:hover {
        transform: none;
    }
}

/* ---------------------------------- Contact (iOS26-style liquid glass) ---------------------------------- */

/* Theme-adaptive glass tokens for this section specifically — a true
   layered-glass look (translucent fill + bright rim + soft inner shadow)
   rather than a single flat blurred box. */
:root {
    --lg-bg: linear-gradient(158deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.045) 55%, rgba(255, 255, 255, 0.09));
    --lg-border: rgba(255, 255, 255, 0.30);
    --lg-sheen: rgba(255, 255, 255, 0.5);
    --lg-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
    --lg-input-bg: rgba(20, 18, 30, 0.28);
    --lg-input-border: rgba(255, 255, 255, 0.14);
    --lg-input-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    --lg-dot-bg: rgba(255, 255, 255, 0.10);
    --lg-dot-border: rgba(255, 255, 255, 0.22);
}

html.light-mode {
    --lg-bg: linear-gradient(158deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.4) 55%, rgba(255, 255, 255, 0.65));
    --lg-border: rgba(255, 255, 255, 0.75);
    --lg-sheen: rgba(255, 255, 255, 0.9);
    --lg-shadow: 0 30px 70px -20px rgba(60, 50, 110, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -1px 0 rgba(60, 50, 110, 0.06);
    --lg-input-bg: rgba(255, 255, 255, 0.55);
    --lg-input-border: rgba(40, 33, 74, 0.14);
    --lg-input-shadow: inset 0 1px 3px rgba(40, 33, 74, 0.08), inset 0 -1px 0 rgba(255, 255, 255, 0.7);
    --lg-dot-bg: rgba(255, 255, 255, 0.55);
    --lg-dot-border: rgba(40, 33, 74, 0.16);
}

.contact-liquid,
.liquid-glass {
    position: relative;
    border-radius: 32px;
    overflow: hidden;
    padding: clamp(1.7rem, 4vw, 3.2rem);
    background: var(--lg-bg);
    border: 1px solid var(--lg-border);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    box-shadow: var(--lg-shadow);
    isolation: isolate;
}

/* Cursor-follow refraction highlight — the pointer "moves the light" across the glass */
.contact-liquid::before,
.liquid-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(520px circle at var(--cx, 30%) var(--cy, 15%), rgba(255, 255, 255, 0.22), transparent 62%);
    transition: background 0.5s ease;
    mix-blend-mode: overlay;
}

html.light-mode .contact-liquid::before,
html.light-mode .liquid-glass::before {
    mix-blend-mode: soft-light;
}



@media (prefers-reduced-motion: reduce) {
    .contact-sheen {
        animation: none;
    }
}

/* Ambient drifting colour behind the glass — refracted, not flat, colour */
.contact-blob,
.glass-blob {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(6px);
    opacity: 0.7;
    animation: blobDrift 16s ease-in-out infinite;
}

.blob-a {
    width: 320px;
    height: 320px;
    left: -8%;
    top: -14%;
    background: radial-gradient(circle, var(--signal), transparent 68%);
    animation-duration: 17s;
}

.blob-b {
    width: 280px;
    height: 280px;
    right: -10%;
    top: 28%;
    background: radial-gradient(circle, var(--circuit), transparent 68%);
    animation-duration: 21s;
    animation-delay: -4s;
}

.blob-c {
    width: 260px;
    height: 260px;
    left: 32%;
    bottom: -20%;
    background: radial-gradient(circle, var(--iris), transparent 68%);
    animation-duration: 19s;
    animation-delay: -9s;
}

@keyframes blobDrift {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(4%, 6%) scale(1.08);
    }

    66% {
        transform: translate(-5%, -4%) scale(0.94);
    }
}

@media (prefers-reduced-motion: reduce) {

    .contact-blob,
    .glass-blob {
        animation: none;
    }
}

.contact-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.5fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
}

.contact-disclaimer {
    font-size: 0.82rem;
    color: var(--paper-faint);
    font-style: italic;
    margin-bottom: 1.2rem;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    background: var(--lg-input-bg);
    border: 1px solid var(--lg-input-border);
    box-shadow: var(--lg-input-shadow);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.25s var(--ease), background 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--paper-faint);
}

.form-group input:hover,
.form-group textarea:hover {
    background: color-mix(in srgb, var(--lg-input-bg) 88%, var(--paper) 4%);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--signal);
    box-shadow: var(--lg-input-shadow), 0 0 0 4px var(--signal-dim);
}

.form-group textarea {
    resize: vertical;
}

.form-button-wrapper {
    position: relative;
}

.submit-btn {
    position: relative;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 1rem 1.9rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--signal), var(--signal-strong));
    color: #16130a;
    border: 1px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 14px 30px rgba(221, 154, 59, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.submit-btn i {
    transition: transform 0.35s var(--ease);
}

.submit-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 18px 38px rgba(221, 154, 59, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.submit-btn:hover i {
    transform: translate(4px, -3px) rotate(12deg);
}

.submit-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Click ripple, driven by --rx/--ry set from pointer position in JS */
.submit-btn::after {
    content: '';
    position: absolute;
    left: var(--rx, 50%);
    top: var(--ry, 50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
}

.submit-btn.rippling::after {
    animation: submitRipple 0.6s ease-out;
}

@keyframes submitRipple {
    to {
        transform: translate(-50%, -50%) scale(22);
        opacity: 0;
    }
}

.statusPopup {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    display: none;
    align-items: center;
    gap: 0.6rem;
    opacity: 0;
    background: var(--lg-input-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--lg-input-border);
}

.statusPopup.active {
    display: flex;
    opacity: 1;
}

.statusPopup.success {
    color: var(--ok);
}

.statusPopup.error {
    color: var(--err);
}

.statusPopup.sending {
    color: var(--signal);
}

/* Icon-only social dock — an iOS-style vertical glass dock on desktop,
   a horizontal row on narrow screens. Labels only ever appear as a tooltip. */
.contact-dock-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    justify-self: center;
}

.contact-dock-label {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--signal);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.85rem;
    border-radius: 28px;
    background: var(--lg-input-bg);
    border: 1px solid var(--lg-input-border);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: var(--lg-input-shadow);
}

.social-dot {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lg-dot-bg);
    border: 1px solid var(--lg-dot-border);
    color: var(--paper);
    font-size: 1.05rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.35s var(--ease), background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.social-dot:hover {
    transform: translateY(-4px) scale(1.1);
    background: linear-gradient(135deg, var(--signal), var(--signal-strong));
    color: #16130a;
    box-shadow: 0 12px 24px rgba(221, 154, 59, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Pure-CSS tooltip, appears to the left of the dock */
.social-dot::after {
    content: attr(data-tip);
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    white-space: nowrap;
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    background: var(--panel);
    color: var(--paper);
    border: 1px solid var(--hairline-strong);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.social-dot:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

@media (max-width: 899px) {
    .contact-container {
        /* minmax(0, 1fr) instead of a bare 1fr — grid items default to
           min-width:auto, so the intrinsic (non-wrapping) width of the
           dock/social-icons row was forcing this single column — and every
           child in it, including the form — wider than the glass card,
           which then got silently clipped by the card's overflow:hidden.
           That's what made every element look "pushed left" with no
           breathing room on the right. */
        grid-template-columns: minmax(0, 1fr);
    }

    .contact-form,
    .contact-dock-wrap {
        min-width: 0;
    }

    .contact-dock-wrap {
        flex-direction: row-reverse;
        justify-content: center;
        flex-wrap: wrap;
    }

    .contact-dock-label {
        writing-mode: horizontal-tb;
        transform: none;
    }

    .social-links {
        flex-direction: row;
    }

    .social-dot::after {
        right: auto;
        left: 50%;
        top: auto;
        bottom: calc(100% + 10px);
        transform: translateX(-50%) translateY(6px);
    }

    .social-dot:hover::after {
        transform: translateX(-50%) translateY(0);
    }
}

/* ---------------------------------- Footer ---------------------------------- */
footer {
    border-top: 1px solid var(--hairline);
    padding: 2.5rem 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

footer p {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--paper-faint);
    margin: 0;
}

/* ---------------------------------- Particles (ambient) ---------------------------------- */
.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particles div {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--signal);
    opacity: 0.5;
    animation: floatp 14s linear infinite;
    transform: translate(var(--x), var(--y));
}

@keyframes floatp {
    0% {
        transform: translate(var(--x), var(--y)) translateY(0);
        opacity: 0;
    }

    10% {
        opacity: 0.5;
    }

    90% {
        opacity: 0.5;
    }

    100% {
        transform: translate(var(--x), calc(var(--y) - 40vh));
        opacity: 0;
    }
}

/* ---------------------------------- Utility ---------------------------------- */
.text-justify {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    line-height: 1.6;
}

/* ===== Shared liquid-glass tokens (used by nav, footer, mobile shell, video, projects) ===== */
/* ---------- Liquid-glass tokens (dark default, light override) ---------- */
:root {
    --m-glass-bg:
        linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05) 55%, rgba(255, 255, 255, 0.10)),
        rgba(26, 24, 36, 0.38);
    --m-glass-border: rgba(255, 255, 255, 0.16);
    --m-glass-shadow:
        0 12px 32px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.30),
        inset 0 -1px 0 rgba(0, 0, 0, 0.22),
        inset 0 0 22px rgba(255, 255, 255, 0.05);
    --m-rim: linear-gradient(140deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, 0.28));
    --m-lens: linear-gradient(160deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.08));
    --m-lens-border: rgba(255, 255, 255, 0.28);
    --m-sheet-tint: rgba(16, 14, 24, 0.72);
}

html.light-mode {
    --m-glass-bg:
        linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.42) 55%, rgba(255, 255, 255, 0.62)),
        rgba(238, 236, 246, 0.35);
    --m-glass-border: rgba(255, 255, 255, 0.85);
    --m-glass-shadow:
        0 12px 30px rgba(60, 50, 110, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(60, 50, 110, 0.08),
        inset 0 0 22px rgba(255, 255, 255, 0.35);
    --m-rim: linear-gradient(140deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0) 34%, rgba(255, 255, 255, 0) 66%, rgba(120, 105, 200, 0.22));
    --m-lens: linear-gradient(160deg, rgba(109, 91, 208, 0.18), rgba(109, 91, 208, 0.07));
    --m-lens-border: rgba(109, 91, 208, 0.25);
    --m-sheet-tint: rgba(243, 241, 251, 0.72);
}


/* ==========================================================================
   SHARED LAYER (v2) — liquid-glass nav/footer, theme switch animation,
   page transitions, projects showcase. (Glass tokens defined just above.)
   ========================================================================== */

/* ---------------------------------- Desktop liquid-glass nav ---------------------------------- */
@media (min-width: 900px) {
    html nav[aria-label="Main navigation"] {
        top: 14px;
        left: 50%;
        right: auto;
        width: min(1140px, calc(100% - 48px));
        height: 62px;
        transform: translateX(-50%);
        border-radius: 999px;
        border: 1px solid var(--m-glass-border);
        background: var(--m-glass-bg);
        box-shadow: var(--m-glass-shadow);
        -webkit-backdrop-filter: blur(24px) saturate(200%) brightness(1.06);
        backdrop-filter: blur(24px) saturate(200%) brightness(1.06);
        isolation: isolate;
        transition: width 0.6s var(--ease), box-shadow 0.4s ease, top 0.4s var(--ease);
    }

    html nav[aria-label="Main navigation"].is-scrolled {
        width: min(1000px, calc(100% - 48px));
        top: 10px;
    }

    nav[aria-label="Main navigation"]::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        padding: 1px;
        background: var(--m-rim);
        -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
        -webkit-mask-composite: xor;
        mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
        pointer-events: none;
        z-index: 2;
    }

    nav[aria-label="Main navigation"] .nav-content {
        max-width: none;
        padding-left: 1.6rem;
        padding-right: 0.9rem;
    }

    .visible-links {
        gap: 0.35rem;
    }

    .visible-links a {
        padding: 0.55rem 1rem;
        border-radius: 999px;
        border: 1px solid transparent;
        transition: color 0.25s ease, background 0.3s ease, border-color 0.3s ease, transform 0.3s var(--ease);
    }

    .visible-links a::after {
        display: none;
    }

    .visible-links a:hover {
        background: var(--m-lens);
        border-color: var(--m-lens-border);
        color: var(--paper);
        transform: translateY(-1px);
    }

    .theme-toggle {
        background: var(--m-glass-bg);
        border: 1px solid var(--m-glass-border);
        box-shadow: var(--m-glass-shadow);
        -webkit-backdrop-filter: blur(20px) saturate(190%);
        backdrop-filter: blur(20px) saturate(190%);
        width: 50px;
        height: 50px;
    }
}

/* ---------------------------------- Liquid-glass footer (all sizes) ---------------------------------- */
footer {
    border-top: 0;
    padding: 1.5rem 0 2.6rem;
}

footer .container {
    position: relative;
    width: min(1140px, calc(100% - 2 * var(--edge)));
    max-width: none;
    margin: 0 auto;
    padding: 1.15rem 1.8rem;
    border-radius: 999px;
    overflow: hidden;
    isolation: isolate;
    background: var(--m-glass-bg);
    border: 1px solid var(--m-glass-border);
    box-shadow: var(--m-glass-shadow);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    backdrop-filter: blur(24px) saturate(190%);
}

footer .container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--m-rim);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
    z-index: 2;
}

footer .container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -40%;
    width: 28%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent);
    transform: skewX(-18deg);
    animation: footSheen 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes footSheen {

    0%,
    55% {
        left: -40%;
    }

    100% {
        left: 130%;
    }
}

footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    text-align: center;
    line-height: 1.5;
}

footer p::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 10px var(--signal);
    flex-shrink: 0;
}

footer p strong {
    color: var(--paper);
}

@media (max-width: 899px) {
    footer .container {
        border-radius: 26px;
        padding: 1rem 1.2rem;
    }
}

/* ---------------------------------- Theme switch animation ---------------------------------- */
html.theme-vt::view-transition-old(root),
html.theme-vt::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

html.theme-vt::view-transition-old(root) {
    z-index: 1;
}

html.theme-vt::view-transition-new(root) {
    z-index: 2;
}

.theme-wipe {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: none;
    will-change: clip-path;
}

.theme-ripple {
    position: fixed;
    z-index: 2147483001;
    pointer-events: none;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 50%;
    border: 2px solid var(--signal);
    box-shadow: 0 0 30px var(--signal), inset 0 0 20px var(--signal-dim);
    opacity: 0.9;
    transform: translate(var(--tx), var(--ty)) scale(0);
    animation: themeRipple 0.8s cubic-bezier(0.65, 0, 0.2, 1) forwards;
}

@keyframes themeRipple {
    70% {
        opacity: 0.55;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(var(--s));
        opacity: 0;
    }
}

html.theme-anim .theme-toggle,
html.theme-anim .m-theme i {
    animation: themeSpin 0.85s cubic-bezier(0.5, 0, 0.2, 1);
}

@keyframes themeSpin {
    0% {
        transform: rotate(0) scale(1);
    }

    45% {
        transform: rotate(200deg) scale(0.7);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* ---------------------------------- Page transitions ---------------------------------- */
html.pt-cover::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: var(--ink);
}

.pt {
    --dir: 1;
    opacity: 1;
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    pointer-events: none;
    visibility: hidden;
    overflow: hidden;
}

.pt.is-on {
    visibility: visible;
    pointer-events: auto;
}

/* Arrival: no second animation — the covered screen just dissolves quickly */
.pt.is-fade {
    opacity: 0;
    transition: opacity 0.22s ease;
}

.pt-slats {
    position: absolute;
    inset: 0;
    display: flex;
}

.pt-slat {
    --i: 0;
    position: relative;
    flex: 1 0 0;
    margin-right: -1px;
    background: var(--ink);
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.10), inset -1px 0 0 rgba(0, 0, 0, 0.25);
    transform: translateX(calc(var(--dir) * 101%));
    transition: transform 0.42s cubic-bezier(0.76, 0, 0.24, 1) calc(var(--i) * 30ms);
    will-change: transform;
}

.pt-slat::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(221, 154, 59, 0.10), transparent 40%, rgba(95, 179, 163, 0.10)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 40%);
    pointer-events: none;
}

.pt.is-in .pt-slat {
    transform: none;
}

.pt.is-covered .pt-slat {
    transform: none;
    transition: none;
}

.pt.is-out .pt-slat {
    transform: translateX(calc(var(--dir) * -101%));
}

.pt-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease 0.2s, transform 0.5s var(--ease) 0.2s;
    color: var(--paper);
}

.pt.is-in .pt-label,
.pt.is-covered .pt-label {
    opacity: 1;
    transform: none;
}

.pt.is-out .pt-label {
    opacity: 0;
    transform: translateY(-8px);
    transition-delay: 0s;
}

.pt-icon {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    background: linear-gradient(150deg, var(--signal-strong), var(--signal));
    box-shadow: 0 14px 34px -8px var(--signal), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pt-name {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    font-weight: 600;
}

.pt-line {
    width: 120px;
    height: 2px;
    border-radius: 2px;
    background: var(--hairline-strong);
    overflow: hidden;
    position: relative;
}

.pt-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--circuit), var(--signal));
    transform: translateX(-100%);
}

.pt.is-in .pt-line::after {
    animation: ptLine 0.7s var(--ease) 0.1s forwards;
}


@keyframes ptLine {
    to {
        transform: none;
    }
}

@keyframes ptLabelIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pt {
        display: none;
    }

    html.pt-cover::after {
        display: none;
    }

    footer .container::after {
        animation: none;
        display: none;
    }

    html.theme-anim .theme-toggle,
    html.theme-anim .m-theme i {
        animation: none;
    }
}

/* ---------------------------------- Desktop hamburger menu ---------------------------------- */
.dm-btn,
.dm-panel,
.dm-backdrop {
    display: none;
}

@media (min-width: 900px) {
    .dm-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-left: 0.5rem;
        border-radius: 50%;
        cursor: pointer;
        color: var(--paper);
        background: var(--m-lens);
        border: 1px solid var(--m-lens-border);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
        transition: transform 0.35s var(--ease), background 0.3s ease, border-color 0.3s ease;
    }

    .dm-btn:hover {
        transform: scale(1.08);
        border-color: var(--signal);
    }

    .dm-btn:active {
        transform: scale(0.92);
    }

    .dm-btn:focus-visible {
        outline: 2px solid var(--signal);
        outline-offset: 2px;
    }

    .dm-burger {
        position: relative;
        width: 18px;
        height: 12px;
        display: block;
    }

    .dm-burger i {
        position: absolute;
        left: 0;
        height: 2px;
        width: 100%;
        border-radius: 2px;
        background: currentColor;
        transition: transform 0.5s cubic-bezier(0.34, 1.5, 0.5, 1), top 0.4s var(--ease), width 0.35s var(--ease), opacity 0.2s ease, background 0.3s ease;
    }

    .dm-burger i:nth-child(1) {
        top: 0;
    }

    .dm-burger i:nth-child(2) {
        top: 5px;
        width: 65%;
    }

    .dm-burger i:nth-child(3) {
        top: 10px;
        width: 82%;
    }

    .dm-btn:hover .dm-burger i:nth-child(2),
    .dm-btn:hover .dm-burger i:nth-child(3) {
        width: 100%;
    }

    .dm-btn[aria-expanded="true"] {
        background: var(--signal);
        color: #16130a;
        border-color: var(--signal);
    }

    .dm-btn[aria-expanded="true"] .dm-burger i:nth-child(1) {
        top: 5px;
        transform: rotate(45deg);
    }

    .dm-btn[aria-expanded="true"] .dm-burger i:nth-child(2) {
        opacity: 0;
        transform: translateX(10px);
    }

    .dm-btn[aria-expanded="true"] .dm-burger i:nth-child(3) {
        top: 5px;
        width: 100%;
        transform: rotate(-45deg);
    }

    .dm-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1190;
        background: rgba(6, 5, 10, 0.34);
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(5px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s;
    }

    .dm-backdrop.is-open {
        opacity: 1;
        visibility: visible;
    }

    .dm-panel {
        display: block;
        position: fixed;
        z-index: 1250;
        top: 90px;
        right: 24px;
        width: 500px;
        max-height: calc(100vh - 110px);
        overflow-x: hidden;
        overflow-y: auto;
        padding: 16px 16px 14px;
        border-radius: 32px;
        isolation: isolate;
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04) 60%, rgba(255, 255, 255, 0.08)), var(--m-sheet-tint);
        border: 1px solid var(--m-glass-border);
        box-shadow: var(--m-glass-shadow), 0 40px 80px -30px rgba(0, 0, 0, 0.55);
        -webkit-backdrop-filter: blur(30px) saturate(190%);
        backdrop-filter: blur(30px) saturate(190%);
        transform-origin: calc(100% - 30px) -24px;
        transform: translateY(-10px) scale(0.9);
        clip-path: circle(0px at calc(100% - 30px) -24px);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.6s cubic-bezier(0.34, 1.3, 0.5, 1), clip-path 0.65s cubic-bezier(0.65, 0, 0.2, 1), opacity 0.3s ease, visibility 0.65s, top 0.4s var(--ease), right 0.4s var(--ease);
    }

    .dm-panel.is-open {
        transform: none;
        clip-path: circle(1400px at calc(100% - 30px) -24px);
        opacity: 1;
        visibility: visible;
    }

    .dm-panel::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        padding: 1px;
        background: var(--m-rim);
        -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
        -webkit-mask-composite: xor;
        mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
        pointer-events: none;
        z-index: 3;
    }

    .dm-panel::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: -50%;
        width: 35%;
        background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transform: skewX(-18deg);
        opacity: 0;
        pointer-events: none;
        z-index: 2;
    }

    .dm-panel.is-open::after {
        animation: dmSheen 1.2s ease 0.25s both;
    }

    @keyframes dmSheen {
        from {
            left: -50%;
            opacity: 0.9;
        }

        to {
            left: 130%;
            opacity: 0;
        }
    }

    .dm-head,
    .dm-foot {
        opacity: 0;
        transform: translateY(8px);
        transition: opacity 0.4s ease, transform 0.5s var(--ease);
    }

    .dm-panel.is-open .dm-head,
    .dm-panel.is-open .dm-foot {
        opacity: 1;
        transform: none;
        transition-delay: 0.3s;
    }

    .dm-panel.is-open .dm-foot {
        transition-delay: 0.55s;
    }

    .dm-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 2px 8px 10px;
        font-family: var(--font-mono);
        font-size: 0.7rem;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--paper-faint);
    }

    .dm-head kbd {
        font-family: var(--font-mono);
        font-size: 0.64rem;
        padding: 0.15rem 0.5rem;
        border-radius: 6px;
        border: 1px solid var(--hairline-strong);
        color: var(--paper-faint);
    }

    .dm-grid {
        position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }

    .dm-item {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        padding: 0.65rem 0.75rem;
        border-radius: 20px;
        border: 1px solid transparent;
        color: var(--paper);
        text-decoration: none;
        opacity: 0;
        transform: translateY(14px) scale(0.94);
        transition: background 0.3s ease, border-color 0.3s ease;
    }

    .dm-panel.is-open .dm-item {
        opacity: 1;
        transform: none;
        transition: opacity 0.45s ease calc(var(--d, 0) * 38ms + 160ms), transform 0.6s cubic-bezier(0.34, 1.4, 0.5, 1) calc(var(--d, 0) * 38ms + 160ms), background 0.3s ease, border-color 0.3s ease;
    }

    .dm-panel.is-open .dm-item:hover {
        background: var(--m-lens);
        border-color: var(--m-lens-border);
        transform: translateX(4px);
        transition-delay: 0s;
    }

    .dm-item:focus-visible {
        outline: 2px solid var(--signal);
        outline-offset: -2px;
    }

    .dm-ic {
        position: relative;
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        border-radius: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.05rem;
        color: #fff;
        background: linear-gradient(150deg, var(--c1), var(--c2));
        box-shadow: 0 8px 18px -8px var(--c1), inset 0 1px 0 rgba(255, 255, 255, 0.45);
        transition: transform 0.45s cubic-bezier(0.34, 1.8, 0.5, 1);
    }

    .dm-item:hover .dm-ic {
        transform: rotate(-8deg) scale(1.12);
    }

    .dm-item.is-current .dm-ic::after {
        content: '';
        position: absolute;
        inset: -3px;
        border-radius: inherit;
        border: 2px solid var(--signal);
        animation: dmRing 2s ease-out infinite;
    }

    @keyframes dmRing {
        from {
            transform: scale(0.96);
            opacity: 0.9;
        }

        to {
            transform: scale(1.25);
            opacity: 0;
        }
    }

    .dm-t b {
        display: block;
        font-size: 0.92rem;
        font-weight: 600;
        line-height: 1.2;
    }

    .dm-t small {
        font-family: var(--font-mono);
        font-size: 0.66rem;
        color: var(--paper-faint);
    }

    .dm-foot {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-top: 10px;
        padding: 12px 6px 2px;
        border-top: 1px solid var(--m-glass-border);
    }

    .dm-social {
        display: flex;
        gap: 8px;
    }

    .dm-social a {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--paper);
        background: var(--lg-dot-bg);
        border: 1px solid var(--lg-dot-border);
        text-decoration: none;
        transition: transform 0.3s var(--ease), background 0.3s ease, color 0.3s ease;
    }

    .dm-social a:hover {
        transform: translateY(-3px);
        background: var(--signal);
        color: #16130a;
    }

    .dm-seg {
        display: inline-flex;
        padding: 3px;
        border-radius: 999px;
        background: var(--lg-input-bg);
        border: 1px solid var(--lg-input-border);
    }

    .dm-seg button {
        border: 0;
        background: transparent;
        color: var(--paper-dim);
        font-family: var(--font-body);
        font-size: 0.74rem;
        font-weight: 600;
        padding: 8px 14px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        transition: background 0.3s ease, color 0.3s ease;
    }

    .dm-seg button.is-on {
        background: var(--signal);
        color: #16130a;
    }
}

@media (prefers-reduced-motion: reduce) {

    .dm-panel,
    .dm-item,
    .dm-burger i,
    .dm-head,
    .dm-foot {
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }

    .dm-panel::after,
    .dm-item.is-current .dm-ic::after {
        animation: none;
    }
}

/* ---- shared rules preserved from the old hero/about/projects blocks ---- */
.btn {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    padding: 0.9rem 1.6rem;
    border-radius: 999px;
    border: 1px solid var(--hairline-strong);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s var(--ease);
    background: transparent;
    color: var(--paper);
}

.btn-primary {
    background: var(--signal);
    color: #16130a;
    border-color: var(--signal);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--signal-strong);
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(221, 154, 59, 0.28);
}

.btn-ghost:hover {
    border-color: var(--signal);
    color: var(--signal);
    transform: translateY(-3px);
}

.hl {
    color: var(--signal);
    font-weight: 600;
    font-style: normal;
}

.projects-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--paper-faint);
    margin-bottom: 0.5rem;
}

.projects-hint i {
    color: var(--signal);
    animation: hintSlide 1.8s ease-in-out infinite;
}

@keyframes hintSlide {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(4px);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}


/* ==========================================================================
   SECTION TITLES — one style for every title on the site, modelled on the
   "Selected work" heading: heavy uppercase gradient word + italic serif
   lowercase word. Markup:
     <h2 class="sec-title"><span class="grad-text">Selected</span> <em>work</em></h2>
   ========================================================================== */
:root {
    --grad-1: #ffffff;
    --grad-2: #d4d1c8;
    --grad-3: #4a4952;
}

html.light-mode {
    --grad-1: #1c1a2b;
    --grad-2: #4a4570;
    --grad-3: #cfc9ea;
}

.grad-text {
    background: linear-gradient(to bottom, var(--grad-1) 10%, var(--grad-2) 55%, var(--grad-3) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.sec-title {
    margin: 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.2em 0.35em;
    font-family: var(--font-body);
    font-weight: 900;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    line-height: 0.95;
    font-size: clamp(2.8rem, 7vw, 6.2rem);
    text-align: center;
}

.sec-title .grad-text {
    padding: 0.04em 0.04em;
}

.sec-title em {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: -0.02em;
    color: var(--paper-dim);
    padding-right: 0.1em;
}

@media (max-width: 899px) {

    .sec-title {
        font-size: clamp(1.7rem, 8.2vw, 4.2rem) !important;
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}
