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

:root {
    --bg:          #0d1117;
    --bg-raised:   #0f141a;
    --surface:     #161b22;
    --surface-2:   #1c2128;
    --border:      #30363d;
    --border-subtle: #21262d;
    --text:        #c9d1d9;
    --text-muted:  #8b949e;
    --heading:     #f0f6fc;
    --accent:      #58a6ff;
    --accent-dim:  rgba(88, 166, 255, 0.12);
    --accent-glow: rgba(88, 166, 255, 0.25);
    --green:       #3fb950;
    --green-bg:    #238636;
    --green-hover: #2ea043;
    --radius:      8px;
    --radius-lg:   12px;
    --nav-h:       60px;
    --nav-blur-bg: rgba(13, 17, 23, 0.82);
}

:root[data-theme="light"] {
    --bg:          #ffffff;
    --bg-raised:   #f6f8fa;
    --surface:     #f6f8fa;
    --surface-2:   #eaeef2;
    --border:      #d0d7de;
    --border-subtle: #d8dee4;
    --text:        #1f2328;
    --text-muted:  #636c76;
    --heading:     #1f2328;
    --accent:      #0969da;
    --accent-dim:  rgba(9, 105, 218, 0.08);
    --accent-glow: rgba(9, 105, 218, 0.15);
    --green:       #1a7f37;
    --green-bg:    #1f883d;
    --green-hover: #1a7f37;
    --nav-blur-bg: rgba(255, 255, 255, 0.88);
}

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* ───── NAV ───── */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    padding: 0 32px;
    border-bottom: 1px solid transparent;
    transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}

nav.scrolled {
    background: var(--nav-blur-bg);
    border-color: var(--border-subtle);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.nav-inner {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--heading);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

.nav-logo .fish {
    font-size: 1.2rem;
    line-height: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
    color: var(--heading);
    background: var(--surface);
}

.nav-links .github-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    margin-left: 8px;
}

.nav-links .github-link:hover {
    color: var(--heading);
    border-color: var(--border);
    background: var(--surface);
}

/* ───── THEME SWITCHER ───── */
.theme-switcher {
    display: flex;
    align-items: center;
    height: 43px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    overflow: hidden;
    margin-left: 4px;
    flex-shrink: 0;
}

.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 100%;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border-subtle);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    padding: 0;
    flex-shrink: 0;
}

.theme-btn:last-child {
    border-right: none;
}

.theme-btn svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    flex-shrink: 0;
}

.theme-btn:hover {
    color: var(--heading);
    background: var(--surface);
}

.theme-btn.active {
    color: var(--accent);
    background: var(--accent-dim);
}

/* ───── HAMBURGER TOGGLE ───── */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    margin-left: auto;
}

.nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

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

/* ───── HERO ───── */
.hero {
    padding: 72px 20px 56px;
    max-width: 1000px;
    margin: 0 auto;
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
    font-family: 'DM Mono', monospace;
}

.hero-eyebrow::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.8;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--heading);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 24px;
}

.hero h1 .fish {
    display: inline-block;
}

.hero-divider {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin-bottom: 24px;
}

.hero-quote {
    border-left: 3px solid var(--accent);
    background: var(--accent-dim);
    padding: 18px 24px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 28px;
    max-width: 750px;
}

.hero-quote p {
    color: var(--text);
    font-size: 1.05rem;
    font-style: italic;
    line-height: 1.6;
}

.hero-body {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 1000px;
    line-height: 1.75;
}

.hero-body code {
    background: rgba(110, 118, 129, 0.3);
    padding: 0.15em 0.45em;
    border-radius: 4px;
    font-family: 'DM Mono', monospace;
    font-size: 0.85em;
    color: var(--text);
}

/* ───── SECTION COMMON ───── */
section {
    padding: 56px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.section-label {
    margin-top: 0.25em;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--heading);
    letter-spacing: -0.02em;
}

/* ───── TECH GRID ───── */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.tech-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}

.tech-card::after {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

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

.tech-card:hover {
    border-color: var(--border);
    transform: translateY(-2px);
}

.tech-card:hover::before {
    opacity: 1;
}

.tech-card-icon {
    font-size: 1.4rem;
    margin-bottom: 14px;
    display: block;
    line-height: 1;
}

.tech-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.tech-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.tech-tag {
    display: inline-block;
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(88, 166, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 12px;
}

/* ───── PROJECT CARD ───── */
.project-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}

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

.project-card-glow {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

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

.project-name {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--heading);
    letter-spacing: -0.02em;
}

.project-mono {
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    padding: 2px 10px;
    border-radius: 20px;
}

.project-desc {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 680px;
}

.project-desc code {
    background: rgba(110, 118, 129, 0.3);
    padding: 0.15em 0.45em;
    border-radius: 4px;
    font-family: 'DM Mono', monospace;
    font-size: 0.82em;
    color: var(--text);
}

.badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.badges img {
    height: 20px;
    border-radius: 3px;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

a.button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
    border: 1px solid transparent;
    cursor: pointer;
    letter-spacing: -0.005em;
}

a.button.primary {
    background-color: var(--green-bg);
    color: #ffffff;
    border-color: rgba(240, 246, 252, 0.1);
    box-shadow: 0 0 0 0 rgba(63, 185, 80, 0);
}

a.button.primary:hover {
    background-color: var(--green-hover);
    box-shadow: 0 0 12px rgba(63, 185, 80, 0.2);
}

a.button.secondary {
    background-color: var(--surface-2);
    color: var(--text);
    border-color: var(--border-subtle);
}

a.button.secondary:hover {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--heading);
}

/* ───── FOOTER ───── */
footer {
    border-top: 1px solid var(--border-subtle);
    margin-top: 32px;
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 36px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--heading);
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
    width: 100%;
    margin-top: 8px;
}

/* ───── SECTION DIVIDER ───── */
.section-sep {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-sep hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
}

/* ───── ENTRANCE ANIMATIONS ───── */
.animate-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* stagger children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.visible > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0s; }
.stagger-children.visible > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.08s; }
.stagger-children.visible > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.16s; }
.stagger-children.visible > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.24s; }

/* ───── SVG ICONS (inline, simple) ───── */
.icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    fill: currentColor;
}

/* ───── PROJECTS LIST ───── */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ───── RESUME ───── */
.resume-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.resume-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.resume-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--heading);
    letter-spacing: -0.02em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.resume-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.resume-group-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

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

.resume-tag {
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    padding: 5px 12px;
    border-radius: 6px;
    transition: border-color 0.15s, color 0.15s;
}

.resume-tag:hover {
    border-color: var(--border);
    color: var(--heading);
}

.resume-tag.accent {
    color: var(--accent);
    background: var(--accent-dim);
    border-color: rgba(88, 166, 255, 0.2);
}

.resume-experience-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}

.resume-experience-card::after {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

.resume-experience-card:hover {
    border-color: var(--border);
}

.resume-experience-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s;
}

.resume-experience-card:hover::before {
    opacity: 1;
}

.resume-exp-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.resume-exp-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--heading);
    letter-spacing: -0.01em;
}

.resume-exp-company {
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 4px;
}

.resume-exp-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.resume-exp-date {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    padding: 2px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.resume-exp-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-top: 12px;
}

.resume-exp-desc ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.resume-exp-desc ul li {
    padding-left: 16px;
    position: relative;
}

.resume-exp-desc ul li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--accent);
    opacity: 0.6;
}

/* ───── RESPONSIVE ───── */
@media (max-width: 768px) {
    nav { padding: 0 16px; }

    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 8px 0;
        z-index: 99;
    }

    .nav-links.open { display: flex; }

    .nav-links a {
        width: 100%;
        padding: 10px 20px;
        border-radius: 0;
    }

    .nav-links .github-link {
        background: none;
        border: none;
        border-radius: 0;
        padding: 10px 20px;
        margin-left: 0;
    }

    .theme-switcher {
        width: 100%;
        border: none;
        border-top: 1px solid var(--border-subtle);
        border-radius: 0;
        margin: 4px 0 0;
        padding: 8px 20px;
        height: auto;
        justify-content: flex-start;
        gap: 8px;
    }

    .theme-btn {
        border-right: 1px solid var(--border-subtle);
        border-radius: 6px;
        width: 36px;
        height: 32px;
    }

    .theme-btn:last-child { border-right: 1px solid var(--border-subtle); }

    .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }

    .resume-exp-header { flex-direction: column; gap: 4px; }
    .resume-exp-meta { align-self: flex-start; }

    .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .footer-links { flex-wrap: wrap; gap: 8px 16px; }
    .footer-copy { margin-top: 0; }

    .project-card { padding: 24px 20px; }
}

@media (max-width: 480px) {
    .hero { padding: 48px 16px 40px; }
    .hero h1 { font-size: clamp(1.6rem, 8vw, 2.4rem); }

    section { padding: 40px 16px; }

    .tech-grid { grid-template-columns: 1fr; }

    .resume-tags { gap: 6px; }
    .resume-tag { font-size: 0.75rem; }

    .section-sep { padding: 0 16px; }
}
