/* ===================================================================
   Byeonghyeon Kim - Portfolio
   Dark-first, terminal/code aesthetic. Light variant via body.light
   =================================================================== */

:root {
    /* dark (default) */
    --bg: #0a1426;
    --bg-soft: #0e1a30;
    --surface: #122038;
    --surface-2: #182742;
    --border: #243450;
    --border-soft: #1a2840;

    --text: #ece7db;
    --text-dim: #a7afc1;
    --text-mute: #7c8699;

    --primary: #e6a95c;
    --primary-dim: #c98a3e;
    --primary-strong: #f4c078;
    --primary-glow: rgba(230, 169, 92, .16);
    --primary-border: rgba(230, 169, 92, .30);

    --term-bg: #0b1322;
    --term-bar: #16223a;

    --shadow-card: 0 20px 50px rgba(0, 0, 0, .4);
    --shadow-soft: 0 24px 60px rgba(0, 0, 0, .45);

    --mono: 'JetBrains Mono', 'Pretendard Variable', ui-monospace, SFMono-Regular, Menlo, 'Apple SD Gothic Neo', 'Malgun Gothic', monospace;
    --sans: 'Inter', 'Pretendard Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', Roboto, sans-serif;

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 18px;
    --maxw: 1120px;
    --ease: cubic-bezier(.4, 0, .2, 1);
}

body.light {
    --bg: #f4f1e8;
    --bg-soft: #ece8dc;
    --surface: #ffffff;
    --surface-2: #f1eee4;
    --border: #e6e0d2;
    --border-soft: #ece7da;

    --text: #0a1426;
    --text-dim: #4a5468;
    --text-mute: #5d6675;

    --primary: #965a0c;
    --primary-dim: #c98a3e;
    --primary-strong: #74470a;
    --primary-glow: rgba(150, 90, 12, .12);
    --primary-border: rgba(150, 90, 12, .30);

    /* terminal stays dark in both themes for authenticity */
    --term-bg: #0b1322;
    --term-bar: #16223a;

    --shadow-card: 0 16px 40px rgba(20, 30, 50, .1);
    --shadow-soft: 0 20px 50px rgba(20, 30, 50, .12);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background .3s var(--ease), color .3s var(--ease);
}

::selection { background: var(--primary); color: #1a1206; }

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; width: 100%; }
.mono { font-family: var(--mono); }

/* ===== Fixed background layers ===== */
.hero-bg {
    position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background:
        radial-gradient(ellipse 52% 46% at 80% 16%, var(--primary-glow), transparent 62%),
        linear-gradient(100deg, rgba(10,20,38,.96) 0%, rgba(10,20,38,.9) 46%, rgba(10,20,38,.6) 76%, rgba(10,20,38,.82) 100%),
        url("../assets/hero-bg.jpg") center 22% / cover no-repeat,
        var(--bg);
}
/* light theme: SAME photo, color-inverted (white bg, dark formulas).
   Trick: a dark veil is used here because filter:invert flips it to a
   light veil - keeping the left text column clean while formulas stay
   faint on the right. .hero-bg is a decorative layer (no content), so
   inverting it never touches page text. */
body.light .hero-bg {
    background:
        linear-gradient(100deg, rgba(0,0,0,.93) 0%, rgba(0,0,0,.86) 46%, rgba(0,0,0,.55) 76%, rgba(0,0,0,.74) 100%),
        url("../assets/hero-bg.jpg") center 22% / cover no-repeat,
        #0a1426;
    filter: invert(1);
}
/* aurora would invert to magenta in light mode - hide it there */
body.light .hero-bg::before { display: none; }
/* drifting aurora glow */
.hero-bg::before {
    content: ""; position: absolute; inset: -25%;
    background:
        radial-gradient(circle at 30% 32%, var(--primary-glow), transparent 42%),
        radial-gradient(circle at 72% 58%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 44%);
    filter: blur(48px); opacity: .7;
    animation: aurora 20s ease-in-out infinite alternate;
}
@keyframes aurora {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(4%, 3%, 0) scale(1.12); }
}
/* fine film grain */
.hero-bg::after {
    content: ""; position: absolute; inset: 0; opacity: .04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.light .hero-bg::after { opacity: .02; }

.grid-overlay {
    position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
    background-image:
        linear-gradient(var(--border-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 12%, #000 25%, transparent 72%);
    mask-image: radial-gradient(ellipse 75% 60% at 50% 12%, #000 25%, transparent 72%);
}

/* ===== Navbar ===== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    background: color-mix(in srgb, var(--bg) 60%, transparent);
    border-bottom: 1px solid transparent;
    transition: border-color .3s var(--ease), background .3s var(--ease);
}
.navbar.scrolled { border-bottom-color: var(--border-soft); }
.nav-container {
    max-width: var(--maxw); margin: 0 auto; padding: 15px 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.nav-logo { font-family: var(--mono); font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }
.nav-logo span { color: var(--primary); }
.nav-menu { display: flex; gap: 28px; list-style: none; }
.nav-link {
    font-family: var(--mono); font-size: .88rem; color: var(--text-dim);
    transition: color .2s var(--ease); position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link.active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
    background: var(--primary); border-radius: 2px;
}
.nav-controls { display: flex; align-items: center; gap: 12px; }
.nav-resume {
    font-family: var(--mono); font-size: .82rem; color: #1a1206; font-weight: 700;
    padding: 8px 16px; background: var(--primary); border: 1px solid var(--primary); border-radius: var(--radius-sm);
    transition: all .2s var(--ease);
}
.nav-resume:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: #1a1206; transform: translateY(-1px); box-shadow: 0 8px 24px var(--primary-glow); }

.toggle-btn {
    background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
    border-radius: 999px; cursor: pointer; transition: all .2s var(--ease);
    display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono);
}
.lang-toggle { padding: 7px 12px; font-size: .76rem; gap: 4px; }
.lang-option { color: var(--text-mute); transition: color .2s; }
.lang-option.active { color: var(--primary); font-weight: 700; }
.lang-divider { color: var(--text-mute); }
.theme-toggle { width: 36px; height: 36px; font-size: .92rem; }
.theme-toggle:hover, .lang-toggle:hover { border-color: var(--primary); }
.theme-toggle .fa-sun { display: none; }
.theme-toggle .fa-moon { display: inline-block; }
body.light .theme-toggle .fa-sun { display: inline-block; }
body.light .theme-toggle .fa-moon { display: none; }

.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all .25s var(--ease); }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
    min-height: 100vh; display: flex; align-items: center;
    padding: 120px 0 80px; position: relative;
}
.hero-inner { position: relative; z-index: 1; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: var(--mono); font-size: .8rem; color: var(--primary);
    background: var(--primary-glow); border: 1px solid var(--primary-border);
    padding: 7px 15px; border-radius: 999px;
}
/* freelance badge: cool teal variant (dot pulse recolored via --primary-border) */
.hero-badge-alt { color: #5bc0b5; background: rgba(79, 182, 173, .12); border-color: rgba(79, 182, 173, .30); }
.hero-badge-alt .badge-dot { background: #5bc0b5; --primary-border: rgba(79, 182, 173, .35); }
body.light .hero-badge-alt { color: #0f766e; background: rgba(15, 118, 110, .10); border-color: rgba(15, 118, 110, .32); }
body.light .hero-badge-alt .badge-dot { background: #0f766e; --primary-border: rgba(15, 118, 110, .35); }
.badge-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--primary);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--primary-border); }
    70% { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
.hero-name {
    font-size: clamp(2.8rem, 8vw, 5.2rem); font-weight: 800; letter-spacing: -.03em;
    line-height: 1.02; margin-bottom: 12px;
}
.hero-handle {
    font-family: var(--mono); color: var(--text-mute); font-size: 1rem;
    margin-bottom: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.hero-handle .sep { opacity: .6; }
.hero-lead {
    font-size: 1.18rem; color: var(--text-dim); max-width: 640px; margin-bottom: 36px;
}
.hero-lead b { color: var(--text); font-weight: 600; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }
.btn {
    font-family: var(--mono); font-size: .92rem; font-weight: 500;
    padding: 14px 26px; border-radius: var(--radius-sm); cursor: pointer;
    display: inline-flex; align-items: center; gap: 9px; border: 1px solid transparent;
    transition: all .2s var(--ease);
}
.btn-primary { background: var(--primary); color: #1a1206; }
.btn-primary:hover { background: var(--primary-strong); transform: translateY(-2px); box-shadow: 0 10px 30px var(--primary-glow); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.hero-socials { display: flex; gap: 18px; }
.hero-socials a { color: var(--text-mute); font-size: 1.3rem; transition: color .2s, transform .2s; }
.hero-socials a:hover { color: var(--primary); transform: translateY(-3px); }
.hero-scroll {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    color: var(--text-mute); font-size: 1.1rem; animation: bob 2s infinite; z-index: 1;
}
.hero-scroll:hover { color: var(--primary); }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ===== Sections ===== */
.section { padding: 110px 0; position: relative; }
.about { background: var(--bg); }
.skills { background: var(--bg-soft); }
.projects { background: var(--bg); }
.experience { background: var(--bg-soft); }
.contact { background: var(--bg); }

.section-label {
    font-family: var(--mono); font-size: .82rem; color: var(--primary);
    letter-spacing: .04em; margin-bottom: 16px; display: inline-block;
}
.section-label::before { content: "// "; }
.section-title {
    font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 800; letter-spacing: -.02em;
    margin-bottom: 14px; line-height: 1.1;
}
.section-subtitle { color: var(--text-dim); font-size: 1.05rem; max-width: 580px; margin-bottom: 52px; }

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.about-body p { color: var(--text-dim); margin-bottom: 18px; font-size: 1.02rem; }
.about-body p:last-child { margin-bottom: 0; }
.about-body strong { color: var(--text); font-weight: 600; }
.about-focus { margin-top: 28px; }
.about-focus .focus-note { margin-top: 14px; margin-bottom: 0; }

.terminal {
    background: var(--term-bg); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-soft);
}
.terminal-bar { display: flex; align-items: center; gap: 8px; padding: 13px 16px; background: var(--term-bar); border-bottom: 1px solid #222831; }
.tl { width: 12px; height: 12px; border-radius: 50%; }
.tl-r { background: #ff5f56; } .tl-y { background: #ffbd2e; } .tl-g { background: #27c93f; }
.terminal-title { margin-left: 10px; font-family: var(--mono); font-size: .78rem; color: #5f6b78; }
.terminal-body { padding: 22px; font-family: var(--mono); font-size: .9rem; line-height: 1.85; color: #e8edf2; }
.terminal-body .c { color: var(--primary); }
.terminal-body .cmd { color: #e8edf2; }
.terminal-body .o { color: #9aa5b1; }
.terminal-body .spacer { height: 10px; }
.cursor { color: var(--primary); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 56px; }
.stat {
    border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 24px 16px;
    background: var(--surface); text-align: center; transition: border-color .2s, transform .2s;
}
.stat:hover { border-color: var(--primary-border); transform: translateY(-3px); }
.stat-n { font-size: 2.1rem; font-weight: 800; color: var(--primary); font-family: var(--mono); }
.stat-t { font-size: .82rem; color: var(--text-mute); margin-top: 4px; }

/* ===== Skills ===== */
.skill-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.skill-category h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 24px; display: flex; align-items: center; gap: 11px; }
.skill-category h3 i { color: var(--primary); font-size: 1.1rem; }
/* Skill evidence tiers (dots = where it was used, not self-rating) */
.tier-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 28px; font-size: .72rem; color: var(--text-mute); font-family: var(--mono); }
.tier-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.skill-row { margin-bottom: 18px; }
.skill-row .row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.skill-row .skill-name { font-size: .9rem; color: var(--text-dim); }
.tier-dots { display: inline-flex; gap: 4px; flex-shrink: 0; }
.tier-dots i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--surface-2); }
.tier-dots.t1 i:nth-child(-n+1),
.tier-dots.t2 i:nth-child(-n+2),
.tier-dots.t3 i:nth-child(-n+3) { background: linear-gradient(135deg, var(--primary-dim), var(--primary-strong)); }
.skill-ev { display: block; margin-top: 5px; font-family: var(--mono); font-size: .72rem; color: var(--text-mute); }
.skill-ev .tier-label { text-transform: uppercase; letter-spacing: .04em; }
.skill-ev.t3 .tier-label { color: var(--primary); }

.skill-tools { margin-top: 48px; padding-top: 36px; border-top: 1px solid var(--border-soft); }
.tools-label { display: block; font-family: var(--mono); font-size: .82rem; color: var(--text-mute); margin-bottom: 16px; }
.tools-label::before { content: "// "; color: var(--primary); }
.tools-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.tool-tag {
    font-family: var(--mono); font-size: .78rem; color: var(--text-dim);
    background: var(--surface); border: 1px solid var(--border-soft);
    padding: 6px 13px; border-radius: 7px; transition: all .2s var(--ease);
}
.tool-tag:hover { border-color: var(--primary-border); color: var(--primary); }

/* ===== Projects ===== */
.project-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.filter-btn {
    font-family: var(--mono); font-size: .85rem; color: var(--text-dim);
    background: var(--surface); border: 1px solid var(--border-soft);
    padding: 9px 18px; border-radius: 999px; cursor: pointer; transition: all .2s var(--ease);
}
.filter-btn:hover { border-color: var(--primary-border); color: var(--text); }
.filter-btn.active { background: var(--primary); color: #1a1206; border-color: var(--primary); font-weight: 600; }

.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.project-card {
    background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
    padding: 28px; transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
    position: relative; overflow: hidden; display: flex; flex-direction: column;
}
.project-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0; transition: opacity .25s var(--ease);
}
.project-card:hover { transform: translateY(-4px); border-color: var(--primary-border); box-shadow: var(--shadow-card); }
.project-card:hover::before { opacity: 1; }
.project-card.hidden { display: none; }

.project-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 6px; }
.project-header h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; }
.project-tag {
    font-family: var(--mono); font-size: .68rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; white-space: nowrap; flex-shrink: 0;
    border: 1px solid transparent;
}
.project-tag.completed { color: var(--primary); background: var(--primary-glow); border-color: var(--primary-border); }
.project-tag.mvp { color: #60a5fa; background: rgba(96, 165, 250, .12); border-color: rgba(96, 165, 250, .28); }
.project-tag.in-progress { color: #4fb6ad; background: rgba(79, 182, 173, .12); border-color: rgba(79, 182, 173, .30); }
.project-tag.planning { color: #a78bfa; background: rgba(167, 139, 250, .12); border-color: rgba(167, 139, 250, .28); }
.project-subtitle { font-family: var(--mono); font-size: .78rem; color: var(--primary); margin-bottom: 14px; }
.project-description { color: var(--text-dim); font-size: .94rem; margin-bottom: 18px; }
.project-tech { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.tech-badge {
    font-family: var(--mono); font-size: .72rem; color: var(--text-dim);
    background: var(--surface-2); border: 1px solid var(--border-soft);
    padding: 4px 10px; border-radius: 6px;
}
.project-result {
    font-size: .88rem; color: var(--text-dim); padding: 12px 14px; margin-top: auto;
    background: var(--primary-glow); border-left: 2px solid var(--primary); border-radius: 0 8px 8px 0;
}
.project-result i { color: var(--primary); margin-right: 5px; }
.project-result strong { color: var(--text); }
.case-study {
    margin-top: 14px; padding: 14px; background: var(--surface-2);
    border: 1px solid var(--border-soft); border-radius: 10px;
    display: flex; flex-direction: column; gap: 7px;
}
.case-study-item { font-size: .85rem; color: var(--text-dim); line-height: 1.5; }
.case-study-item strong { color: var(--primary); font-family: var(--mono); font-size: .8rem; }
.project-link {
    display: inline-flex; align-items: center; gap: 7px; margin-top: 16px;
    font-family: var(--mono); font-size: .82rem; color: var(--primary);
    transition: gap .2s var(--ease);
}
.project-link:hover { gap: 11px; }
.project-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.project-links .project-link { margin-top: 0; }

/* ===== Experience timeline ===== */
.timeline { position: relative; max-width: 820px; }
.timeline::before {
    content: ""; position: absolute; left: 23px; top: 8px; bottom: 8px; width: 2px;
    background: linear-gradient(180deg, var(--primary), var(--border-soft));
}
.tl-item { position: relative; padding-left: 70px; padding-bottom: 40px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-marker {
    position: absolute; left: 24px; top: 18px; width: 14px; height: 14px; border-radius: 50%;
    background: var(--primary); transform: translateX(-50%); z-index: 1;
}
.tl-marker i { display: none; }
.tl-content {
    background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
    padding: 22px 24px; transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.tl-content:hover { border-color: var(--primary-border); transform: translateX(4px); }
.tl-period { font-size: .76rem; color: var(--primary); display: block; margin-bottom: 7px; }
.tl-content h3 { font-size: 1.2rem; font-weight: 700; }
.tl-role { font-size: .9rem; color: var(--text-mute); margin-bottom: 12px; font-family: var(--mono); }
.tl-content > p { color: var(--text-dim); font-size: .94rem; margin-bottom: 14px; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 7px; }

/* Evidence sub-branch hanging off a timeline entry (tree node).
   Sits as a sibling AFTER .tl-content inside .tl-item, so the main
   rail continues down into it; a node dot taps the rail like a leaf. */
.tl-evidence { position: relative; padding-left: 70px; padding-top: 18px; }
.tl-evidence::before {
    content: ""; position: absolute; left: 24px; top: 30px; width: 12px; height: 12px; border-radius: 50%;
    background: var(--surface); border: 2px solid var(--primary-border); transform: translateX(-50%); z-index: 1;
}
.tl-evidence-label { display: block; font-size: .72rem; color: var(--text-mute); margin-bottom: 12px; font-family: var(--mono); }
.tl-evidence-label::before { content: "\2514 "; color: var(--primary); }
.tl-evidence-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.tl-evidence figure { margin: 0; flex: 0 1 240px; min-width: 0; }
.tl-evidence img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 10px; border: 1px solid var(--border-soft); transition: border-color .2s var(--ease), transform .2s var(--ease); }
.tl-evidence a:hover img { border-color: var(--primary-border); transform: translateY(-2px); }
.tl-evidence figcaption { margin-top: 7px; font-size: .72rem; line-height: 1.35; color: var(--text-mute); font-family: var(--mono); }

/* ===== Contact ===== */
.contact .container { text-align: center; }
.contact .section-subtitle { margin-left: auto; margin-right: auto; }
.contact-email {
    display: inline-block; font-size: clamp(1.2rem, 3vw, 1.7rem); font-weight: 600;
    color: var(--text); padding-bottom: 4px; margin-bottom: 44px;
    border-bottom: 2px solid var(--primary-border); transition: border-color .2s, color .2s;
}
.contact-email:hover { color: var(--primary); border-color: var(--primary); }
.contact-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; }
.contact-card {
    display: flex; align-items: center; gap: 14px; text-align: left;
    background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
    padding: 18px 24px; min-width: 230px; transition: all .2s var(--ease);
}
.contact-card:hover { border-color: var(--primary-border); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.contact-card i { font-size: 1.5rem; color: var(--primary); }
.contact-card h3 { font-size: .98rem; font-weight: 600; }
.contact-card p { font-size: .82rem; color: var(--text-mute); font-family: var(--mono); }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border-soft); padding: 36px 0; background: var(--bg); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-logo { font-weight: 700; font-size: 1.1rem; }
.footer-logo span { color: var(--primary); }
.footer-inner p { font-size: .8rem; color: var(--text-mute); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-mute); font-size: 1.15rem; transition: color .2s, transform .2s; }
.footer-links a:hover { color: var(--primary); transform: translateY(-2px); }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ===== Back to top (created in JS) ===== */
#backToTop {
    position: fixed; bottom: 28px; right: 28px; width: 46px; height: 46px; border-radius: 50%;
    background: var(--primary); color: #1a1206; border: none; cursor: pointer; display: none;
    align-items: center; justify-content: center; font-size: 1rem; z-index: 99;
    box-shadow: 0 8px 24px var(--primary-glow); transition: transform .2s var(--ease), background .2s;
}
#backToTop:hover { transform: translateY(-3px); background: var(--primary-strong); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; gap: 36px; }
    .skill-cats { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 768px) {
    .nav-menu {
        position: fixed; top: 62px; left: 0; right: 0; flex-direction: column; gap: 0;
        background: var(--bg); border-bottom: 1px solid var(--border);
        padding: 0 24px; max-height: 0; overflow: hidden; transition: max-height .3s var(--ease), padding .3s var(--ease);
    }
    .nav-menu.active { max-height: 340px; padding: 12px 24px 20px; }
    .nav-menu li { width: 100%; }
    .nav-link { display: block; padding: 13px 0; font-size: 1rem; border-bottom: 1px solid var(--border-soft); }
    .nav-link.active::after { display: none; }
    .hamburger { display: flex; }
    .nav-resume { display: none; }
    .projects-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .section { padding: 84px 0; }
    .hero { padding-top: 110px; }
    .footer-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 420px) {
    .container { padding: 0 18px; }
    .project-card { padding: 22px; }
    .tl-item { padding-left: 58px; }
    .tl-evidence { padding-left: 58px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    .reveal { opacity: 1; transform: none; }
    .bar i { transition: none; }
}
