/* ═══════════════════════════════════════════════════════
   PSW — Personal Website Design System
   Light (AlphaQubit) / Dark (navy+gold) dual theme
   ═══════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS — LIGHT (DEFAULT) ── */
:root, [data-theme="light"] {
    /* Core palette (constant) */
    --navy: #0f056b;
    --navy-deep: #08033d;
    --navy-light: #1a0f8a;
    --gold: #d4a843;
    --gold-light: #c49530;
    --gold-dim: #9a7525;
    --gold-glow: rgba(212, 168, 67, 0.12);
    --green-dot: #22c55e;
    --green-glow: rgba(34, 197, 94, 0.4);

    /* Functional (theme-dependent) */
    --bg-primary: #f5f2eb;
    --bg-secondary: #eae6dd;
    --bg-card: rgba(15, 5, 107, 0.04);
    --bg-card-hover: rgba(15, 5, 107, 0.08);
    --bg-card-featured: linear-gradient(135deg, rgba(15, 5, 107, 0.08), rgba(212, 168, 67, 0.05));
    --text-primary: #0a0a1a;
    --text-secondary: #4a4560;
    --text-muted: #7a7590;
    --border: rgba(15, 5, 107, 0.1);
    --border-hover: rgba(212, 168, 67, 0.4);
    --border-subtle: rgba(15, 5, 107, 0.05);
    --border-featured: rgba(212, 168, 67, 0.25);
    --tag-bg: rgba(15, 5, 107, 0.06);
    --tag-border: rgba(15, 5, 107, 0.1);
    --tag-hover-border: rgba(15, 5, 107, 0.18);

    /* Nav */
    --nav-bg: rgba(245, 242, 235, 0.92);
    --nav-shadow: rgba(0, 0, 0, 0.06);
    --mobile-bg: rgba(245, 242, 235, 0.97);

    /* Card hover shadow */
    --card-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 0 60px rgba(15, 5, 107, 0.04);
    --card-shadow-featured: 0 12px 40px rgba(0, 0, 0, 0.08), 0 0 80px rgba(212, 168, 67, 0.06);

    /* Canvas particle colors */
    --particle-r: 15;
    --particle-g: 5;
    --particle-b: 107;
    --particle-connection-r: 15;
    --particle-connection-g: 5;
    --particle-connection-b: 107;

    /* Grain overlay */
    --grain-opacity: 0.015;

    /* Hero overlay */
    --hero-overlay:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(15, 5, 107, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 80% 20%, rgba(212, 168, 67, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse 40% 40% at 20% 80%, rgba(15, 5, 107, 0.05) 0%, transparent 50%),
        linear-gradient(to bottom, rgba(245,242,235,0) 0%, rgba(245,242,235,0.5) 80%, rgba(245,242,235,1) 100%);

    /* Selection */
    --selection-bg: var(--gold);
    --selection-color: #fff;

    /* Typography */
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;

    /* Spacing */
    --section-pad: clamp(80px, 10vw, 140px);
    --container-max: 1200px;
    --container-pad: clamp(20px, 4vw, 40px);

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration: 0.6s;
}

/* ── DESIGN TOKENS — DARK ── */
[data-theme="dark"] {
    --gold-light: #e8c872;
    --gold-dim: #a07e2e;
    --green-dot: #4ade80;
    --green-glow: rgba(74, 222, 128, 0.5);

    --bg-primary: #050510;
    --bg-secondary: #0a0a1a;
    --bg-card: rgba(15, 5, 107, 0.12);
    --bg-card-hover: rgba(15, 5, 107, 0.22);
    --bg-card-featured: linear-gradient(135deg, rgba(15, 5, 107, 0.25), rgba(212, 168, 67, 0.06));
    --text-primary: #f5f2eb;
    --text-secondary: #9994b0;
    --text-muted: #5c576e;
    --border: rgba(212, 168, 67, 0.12);
    --border-hover: rgba(212, 168, 67, 0.3);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-featured: rgba(212, 168, 67, 0.2);
    --tag-bg: rgba(255, 255, 255, 0.04);
    --tag-border: rgba(255, 255, 255, 0.06);
    --tag-hover-border: rgba(255, 255, 255, 0.1);

    --nav-bg: rgba(5, 5, 16, 0.92);
    --nav-shadow: rgba(0, 0, 0, 0.3);
    --mobile-bg: rgba(5, 5, 16, 0.97);

    --card-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 60px rgba(15, 5, 107, 0.1);
    --card-shadow-featured: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 80px rgba(212, 168, 67, 0.08);

    --particle-r: 212;
    --particle-g: 168;
    --particle-b: 67;
    --particle-connection-r: 15;
    --particle-connection-g: 5;
    --particle-connection-b: 107;

    --grain-opacity: 0.022;

    --hero-overlay:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(15, 5, 107, 0.45) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 80% 20%, rgba(212, 168, 67, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse 40% 40% at 20% 80%, rgba(15, 5, 107, 0.2) 0%, transparent 50%),
        linear-gradient(to bottom, rgba(5,5,16,0) 0%, rgba(5,5,16,0.6) 80%, rgba(5,5,16,1) 100%);

    --selection-color: #050510;
}

/* ── RESET & BASE ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

::selection {
    background: var(--selection-bg);
    color: var(--selection-color);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

/* ── SECTION HEADERS ── */
.section-index {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.7;
}

.section-header {
    margin-bottom: clamp(40px, 6vw, 72px);
}

/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 var(--container-pad);
    transition: background var(--duration) var(--ease-out), backdrop-filter var(--duration), box-shadow var(--duration);
}

.nav--scrolled, .nav--solid {
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 30px var(--nav-shadow);
}

.nav__inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.3s;
}
.nav__logo:hover { opacity: 0.8; }

.nav__logo-mark {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    color: var(--gold);
}

.nav__logo-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

.nav__links {
    display: flex;
    gap: 32px;
}

.nav__link {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    transition: color 0.3s;
    position: relative;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 0.4s var(--ease-out);
}

.nav__link:hover, .nav__link--active { color: var(--gold); }
.nav__link:hover::after, .nav__link--active::after { width: 100%; }

.nav__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language Toggle */
.lang-toggle, .theme-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(212, 168, 67, 0.08);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    transition: border-color 0.3s, background 0.3s;
    color: var(--text-muted);
}

.lang-toggle:hover, .theme-toggle:hover {
    border-color: var(--border-hover);
    background: rgba(212, 168, 67, 0.12);
}

.lang-toggle__option {
    color: var(--text-muted);
    transition: color 0.3s;
    cursor: pointer;
}

.lang-toggle__option--active {
    color: var(--gold);
    font-weight: 700;
}

.lang-toggle__separator {
    color: var(--text-muted);
    opacity: 0.4;
}

/* Theme Toggle */
.theme-toggle {
    padding: 6px 10px;
    font-size: 1rem;
    letter-spacing: 0;
}

.theme-toggle__icon {
    line-height: 1;
    transition: transform 0.3s var(--ease-out);
}

.theme-toggle:hover .theme-toggle__icon {
    transform: rotate(20deg);
}

/* Burger */
.nav__burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav__burger span {
    width: 22px;
    height: 1.5px;
    background: var(--text-primary);
    transition: transform 0.3s var(--ease-out), opacity 0.3s;
    display: block;
}

.nav__burger--open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__burger--open span:nth-child(2) { opacity: 0; }
.nav__burger--open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile nav */
.nav__mobile {
    display: none;
    flex-direction: column;
    padding: 24px var(--container-pad) 32px;
    border-top: 1px solid var(--border);
    background: var(--mobile-bg);
    backdrop-filter: blur(24px);
}

.nav__mobile--open { display: flex; }

.nav__mobile-link {
    padding: 14px 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    transition: color 0.3s, padding-left 0.3s;
}

.nav__mobile-link:hover {
    color: var(--gold);
    padding-left: 8px;
}

@media (max-width: 768px) {
    .nav__links { display: none; }
    .nav__burger { display: flex; }
}

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 120px var(--container-pad) 80px;
}

.hero__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: var(--hero-overlay);
    z-index: 1;
    transition: background 0.6s ease;
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    text-align: center;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin-bottom: 40px;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    animation: fadeInUp 1s var(--ease-out) 0.2s both;
}

.hero__badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green-dot);
    box-shadow: 0 0 8px var(--green-glow);
    animation: pulse-dot 2s ease-in-out infinite;
}

.hero__title {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.05;
    margin-bottom: 24px;
}

.hero__title-line {
    display: block;
    animation: fadeInUp 1s var(--ease-out) both;
}

.hero__title-line--1 { font-size: clamp(2.8rem, 7vw, 5.5rem); animation-delay: 0.4s; }
.hero__title-line--2 { font-size: clamp(2.8rem, 7vw, 5.5rem); animation-delay: 0.55s; }
.hero__title-line--3 { font-size: clamp(3.2rem, 8vw, 6.2rem); animation-delay: 0.7s; }

.hero__title-accent {
    color: var(--gold);
    font-style: italic;
    text-shadow: 0 0 60px rgba(212, 168, 67, 0.2);
}

.hero__subtitle {
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 48px;
    animation: fadeInUp 1s var(--ease-out) 0.9s both;
}

/* Stats */
.hero__stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-bottom: 48px;
    animation: fadeInUp 1s var(--ease-out) 1.1s both;
}

.hero__stat { text-align: center; }

.hero__stat-number {
    font-family: var(--font-mono);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700;
    color: var(--gold);
}

.hero__stat-plus {
    font-family: var(--font-mono);
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--gold);
    opacity: 0.7;
}

.hero__stat-text {
    font-family: var(--font-mono);
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    color: var(--gold);
    opacity: 0.6;
    margin-right: 4px;
}

.hero__stat-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.02em;
}

.hero__stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
}

/* CTAs */
.hero__cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s var(--ease-out) 1.3s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 14px 32px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 8px;
    transition: all 0.4s var(--ease-out);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: var(--gold);
    color: #fff;
}

.btn--primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn--primary:hover::before { transform: translateX(100%); }

.btn--primary:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(212, 168, 67, 0.3);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn--ghost:hover {
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(212, 168, 67, 0.1);
}

/* Scroll indicator */
.hero__scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
    animation: fadeInUp 1s var(--ease-out) 1.6s both;
}

.hero__scroll span {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.hero__scroll-nn {
    display: block;
    margin-bottom: 2px;
    filter: drop-shadow(0 0 5px rgba(212, 168, 67, 0.4));
}

.hero__scroll-nn .nn-node {
    fill: var(--bg-card);
    stroke: var(--gold);
    stroke-width: 1.5;
}

.hero__scroll-nn .nn-node--output {
    fill: var(--gold);
}

.hero__scroll-nn .nn-link {
    stroke: var(--gold);
    stroke-width: 1;
    opacity: 0.35;
}

.hero__scroll-nn .nn-scroll-line {
    stroke: var(--gold);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 26;
    stroke-dashoffset: 26;
    animation: flowLine 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes flowLine {
    0% { stroke-dashoffset: 26; opacity: 0; }
    20% { opacity: 1; }
    50% { stroke-dashoffset: 0; opacity: 1; }
    80% { opacity: 1; }
    100% { stroke-dashoffset: -26; opacity: 0; }
}

/* ═══════════════════════════════════════════
   ABOUT STRIP
   ═══════════════════════════════════════════ */
.about-strip {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    background: var(--bg-card);
    overflow: hidden;
    position: relative;
}

.about-strip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(212, 168, 67, 0.03), transparent);
}

.about-strip__inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

.about-strip__text p {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-align: center;
}

/* ═══════════════════════════════════════════
   BIO SECTION
   ═══════════════════════════════════════════ */
.bio {
    padding: 48px 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.bio__inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 36px;
    border-left: 3px solid var(--gold);
    background: var(--bg-card);
    border-radius: 0 12px 12px 0;
    position: relative;
}

.bio__text {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   PROJECTS
   ═══════════════════════════════════════════ */
.projects {
    padding: var(--section-pad) 0;
}

.projects__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.project-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: clamp(28px, 4vw, 44px);
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 32px;
    align-items: start;
    transition: border-color 0.4s var(--ease-out), background 0.4s, transform 0.4s var(--ease-out), box-shadow 0.4s;
    overflow: hidden;
}

.project-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--card-shadow);
}

.project-card--featured {
    grid-template-columns: 1fr;
    background: var(--bg-card-featured);
    border-color: var(--border-featured);
}

.project-card--featured:hover {
    border-color: rgba(212, 168, 67, 0.4);
    box-shadow: var(--card-shadow-featured);
}

.project-card--featured .project-card__visual {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.project-card__index {
    position: absolute;
    top: 20px;
    right: 24px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.project-card__badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--gold);
    background: rgba(212, 168, 67, 0.1);
    border: 1px solid rgba(212, 168, 67, 0.2);
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.project-card__visual {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
}

.project-card__glow {
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.project-card__icon svg {
    width: 64px;
    height: 64px;
    transition: transform 0.6s var(--ease-out);
}

.project-card:hover .project-card__icon svg { transform: scale(1.08); }

.project-card--featured .project-card__icon svg { width: 80px; height: 80px; }

.project-card__title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    font-weight: 400;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.project-card__desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.project-card__tags span {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    padding: 4px 10px;
    border-radius: 4px;
    transition: border-color 0.3s, color 0.3s;
}

.project-card:hover .project-card__tags span { border-color: var(--tag-hover-border); }

.project-card__meta { margin-top: 8px; }

.project-card__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.project-card__status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green-dot);
    box-shadow: 0 0 6px var(--green-glow);
    animation: pulse-dot 2s ease-in-out infinite;
}

.project-card__link {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--gold);
    letter-spacing: 0.04em;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}

.project-card__link:hover {
    color: var(--gold-light);
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .project-card { grid-template-columns: 1fr; }
    .project-card__visual { display: none; }
    .project-card--featured .project-card__visual { display: flex; }
}

/* ═══════════════════════════════════════════
   COMPETENCIES (detailed)
   ═══════════════════════════════════════════ */
.competencies {
    padding: var(--section-pad) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
}

.competencies::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
    opacity: 0.3;
}

.competencies__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.competency-card {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    transition: border-color 0.4s, transform 0.4s var(--ease-out), background 0.4s;
    position: relative;
    overflow: hidden;
}

.competency-card--featured {
    grid-column: 1 / -1;
    background: var(--bg-card-featured);
    border-color: var(--border-featured);
}

.competency-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}

.competency-card:hover::before { opacity: 0.6; }

.competency-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    background: var(--bg-card-hover);
}

.competency-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.competency-card__icon {
    font-size: 1.2rem;
    color: var(--gold);
    flex-shrink: 0;
}

.competency-card__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--text-primary);
}

.competency-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.competency-card__tags span {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    padding: 4px 10px;
    border-radius: 4px;
    transition: border-color 0.3s, color 0.3s, background 0.3s;
}

.competency-card:hover .competency-card__tags span {
    border-color: var(--tag-hover-border);
}

.competency-card__tags span:hover {
    color: var(--gold);
    border-color: var(--gold);
}

/* Language bars */
.lang-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.lang-bar:last-child { margin-bottom: 0; }

.lang-bar__name {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-secondary);
    min-width: 80px;
    letter-spacing: 0.03em;
}

.lang-bar__track {
    flex: 1;
    height: 4px;
    background: var(--tag-bg);
    border-radius: 2px;
    overflow: hidden;
}

.lang-bar__fill {
    height: 100%;
    background: var(--gold);
    border-radius: 2px;
    transition: width 1.2s var(--ease-out);
}

.lang-bar__level {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    min-width: 60px;
    text-align: right;
    letter-spacing: 0.04em;
}

@media (max-width: 768px) {
    .competencies__grid {
        grid-template-columns: 1fr;
    }
    .competency-card--featured {
        grid-column: auto;
    }
}

/* ═══════════════════════════════════════════
   TIMELINE
   ═══════════════════════════════════════════ */
.timeline {
    padding: var(--section-pad) 0;
}

.timeline__track {
    position: relative;
    padding-left: 48px;
}

.timeline__track::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, var(--gold), var(--border), transparent);
}

.timeline__item {
    position: relative;
    margin-bottom: 48px;
}

.timeline__item:last-child { margin-bottom: 0; }

.timeline__marker {
    position: absolute;
    left: -44px;
    top: 4px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: var(--bg-primary);
    transition: background 0.3s, box-shadow 0.3s;
}

.timeline__item:first-child .timeline__marker {
    background: var(--gold);
    box-shadow: 0 0 12px rgba(212, 168, 67, 0.3);
}

.timeline__item:hover .timeline__marker {
    box-shadow: 0 0 12px rgba(212, 168, 67, 0.4);
}

.timeline__date {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--gold-dim);
    margin-bottom: 8px;
}

.timeline__card {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    transition: border-color 0.4s, transform 0.4s var(--ease-out), box-shadow 0.4s;
}

.timeline__card:hover {
    border-color: var(--border-hover);
    transform: translateX(4px);
    box-shadow: -4px 0 20px rgba(212, 168, 67, 0.05);
}

.timeline__org {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--gold);
    display: block;
    margin-bottom: 4px;
}

.timeline__card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.timeline__card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.timeline__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.timeline__tags span {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--tag-bg);
    padding: 3px 8px;
    border-radius: 3px;
    border: 1px solid var(--tag-border);
}

/* ═══════════════════════════════════════════
   VISION
   ═══════════════════════════════════════════ */
.vision {
    padding: var(--section-pad) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.vision::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(15, 5, 107, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.vision__quote {
    margin-bottom: 56px;
    padding: 40px;
    border-left: 3px solid var(--gold);
    background: rgba(212, 168, 67, 0.04);
    border-radius: 0 12px 12px 0;
    position: relative;
}

.vision__quote::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    left: 16px;
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--gold);
    opacity: 0.15;
    line-height: 1;
}

.vision__quote p {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-style: italic;
    line-height: 1.7;
    color: var(--text-primary);
}

.vision__pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.vision__pillar {
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.4s, transform 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.vision__pillar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}

.vision__pillar:hover::after { opacity: 0.5; }
.vision__pillar:hover { border-color: var(--border-hover); transform: translateY(-3px); }

.vision__pillar-number {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-style: italic;
    color: var(--gold);
    margin-bottom: 12px;
}

.vision__pillar h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.vision__pillar p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ═══════════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════════ */
.contact {
    padding: var(--section-pad) 0;
}

.contact__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.contact__tagline {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 32px;
}

.contact__links {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.contact__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.3s, padding-left 0.3s;
}

.contact__link:hover {
    border-color: var(--gold);
    padding-left: 4px;
}

.contact__link-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: color 0.3s;
}

.contact__link:hover .contact__link-icon {
    color: var(--gold);
}

.contact__link-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-transform: uppercase;
    min-width: 100px;
}

.contact__link-value {
    font-size: 0.88rem;
    color: var(--text-primary);
    transition: color 0.3s;
    margin-left: auto;
}

.contact__link:hover .contact__link-value { color: var(--gold); }

.contact__link--badge .contact__link-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.contact__visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact__pattern {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 1px solid var(--border);
    position: relative;
    animation: rotate-slow 40s linear infinite;
}

.contact__pattern::before,
.contact__pattern::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--border);
}

.contact__pattern::before { inset: 30px; }
.contact__pattern::after { inset: 60px; border-color: rgba(212, 168, 67, 0.15); }

@keyframes rotate-slow { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
    .contact__grid { grid-template-columns: 1fr; }
    .contact__visual { display: none; }
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

.footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 24px;
}

.footer__left {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.footer__center {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.footer__social-link {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: color 0.3s, transform 0.3s;
}

.footer__social-link:hover {
    color: var(--gold);
    transform: translateY(-2px);
}

.footer__right {
    text-align: right;
}

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

/* ═══════════════════════════════════════════
   BLOG PAGE
   ═══════════════════════════════════════════ */
.blog-hero {
    padding: 140px 0 60px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.blog-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 50% at 30% 50%, rgba(15, 5, 107, 0.08), transparent);
    pointer-events: none;
}

.blog-hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 400;
    margin-bottom: 16px;
}

.blog-hero__subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 640px;
    line-height: 1.7;
    margin-bottom: 40px;
}

.blog-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.blog-filter {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.blog-filter:hover {
    border-color: var(--border-hover);
    color: var(--text-secondary);
}

.blog-filter--active {
    background: rgba(212, 168, 67, 0.1);
    border-color: var(--gold);
    color: var(--gold);
}

.blog-grid-section {
    padding: 60px 0 var(--section-pad);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

.blog-card {
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-card);
    transition: border-color 0.4s, background 0.4s, transform 0.4s var(--ease-out), box-shadow 0.4s;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--card-shadow);
}

.blog-card--featured {
    grid-column: 1 / -1;
    background: var(--bg-card-featured);
    border-color: var(--border-featured);
}

.blog-card--hidden { display: none; }

.blog-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.blog-card__category {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--gold);
    text-transform: uppercase;
    background: rgba(212, 168, 67, 0.08);
    padding: 4px 10px;
    border-radius: 4px;
}

.blog-card__date {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
}

.blog-card__title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 12px;
    color: var(--text-primary);
    transition: color 0.3s;
}

.blog-card:hover .blog-card__title { color: var(--gold-light); }
.blog-card--featured .blog-card__title { font-size: 1.6rem; }

.blog-card__excerpt {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    flex: 1;
}

.blog-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.blog-card__tags span {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--tag-bg);
    padding: 3px 8px;
    border-radius: 3px;
    border: 1px solid var(--tag-border);
}

.blog-card__link {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--gold);
    letter-spacing: 0.04em;
    align-self: flex-start;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}

.blog-card__link:hover {
    color: var(--gold-light);
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .blog-grid { grid-template-columns: 1fr; }
    .hero__stats { flex-direction: column; gap: 20px; }
    .hero__stat-divider { width: 40px; height: 1px; }
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal--visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal--stagger > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal--stagger.reveal--visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.reveal--stagger.reveal--visible > *:nth-child(2) { transition-delay: 0.08s; opacity: 1; transform: translateY(0); }
.reveal--stagger.reveal--visible > *:nth-child(3) { transition-delay: 0.08s; opacity: 1; transform: translateY(0); }
.reveal--stagger.reveal--visible > *:nth-child(4) { transition-delay: 0.16s; opacity: 1; transform: translateY(0); }
.reveal--stagger.reveal--visible > *:nth-child(5) { transition-delay: 0.24s; opacity: 1; transform: translateY(0); }
.reveal--stagger.reveal--visible > *:nth-child(6) { transition-delay: 0.32s; opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════
   GRAIN OVERLAY
   ═══════════════════════════════════════════ */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 480px) {
    .hero__badge { font-size: 0.65rem; padding: 6px 14px; }
    .hero__cta { flex-direction: column; align-items: center; }
    .btn { width: 100%; justify-content: center; }
    .about-strip__text p { font-size: 0.65rem; }
    .footer__inner { flex-direction: column; text-align: center; }
    .footer__right { text-align: center; }
    .footer__left { flex-direction: column; }
}

@media (min-width: 1024px) {
    .projects__grid { grid-template-columns: repeat(2, 1fr); }
    .project-card--featured { grid-column: 1 / -1; }
}

/* ═══════════════════════════════════════════
   FOCUS & ACCESSIBILITY
   ═══════════════════════════════════════════ */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .hero__canvas { display: none; }
}

/* ═══════════════════════════════════════════
   ARTICLE PAGES
   ═══════════════════════════════════════════ */
.article {
    max-width: 740px;
    margin: 0 auto;
    padding: 140px var(--container-pad) var(--section-pad);
}

.article__back {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--gold);
    letter-spacing: 0.04em;
    margin-bottom: 32px;
    transition: color 0.3s;
}

.article__back:hover {
    color: var(--gold-light);
}

.article__header {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.article__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.article__category {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--gold);
    text-transform: uppercase;
    background: var(--gold-glow);
    padding: 4px 10px;
    border-radius: 4px;
}

.article__date {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
}

.article__title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-primary);
}

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

.article__tags span {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--tag-bg);
    padding: 3px 8px;
    border-radius: 3px;
    border: 1px solid var(--tag-border);
}

/* Article body typography */
.article__body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-secondary);
}

.article__body h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text-primary);
    margin: 48px 0 16px;
}

.article__body h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-primary);
    margin: 32px 0 12px;
}

.article__body p {
    margin-bottom: 1.5em;
}

.article__body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.article__body a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article__body a:hover {
    color: var(--gold-light);
}

.article__body blockquote {
    border-left: 3px solid var(--gold);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--gold-glow);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.article__body code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--tag-bg);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--tag-border);
}

.article__body pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    overflow-x: auto;
    margin: 24px 0;
}

.article__body pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.article__body ul, .article__body ol {
    padding-left: 24px;
    margin-bottom: 1.5em;
}

.article__body li {
    margin-bottom: 0.5em;
}

.article__body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 24px 0;
}

.article__body .math-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 24px;
    margin: 24px 0;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: center;
}

/* CV button style */
.btn--cv {
    border-color: var(--gold-dim);
    color: var(--gold);
}
.btn--cv:hover {
    border-color: var(--gold);
    background: var(--gold-glow);
}
