@import url('https://fonts.googleapis.com/css2?family=Funnel+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Funnel+Display:wght@400;500;600;700&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== THEMES ===== */
[data-theme="light"] {
    --bg: #f8f7f4; --bg-warm: #f0eee9; --surface: #fff;
    --glass: rgba(248,247,244,0.85);
    --border: rgba(0,0,0,0.06); --border-accent: rgba(0,0,0,0.11);
    --text-1: #1a1916; --text-2: #5c5a55; --text-3: #908d86; --text-4: #bab7b0;
    --accent: #b8612a; --accent-soft: rgba(184,97,42,0.07);
    --green: #4d8a5e; --green-soft: rgba(77,138,94,0.08);
    --sh-card: 0 1px 3px rgba(0,0,0,0.03);
    --sh-card-hover: 0 8px 28px rgba(0,0,0,0.06);
    --sh-dropdown: 0 12px 40px rgba(0,0,0,0.09);
    --scroll-t: rgba(0,0,0,0.08); --scroll-h: rgba(0,0,0,0.16);
    --hover-tint: rgba(0,0,0,0.015); --nav-bg: rgba(0,0,0,0.025);
}

[data-theme="jetblack"] {
    --bg: #0b1919; --bg-warm: #0f2222; --surface: #132b2b;
    --glass: rgba(11,25,25,0.9);
    --border: rgba(79,176,176,0.07); --border-accent: rgba(79,176,176,0.14);
    --text-1: #dcefef; --text-2: #8ec4c4; --text-3: #3f8d8d; --text-4: #2a5e5e;
    --accent: #4fb0b0; --accent-soft: rgba(79,176,176,0.07);
    --green: #4fb0b0; --green-soft: rgba(79,176,176,0.08);
    --sh-card: 0 1px 3px rgba(0,0,0,0.2); --sh-card-hover: 0 8px 28px rgba(0,0,0,0.35);
    --sh-dropdown: 0 12px 40px rgba(0,0,0,0.45);
    --scroll-t: rgba(79,176,176,0.12); --scroll-h: rgba(79,176,176,0.25);
    --hover-tint: rgba(79,176,176,0.02); --nav-bg: rgba(79,176,176,0.05);
}

[data-theme="midnight"] {
    --bg: #0c0e1a; --bg-warm: #10122a; --surface: #151830;
    --glass: rgba(12,14,26,0.9);
    --border: rgba(120,130,255,0.07); --border-accent: rgba(120,130,255,0.16);
    --text-1: #e0e2ff; --text-2: #9da2d4; --text-3: #5a5f8a; --text-4: #3a3e62;
    --accent: #7882ff; --accent-soft: rgba(120,130,255,0.07);
    --green: #6dd49c; --green-soft: rgba(109,212,156,0.08);
    --sh-card: 0 1px 3px rgba(0,0,0,0.2); --sh-card-hover: 0 8px 28px rgba(0,0,0,0.4);
    --sh-dropdown: 0 12px 40px rgba(0,0,0,0.45);
    --scroll-t: rgba(120,130,255,0.12); --scroll-h: rgba(120,130,255,0.25);
    --hover-tint: rgba(120,130,255,0.02); --nav-bg: rgba(120,130,255,0.05);
}

[data-theme="rose"] {
    --bg: #f9f3f0; --bg-warm: #f3e8e3; --surface: #fff;
    --glass: rgba(249,243,240,0.88);
    --border: rgba(160,90,70,0.07); --border-accent: rgba(160,90,70,0.13);
    --text-1: #2e1a15; --text-2: #7a5248; --text-3: #b08a80; --text-4: #d4bab4;
    --accent: #b85238; --accent-soft: rgba(184,82,56,0.07);
    --green: #5e9468; --green-soft: rgba(94,148,104,0.08);
    --sh-card: 0 1px 3px rgba(160,90,70,0.03); --sh-card-hover: 0 8px 28px rgba(160,90,70,0.07);
    --sh-dropdown: 0 12px 40px rgba(160,90,70,0.09);
    --scroll-t: rgba(160,90,70,0.08); --scroll-h: rgba(160,90,70,0.18);
    --hover-tint: rgba(160,90,70,0.015); --nav-bg: rgba(160,90,70,0.03);
}

/* ===== BASE ===== */
:root {
    --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 100px;
    --ease: cubic-bezier(0.16,1,0.3,1);
    --pad: 3rem; --w: 1100px;
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    font-family: 'Funnel Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg); color: var(--text-1);
    line-height: 1.65; min-height: 100vh;
    overflow-x: hidden; font-size: 16px;
    transition: background 0.4s, color 0.4s;
}
::selection { background: var(--accent); color: var(--bg); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-t); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-h); }

/* ===== NAV ===== */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--glass);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border-bottom: 1px solid var(--border);
    transition: background 0.4s, border-color 0.4s;
}
.nav-inner {
    max-width: var(--w); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--pad); height: 56px; gap: 0.75rem;
    position: relative;
}

.nav-logo {
    font-family: 'Funnel Display', Georgia, serif;
    font-size: 1.0625rem; font-weight: 400;
    color: var(--text-1); text-decoration: none;
    letter-spacing: -0.02em; transition: color 0.3s;
    flex-shrink: 0;
}
.nav-logo:hover { color: var(--accent); }

.nav-links {
    display: flex; gap: 2px;
    position: absolute; left: 50%; transform: translateX(-50%);
}
.nav-link {
    font-size: 0.8125rem; font-weight: 500; color: var(--text-3);
    text-decoration: none; padding: 6px 14px; border-radius: var(--r-pill);
    transition: all 0.25s;
}
.nav-link:hover { color: var(--text-1); background: var(--nav-bg); }
.nav-link.active { color: var(--text-1); font-weight: 600; }
.nav-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Theme */
.theme-btn {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--bg-warm); border: 1px solid var(--border);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.3s; position: relative; overflow: hidden; flex-shrink: 0;
}
.theme-btn:hover { border-color: var(--border-accent); transform: scale(1.08); }
.theme-btn:active { transform: scale(0.95); }
.theme-btn svg { width: 14px; height: 14px; color: var(--text-3); transition: all 0.35s; position: absolute; }
.icon-sun { opacity: 1; transform: rotate(0) scale(1); }
.icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
[data-theme="jetblack"] .icon-sun, [data-theme="midnight"] .icon-sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="jetblack"] .icon-moon, [data-theme="midnight"] .icon-moon { opacity: 1; transform: rotate(0) scale(1); }

.theme-picker { position: relative; }
.theme-dots {
    display: none; position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 8px;
    box-shadow: var(--sh-dropdown); z-index: 200;
    flex-direction: column; gap: 4px; min-width: 150px;
}
.theme-dots.open { display: flex; }
.theme-opt {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; border-radius: 6px; cursor: pointer;
    transition: all 0.2s; border: none; background: none; font-family: inherit;
    font-size: 0.8125rem; font-weight: 500; color: var(--text-2);
    width: 100%; text-align: left;
}
.theme-opt:hover { background: var(--nav-bg); color: var(--text-1); }
.theme-opt.active { color: var(--accent); font-weight: 600; }
.theme-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; border: 1.5px solid var(--border); }
.theme-dot.t-light { background: #f8f7f4; }
.theme-dot.t-jetblack { background: #0b1919; border-color: #4fb0b0; }
.theme-dot.t-midnight { background: #0c0e1a; border-color: #7882ff; }
.theme-dot.t-rose { background: #f9f3f0; border-color: #b85238; }

/* ===== MAIN ===== */
.main { max-width: var(--w); margin: 0 auto; padding: 0 var(--pad) 5rem; }

/* ===== HERO ===== */
.hero {
    padding: 7rem 0 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    opacity: 0; transform: translateY(16px);
    animation: reveal 0.7s var(--ease) 0.1s forwards;
}
@keyframes reveal { to { opacity: 1; transform: none; } }

/* Floating shapes */
.hero-shapes {
    position: absolute; inset: 0;
    pointer-events: none; z-index: 0;
}
.hero h1, .hero-sub, .hero-links { position: relative; z-index: 1; }

.shape { position: absolute; }

/* Small circles */
.shape-circle {
    border-radius: 50%;
    border: 1.5px solid var(--border-accent);
}
.s1 { width: 40px; height: 40px; top: 15%; left: 8%; animation: float 8s ease-in-out infinite; opacity: 0.5; }
.s2 { width: 24px; height: 24px; top: 65%; right: 12%; animation: float 6s ease-in-out infinite 1s; opacity: 0.4; }
.s3 { width: 16px; height: 16px; bottom: 20%; left: 20%; animation: float 7s ease-in-out infinite 2s; opacity: 0.3; background: var(--accent-soft); border: none; }

/* Rings */
.shape-ring {
    border-radius: 50%;
    border: 1px solid var(--border);
}
.s4 { width: 80px; height: 80px; top: 25%; right: 6%; animation: float 10s ease-in-out infinite 0.5s; opacity: 0.35; }
.s5 { width: 50px; height: 50px; bottom: 30%; left: 5%; animation: float 9s ease-in-out infinite 1.5s; opacity: 0.25; }

/* Dots */
.shape-dot {
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--accent); opacity: 0.3;
}
.s6 { top: 20%; left: 30%; animation: blink 3s ease-in-out infinite; }
.s7 { top: 40%; right: 25%; animation: blink 4s ease-in-out infinite 1s; }
.s8 { bottom: 35%; left: 45%; animation: blink 3.5s ease-in-out infinite 0.5s; }
.s9 { top: 55%; left: 15%; animation: blink 5s ease-in-out infinite 2s; }
.s10 { bottom: 15%; right: 30%; animation: blink 4.5s ease-in-out infinite 1.5s; }

/* Cross / plus signs */
.shape-cross {
    width: 12px; height: 12px; opacity: 0.2;
}
.shape-cross::before, .shape-cross::after {
    content: '';
    position: absolute;
    background: var(--text-4);
    border-radius: 1px;
}
.shape-cross::before {
    width: 12px; height: 1.5px;
    top: 50%; left: 0; transform: translateY(-50%);
}
.shape-cross::after {
    width: 1.5px; height: 12px;
    left: 50%; top: 0; transform: translateX(-50%);
}
.s11 { top: 10%; right: 35%; animation: float 7s ease-in-out infinite 0.8s; }
.s12 { bottom: 25%; right: 18%; animation: float 8s ease-in-out infinite 1.8s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(5deg); }
}
@keyframes blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.08; }
}
.hero h1 {
    font-family: 'Funnel Display', Georgia, serif;
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 400; line-height: 1.05;
    letter-spacing: -0.03em; color: var(--text-1);
    margin-bottom: 1rem; transition: color 0.4s;
}
.hero-sub {
    font-size: 1.0625rem; line-height: 1.75; color: var(--text-2);
    max-width: 520px; transition: color 0.4s;
}
.hero-sub {
    font-size: 1.125rem; line-height: 1.7; color: var(--text-2);
    max-width: 480px; margin: 0 auto 2rem;
}

.hero-links {
    display: flex; justify-content: center; gap: 1.5rem;
}
.hero-links a {
    font-size: 0.875rem; font-weight: 500; color: var(--text-3);
    text-decoration: none; padding: 6px 0;
    border-bottom: 1.5px solid transparent;
    transition: all 0.3s;
}
.hero-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.btn {
    background: var(--text-1); color: var(--bg); border: none;
    padding: 9px 20px; border-radius: var(--r-pill);
    font-family: inherit; font-size: 0.875rem; font-weight: 600;
    cursor: pointer; transition: all 0.3s var(--ease);
}
.btn:hover { transform: scale(1.04); }
.btn-outline {
    display: inline-flex; align-items: center;
    color: var(--accent); text-decoration: none;
    font-size: 0.875rem; font-weight: 600;
    padding: 9px 20px; border-radius: var(--r-pill);
    border: 1.5px solid var(--accent);
    transition: all 0.3s var(--ease);
}
.btn-outline:hover { background: var(--accent-soft); }

/* ===== SECTIONS ===== */
.section {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.section.visible { opacity: 1; transform: none; }

.sec-header { margin-bottom: 2rem; }
.sec-label {
    font-size: 0.6875rem; font-weight: 700; color: var(--accent);
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem;
    display: block;
}
.sec-title {
    font-family: 'Funnel Display', Georgia, serif;
    font-size: 1.75rem; font-weight: 400;
    letter-spacing: -0.02em; color: var(--text-1);
}

/* ===== ABOUT ===== */
.about-grid {
    display: grid; grid-template-columns: 1fr 200px; gap: 2rem;
    margin-bottom: 2rem;
}
.about-text p {
    font-size: 1rem; line-height: 1.8; color: var(--text-2);
    margin-bottom: 1rem;
}
.about-text p:last-child { margin-bottom: 0; }

.about-highlights { display: flex; flex-direction: column; gap: 0.75rem; }
.highlight-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 1rem 1.25rem;
    transition: background 0.4s, border-color 0.4s;
}
.highlight-val {
    font-size: 1.375rem; font-weight: 800; color: var(--text-1);
    letter-spacing: -0.03em; display: block; line-height: 1;
    transition: color 0.4s;
}
.highlight-lbl {
    font-size: 0.75rem; font-weight: 500; color: var(--text-3);
    margin-top: 4px; display: block; transition: color 0.4s;
}

.focus-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.focus-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 1.25rem;
    transition: background 0.4s, border-color 0.4s;
}
.focus-card h3 {
    font-size: 0.9375rem; font-weight: 700; color: var(--text-1);
    margin-bottom: 0.5rem; transition: color 0.4s;
}
.focus-card p {
    font-size: 0.875rem; line-height: 1.6; color: var(--text-3);
    transition: color 0.4s;
}

/* ===== TIMELINE ===== */
.timeline-list { display: flex; flex-direction: column; }
.timeline-item {
    display: flex; gap: 1.5rem; padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.4s;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-year {
    font-size: 0.8125rem; font-weight: 700; color: var(--accent);
    white-space: nowrap; min-width: 80px; padding-top: 2px;
}
.timeline-content h3 {
    font-size: 1rem; font-weight: 600; color: var(--text-1);
    margin-bottom: 0.25rem; transition: color 0.4s;
}
.timeline-content p {
    font-size: 0.875rem; line-height: 1.6; color: var(--text-2);
    transition: color 0.4s;
}

/* ===== PROJECTS ===== */
.project-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
}
.project-card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 1.5rem;
    text-decoration: none; color: inherit;
    transition: all 0.35s var(--ease), background 0.4s, border-color 0.4s;
    box-shadow: var(--sh-card);
    position: relative; min-width: 0;
}
.project-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--sh-card-hover);
    transform: translateY(-2px);
}
.project-tag {
    font-size: 0.625rem; font-weight: 600; color: var(--accent);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    display: inline-block;
}
.project-card h3 {
    font-size: 1rem; font-weight: 700; color: var(--text-1);
    margin-bottom: 0.375rem; transition: color 0.4s;
}
.project-card:hover h3 { color: var(--accent); }
.project-card p {
    font-size: 0.8125rem; line-height: 1.6; color: var(--text-2);
    margin-bottom: 0.75rem; transition: color 0.4s;
}
.project-tech { display: flex; flex-wrap: wrap; gap: 4px; }
.tech-pill {
    font-size: 0.6875rem; font-weight: 600;
    padding: 3px 8px; border-radius: var(--r-pill);
    background: var(--bg-warm); color: var(--text-3);
}

.project-link {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.75rem; font-weight: 500; color: var(--text-4);
    margin-top: 0.75rem;
    transition: color 0.3s;
}
.project-card:hover .project-link { color: var(--accent); }

.project-ext {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 4px;
    color: var(--text-4); transition: all 0.3s;
    flex-shrink: 0;
}
.project-ext:hover { color: var(--accent); background: var(--accent-soft); }
.project-ext svg { width: 13px; height: 13px; }

/* Project image */
.project-img {
    width: 100%; height: 130px; object-fit: cover;
    border-radius: 8px; margin-bottom: 0.75rem;
    border: 1px solid var(--border);
}
.project-card:hover .project-img { opacity: 0.9; }

/* Project detail image */
.project-hero-img {
    width: 100%; height: 260px; object-fit: cover;
    object-position: center top;
    border-radius: var(--r-md); margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

/* ===== BOOK TICKER (Scrolling Banner) ===== */
.book-ticker-wrap {
    overflow: hidden;
    position: relative;
    padding: 1rem 0;
}
.book-ticker-wrap::before,
.book-ticker-wrap::after {
    content: '';
    position: absolute; top: 0; bottom: 0; width: 60px;
    z-index: 2; pointer-events: none;
}
.book-ticker-wrap::before {
    left: 0;
    background: linear-gradient(to right, var(--bg), transparent);
}
.book-ticker-wrap::after {
    right: 0;
    background: linear-gradient(to left, var(--bg), transparent);
}

.book-ticker {
    display: flex; gap: 2rem;
    animation: ticker 40s linear infinite;
    width: max-content;
}
.book-ticker:hover { animation-play-state: paused; }

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.book-ticker-item {
    display: flex; align-items: flex-start; gap: 1rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 1.25rem 1.5rem;
    min-width: 340px; max-width: 340px;
    flex-shrink: 0;
    transition: border-color 0.3s;
}
.book-ticker-item:hover { border-color: var(--border-accent); }

.book-ticker-num {
    font-family: 'Funnel Display', Georgia, serif;
    font-size: 1.5rem; font-weight: 400;
    color: var(--accent); line-height: 1;
    flex-shrink: 0; opacity: 0.5;
}
.book-ticker-info h3 {
    font-size: 0.875rem; font-weight: 700; color: var(--text-1);
    margin-bottom: 2px;
}
.book-ticker-author {
    font-size: 0.75rem; color: var(--text-3); margin-bottom: 0.375rem;
}
.book-ticker-quote {
    font-size: 0.8125rem; line-height: 1.55; color: var(--text-2);
    font-style: italic;
}

/* ===== SKILLS ===== */
.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.skill-card {
    display: block;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 1rem;
    text-decoration: none; color: inherit;
    transition: all 0.3s var(--ease), background 0.4s, border-color 0.4s;
    position: relative;
}
.skill-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
}
.skill-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.375rem;
}
.skill-name {
    font-size: 0.875rem; font-weight: 700; color: var(--text-1);
    transition: color 0.4s;
}
.skill-card:hover .skill-name { color: var(--accent); }
.skill-cat {
    font-size: 0.6875rem; font-weight: 600; color: var(--accent);
    background: var(--accent-soft); padding: 2px 7px;
    border-radius: 3px; letter-spacing: 0.02em;
}
.skill-desc {
    font-size: 0.8125rem; line-height: 1.55; color: var(--text-3);
    transition: color 0.4s;
}
.skill-arrow {
    position: absolute; right: 0.875rem; bottom: 0.875rem;
    width: 14px; height: 14px; color: var(--text-4);
    opacity: 0; transform: translateX(-4px);
    transition: all 0.3s var(--ease);
}
.skill-card:hover .skill-arrow { opacity: 1; transform: none; color: var(--accent); }

/* ===== CERTS ===== */
.cert-list { display: flex; flex-direction: column; gap: 0; }
.cert-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 0; border-bottom: 1px solid var(--border);
    font-size: 0.9375rem; color: var(--text-2);
    transition: border-color 0.4s, color 0.4s;
}
.cert-item:last-child { border-bottom: none; }
.cert-icon { width: 16px; height: 16px; color: var(--green); flex-shrink: 0; }

/* ===== BOOKS ===== */
.book-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.book-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 1.25rem;
    transition: background 0.4s, border-color 0.4s;
}
.book-card h3 {
    font-size: 0.875rem; font-weight: 700; color: var(--text-1);
    margin-bottom: 0.125rem; transition: color 0.4s;
}
.book-author {
    font-size: 0.75rem; color: var(--text-3); margin-bottom: 0.625rem;
    transition: color 0.4s;
}
.book-quote {
    font-size: 0.8125rem; line-height: 1.6; color: var(--text-2);
    font-style: italic; transition: color 0.4s;
}

/* ===== CONTACT ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 220px; gap: 2rem; }
.contact-info p {
    font-size: 0.9375rem; line-height: 1.75; color: var(--text-2);
    margin-bottom: 1.25rem; transition: color 0.4s;
}
.contact-links { display: flex; flex-direction: column; gap: 0.5rem; }
.contact-link {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.875rem; font-weight: 500; color: var(--accent);
    text-decoration: none; transition: opacity 0.3s;
}
.contact-link:hover { opacity: 0.65; }
.contact-link svg { width: 16px; height: 16px; }

.collab-label {
    font-size: 0.6875rem; font-weight: 700; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem;
}
.collab-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.625rem 0; border-bottom: 1px solid var(--border);
    text-decoration: none; color: var(--text-2);
    font-size: 0.875rem; font-weight: 500;
    transition: color 0.3s, border-color 0.4s;
}
.collab-item:hover { color: var(--accent); }
.collab-item:last-child { border-bottom: none; }
.collab-arrow { width: 14px; height: 14px; color: var(--text-4); transition: color 0.3s; }
.collab-item:hover .collab-arrow { color: var(--accent); }

/* ===== FOOTER ===== */
.foot {
    text-align: center; padding: 3rem var(--pad) 2rem;
    border-top: 1px solid var(--border);
    max-width: var(--w); margin: 0 auto;
}
.foot p { font-size: 0.75rem; color: var(--text-3); font-weight: 500; }
.foot .foot-sub { font-size: 0.6875rem; color: var(--text-4); margin-top: 0.25rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    :root { --pad: 1.5rem; }
    .site-header { display: none; }
    .hero { padding: 3.5rem 0 3rem; }
    .hero-shapes { display: none; }
    .hero h1 { font-size: 2.25rem; }
    .about-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .about-highlights { flex-direction: row; flex-wrap: wrap; }
    .highlight-card { flex: 1; min-width: 100px; }
    .focus-cards { grid-template-columns: 1fr; gap: 8px; }
    .focus-card { padding: 1.25rem; }
    .project-card { padding: 1.25rem; }
    .skill-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .book-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .section { padding: 3.5rem 0; }
    .timeline-item { padding: 1rem 0; }
    .cert-item { padding: 0.875rem 0; }

    /* Theme picker mobile fix */
    .theme-picker { position: static; }
    .theme-dots {
        position: fixed; top: auto; bottom: 0; left: 0; right: 0;
        border-radius: var(--r-lg) var(--r-lg) 0 0;
        padding: 20px 16px; min-width: unset;
        box-shadow: 0 -8px 40px rgba(0,0,0,0.2);
        z-index: 9999;
    }
    .theme-dots::before {
        content: '';
        display: block; width: 36px; height: 4px;
        background: var(--text-4); border-radius: 2px;
        margin: 0 auto 12px;
    }
    .theme-opt {
        padding: 12px 14px; font-size: 0.9375rem;
        border-radius: var(--r-sm);
    }
    .theme-dot { width: 16px; height: 16px; }

    /* Backdrop */
    .theme-backdrop {
        display: none; position: fixed; inset: 0;
        background: rgba(0,0,0,0.3); z-index: 9998;
    }
    .theme-backdrop.open { display: block; }
}

@media (max-width: 480px) {
    :root { --pad: 1.25rem; }
    .hero { padding: 3rem 0 2.5rem; }
    .hero h1 { font-size: 1.875rem; }
    .hero-sub { font-size: 0.9375rem; }
    .hero-links { gap: 1.25rem; }
    .skill-grid { grid-template-columns: 1fr; }
    .project-grid { grid-template-columns: 1fr !important; }
    .timeline-item { flex-direction: column; gap: 0.5rem; }
    .timeline-year { min-width: auto; }
    .section { padding: 3rem 0; }
    .d-sec { padding: 1.25rem; }
}

/* ===== PROJECT DETAIL PAGE ===== */
.detail-page { max-width: var(--w); margin: 0 auto; padding: 0 var(--pad) 5rem; }

.back {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--text-3); text-decoration: none;
    font-size: 0.875rem; font-weight: 500;
    padding: 2rem 0 1.5rem;
    transition: color 0.3s;
}
.back:hover { color: var(--accent); }
.back svg { width: 14px; height: 14px; flex-shrink: 0; transition: transform 0.3s; }
.back:hover svg { transform: translateX(-3px); }

.project-hero {
    padding: 3rem 0 2.5rem;
    border-bottom: 1px solid var(--border);
    opacity: 0; transform: translateY(16px);
    animation: reveal 0.7s var(--ease) 0.1s forwards;
}
.project-hero h1 {
    font-family: 'Funnel Display', Georgia, serif;
    font-size: clamp(2rem, 4vw, 2.875rem);
    font-weight: 400; line-height: 1.1;
    letter-spacing: -0.03em; margin-bottom: 1.25rem;
    color: var(--text-1);
}
.project-desc-long {
    font-size: 1rem; line-height: 1.75; color: var(--text-2);
    max-width: 680px; margin-bottom: 1.5rem;
}

.project-meta-row {
    display: flex; gap: 2rem; margin-bottom: 1.25rem;
}
.project-meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-label {
    font-size: 0.6875rem; font-weight: 700; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 0.08em;
}
.meta-value {
    font-size: 0.875rem; font-weight: 500; color: var(--text-1);
}

.project-tech-row {
    display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 1.5rem;
}

.project-live-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--text-1); color: var(--bg);
    padding: 10px 22px; border-radius: var(--r-pill);
    text-decoration: none; font-size: 0.875rem; font-weight: 600;
    transition: all 0.3s var(--ease);
}
.project-live-btn:hover { transform: scale(1.04); }
.project-live-btn svg { width: 14px; height: 14px; }

/* Detail page two-column layout */
.project-detail-grid {
    display: grid; grid-template-columns: 1fr 220px;
    gap: 2.5rem; align-items: start;
    padding-top: 2rem;
}
.project-detail-main { min-width: 0; }
.project-sidebar { position: relative; }
.project-sidebar .sidebar-sticky { position: sticky; top: 72px; }

.toc-nav { display: flex; flex-direction: column; gap: 1px; }
.toc-label {
    font-size: 0.6875rem; font-weight: 700; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.625rem;
}
.toc-card { margin-bottom: 1rem; }
.toc-link {
    font-size: 0.8125rem; font-weight: 500; color: var(--text-3);
    text-decoration: none; padding: 5px 10px;
    border-radius: 5px; border-left: 2px solid transparent;
    transition: all 0.25s; display: block;
}
.toc-link:hover { color: var(--text-1); background: var(--hover-tint); }
.toc-link.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

.sidebar-link {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.8125rem; font-weight: 500; color: var(--accent);
    text-decoration: none; padding: 5px 10px;
    transition: opacity 0.3s;
}
.sidebar-link:hover { opacity: 0.65; }
.sidebar-link svg { width: 12px; height: 12px; }

/* Detail sections */
.d-sec {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 1.5rem;
    margin-bottom: 10px;
    transition: background 0.4s, border-color 0.4s;
}
.sec-label {
    font-size: 0.6875rem; font-weight: 700; color: var(--accent);
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1rem;
}
.d-sec p {
    font-size: 0.9375rem; line-height: 1.8; color: var(--text-1);
    white-space: pre-line;
}

.detail-list {
    list-style: none; padding: 0;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.detail-list li {
    font-size: 0.875rem; line-height: 1.6; color: var(--text-2);
    padding-left: 1rem;
    border-left: 2px solid var(--border-accent);
    transition: border-color 0.3s, color 0.3s;
}
.detail-list li:hover { border-color: var(--accent); color: var(--text-1); }

/* Roadmap */
.roadmap-list { display: flex; flex-direction: column; }
.roadmap-item {
    position: relative; padding: 0.5rem 0 0.5rem 20px;
    font-size: 0.875rem; line-height: 1.6; color: var(--text-2);
    border-left: 1.5px solid var(--border-accent);
}
.roadmap-item:first-child { padding-top: 0; }
.roadmap-item:last-child { padding-bottom: 0; }
.roadmap-item::before {
    content: ''; position: absolute;
    left: -3px; top: 0.8rem;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--accent);
}
.roadmap-item:first-child::before { top: 0.2rem; }

/* Other projects */
.other-projects { padding-top: 3rem; }
.other-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    margin-top: 1.25rem;
}
.other-card {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 0.875rem 1rem;
    text-decoration: none; color: inherit;
    transition: all 0.3s var(--ease);
}
.other-card:hover {
    border-color: var(--border-accent); transform: translateY(-1px);
}
.other-tag {
    font-size: 0.625rem; font-weight: 700; color: var(--green);
    background: var(--green-soft); padding: 2px 6px;
    border-radius: 3px; letter-spacing: 0.02em; white-space: nowrap;
}
.other-name {
    font-size: 0.875rem; font-weight: 600; color: var(--text-1);
}

/* ===== SKILL DETAIL PAGE ===== */
.skill-hero {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--border);
    opacity: 0; transform: translateY(16px);
    animation: reveal 0.7s var(--ease) 0.1s forwards;
}
.skill-hero .skill-cat {
    font-size: 0.75rem; padding: 4px 10px; margin-bottom: 0.75rem;
    display: inline-block;
}
.skill-hero h1 {
    font-family: 'Funnel Display', Georgia, serif;
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 400; line-height: 1.1;
    letter-spacing: -0.03em; margin-bottom: 1rem;
    color: var(--text-1);
}
.skill-hero .skill-desc-long {
    font-size: 1rem; line-height: 1.75; color: var(--text-2);
    max-width: 680px; margin-bottom: 1.5rem;
}

.skill-used-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px; margin-top: 1rem;
}
.skill-used-card {
    display: flex; align-items: center; gap: 0.75rem;
    background: var(--bg-warm); border: 1px solid var(--border);
    border-radius: var(--r-sm); padding: 0.75rem 1rem;
    text-decoration: none; color: inherit;
    transition: all 0.3s var(--ease);
}
.skill-used-card:hover {
    border-color: var(--border-accent); transform: translateY(-1px);
}
.skill-used-card img {
    width: 36px; height: 36px; border-radius: 6px;
    object-fit: cover; border: 1px solid var(--border);
}
.skill-used-name {
    font-size: 0.8125rem; font-weight: 600; color: var(--text-1);
}

@media (max-width: 768px) {
    .other-grid { grid-template-columns: repeat(2, 1fr); }
    .project-meta-row { flex-direction: column; gap: 1rem; }
    .project-img, .project-hero-img { display: none; }
    .project-detail-grid { grid-template-columns: 1fr; }
    .project-sidebar { display: none; }
}
