/* ── TOKENS ──────────────────────────────────────────────── */
:root {
    /* Colours — light */
    --cream: #f2ede4;
    --cream-mid: #e8e1d6;
    --cream-border: #d8d0c4;
    --accent: #1a1678;
    --accent-light: #2820a0;
    --accent-muted: #4040b8;
    --secondary: #6b2c3e;
    --secondary-lt: #8b3a52;
    --highlight: #c9a050;
    --text: #2c2218;
    --text-mid: #5a4a3e;
    --text-muted: #8a7a6e;

    /* Colours — tags */
    --tag-bg: #ddd5c8;
    --tag-text: #3d2b1f;

    /* Typography */
    --font-display: "Cormorant Garamond", Georgia, serif;
    --font-body: "Lora", Georgia, serif;
    --font-mono: "DM Mono", "Courier New", monospace;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 7rem;

    /* Layout */
    --max-w: 1180px;
    --nav-h: 64px;
    --radius: 6px;
    --radius-lg: 12px;

    /* Motion */
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --dur: 0.25s;
    --dur-md: 0.4s;
}

@media (prefers-color-scheme: dark) {
    :root {
        --cream: #18160f;
        --cream-mid: #22201a;
        --cream-border: #3a3530;
        --accent: #c9a050;
        --accent-light: #d4b060;
        --accent-muted: #a88040;
        --secondary: #d4889a;
        --secondary-lt: #e8a0b0;
        --highlight: #d4aa60;
        --text: #ede8df;
        --text-mid: #c8bdb0;
        --text-muted: #8a8070;
        --tag-bg: #302a22;
        --tag-text: #c8bdb0;
    }
}

/* ── RESET & BASE ─────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-h);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--cream);
    overflow-x: hidden;
}

img,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

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

ul[role="list"] {
    list-style: none;
}

/* Focus styles — visible everywhere */
:focus-visible {
    outline: 3px solid var(--highlight);
    outline-offset: 3px;
    border-radius: var(--radius);
}

/* ── SKIP LINK ────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--accent);
    color: var(--cream);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.875rem;
    z-index: 9999;
    transition: top var(--dur) var(--ease);
}

.skip-link:focus {
    top: 1rem;
}

/* ── NAVIGATION ───────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background: color-mix(in srgb, var(--cream) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--cream-border);
}

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

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.05em;
    transition: opacity var(--dur) var(--ease);
}

.nav-logo:hover {
    opacity: 0.7;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    list-style: none;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--text-mid);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    transition:
        color var(--dur) var(--ease),
        background var(--dur) var(--ease);
}

.nav-link:hover {
    color: var(--text);
    background: var(--cream-mid);
}

.nav-link--cta {
    background: var(--accent);
    color: var(--cream) !important;
    padding: 0.4rem 1rem;
    font-size: 0.8125rem;
    letter-spacing: 0.03em;
}

.nav-link--cta:hover {
    background: var(--accent-light);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--text);
    transition:
        transform var(--dur) var(--ease),
        opacity var(--dur) var(--ease);
}

.nav-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
    min-height: calc(100vh - var(--nav-h));
    display: grid;
    grid-template-columns: 1fr 380px;
    align-items: center;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
    gap: var(--space-xl);
}

.hero-inner {
    width: 100%;
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.eyebrow-line {
    display: block;
    width: 40px;
    height: 1px;
    background: var(--highlight);
}

.hero-heading {
    font-family: var(--font-display);
    font-weight: 300;
    line-height: 1.08;
    margin-bottom: var(--space-md);
}

.hero-name {
    display: block;
    font-size: clamp(3.5rem, 7vw, 6rem);
    color: var(--accent);
    letter-spacing: -0.02em;
}

.hero-role {
    display: block;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-style: italic;
    color: var(--text-mid);
    font-weight: 300;
    margin-top: 0.25em;
}

.hero-description {
    font-size: 1.0625rem;
    color: var(--text-mid);
    line-height: 1.75;
    margin-bottom: var(--space-md);
    max-width: 46ch;
}

.hero-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--dur) var(--ease);
    cursor: pointer;
    text-decoration: none;
}

.btn--primary {
    background: var(--accent);
    color: var(--cream);
}

.btn--primary:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 25%, transparent);
}

.btn--ghost {
    border: 1.5px solid var(--cream-border);
    color: var(--text-mid);
}

.btn--ghost:hover {
    border-color: var(--accent-muted);
    color: var(--accent);
    transform: translateY(-1px);
}

.hero-live {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.hero-live-link {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--accent);
    border-bottom: 1px solid var(--accent-muted);
    transition: color var(--dur) var(--ease);
}

.hero-live-link:hover {
    color: var(--accent-light);
}

.hero-live-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
}


/* ── SECTION SHARED ───────────────────────────────────────── */
.section-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
}

.section-header {
    margin-bottom: var(--space-lg);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 300;
    color: var(--accent);
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.section-sub {
    margin-top: 0.5rem;
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ── PROJECTS ─────────────────────────────────────────────── */
.projects-section {
    border-top: 1px solid var(--cream-border);
}

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

.project-card {
    background: var(--cream-mid);
    border: 1px solid var(--cream-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition:
        transform var(--dur-md) var(--ease-out),
        box-shadow var(--dur-md) var(--ease-out);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 10%, transparent);
}

.project-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.project-img {
    overflow: hidden;
    height: 220px;
}

.proj-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.proj-placeholder--tutle {
    background: #7B4A2D;
}

.project-img--tutle-split {
    display: flex;
    gap: 0;
    background: #1a1618;
}

.tutle-split-img {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-right: 1px solid rgba(255,255,255,0.08);
}

.tutle-split-img:last-child {
    border-right: none;
}

/* Per-image centering tweaks */
.tutle-split-img--swipe {
    object-position: center center;
}

.proj-placeholder--mentor {
    background: #9C27B0;
}

.proj-placeholder--magpie {
    background: #2d4e2f;
}

.proj-placeholder--mss {
    background: #851829;
}

.proj-placeholder-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 300;
    font-style: italic;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.02em;
}

.project-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.project-name {
    font-family: var(--font-display);
    font-size: 1.625rem;
    font-weight: 600;
    color: var(--accent);
    line-height: 1.2;
}

.project-desc {
    font-size: 0.9375rem;
    color: var(--text-mid);
    line-height: 1.65;
    flex: 1;
}

.project-footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--cream-border);
}

.project-award {
    color: var(--text-mid);
}

/* ── ABOUT ────────────────────────────────────────────────── */
.about-section {
    background: var(--cream-mid);
    border-top: 1px solid var(--cream-border);
    border-bottom: 1px solid var(--cream-border);
}

.about-text .section-title {
    margin-bottom: var(--space-md);
}

.about-lead {
    font-size: 1.1875rem;
    color: var(--text);
    line-height: 1.75;
    margin-bottom: var(--space-sm);
}

.about-text p {
    font-size: 1rem;
    color: var(--text-mid);
    margin-bottom: var(--space-sm);
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-closing {
    font-style: italic;
    color: var(--accent-muted) !important;
}


.hero-aside {
    align-self: center;
    width: 100%;
}

.sidebar-block {
    background: var(--cream);
    border: 1px solid var(--cream-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.sidebar-block:last-child {
    margin-bottom: 0;
}

.sidebar-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.sidebar-list li {
    font-size: 0.875rem;
    color: var(--text-mid);
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--cream-border);
    line-height: 1.5;
}

.sidebar-list li:last-child {
    border-bottom: none;
}

.sidebar-list li span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.sidebar-divider {
    margin-top: 0.5rem;
    padding-top: 0.75rem !important;
    border-top: 1px solid var(--cream-border);
}

/* ── SKILLS ───────────────────────────────────────────────── */
.skills-section {
    border-top: 1px solid var(--cream-border);
}

.skills-section .section-title {
    margin-bottom: var(--space-lg);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.skill-group {
    border-top: 2px solid var(--accent);
    padding-top: 1rem;
}

.skill-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.skill-list li {
    font-size: 0.9375rem;
    color: var(--text-mid);
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--cream-border);
}

.skill-list li:last-child {
    border-bottom: none;
}

/* ── CONTACT ──────────────────────────────────────────────── */
.contact-section {
    background: var(--accent);
    border-top: 1px solid var(--cream-border);
}

.contact-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

.contact-section .section-title {
    color: var(--cream);
}

.contact-lead {
    margin-top: var(--space-sm);
    font-size: 1rem;
    color: color-mix(in srgb, var(--cream) 70%, transparent);
    line-height: 1.75;
}

.contact-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.5vw, 1.875rem);
    font-weight: 300;
    color: var(--cream);
    border-bottom: 1px solid color-mix(in srgb, var(--cream) 40%, transparent);
    padding-bottom: 0.25rem;
    transition:
        border-color var(--dur) var(--ease),
        opacity var(--dur) var(--ease);
    margin-bottom: var(--space-md);
    word-break: break-word;
}

.contact-cta:hover {
    border-color: var(--highlight);
    opacity: 0.9;
}

.contact-secondary {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.contact-link {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: color-mix(in srgb, var(--cream) 60%, transparent);
    letter-spacing: 0.05em;
    transition: color var(--dur) var(--ease);
}

.contact-link:hover {
    color: var(--cream);
}

/* ── FOOTER ───────────────────────────────────────────────── */
.site-footer {
    background: #1b3054;
    padding: var(--space-md);
}

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

.footer-copy {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-copy [lang="es"] {
    font-style: italic;
}

.footer-stack {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.35);
}

@media (prefers-color-scheme: dark) {
    .footer-copy {
        color: rgba(255, 255, 255, 0.65);
    }

    .footer-stack {
        color: rgba(255, 255, 255, 0.35);
    }
}

/* ── ANIMATIONS ───────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .hero-inner > * {
        animation: fadeUp 0.7s var(--ease-out) both;
    }

    .hero-eyebrow {
        animation-delay: 0s;
    }

    .hero-heading {
        animation-delay: 0.1s;
    }

    .hero-description {
        animation-delay: 0.2s;
    }

    .hero-actions {
        animation-delay: 0.3s;
    }

    .hero-live {
        animation-delay: 0.4s;
    }

    @keyframes fadeUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

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

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        padding: var(--space-lg) var(--space-md);
    }

    .hero-aside {
        display: none;
    }

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

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

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--cream);
        border-bottom: 1px solid var(--cream-border);
        padding: var(--space-sm) var(--space-md);
        gap: 0.25rem;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }

    .nav-menu.is-open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

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

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 400px) {
    .section-inner {
        padding: var(--space-lg) var(--space-sm);
    }

    .hero {
        padding: var(--space-lg) var(--space-sm);
    }
}
