/* ============================================================
   Glen Carter — Portfolio
   Design system: compact scale + glassmorphism + scroll-driven bg
   ============================================================ */

:root {
    /* Colors — premium dark theme */
    --bg-dark: #0f1115;
    --bg-card: #161b22;
    --text-main: #e6e6e6;
    --text-muted: #a0a0a0;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;

    /* Spacing & layout */
    --container-width: 1140px;
    --header-height: 60px;
    --section-pad: 46px;

    /* Effects */
    --radius-sm: 8px;
    --radius-md: 14px;
    --shadow-soft: 0 10px 28px -14px rgba(0, 0, 0, 0.6);

    /* Navbar glass (kept fairly opaque for legibility) */
    --glass-bg: rgba(13, 15, 19, 0.66);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);

    /* Glassmorphism surfaces — translucent so the moving
       background gradient reads through the frosted panels */
    --surface: rgba(255, 255, 255, 0.045);
    --surface-strong: rgba(255, 255, 255, 0.072);
    --surface-border: rgba(255, 255, 255, 0.10);
    --surface-border-hover: rgba(255, 255, 255, 0.22);
    --blur: blur(16px) saturate(160%);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.55;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

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

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.4rem, 4.4vw, 3.7rem);
    margin-bottom: 14px;
}

h2 {
    font-size: 2rem;
    margin-bottom: 0.7rem;
}

h3 {
    font-size: 1.3rem;
}

p {
    color: var(--text-muted);
    margin-bottom: 0.9rem;
    font-size: 1rem;
}

/* Scroll-driven gradient background (set by JS in main.js) */
#aurora-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 78% 16%, rgba(59, 130, 246, 0.20) 0%, transparent 48%),
        radial-gradient(circle at 16% 74%, rgba(139, 92, 246, 0.18) 0%, transparent 46%),
        radial-gradient(circle at 54% 98%, rgba(16, 185, 129, 0.14) 0%, transparent 52%);
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: var(--section-pad) 0;
}

.accent-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background: var(--accent-gradient);
    color: white;
    padding: 10px 26px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(59, 130, 246, 0.55);
}

.btn-secondary {
    display: inline-block;
    background: rgba(255, 255, 255, 0.03);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    color: var(--text-main);
    padding: 10px 26px;
    border-radius: 50px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 12px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--surface-border-hover);
}

/* Entrance animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(28px);
    animation: fadeInUp 0.8s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

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

/* Scroll-reveal */
.fade-in-section {
    opacity: 0;
    transform: translateY(42px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
    z-index: 1000;
    border-bottom: var(--glass-border);
}

/* Glass effect via pseudo-element: keeps backdrop-filter off the navbar
   itself so it does not become a containing block for the fixed-position
   mobile menu (which must fill the full viewport). */
.navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
}

.nav-links a:not(.btn-primary) {
    position: relative;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 4px 0;
}

.nav-links a:not(.btn-primary)::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.nav-links a:not(.btn-primary):hover {
    color: var(--text-main);
}

.nav-links a:not(.btn-primary):hover::after,
.nav-links a:not(.btn-primary).active::after {
    transform: scaleX(1);
}

.nav-links a:not(.btn-primary).active {
    color: var(--text-main);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
    background: none;
    border: none;
    padding: 4px;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background-color: var(--text-main);
    transition: all 0.3s ease;
}

/* ===== Homepage section sub-nav ===== */
.section-nav {
    position: sticky;
    top: var(--header-height);
    z-index: 900;
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border-bottom: var(--glass-border);
}

.section-nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.section-nav-links::-webkit-scrollbar {
    display: none;
}

.section-nav-links a {
    display: block;
    position: relative;
    padding: 13px 0;
    font-size: 0.86rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.section-nav-links a:hover {
    color: var(--text-main);
}

.section-nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.section-nav-links a:hover::after,
.section-nav-links a.active::after {
    transform: scaleX(1);
}

.section-nav-links a.active {
    color: var(--text-main);
}

/* Extra scroll offset on the homepage for the stacked sub-nav */
html.home {
    scroll-padding-top: 116px;
}

/* ===== Hero ===== */
.hero {
    min-height: 82vh;
    height: auto;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: calc(var(--header-height) + 30px);
    padding-bottom: 44px;
}

.hero>.container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gradient-orb {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 300px;
    height: 300px;
    background: var(--accent-gradient);
    border-radius: 50%;
    filter: blur(85px);
    opacity: 0.5;
    animation: float 6s ease-in-out infinite;
}

.hero-photo {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 348px;
    aspect-ratio: 2 / 3;
    border-radius: 22px;
    overflow: hidden;
    border: var(--glass-border);
    box-shadow: var(--shadow-soft);
}

.hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 14px;
}

/* ===== Section titles ===== */
.section-title {
    margin-bottom: 28px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 48px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.section-intro {
    max-width: 700px;
    margin-bottom: 30px;
}

/* ===== About ===== */
.about-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.about-main p {
    font-size: 1.04rem;
    line-height: 1.7;
    margin-bottom: 1.05rem;
}

.about-main p:first-child {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-main);
}

.about-main p:last-child {
    margin-bottom: 0;
}

.about-expertise {
    background: var(--surface);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 24px 26px;
}

.about-expertise-title {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: var(--accent-primary);
    margin-bottom: 14px;
}

.expertise-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
}

.expertise-item:first-of-type {
    padding-top: 0;
}

.expertise-item:last-child {
    padding-bottom: 0;
}

.expertise-item + .expertise-item {
    border-top: 1px solid var(--surface-border);
}

.expertise-item-icon {
    flex-shrink: 0;
    width: 22px;
    margin-top: 3px;
    font-size: 1.05rem;
    color: var(--accent-primary);
    text-align: center;
}

.expertise-item h4 {
    font-size: 0.97rem;
    margin-bottom: 4px;
}

.expertise-item p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.tool-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-list span {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.tool-list span:hover {
    background: var(--surface-strong);
    color: var(--text-main);
    border-color: var(--surface-border-hover);
}

/* ===== Experience — Gantt timeline ===== */

/* category colours — muted, premium palette */
.cat-education { --cat: #6f9f91; }
.cat-fulltime { --cat: #7488b5; }
.cat-parttime { --cat: #9a82ac; }
.cat-venture { --cat: #c2a06a; }

/* the box breaks out slightly wider than the content column */
.tl-box {
    margin-top: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: min(1260px, 94vw);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.058), rgba(255, 255, 255, 0.022));
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 22px 26px 26px;
}

.tl-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 24px;
    margin-bottom: 14px;
}

.tl-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    letter-spacing: 0.2px;
    color: var(--text-muted);
}

.tl-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--cat);
    flex-shrink: 0;
}

.tl-legend-dash .tl-swatch {
    width: 22px;
    background: repeating-linear-gradient(90deg, var(--text-muted) 0 4px, transparent 4px 7px);
}

.tl-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.tl-scroll::-webkit-scrollbar {
    display: none;
}

/* ----- Gantt chart ----- */
.tl-gantt {
    --tl-label-w: 250px;
    min-width: 900px;
}

.tl-years {
    display: grid;
    grid-template-columns: var(--tl-label-w) 1fr;
    margin-bottom: 6px;
}

.tl-years-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.tl-rows {
    display: flex;
    flex-direction: column;
}

.tl-row {
    display: grid;
    grid-template-columns: var(--tl-label-w) 1fr;
    align-items: stretch;
    width: 100%;
    min-height: 36px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.tl-row-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    padding: 5px 16px 5px 2px;
    position: sticky;
    left: 0;
    z-index: 2;
}

.tl-row-role {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.78rem;
    line-height: 1.26;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.tl-row:hover .tl-row-role,
.tl-row.is-active .tl-row-role {
    color: var(--text-main);
}

.tl-row-meta {
    font-size: 0.67rem;
    color: var(--text-muted);
    opacity: 0.75;
}

.tl-row-track {
    position: relative;
    align-self: stretch;
    background: repeating-linear-gradient(to right,
            rgba(255, 255, 255, 0.05) 0 1px,
            transparent 1px calc(100% / 7));
}

.tl-bar {
    position: absolute;
    left: var(--s);
    width: var(--w);
    min-width: 24px;
    top: 50%;
    height: 16px;
    transform: translateY(-50%);
    transform-origin: left center;
    background: var(--cat);
    border-radius: 5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: filter 0.2s ease, box-shadow 0.2s ease;
}

/* intermittent / recurring work — a dashed, segmented bar */
.tl-row.is-intermittent .tl-bar {
    background: repeating-linear-gradient(90deg, var(--cat) 0 10px, transparent 10px 16px);
    box-shadow: none;
}

.tl-row:hover .tl-bar {
    filter: brightness(1.13);
}

.tl-row.is-active .tl-bar {
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.3), 0 4px 14px -2px var(--cat),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    filter: brightness(1.08);
}

/* entrance — bars sweep in from the left */
@keyframes tlBarIn {
    from { transform: translateY(-50%) scaleX(0); }
    to { transform: translateY(-50%) scaleX(1); }
}

.fade-in-section.visible .tl-bar {
    animation: tlBarIn 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* detail panel — all panels stack in one grid cell and cross-fade */
.tl-detail {
    display: grid;
    margin-top: 10px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tl-panel {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}

.tl-panel.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    z-index: 1;
}

.tl-panel-cat {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--cat);
    margin-bottom: 10px;
}

.te-date {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.te-role {
    font-size: 1.4rem;
    margin-bottom: 3px;
}

.te-company {
    display: block;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.te-desc {
    margin: 0;
    font-size: 0.97rem;
    line-height: 1.62;
}

/* ===== Projects ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.project-card {
    background: var(--surface);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
    border-color: var(--surface-border-hover);
    background: var(--surface-strong);
}

.project-image {
    height: 150px;
    background: #252a33;
    width: 100%;
}

.placeholder-img {
    width: 100%;
    height: 100%;
}

.project-info {
    padding: 20px;
}

.project-info h3 {
    margin-bottom: 8px;
}

.project-tags {
    margin: 14px 0 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.project-tags span {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    padding: 4px 10px;
    border-radius: 5px;
}

.btn-text {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Featured project */
.featured-project {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    background: var(--surface);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 26px;
    align-items: center;
}

.featured-label {
    display: inline-block;
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-primary);
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 14px;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.project-tagline {
    font-size: 1.15rem;
    color: var(--text-main);
    font-weight: 500;
    margin-bottom: 12px;
}

.project-features {
    margin: 16px 0;
}

.project-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 7px;
    color: var(--text-muted);
}

.project-features li i {
    color: var(--accent-secondary);
}

.featured-image-wrapper {
    height: 100%;
}

/* ===== Articles / Writing ===== */
.writing-block+.writing-block {
    margin-top: 32px;
}

.block-title {
    font-size: 1.35rem;
    margin-bottom: 18px;
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.article-item {
    display: flex;
    align-items: center;
    padding: 18px 22px;
    background: var(--surface);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.article-item:hover {
    background: var(--surface-strong);
    border-color: var(--surface-border-hover);
    transform: translateY(-2px);
}

.article-date {
    width: 100px;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.pub-venue {
    width: 220px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.article-title {
    font-size: 1.1rem;
    flex-grow: 1;
    margin: 0 20px;
}

.read-more {
    color: var(--accent-primary);
    font-weight: 600;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.article-item:hover .read-more {
    opacity: 1;
    transform: translateX(0);
}

/* ===== Languages & Interests ===== */
.interests-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.lang-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lang-list li:last-child {
    border-bottom: none;
}

.lang-level {
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* ===== Contact ===== */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.form-group {
    margin-bottom: 14px;
}

input,
textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, background 0.3s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
}

.contact-form {
    background: var(--surface);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 26px;
}

.form-status {
    margin-top: 12px;
    font-size: 0.92rem;
    color: var(--accent-primary);
    min-height: 1.2em;
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-link {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ===== Footer ===== */
footer {
    padding: 30px 0;
    text-align: center;
    color: var(--text-muted);
    border-top: var(--glass-border);
    margin-top: 30px;
}

/* ===== Accessibility ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ===== Cookie consent banner ===== */
.consent-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 540px;
    margin: 0 auto;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    box-shadow: var(--shadow-soft);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.consent-banner p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.consent-actions {
    display: flex;
    gap: 12px;
}

.consent-actions button {
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 9px 22px;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.consent-actions button:hover {
    transform: translateY(-2px);
}

.consent-accept {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
}

.consent-decline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== Interactive models ===== */
.model-module {
    background: var(--surface);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 24px;
}

.model-module:last-child {
    margin-bottom: 0;
}

.model-intro {
    margin-bottom: 22px;
}

.model-intro h3 {
    font-size: 1.5rem;
    margin: 12px 0 10px;
}

.model-intro p {
    margin-bottom: 0;
    max-width: 780px;
    font-size: 0.97rem;
}

.case-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 11px;
    border-radius: 50px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.case-tag.green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}

/* Controls */
.model-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 20px 28px;
    margin-bottom: 26px;
}

.control label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 11px;
}

.control-val {
    color: var(--accent-primary);
    font-weight: 700;
    white-space: nowrap;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #fff;
    cursor: pointer;
}

/* Stat cards */
.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.stat {
    flex: 1;
    min-width: 150px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.stat-value {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat.pos .stat-value {
    color: #10b981;
}

.stat.neg .stat-value {
    color: #f87171;
}

.stat-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Chart */
.chart-wrap {
    margin: 0 0 20px;
}

.chart {
    width: 100%;
    height: auto;
    display: block;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
}

.chart-wrap figcaption {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.chart text {
    font-family: var(--font-body);
}

.chart-axislabel {
    fill: var(--text-muted);
    font-size: 14px;
}

.chart-meanlabel {
    fill: var(--text-main);
    font-size: 14px;
    font-weight: 600;
}

.chart-base {
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 1;
}

.chart-zero {
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
}

.chart-mean {
    stroke: #c4b5fd;
    stroke-width: 2;
}

/* Insight callout */
.model-insight {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-left: 3px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
}

.insight-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-primary);
    margin-bottom: 9px;
}

.model-insight p {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.model-insight p:last-child {
    margin-bottom: 0;
}

.model-insight strong {
    color: var(--text-main);
    font-weight: 600;
}

/* hcPCR signal-deconvolution model */
.hc-controls {
    margin-bottom: 26px;
}

.hc-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.hc-targets {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.hc-target {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    padding: 10px 15px;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.hc-target:hover {
    border-color: var(--surface-border-hover);
}

.hc-target.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-primary);
    color: var(--text-main);
}

.hc-target .hc-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.35;
    transition: opacity 0.2s ease;
}

.hc-target.active .hc-dot {
    opacity: 1;
}

.hc-tname {
    font-weight: 600;
    font-style: italic;
}

.hc-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.hc-noise-control {
    max-width: 340px;
}

.hc-result {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.hc-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
}

.hc-row .hc-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hc-name {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.hc-name strong {
    font-style: italic;
    color: var(--text-main);
    font-size: 0.98rem;
}

.hc-gene {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.hc-verdict {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.hc-row.on .hc-verdict {
    color: #10b981;
}

.hc-conf {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
}

.research-link {
    margin: 4px 0 0;
}

.research-link a {
    color: var(--accent-primary);
    font-weight: 600;
}

.research-link a:hover {
    text-decoration: underline;
}

/* Doctoral-research gateway cards (homepage) */
.research-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.research-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--radius-md);
    padding: 28px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.research-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(16, 185, 129, 0.4);
}

.research-card h3 {
    font-size: 1.25rem;
    margin: 14px 0 10px;
}

.research-card p {
    font-size: 0.95rem;
    margin-bottom: 18px;
    flex-grow: 1;
}

.research-card-go {
    color: #10b981;
    font-weight: 600;
    font-size: 0.9rem;
}

.research-card:hover .research-card-go {
    color: #34d399;
}

/* ===== Sub-page hero (Articles / Store) ===== */
.page-hero {
    padding: calc(var(--header-height) + 54px) 0 6px;
}

.page-eyebrow {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-primary);
    margin-bottom: 12px;
}

.page-hero h1 {
    font-size: clamp(2.2rem, 4vw, 3.1rem);
    margin-bottom: 14px;
}

.page-lead {
    max-width: 620px;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0;
}

/* ===== Articles grid ===== */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}

.article-card {
    display: flex;
    flex-direction: column;
    padding: 24px 24px 22px;
    background: var(--surface);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

a.article-card:hover {
    transform: translateY(-4px);
    border-color: var(--surface-border-hover);
    background: var(--surface-strong);
}

.article-card-tag {
    align-self: flex-start;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.22);
    padding: 4px 11px;
    border-radius: 50px;
    margin-bottom: 14px;
}

.article-card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.article-card-title {
    font-size: 1.16rem;
    line-height: 1.34;
    margin-bottom: 10px;
}

.article-card-excerpt {
    font-size: 0.93rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0 0 18px;
    flex-grow: 1;
}

.article-card-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.article-card-more.is-muted {
    color: var(--text-muted);
}

.article-card.is-pending {
    opacity: 0.7;
}

/* ===== Featured article (Articles page) ===== */
.featured-article {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.featured-article-body {
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.featured-article-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.featured-article-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.2;
}

.featured-article-excerpt {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin: 0 0 6px;
}

.featured-article-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 4.2rem;
}

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

    .featured-article-visual {
        order: -1;
        min-height: 130px;
        font-size: 3rem;
    }

    .featured-article-body {
        padding: 30px 24px;
    }
}

/* ===== Product grid (Store) ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 24px;
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--surface-border-hover);
}

.product-visual {
    height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--pa, var(--accent-primary));
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--surface-border);
}

.product-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 20px 22px 22px;
}

.product-tag {
    align-self: flex-start;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border: 1px solid var(--surface-border);
    padding: 4px 11px;
    border-radius: 50px;
    margin-bottom: 12px;
}

.product-title {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.product-desc {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0 0 20px;
    flex-grow: 1;
}

.product-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.product-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.product-price.is-muted {
    color: var(--text-muted);
    font-weight: 500;
}

.product-cta {
    padding: 8px 22px;
    font-size: 0.9rem;
}

.product-card.is-pending {
    opacity: 0.72;
}

.store-note {
    margin: 28px 0 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.store-note a {
    color: var(--accent-primary);
    font-weight: 600;
}

.writing-cta {
    margin: 26px 0 0;
    font-size: 0.95rem;
}

.writing-cta a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-primary);
    font-weight: 600;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: fixed;
        inset: 0;
        background: var(--bg-dark);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .nav-links.active {
        display: flex;
        opacity: 1;
    }

    .nav-links li {
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateY(0);
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .hamburger {
        display: flex;
    }

    .hero {
        min-height: auto;
        padding-bottom: 30px;
    }

    .hero>.container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        order: 2;
    }

    .hero-visual {
        order: 1;
    }

    .hero-photo {
        max-width: 200px;
    }

    .gradient-orb {
        width: 230px;
        height: 230px;
    }

    h1 {
        font-size: 2.1rem;
    }

    .about-layout,
    .contact-wrapper,
    .interests-grid,
    .featured-project {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .btn-secondary {
        margin-left: 0;
        margin-top: 12px;
    }

    .tl-box {
        padding: 16px 12px 20px;
    }

    .tl-gantt {
        --tl-label-w: 146px;
    }

    .tl-row-label,
    .tl-years-spacer {
        background: rgba(15, 18, 24, 0.94);
    }

    .tl-years-spacer {
        position: sticky;
        left: 0;
        z-index: 2;
    }

    .article-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .pub-venue {
        width: auto;
    }

    .article-title {
        margin: 0;
    }

    .read-more {
        display: none;
    }

    .featured-image-wrapper {
        min-height: 220px;
    }
}

@media (max-width: 600px) {
    .model-module {
        padding: 22px 18px;
    }

    .hc-target {
        flex: 1 1 100%;
    }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
