/* =========================
   RESET
========================= */

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

/* =========================
   FONTS
========================= */

@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: swap;
    src: url("../fonts/archivo-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =========================
   VARIABLES
========================= */

:root {
    color-scheme: dark;

    /* Monochrome palette: the PRD roles, inverted onto a black ground. */
    --primary-color: #f4f4f5;
    --secondary-color: #a8a8b0;
    --background-color: #0a0a0b;
    --surface-color: #121215;
    --border-color: #2e2e35;
    --accent-color: #ffffff;

    /* Extra roles the black world needs. */
    --border-strong: #4a4a54;
    --plate-color: #17171b;

    --radius-sm: 8px;
    --radius: 16px;
    --max-width: 1100px;

    --font-sans: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
}

/* =========================
   GLOBAL
========================= */

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--primary-color);
    background: var(--background-color);
    caret-color: var(--accent-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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



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

ul {
    list-style: none;
}

p {
    text-wrap: pretty;
}

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

section {
    padding: 96px 0;
}

/* Every section starts on a hairline: the page reads as one ruled register. */
main > section:not(#hero) {
    border-top: 1px solid var(--border-color);
}

h1 {
    font-size: clamp(2.5rem, 5.6vw, 4.5rem);
    line-height: 1.03;
    letter-spacing: -0.03em;
    font-weight: 700;
    text-wrap: balance;
}

h2 {
    font-size: clamp(1.75rem, 2.6vw, 2.5rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
    font-weight: 700;
    margin-bottom: 32px;
    text-wrap: balance;
}

h3 {
    font-size: 1.125rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    font-weight: 600;
}

html {
    scroll-behavior: smooth;
    scrollbar-color: var(--border-strong) var(--background-color);
}

section[id] {
    scroll-margin-top: 80px;
}

/* =========================
   HEADER
========================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 24px;
}

.logo {
    font-weight: 700;
    letter-spacing: -0.015em;
    transition: color .2s ease;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.nav-links a {
    color: var(--secondary-color);
    font-size: .875rem;
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
    transition: color .2s ease, border-color .2s ease;
}

.nav-links a:hover {
    color: var(--accent-color);
    border-bottom-color: var(--border-strong);
}

/* =========================
   HERO
========================= */

.hero {
    display: flex;
    align-items: center;
    min-height: 60vh;
}

.hero-text {
    flex: 1 1 66%;
    padding-right: 56px;
}

.hero-subtitle {
    color: var(--primary-color);
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    margin-top: 20px;
}

.hero-description {
    color: var(--secondary-color);
    max-width: 65ch;
    margin-top: 16px;
}

.hero-image {
    flex: 0 1 34%;
    margin: 0;
    padding-left: 56px;
    border-left: 1px solid var(--border-color);
}

.hero-image img {
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: 30% center;
    border-radius: var(--radius);
}

.hero-image figcaption {
    margin-top: 16px;
    color: var(--secondary-color);
    font-size: .8125rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

#hero {
    padding: 72px 0 96px;
}

/* =========================
   BUTTONS
========================= */

.btn {
    display: inline-block;
    padding: 14px 26px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: .9375rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

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

/* Hover keeps the same ink-on-paper pair, one step dimmer. */
.btn-primary:hover {
    background: #dedee3;
    color: var(--background-color);
}

.btn-secondary {
    background: transparent;
    border-color: var(--border-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    border-color: var(--border-strong);
    background: var(--surface-color);
}

/* =========================
   ABOUT
========================= */

#about article p {
    color: var(--secondary-color);
    max-width: 68ch;
}

.about-facts {
    margin-top: 36px;
    border-top: 1px solid var(--border-color);
}

.about-facts li {
    display: grid;
    grid-template-columns: 160px minmax(0, 60ch);
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--secondary-color);
    font-size: .9375rem;
}

.about-facts strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* =========================
   EDUCATION
========================= */

.education-list {
    display: grid;
    gap: 32px;
}

/* Ruled register entry, shared with Experience. */
.edu-card,
.exp-card {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.edu-meta,
.exp-meta {
    color: var(--secondary-color);
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin: 8px 0 12px;
}

.edu-card p,
.exp-card p {
    color: var(--secondary-color);
    font-size: .9375rem;
    max-width: 68ch;
}

/* =========================
   SKILLS
========================= */

/* One bordered grid whose 1px gaps are the only dividers. */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.skill-card {
    background: var(--background-color);
    padding: 24px;
    transition: background-color .2s ease;
}

.skill-card:hover {
    background: var(--surface-color);
}

.skill-card h3 {
    margin-bottom: 14px;
}

.skill-card li {
    color: var(--secondary-color);
    font-size: .9375rem;
    margin-bottom: 4px;
}

/* =========================
   EXPERIENCE
========================= */

.experience-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 36px 40px;
}

/* =========================
   PROJECTS
========================= */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: background-color .2s ease, border-color .2s ease;
}

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

.project-card figure {
    margin: 0;
}

.project-card img {
    width: 100%;
}

.project-card h3 {
    margin: 20px 20px 8px;
}

.project-card p {
    margin: 0 20px;
    color: var(--secondary-color);
    font-size: .9375rem;
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 20px;
}

.tech-list li {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px 10px;
    color: var(--secondary-color);
    font-size: .75rem;
    letter-spacing: .02em;
}

.project-link {
    align-self: flex-start;
    margin: 0 20px 20px;
    margin-top: auto;
    color: var(--primary-color);
    font-size: .9375rem;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: color .2s ease, text-decoration-color .2s ease;
}

.project-link:hover {
    color: var(--accent-color);
    text-decoration-color: var(--accent-color);
}

/* =========================
   CONTACT
========================= */

#contact p {
    color: var(--secondary-color);
    max-width: 65ch;
}

#contact .btn {
    margin-top: 32px;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 32px;
}

.contact-links a {
    color: var(--secondary-color);
    font-weight: 600;
    transition: color .2s ease;
}

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

/* =========================
   STATES
========================= */

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

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

:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 2px;
}

/* The one authored moment: the hero settles in once, on load. */
@media (prefers-reduced-motion: no-preference) {
    .hero-text > *,
    .hero-image {
        animation: rise .7s cubic-bezier(.16, 1, .3, 1) both;
    }

    .hero-text > :nth-child(2) {
        animation-delay: .07s;
    }

    .hero-text > :nth-child(3) {
        animation-delay: .14s;
    }

    .hero-text > :nth-child(4) {
        animation-delay: .21s;
    }

    .hero-image {
        animation-delay: .12s;
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

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

/* =========================
   FOOTER
========================= */

.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
}

.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
}

.site-footer p {
    color: var(--secondary-color);
    font-size: .875rem;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1023px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    section {
        padding: 64px 0;
    }

    h1 {
        font-size: clamp(2.25rem, 9vw, 3rem);
    }

    h2 {
        margin-bottom: 24px;
    }

    .hero {
        flex-direction: column;
        align-items: stretch;
        gap: 40px;
        min-height: auto;
    }

    .hero-text,
    .hero-image {
        flex: 0 0 auto;
    }

    .hero-text {
        padding-right: 0;
    }

    

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

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

    .about-facts li {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .nav {
        padding: 14px 24px;
    }

    .nav-links {
        gap: 12px 20px;
    }
}
