/* ============================================
   DESIGN SYSTEM — martinwu.tech
   Inspired by: Brittany Chiang, Camille Mormal
   Dark-first, techy, clean
   ============================================ */

/* --- Custom Properties --- */
:root {
    /* Dark theme (default) */
    --bg:           #0a192f;
    --bg-light:     #112240;
    --bg-lighter:   #1d3461;
    --navy-shadow:  rgba(2,12,27,0.7);

    --slate:        #8892b0;
    --light-slate:  #a8b2d1;
    --lightest-slate: #ccd6f6;
    --white:        #e6f1ff;

    --accent:       #64ffda;
    --accent-tint:  rgba(100,255,218,0.1);
    --accent-rgb:   100,255,218;

    --font-sans:    'Inter', -apple-system, system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

    --fs-xxs:       12px;
    --fs-xs:        13px;
    --fs-sm:        14px;
    --fs-md:        16px;
    --fs-lg:        18px;
    --fs-xl:        20px;
    --fs-xxl:       22px;
    --fs-heading:   32px;

    --border-radius: 4px;
    --nav-height:    70px;
    --transition:    all 0.25s cubic-bezier(0.645,0.045,0.355,1);
    --easing:        cubic-bezier(0.645,0.045,0.355,1);

    --max-width:     1000px;
    --tab-width:     120px;
    --side-width:    40px;
}

[data-theme="light"] {
    --bg:            #f8f9fc;
    --bg-light:      #ffffff;
    --bg-lighter:    #e8ecf4;
    --navy-shadow:   rgba(0,0,0,0.08);

    --slate:         #4a5568;
    --light-slate:   #64748b;
    --lightest-slate:#1a202c;
    --white:         #0f172a;

    --accent:        #0066ff;
    --accent-tint:   rgba(0,102,255,0.08);
    --accent-rgb:    0,102,255;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg);
}

body {
    font-family: var(--font-sans);
    font-size: var(--fs-md);
    line-height: 1.6;
    color: var(--slate);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

::selection {
    background: var(--accent-tint);
    color: var(--accent);
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }

.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }
.text-accent { color: var(--accent); }

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

/* Focus styles */
*:focus { outline: none; }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* --- Cursor Glow --- */
.cursor-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    will-change: top, left;
}

[data-theme="light"] .cursor-glow {
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.04) 0%, transparent 70%);
}

@media (max-width: 768px) {
    .cursor-glow { display: none; }
}

/* --- Header / Nav --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    transition: var(--transition);
}

[data-theme="light"] .header {
    background: rgba(248, 249, 252, 0.85);
}

.header.scrolled {
    box-shadow: 0 10px 30px -10px var(--navy-shadow);
    height: var(--nav-height);
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.08);
}

.header.hidden { transform: translateY(calc(var(--nav-height) * -1)); }

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 50px;
    height: 100%;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -1px;
}
.nav-logo:hover { color: var(--accent); }

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 8px;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--lightest-slate);
    padding: 10px 12px;
    position: relative;
    transition: var(--transition);
}

.nav-link:hover { color: var(--accent); }

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 12px;
    right: 12px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.25s var(--easing);
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-link.resume-nav {
    border: 1px solid var(--accent);
    border-radius: var(--border-radius);
    padding: 8px 16px;
    color: var(--accent);
    margin-left: 8px;
}

.nav-link.resume-nav:hover {
    background: var(--accent-tint);
}

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

.theme-toggle {
    background: none;
    border: 1px solid var(--slate);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--lightest-slate);
    font-size: var(--fs-sm);
    transition: var(--transition);
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-tint);
}

/* Hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 200;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--accent);
    margin: 5px 0;
    transition: var(--transition);
    border-radius: 2px;
}

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

/* --- Side Elements --- */
.side-email, .side-socials {
    position: fixed;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10;
}

.side-email::after, .side-socials::after {
    content: '';
    display: block;
    width: 1px;
    height: 90px;
    background: var(--light-slate);
}

.side-email {
    right: 40px;
}

.side-email a {
    font-size: var(--fs-xxs);
    letter-spacing: 1.5px;
    writing-mode: vertical-rl;
    color: var(--light-slate);
    transition: var(--transition);
}

.side-email a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.side-socials {
    left: 40px;
}

.side-socials a {
    font-size: var(--fs-xl);
    color: var(--light-slate);
    transition: var(--transition);
}

.side-socials a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

/* --- Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 clamp(25px, 10vw, 150px);
    position: relative;
    overflow: hidden;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Fade-up animation for hero elements */
.fade-up {
    opacity: 0;
    transform: translateY(25px);
    animation: fadeUp 0.6s var(--easing) forwards;
    animation-delay: calc(var(--delay) * 100ms + 600ms);
}

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

.hero-greeting {
    font-size: var(--fs-md);
    color: var(--accent);
    margin-bottom: 16px;
    font-weight: 400;
}

.hero-name {
    font-size: clamp(40px, 7vw, 72px);
    font-weight: 700;
    color: var(--lightest-slate);
    line-height: 1.1;
    margin-bottom: 8px;
    letter-spacing: -2px;
}

.hero-tagline {
    font-size: clamp(28px, 5vw, 52px);
    font-weight: 600;
    color: var(--slate);
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero-description {
    max-width: 520px;
    font-size: var(--fs-lg);
    color: var(--slate);
    line-height: 1.7;
    margin-bottom: 40px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--border-radius);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--accent-tint);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.15), 0 4px 12px rgba(var(--accent-rgb), 0.1);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 14px 28px;
    background: none;
    border: none;
    color: var(--lightest-slate);
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-ghost:hover { color: var(--accent); }

/* Terminal */
.hero-terminal {
    background: var(--bg-light);
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    border-radius: 8px;
    overflow: hidden;
    box-shadow:
        0 20px 60px -15px var(--navy-shadow),
        0 0 20px -5px rgba(var(--accent-rgb), 0.08);
    transition: box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-terminal:hover {
    box-shadow:
        0 20px 60px -15px var(--navy-shadow),
        0 0 30px -5px rgba(var(--accent-rgb), 0.15);
}

[data-theme="light"] .hero-terminal {
    box-shadow: 0 20px 60px -15px rgba(0,0,0,0.1);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-lighter);
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.1);
}

.terminal-dots { display: flex; gap: 8px; }

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--slate);
    opacity: 0.3;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.terminal-dot svg {
    width: 8px;
    height: 8px;
    color: rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.terminal-dots:hover .terminal-dot svg {
    opacity: 1;
}

.terminal-dot:hover {
    transform: scale(1.2);
}

.terminal-dot:nth-child(1) { background: #ff5f56; opacity: 0.8; }
.terminal-dot:nth-child(2) { background: #ffbd2e; opacity: 0.8; }
.terminal-dot:nth-child(3) { background: #27c93f; opacity: 0.8; }

/* Terminal minimize / maximize states */
.hero-terminal .terminal-body {
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease,
                min-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 600px;
    overflow: hidden;
}

.hero-terminal.minimized .terminal-body {
    max-height: 0;
    min-height: 0;
    padding: 0 20px;
    opacity: 0;
    overflow: hidden;
}

.hero-terminal.minimized .terminal-header {
    border-bottom-color: transparent;
}

.hero-terminal.maximized {
    transform: scale(1.04);
    box-shadow:
        0 25px 80px -15px var(--navy-shadow),
        0 0 40px -5px rgba(var(--accent-rgb), 0.2);
}

/* Fullscreen interactive terminal overlay */
.terminal-fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: overlayIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.terminal-fullscreen-overlay.closing {
    animation: overlayOut 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes overlayIn {
    from {
        background: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
    to {
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

@keyframes overlayOut {
    from {
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    to {
        background: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
}

.terminal-fullscreen {
    width: 100%;
    max-width: 900px;
    height: 70vh;
    max-height: 600px;
    background: var(--bg-light);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 30px 80px -15px rgba(0, 0, 0, 0.5),
        0 0 60px -10px rgba(var(--accent-rgb), 0.15);
    transform: scale(0.92) translateY(20px);
    opacity: 0;
    animation: termPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.05s;
}

.terminal-fullscreen.closing {
    animation: termPopOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

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

@keyframes termPopOut {
    from {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    to {
        transform: scale(0.92) translateY(20px);
        opacity: 0;
    }
}

/* PIP (picture-in-picture) mini terminal */
.terminal-pip {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    height: 260px;
    background: var(--bg-light);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 15px 40px -10px rgba(0, 0, 0, 0.4),
        0 0 30px -8px rgba(var(--accent-rgb), 0.12);
    z-index: 9998;
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    animation: pipSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    resize: none;
    transition: box-shadow 0.3s ease;
}

.terminal-pip:hover {
    box-shadow:
        0 20px 50px -10px rgba(0, 0, 0, 0.5),
        0 0 40px -8px rgba(var(--accent-rgb), 0.18);
}

.terminal-pip.closing {
    transform: translateY(20px) scale(0.85);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.25s ease;
    animation: none;
}

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

.terminal-pip .terminal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-lighter);
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.1);
    flex-shrink: 0;
    cursor: grab;
}

.terminal-pip .terminal-header:active {
    cursor: grabbing;
}

.terminal-pip .fs-term-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: var(--fs-xxs);
    line-height: 1.7;
    color: var(--light-slate);
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.terminal-pip .fs-input {
    font-size: var(--fs-xxs);
}

@media (max-width: 480px) {
    .terminal-pip {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 16px;
        height: 220px;
    }
}

.terminal-fullscreen .terminal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-lighter);
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.1);
    flex-shrink: 0;
}

.terminal-fullscreen .fs-term-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    line-height: 1.8;
    color: var(--light-slate);
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.terminal-fullscreen .fs-term-body::-webkit-scrollbar {
    width: 6px;
}

.terminal-fullscreen .fs-term-body::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-rgb), 0.3);
    border-radius: 3px;
}

.fs-output-line {
    margin-bottom: 2px;
    white-space: pre-wrap;
    word-break: break-all;
}

.fs-input-line {
    display: flex;
    gap: 8px;
    align-items: center;
}

.fs-input-line .prompt { color: var(--accent); font-weight: 600; }

.fs-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--lightest-slate);
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    caret-color: var(--accent);
}

/* Terminal crash / kernel panic */
.hero-terminal.crashed .terminal-body {
    animation: termGlitch 0.15s steps(2) 3;
}

.terminal-crash-screen {
    color: #ff5f56;
    font-size: var(--fs-xs);
    line-height: 1.6;
    animation: crashFade 0.4s ease forwards;
}

.terminal-crash-screen .crash-header {
    color: #ffffff;
    background: #ff5f56;
    display: inline-block;
    padding: 1px 6px;
    margin-bottom: 8px;
    font-weight: 600;
}

.terminal-reboot {
    color: var(--accent);
    margin-top: 12px;
    animation: blink 1s step-end infinite;
}

@keyframes termGlitch {
    0%   { transform: translate(2px, -1px) skewX(1deg); }
    25%  { transform: translate(-2px, 1px) skewX(-0.5deg); }
    50%  { transform: translate(1px, 2px) skewX(0.5deg); }
    75%  { transform: translate(-1px, -2px) skewX(-1deg); }
    100% { transform: translate(0, 0) skewX(0); }
}

@keyframes crashFade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.terminal-title {
    font-size: var(--fs-xxs);
    color: var(--slate);
    flex: 1;
    text-align: center;
}

.terminal-body {
    padding: 20px;
    font-size: var(--fs-sm);
    line-height: 1.8;
    min-height: 200px;
    color: var(--light-slate);
}

.terminal-line { display: flex; gap: 8px; margin-bottom: 8px; }

.prompt { color: var(--accent); font-weight: 600; }

.cmd { color: var(--lightest-slate); }

.cursor-blink {
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.terminal-output {
    color: var(--slate);
    font-size: var(--fs-xs);
    line-height: 1.7;
}

.terminal-output .out-key { color: var(--accent); }
.terminal-output .out-val { color: var(--lightest-slate); }
.terminal-output .out-bracket { color: var(--slate); opacity: 0.6; }
.terminal-output .out-line { margin-bottom: 2px; }

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeUp 0.6s var(--easing) forwards;
    animation-delay: 2s;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%,100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); }
}

/* --- Sections --- */
.section {
    padding: 100px 0;
    position: relative;
}

.section-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 clamp(25px, 10vw, 150px);
}

.section-heading {
    font-size: clamp(24px, 4vw, var(--fs-heading));
    font-weight: 700;
    color: var(--lightest-slate);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.section-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--bg-lighter), transparent);
    margin-left: 20px;
}

.heading-num {
    color: var(--accent);
    font-size: var(--fs-xl);
    font-weight: 400;
}

/* --- About --- */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 50px;
    align-items: start;
}

.about-text p {
    margin-bottom: 16px;
    color: var(--slate);
    font-size: var(--fs-md);
    line-height: 1.7;
}

.tech-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 10px;
    list-style: none;
    margin-top: 20px;
    font-size: var(--fs-xs);
}

.tech-list li {
    position: relative;
    padding-left: 20px;
    color: var(--lightest-slate);
}

.tech-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: var(--fs-sm);
}

/* About Photo */
.about-photo {
    display: flex;
    justify-content: center;
}

.photo-wrapper {
    position: relative;
    width: 250px;
    height: 250px;
}

.about-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
    filter: grayscale(30%) contrast(1.05);
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.photo-wrapper:hover .about-img {
    filter: none;
}

.photo-border {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: var(--border-radius);
    z-index: 1;
    transition: var(--transition);
}

.photo-wrapper:hover .photo-border {
    top: 10px;
    left: 10px;
}

/* --- Experience --- */
.exp-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.exp-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 24px;
    padding: 24px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
}

.exp-card:hover {
    background: var(--accent-tint);
    box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.1);
    background-image:
        radial-gradient(circle, rgba(var(--accent-rgb), 0.12) 1px, transparent 1px);
    background-size: 16px 16px;
}

.exp-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--bg-lighter);
    border-radius: 2px;
    transition: var(--transition);
}

.exp-card:hover::before {
    background: var(--accent);
}

.exp-date {
    font-size: var(--fs-xs);
    color: var(--slate);
    padding-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exp-role {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--lightest-slate);
    margin-bottom: 4px;
    line-height: 1.3;
}

.exp-at { color: var(--accent); font-weight: 500; }

.exp-context {
    font-size: var(--fs-xs);
    color: var(--slate);
    margin-bottom: 12px;
}

.exp-points {
    list-style: none;
    margin-bottom: 16px;
}

.exp-points li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: var(--fs-sm);
    color: var(--slate);
    line-height: 1.6;
}

.exp-points li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
}

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

.exp-tech span {
    font-family: var(--font-mono);
    font-size: var(--fs-xxs);
    color: var(--accent);
    background: var(--accent-tint);
    padding: 4px 10px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.exp-tech span::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(var(--accent-rgb), 0.15),
        transparent
    );
    transition: none;
}

.exp-tech span:hover::after {
    animation: shimmer 0.6s ease forwards;
}

@keyframes shimmer {
    to { left: 100%; }
}

/* --- Featured Projects --- */
.featured-projects {
    display: flex;
    flex-direction: column;
    gap: 80px;
    margin-bottom: 80px;
}

.featured-project {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: center;
    position: relative;
}

.featured-project.reverse { direction: rtl; }
.featured-project.reverse > * { direction: ltr; }
.featured-project.reverse .fp-content { text-align: right; }
.featured-project.reverse .fp-tech { justify-content: flex-end; }
.featured-project.reverse .fp-links { justify-content: flex-end; }

.fp-overline {
    font-size: var(--fs-xs);
    color: var(--accent);
    margin-bottom: 8px;
    font-weight: 400;
}

.fp-title {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    color: var(--lightest-slate);
    margin-bottom: 20px;
    transition: var(--transition);
}

.fp-title:hover { color: var(--accent); }

.fp-desc {
    background: var(--bg-light);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px -15px var(--navy-shadow);
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
    border: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.fp-desc:hover {
    border-color: rgba(var(--accent-rgb), 0.15);
}

[data-theme="light"] .fp-desc {
    box-shadow: 0 10px 30px -15px rgba(0,0,0,0.08);
    border: 1px solid var(--bg-lighter);
}

.fp-desc p {
    font-size: var(--fs-sm);
    color: var(--light-slate);
    line-height: 1.7;
}

.fp-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    list-style: none;
    margin-bottom: 12px;
}

.fp-tech li {
    font-size: var(--fs-xs);
    color: var(--light-slate);
}

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

.fp-links a {
    font-size: var(--fs-xl);
    color: var(--light-slate);
    transition: var(--transition);
}

.fp-links a:hover { color: var(--accent); }

.fp-image {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.fp-placeholder {
    background: linear-gradient(135deg, var(--bg-lighter), var(--bg-light));
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    font-size: 4rem;
    color: var(--accent);
    opacity: 0.3;
    border-radius: var(--border-radius);
    border: 1px solid rgba(var(--accent-rgb), 0.1);
    transition: var(--transition);
}

.fp-placeholder:hover {
    opacity: 0.6;
    background: linear-gradient(135deg, var(--bg-lighter), rgba(var(--accent-rgb), 0.05));
}

/* --- Other Projects Grid --- */
.other-heading {
    font-size: var(--fs-xxl);
    font-weight: 600;
    color: var(--lightest-slate);
    text-align: center;
    margin-bottom: 40px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.project-tile {
    background: var(--bg-light);
    padding: 28px;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
    cursor: default;
}

.project-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -15px var(--navy-shadow);
    background-image:
        radial-gradient(circle, rgba(var(--accent-rgb), 0.08) 1px, transparent 1px);
    background-size: 16px 16px;
}

[data-theme="light"] .project-tile:hover {
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.08);
}

.tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.tile-icon {
    font-size: 36px;
    color: var(--accent);
    transition: transform 0.3s var(--easing);
}

.project-tile:hover .tile-icon {
    transform: rotate(-8deg) scale(1.1);
}

.tile-links {
    display: flex;
    gap: 12px;
}

.tile-links a {
    font-size: var(--fs-xl);
    color: var(--light-slate);
    transition: var(--transition);
}

.tile-links a:hover { color: var(--accent); }

.tile-title {
    font-size: var(--fs-xxl);
    font-weight: 600;
    color: var(--lightest-slate);
    margin-bottom: 10px;
    transition: var(--transition);
}

.project-tile:hover .tile-title { color: var(--accent); }

.tile-desc {
    font-size: var(--fs-sm);
    color: var(--slate);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 20px;
}

.tile-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    font-size: var(--fs-xxs);
    color: var(--slate);
}

/* --- Contact --- */
.contact-container {
    text-align: center;
    max-width: 600px;
}

.contact-overline {
    font-size: var(--fs-md);
    color: var(--accent);
    margin-bottom: 8px;
}

.contact-heading {
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 700;
    color: var(--lightest-slate);
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.contact-text {
    font-size: var(--fs-lg);
    color: var(--slate);
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* Contact Form */
.contact-form {
    max-width: 500px;
    margin: 0 auto 32px;
    text-align: left;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-light);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    border-radius: var(--border-radius);
    color: var(--lightest-slate);
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    transition: var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--slate);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-lighter);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 16px;
    font-size: var(--fs-md);
}

/* Divider */
.contact-divider {
    position: relative;
    margin: 40px 0;
    text-align: center;
}

.contact-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--bg-lighter);
}

.contact-divider span {
    position: relative;
    background: var(--bg);
    padding: 0 16px;
    font-size: var(--fs-xs);
    color: var(--slate);
}

/* Direct Contact */
.contact-direct {
    text-align: center;
}

.contact-email {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: var(--fs-lg);
    color: var(--accent);
    margin-bottom: 16px;
    transition: var(--transition);
}

.contact-email:hover {
    transform: translateY(-2px);
}

.contact-info-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.contact-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
    color: var(--slate);
}

.contact-chip i { color: var(--accent); font-size: var(--fs-xs); }

/* --- Footer --- */
.footer {
    padding: 24px 0;
    text-align: center;
}

.footer-socials-mobile {
    display: none;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.footer-socials-mobile a {
    font-size: var(--fs-xl);
    color: var(--light-slate);
    transition: var(--transition);
}

.footer-socials-mobile a:hover { color: var(--accent); }

.footer-text {
    font-size: var(--fs-xxs);
    color: var(--slate);
    letter-spacing: 0.5px;
}

.footer-text:hover { color: var(--accent); }

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--easing), transform 0.6s var(--easing);
}

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

/* --- Responsive --- */
@media (max-width: 1080px) {
    .side-email, .side-socials { display: none; }
    .footer-socials-mobile { display: flex; }
    .nav { padding: 0 40px; }
    .section-container { padding: 0 40px; }
}

@media (max-width: 768px) {
    .hamburger { display: block; }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(75vw, 400px);
        height: 100vh;
        background: var(--bg-light);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 10px;
        padding: 60px 0;
        transition: right 0.3s var(--easing);
        box-shadow: -10px 0 30px -15px var(--navy-shadow);
        z-index: 150;
    }

    .nav-links.open { right: 0; }

    .nav-link {
        font-size: var(--fs-lg);
        padding: 16px;
    }

    .nav-link.resume-nav {
        font-size: var(--fs-sm);
        margin-left: 0;
        margin-top: 8px;
    }

    /* Mobile overlay */
    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(10, 25, 47, 0.7);
        z-index: 140;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .mobile-overlay.active {
        opacity: 1;
        pointer-events: all;
    }

    .hero { padding: 0 25px; }
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-name { font-size: clamp(36px, 10vw, 56px); }
    .hero-tagline { font-size: clamp(24px, 6vw, 40px); }

    .about-grid { grid-template-columns: 1fr; text-align: center; }
    .about-photo { order: -1; }
    .tech-list { justify-content: center; text-align: left; }

    .exp-card { grid-template-columns: 1fr; gap: 8px; }
    .exp-date { padding-top: 0; }

    .featured-project { grid-template-columns: 1fr; }
    .featured-project.reverse { direction: ltr; }
    .featured-project.reverse .fp-content { text-align: left; }
    .featured-project.reverse .fp-tech { justify-content: flex-start; }
    .featured-project.reverse .fp-links { justify-content: flex-start; }
    .fp-image { display: none; }
    .fp-desc { padding: 20px; }

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

    .section-container { padding: 0 25px; }
    .nav { padding: 0 25px; }

    .form-row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 480px) {
    .hero-name { font-size: 36px; }
    .hero-tagline { font-size: 22px; }
    .hero-cta { flex-direction: column; align-items: flex-start; }
    .photo-wrapper { width: 200px; height: 200px; }
    .contact-form { padding: 0; }
    .form-group input, .form-group textarea { font-size: var(--fs-xs); }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .fade-up { opacity: 1; transform: none; }
    .reveal { opacity: 1; transform: none; }
    .scroll-line { animation: none; opacity: 0.5; }
    .cursor-blink { animation: none; }
}


