*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0d0d0d;
    --bg2: #141414;
    --bg3: #1a1a1a;
    --surface: #1f1f1f;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --text: #f0ede8;
    --muted: #888;
    --muted2: #555;
    --accent: #c8f060;
    --accent2: #7b6ef6;
    --accent3: #f06060;
    --accent4: #60d4f0;
    --font-display: 'Syne', sans-serif;
    --font-serif: 'Instrument Serif', serif;
    --font-mono: 'DM Mono', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-display);
    overflow-x: hidden;
    cursor: none;
}

/* Custom cursor */
.cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s, width 0.2s, height 0.2s, background 0.2s;
    mix-blend-mode: difference;
}

.cursor-ring {
    position: fixed;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(200, 240, 96, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease-out, width 0.2s, height 0.2s;
}

body:has(a:hover) .cursor,
body:has(button:hover) .cursor {
    width: 18px;
    height: 18px;
}

body:has(a:hover) .cursor-ring,
body:has(button:hover) .cursor-ring {
    width: 56px;
    height: 56px;
    border-color: rgba(200, 240, 96, 0.25);
}

/* Nav */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.25rem 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s, background 0.3s;
}

nav.scrolled {
    background: rgba(13, 13, 13, 0.92);
    backdrop-filter: blur(12px);
    border-color: var(--border);
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-cta {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bg) !important;
    background: var(--accent);
    padding: 7px 16px;
    border-radius: 2px;
    text-decoration: none;
    transition: opacity 0.2s !important;
}

.nav-cta:hover {
    opacity: 0.85;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 3rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.6s 0.2s forwards;
}

.hero-name {
    font-size: clamp(72px, 10vw, 140px);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeUp 0.7s 0.35s forwards;
}

.hero-name em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
}

.hero-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    opacity: 0;
    animation: fadeUp 0.6s 0.55s forwards;
}

.hero-tagline {
    max-width: 420px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--muted);
    font-weight: 400;
}

.hero-tagline strong {
    color: var(--text);
    font-weight: 600;
}

.hero-links {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 2px;
    transition: all 0.2s;
}

.hero-link-primary {
    background: var(--accent);
    color: var(--bg);
}

.hero-link-primary:hover {
    opacity: 0.85;
}

.hero-link-ghost {
    border: 1px solid var(--border-hover);
    color: var(--muted);
}

.hero-link-ghost:hover {
    border-color: var(--text);
    color: var(--text);
}

.hero-scroll {
    position: absolute;
    right: 3rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    animation: fadeIn 0.8s 1s forwards;
}

.hero-scroll span {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted2);
    writing-mode: vertical-rl;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

/* Sections shared */
section {
    padding: 6rem 3rem;
    position: relative;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    max-width: 80px;
}

.section-title {
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.section-title em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    color: var(--muted);
}

/* Projects */
#projects {
    background: var(--bg);
}

.projects-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 3rem;
    margin-bottom: 4rem;
}

.projects-intro-right {
    max-width: 280px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
    padding-top: 8px;
    flex-shrink: 0;
}

.project-card {
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s;
    position: relative;
}

.project-card:hover {
    border-color: var(--border-hover);
}

.project-card-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 320px;
}

.project-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-visual-bg {
    position: absolute;
    inset: 0;
    transition: transform 0.6s ease;
}

.project-card:hover .project-visual-bg {
    transform: scale(1.04);
}

.patchwork-bg {
    background: #0a0a12;
    background-image:
        radial-gradient(circle at 30% 50%, rgba(123, 110, 246, 0.3) 0%, transparent 60%),
        radial-gradient(circle at 70% 30%, rgba(200, 240, 96, 0.15) 0%, transparent 50%);
}

.patchwork-art {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 2rem;
    width: 100%;
}

.patch {
    aspect-ratio: 1;
    border-radius: 3px;
    transition: transform 0.3s;
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
}

.patch-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

.video-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.video-modal.open {
    opacity: 1;
    pointer-events: all;
}

.video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.video-modal-content {
    position: relative;
    z-index: 1;
    width: min(90vw, 960px);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}

.video-modal-player {
    width: 100%;
    display: block;
}

.video-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    font-size: 1rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.project-card:hover .patch {
    transform: scale(0.92) rotate(var(--r));
}

.forecafe-bg {
    background: #080f12;
    background-image: url("media/forecafe-logo.png");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.forecafe-art {
    position: relative;
    z-index: 1;
    padding: 2rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.rag-bg {
    background: #0d0809;
    background-image: url("media/rag-sc.png");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.rag-art {
    position: relative;
    z-index: 1;
    padding: 2rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rag-nodes {
    position: relative;
    width: 180px;
    height: 180px;
}

.rag-node {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0.05em;
    color: var(--muted);
    transition: transform 0.3s;
}

.project-card:hover .rag-node {
    animation: nodePulse 2s ease-in-out infinite;
}

.rag-line {
    position: absolute;
    background: rgba(240, 96, 96, 0.2);
    transform-origin: left center;
    height: 1px;
}

.project-info {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 1px solid var(--border);
}

.project-num {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--muted2);
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.project-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 2px;
    margin-bottom: 1rem;
}

.badge-gold {
    background: rgba(250, 199, 117, 0.12);
    color: #FAC775;
    border: 1px solid rgba(250, 199, 117, 0.2);
}

.badge-blue {
    background: rgba(96, 212, 240, 0.1);
    color: var(--accent4);
    border: 1px solid rgba(96, 212, 240, 0.2);
}

.badge-red {
    background: rgba(240, 96, 96, 0.1);
    color: var(--accent3);
    border: 1px solid rgba(240, 96, 96, 0.2);
}

.project-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.project-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1.5rem;
}

.tag {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    padding: 4px 9px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--muted);
    transition: border-color 0.2s, color 0.2s;
}

.project-card:hover .tag {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text);
}

.project-links {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 2px;
    transition: all 0.2s;
}

.project-link-primary {
    background: var(--accent);
    color: var(--bg);
}

.project-link-primary:hover {
    opacity: 0.85;
}

.project-link-ghost {
    border: 1px solid var(--border-hover);
    color: var(--muted);
}

.project-link-ghost:hover {
    border-color: var(--text);
    color: var(--text);
}

.project-link .arrow {
    transition: transform 0.2s;
}

.project-link:hover .arrow {
    transform: translate(3px, -3px);
}

/* Skills */
#skills {
    background: var(--bg2);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 3rem;
}

.skill-group {
    background: var(--bg2);
    padding: 2rem;
    transition: background 0.2s;
}

.skill-group:hover {
    background: var(--surface);
}

.skill-group-label {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted2);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.skill-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.skill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Experience */
#experience {
    background: var(--bg);
}

.exp-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0;
    margin-top: 3rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.exp-nav {
    border-right: 1px solid var(--border);
    background: var(--bg2);
}

.exp-nav-item {
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.exp-nav-item:last-child {
    border-bottom: none;
}

.exp-nav-item:hover {
    background: var(--surface);
}

.exp-nav-item.active {
    background: var(--surface);
    border-left: 2px solid var(--accent);
    padding-left: calc(1.5rem - 2px);
}

.exp-nav-year {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--muted2);
    letter-spacing: 0.12em;
    margin-bottom: 4px;
}

.exp-nav-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.exp-nav-co {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.exp-content {
    padding: 2.5rem;
    background: var(--bg);
}

.exp-panel {
    display: none;
}

.exp-panel.active {
    display: block;
}

.exp-role {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.exp-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.08em;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 16px;
    align-items: center;
}

.exp-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.exp-bullets {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.exp-bullets li {
    font-size: 14px;
    line-height: 1.65;
    color: var(--muted);
    padding-left: 16px;
    position: relative;
}

.exp-bullets li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 12px;
}

.exp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Education */
.edu-bar {
    margin-top: 2rem;
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg2);
}

.edu-left .edu-degree {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.edu-left .edu-school {
    font-size: 14px;
    color: var(--muted);
}

.edu-right {
    text-align: right;
}

.edu-right .edu-year {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 6px;
}

.edu-badges {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.edu-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 2px;
    border: 1px solid var(--border);
    color: var(--muted);
}

/* Contact */
#contact {
    background: var(--bg2);
    text-align: center;
    padding: 8rem 3rem;
}

.contact-eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.contact-heading {
    font-size: clamp(40px, 6vw, 80px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 2rem;
}

.contact-heading em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 2px;
    border: 1px solid var(--border-hover);
    color: var(--muted);
    transition: all 0.2s;
}

.contact-link:hover {
    color: var(--text);
    border-color: var(--text);
}

.contact-link.primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.contact-link.primary:hover {
    opacity: 0.85;
}

/* Footer */
footer {
    padding: 2rem 3rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg);
}

footer p {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted2);
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scrollPulse {

    0%,
    100% {
        opacity: 0.4;
        transform: scaleY(1);
    }

    50% {
        opacity: 1;
        transform: scaleY(1.1);
    }
}

@keyframes nodePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 768px) {

    /* Hide custom cursor on touch devices */
    .cursor, .cursor-ring { display: none; }
    body { cursor: auto; }

    /* Nav */
    nav {
        padding: 1rem 1.25rem;
    }

    .nav-links {
        gap: 1.25rem;
    }

    .nav-links a:not(.nav-cta) {
        display: none;
    }

    /* Hero */
    .hero {
        padding: 0 1.25rem 3rem;
    }

    .hero-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .hero-tagline {
        max-width: 100%;
    }

    .hero-scroll {
        display: none;
    }

    /* Sections */
    section {
        padding: 4rem 1.25rem;
    }

    /* Projects */
    .projects-intro {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2.5rem;
    }

    .projects-intro-right {
        max-width: 100%;
    }

    .project-card-inner {
        grid-template-columns: 1fr;
    }

    .project-visual {
        min-height: 260px;
    }

    .project-info {
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 1.75rem;
    }

    /* Skills */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Experience — horizontal scrolling tabs */
    .exp-grid {
        grid-template-columns: 1fr;
    }

    .exp-nav {
        border-right: none;
        border-bottom: 1px solid var(--border);
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .exp-nav::-webkit-scrollbar { display: none; }

    .exp-nav-item {
        border-bottom: none;
        border-right: 1px solid var(--border);
        white-space: nowrap;
        flex-shrink: 0;
        min-width: 130px;
    }

    .exp-nav-item:last-child {
        border-right: none;
    }

    .exp-nav-item.active {
        border-left: none;
        padding-left: 1.5rem;
        border-bottom: 2px solid var(--accent);
    }

    .exp-content {
        padding: 1.75rem;
    }

    /* Education */
    .edu-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .edu-right {
        text-align: left;
    }

    .edu-badges {
        justify-content: flex-start;
    }

    /* Contact */
    #contact {
        padding: 5rem 1.25rem;
    }

    /* Footer */
    footer {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1.5rem 1.25rem;
        text-align: center;
    }
}

@media (max-width: 480px) {

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .hero-links {
        flex-direction: column;
        width: 100%;
    }

    .hero-link {
        justify-content: center;
        text-align: center;
    }

    .project-links {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-link {
        width: 100%;
        justify-content: center;
    }
}