/* =========================================================
   1. RESET + DESIGN TOKENS
   - Basic reset
   - Global colors, fonts, spacing variables
   ========================================================= */

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

:root {
    --bg: #f7f6f2;
    --surface: #ffffff;
    --ink: #1c1717;
    --ink-2: #4a4a46;
    --ink-3: #9a9a94;
    --rule: #e3e2dc;

    --accent: #6f5257;
    --accent-muted: #f2e4dc;
    --accent-text: #8a3e22;

    --green: #1c7a50;
    --green-bg: #e8f5ee;

    --amber: #92600a;
    --amber-bg: #fdf3e0;

    --blue: #1a4a8a;
    --blue-bg: #e8f0fc;

    --serif: "DM Serif Display", Georgia, serif;
    --sans: "DM Sans", system-ui, sans-serif;
    --mono: "DM Mono", "Courier New", monospace;

    --max: 1100px;
    --gap: clamp(1rem, 4vw, 2rem);
    --section-py: clamp(3.5rem, 7vw, 6rem);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* =========================================================
   2. GLOBAL LAYOUT HELPERS
   - Shared container
   - Shared section spacing
   ========================================================= */

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gap);
}

section {
    padding: var(--section-py) 0;
}

/* =========================================================
   3. CUSTOM CURSOR
   - Small custom cursor for desktop
   - Keep subtle so it feels refined, not gimmicky
   ========================================================= */

.cursor {
    width: 12px;
    height: 12px;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease;
    transform: translate(-50%, -50%);
    mix-blend-mode: multiply;
}

/* =========================================================
   4. NAVIGATION
   - Sticky top nav
   - Name/logo
   - Nav links and CTA button
   ========================================================= */

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

nav.scrolled {
    border-color: var(--rule);
}

.nav-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gap);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.nav-logo-suffix {
    opacity: 0.35;
}

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

.nav-links a {
    font-size: 13px;
    color: var(--ink-2);
    transition: color 0.15s;
    font-weight: 400;
}

.nav-links a:hover {
    color: var(--ink);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--accent);
    color: #fff !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.15s;
}

.nav-cta:hover {
    opacity: 0.85;
}

.mobile-menu-btn,
.mobile-nav-links {
    display: none;
}

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

    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 36px;
        height: 36px;
        background: transparent;
        border: 1px solid var(--rule);
        border-radius: 8px;
        cursor: pointer;
        z-index: 200;
    }

    .mobile-menu-btn span {
        width: 16px;
        height: 1px;
        background: var(--ink);
        display: block;
        margin: 0 auto;
    }

    .mobile-nav-links {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;

        display: none;
        flex-direction: column;
        align-items: center;

        gap: 0.4rem;
        padding: 1.5rem 0;

        background: var(--bg);
        border-bottom: 1px solid var(--rule);

        list-style: none;
        z-index: 150;
    }

    .mobile-nav-links.active {
        display: flex;
    }


    .mobile-nav-links a {
        color: var(--ink);
        font-size: 1rem;
        font-family: var(--sans);
    }

    .mobile-lang-switch {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        margin-top: 0.15rem;
        font-family: var(--mono);
        font-size: 12px;
        color: var(--ink-3);
    }

    .mobile-lang-switch a {
        font-family: var(--mono);
        font-size: 12px;
        color: var(--ink-3);
    }

    .mobile-lang-switch a.active {
        color: var(--ink);
    }
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-3);
}

.lang-switch a {
    color: var(--ink-3);
    transition: color 0.15s;
}

.lang-switch a:hover,
.lang-switch a.active {
    color: var(--ink);
}

/* =========================================================
   5. HERO SECTION
   - Intro section at the top
   - Status pill, headline, paragraph, action buttons
   - Decorative grid background
   ========================================================= */

#hero {
    padding-top: calc(56px + clamp(2.5rem, 5vw, 4rem));
    padding-bottom: clamp(2.5rem, 5vw, 4rem);
    position: relative;
    overflow: hidden;
}

.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--rule) 1px, transparent 1px),
        linear-gradient(90deg, var(--rule) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 80%);
    opacity: 0.6;
}

.hero-inner {
    position: relative;
    z-index: 2;
}

.hero-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 100px;
    margin-bottom: 1.25rem;
    opacity: 0;
    animation: fadeUp 0.6s 0.1s forwards;
}

.hero-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2.5s infinite;
}

.hero-status span {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-2);
}

.hero-headline {
    max-width: 700px;
    margin-bottom: 1.1rem;
    opacity: 0;
    animation: fadeUp 0.6s 0.2s forwards;
    font-family: var(--serif);
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.hero-headline em {
    font-style: italic;
    color: var(--accent);
}

.hero-sub {
    max-width: 520px;
    font-size: 1rem;
    color: var(--ink-2);
    line-height: 1.7;
    margin-bottom: 2rem;
    font-weight: 300;
    opacity: 0;
    animation: fadeUp 0.6s 0.3s forwards;
}

.hero-meta {
    margin-top: 1.25rem;
    font-size: 12px;
    letter-spacing: 0.02em;
    color: var(--ink-3);
    opacity: 0;
    animation: fadeUp 0.6s 0.5s forwards;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeUp 0.6s 0.4s forwards;
}

/* =========================================================
   6. BUTTONS
   - Primary and secondary hero buttons
   ========================================================= */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.15s, transform 0.15s;
    letter-spacing: -0.01em;
}

.btn-primary:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: transparent;
    color: var(--ink-2);
    border: 1px solid var(--rule);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    transition: border-color 0.15s, color 0.15s, transform 0.15s;
}

.btn-secondary:hover {
    border-color: var(--ink-3);
    color: var(--ink);
    transform: translateY(-1px);
}

/* =========================================================
   7. MARQUEE STRIP
   - Horizontal moving strip of skills / tools
   - Decorative support section after hero
   ========================================================= */

.marquee-section {
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 1rem 0;
    overflow: hidden;
    background: var(--surface);
}

.marquee-track {
    display: flex;
    gap: 3rem;
    animation: marquee 60s linear infinite;
    width: max-content;
}

.marquee-item {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-3);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3rem;
}

.marquee-item::after {
    content: "·";
    color: var(--rule);
}

/* =========================================================
   8. SHARED SECTION HEADERS
   - Reused in projects and potentially other sections
   ========================================================= */

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.section-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.section-title {
    font-family: var(--serif);
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* =========================================================
   9. PROJECTS SECTION
   - Project grid layout
   - Cards, screenshots, tags, links, badges
   ========================================================= */

#projects {
    background: var(--surface);
}

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

.project-card {
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    transform-origin: center;
}

.project-card:hover {
    transform: translateY(-2px) scale(1.015);
    box-shadow: 0 8px 32px rgba(184, 92, 56, 0.1);
}

.project-card.featured {
    grid-column: 1 / -1;
    flex-direction: row;
}

.card-preview {
    background: var(--bg);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
    border-right: 1px solid var(--rule);
}

.project-card.featured .card-preview {
    width: 50%;
    height: auto;
}

.project-card:not(.featured) .card-preview {
    width: 100%;
    height: auto;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.35s ease;
    display: block;
}

.project-card:hover .project-image {
    transform: scale(1.02);
}

.card-body {
    padding: 1.25rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

.project-card.featured .card-body {
    padding: 2rem;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.card-tags-large {
    margin-bottom: 12px;
}

.card-tags-small {
    margin-bottom: 10px;
}

.tag {
    font-family: var(--mono);
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 4px;
    border: 1px solid var(--rule);
    color: var(--ink-3);
    background: var(--surface);
}

.card-title {
    font-family: var(--serif);
    font-size: 1.3rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 6px;
}

.project-card.featured .card-title {
    font-size: 1.75rem;
}

.card-desc {
    font-size: 13.5px;
    color: var(--ink-2);
    line-height: 1.6;
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
}

.card-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.card-link {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-3);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.15s, gap 0.2s;
}

.card-link:hover {
    color: var(--accent);
    gap: 9px;
}

.card-badge {
    font-family: var(--mono);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
}

.badge-green {
    background: var(--green-bg);
    color: var(--green);
}

.badge-amber {
    background: var(--amber-bg);
    color: var(--amber);
}

.badge-blue {
    background: var(--blue-bg);
    color: var(--blue);
}
/* =========================================================
   CLICKABLE PROJECT CARDS
   - Invisible overlay link makes the full card clickable
   - Individual links stay clickable above the overlay
   ========================================================= */
   
.card-overlay-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}


.card-overlay-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.card-links {
    position: relative;
    z-index: 2;
}

.project-card {
    cursor: pointer;
}

.project-card.reveal.visible:hover {
    transform: translateY(-2px) scale(1.015);
}

/* =========================================================
   10. SKILLS SECTION
   - Two-column layout
   - Intro on left, grouped skills on right
   ========================================================= */

#skills {
    background: var(--bg);
}

.skills-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: start;
}

.skills-intro {
    position: sticky;
    top: 80px;
}

.skills-title {
    margin-top: 0.5rem;
}

.skills-intro p {
    font-size: 15px;
    color: var(--ink-2);
    line-height: 1.7;
    margin-top: 1rem;
    font-weight: 300;
}

.skills-groups {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.skill-group-label {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-3);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--rule);
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 400;
    color: var(--ink);
}

.skill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-accent {
    background: var(--accent);
}

.dot-green {
    background: var(--green);
}

.dot-amber {
    background: #d97706;
}

.dot-blue {
    background: #2563eb;
}

/* =========================================================
   11. ABOUT SECTION
   - Dark section
   - Text, profile image, quick facts
   ========================================================= */

#about {
    background: var(--ink);
    color: var(--bg);
    position: relative;
    overflow: hidden;
}

.about-noise {
    position: absolute;
    inset: 0;
    opacity: 0.12;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

.about-layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

#about .section-label {
    color: rgba(247, 246, 242, 0.3);
}

#about .section-title {
    color: var(--bg);
    margin-top: 0.5rem;
}

.about-text {
    margin-top: 1.25rem;
    font-size: 0.86rem;
    color: rgba(247, 246, 242, 0.7);
    line-height: 1.6;
    font-weight: 300;
}

.pfp-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
}

.pfp {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 1px solid rgba(247, 246, 242, 0.12);
    background: rgba(247, 246, 242, 0.05);
    overflow: hidden;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resume-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.9rem 1.1rem;
    border: 1px solid rgba(247, 246, 242, 0.12);
    border-radius: 8px;
    background: rgba(247, 246, 242, 0.04);
    color: rgba(247, 246, 242, 0.75);
    font-size: 13px;
    transition: background 0.2s, border-color 0.2s;
}

.resume-btn:hover {
    background: rgba(247, 246, 242, 0.08);
    border-color: rgba(247, 246, 242, 0.2);
}

.resume-btn span {
    font-family: var(--mono);
    font-size: 10px;
    color: rgba(247, 246, 242, 0.3);
}

.about-facts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.about-fact {
    padding: 1rem 1.1rem;
    border: 1px solid rgba(247, 246, 242, 0.08);
    border-radius: 8px;
    background: rgba(247, 246, 242, 0.03);
    transition: background 0.2s, border-color 0.2s;
}

.about-fact:hover {
    background: rgba(247, 246, 242, 0.07);
    border-color: rgba(247, 246, 242, 0.15);
}

.about-fact-label {
    font-family: var(--mono);
    font-size: 10px;
    color: rgba(247, 246, 242, 0.28);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.about-fact-val {
    font-size: 13.5px;
    color: rgba(247, 246, 242, 0.78);
    line-height: 1.5;
}

/* =========================================================
   12. CONTACT SECTION
   - Final CTA area
   - Email + external links
   ========================================================= */

#contact {
    background: var(--bg);
}

.contact-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 6rem;
    align-items: flex-end;
}

.contact-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-tagline {
    font-family: var(--serif);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.contact-tagline em {
    font-style: italic;
    color: var(--accent);
}

.contact-sub {
    font-size: 15px;
    color: var(--ink-2);
    line-height: 1.7;
    font-weight: 300;
    max-width: 420px;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--ink);
    padding: 10px 0;
    border-bottom: 1px solid var(--rule);
    transition: border-color 0.2s, gap 0.2s;
    width: fit-content;
}

.contact-email:hover {
    border-color: var(--accent);
    gap: 14px;
}

.contact-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 10px;
    font-size: 14px;
    color: var(--ink);
    font-weight: 500;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s;
}

.contact-link:hover {
    border-color: var(--accent);
    transform: translateX(3px);
    box-shadow: 0 4px 16px rgba(184, 92, 56, 0.08);
}

.contact-link span {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-3);
}

/* =========================================================
   13. FOOTER
   - Small closing section
   ========================================================= */

footer {
    border-top: 1px solid var(--rule);
    padding: 1.5rem 0;
    background: var(--bg);
}

.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gap);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copy {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-3);
}

.footer-available {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-3);
}

.avail-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* =========================================================
   14. REVEAL ANIMATIONS
   - Used for fade/scroll reveal effects
   ========================================================= */

.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

/* =========================================================
   15. KEYFRAMES
   - Reused animations for hero and marquee
   ========================================================= */

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

@keyframes pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 35%, transparent);
    }
    60% {
        box-shadow: 0 0 0 5px transparent;
    }
}

@keyframes marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* =========================================================
   16. RESPONSIVE STYLES
   - Tablet and mobile layout adjustments
   ========================================================= */

@media (max-width: 768px) {

    .nav-inner {
        height: 64px;
    }
    .hero-headline {
        margin-bottom: 6rem;
        margin-top: 2rem;
    }

    .cursor {
        display: none;
    }

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

    .project-card.featured {
        flex-direction: column;
        min-height: auto;
    }

    .project-card.featured .card-preview {
        width: 100%;
        height: 240px;
    }

    .project-card:not(.featured) .card-preview {
        height: 220px;
    }

    .skills-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .skills-intro {
        position: static;
    }

    .about-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-inner {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}