:root {
    --black: #0a0a0a;
    --white: #ffffff;
    --off-white: #f6f6f4;
    --red: #e11d2e;
    --muted: #6f6f6f;
    --line: #e4e4e2;
    --line-dark: #2a2a2a;
    --font: 'Lexend', sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--white);
    color: var(--black);
    font-family: var(--font);
    font-weight: 400;
    line-height: 1.7;
}

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

a {
    color: var(--red);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 3px;
}

h1, h2, h3 {
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

/* ---------- header ---------- */

.site-header {
    position: sticky;
    top: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
}

.brand {
    font-weight: 800;
    font-size: 1.1rem;
}

.brand::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--red);
    border-radius: 50%;
    margin-left: 6px;
}

.site-nav {
    display: flex;
    gap: 1.75rem;
}

.site-nav a {
    color: var(--black);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    position: relative;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: var(--red);
    transition: width 0.2s ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
    width: 100%;
}

/* ---------- hamburger menu (CSS-only) ---------- */

/* Hide the real checkbox — the label acts as the visible button */
.menu-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 4px;
    cursor: pointer;
}

.menu-toggle .bar {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: var(--black);
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.mobile-nav {
    display: none;
    flex-direction: column;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-nav a {
    color: var(--black);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.9rem 1.5rem;
    border-top: 1px solid var(--line);
}

.mobile-nav a:first-child {
    border-top: none;
}

.mobile-nav a:hover,
.mobile-nav a:focus-visible {
    background: var(--off-white);
    color: var(--red);
}

/* When the hidden checkbox is checked: open the menu
   and turn the hamburger bars into an X */
.menu-checkbox:checked ~ .mobile-nav {
    max-height: 320px;
}

.menu-checkbox:checked ~ .header-inner .menu-toggle .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-checkbox:checked ~ .header-inner .menu-toggle .bar:nth-child(2) {
    opacity: 0;
}

.menu-checkbox:checked ~ .header-inner .menu-toggle .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- hero ---------- */

.hero {
    padding: 5.5rem 0 4rem;
    border-bottom: 1px solid var(--line);
}

.hero-label {
    font-weight: 600;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    margin: 0 0 1rem;
}

.hero h1 {
    font-size: clamp(2.6rem, 9vw, 6rem);
    line-height: 0.95;
}

.hero .dot {
    color: var(--red);
}

.hero-sub {
    max-width: 32ch;
    color: var(--muted);
    font-size: 1.15rem;
    margin: 1.5rem 0 0;
}

/* ---------- sections ---------- */

.section {
    padding: 4.5rem 0;
    border-bottom: 1px solid var(--line);
}

.section-alt {
    background: var(--off-white);
}

.section-heading {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.section-heading .index {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--red);
}

.section-heading h2 {
    font-size: 1.9rem;
}

.contact-sub {
    color: var(--muted);
    margin-top: 0.5rem;
    font-size: 0.98rem;
}

/* ---------- about ---------- */

.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}

.profile-photo {
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid var(--black);
}

.about-content p {
    flex: 1;
    min-width: 240px;
    font-size: 1.05rem;
}

.fact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    border-top: 1px solid var(--line);
    margin-top: 1rem;
    padding-top: 1rem;
}

.fact-list li {
    display: flex;
    gap: 0.75rem;
    font-size: 0.95rem;
    padding: 0.5rem 0;
}

.fact-list span {
    font-weight: 600;
    min-width: 90px;
    color: var(--red);
}

/* ---------- skills table ---------- */

.skills-table {
    width: 100%;
    border-collapse: collapse;
}

.skills-table th,
.skills-table td {
    text-align: left;
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--line);
}

.skills-table th {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.78rem;
    color: var(--muted);
}

.skills-table td:first-child {
    font-weight: 600;
    white-space: nowrap;
}

.skills-table tbody tr:hover {
    background: var(--white);
}

/* ---------- projects ---------- */

.project-grid {
    display: grid;
    grid-template-columns: 1fr;
}

.featured-project {
    max-width: 640px;
    padding: 2.5rem 2.25rem 2.25rem;
}

.featured-project p {
    font-size: 1rem;
}

.project-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 2rem 1.75rem 1.75rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.project-card:hover {
    border-color: var(--black);
    transform: translateY(-4px);
}

.project-num {
    position: absolute;
    top: -0.9rem;
    left: 1.5rem;
    background: var(--red);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 3px;
}

.project-card h3 {
    font-size: 1.15rem;
    margin: 0.5rem 0 0.75rem;
}

.project-card p {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0 0 1.25rem;
}

.repo-link {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.repo-link:hover {
    text-decoration: underline;
}

/* ---------- contact ---------- */

.section-dark {
    background: var(--black);
    color: var(--white);
    border-bottom: none;
}

.section-dark .section-heading .index {
    color: var(--red);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 3rem;
    align-items: start;
}

.section-dark form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--muted);
}

.field input,
.field textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line-dark);
    padding: 0.6rem 0.1rem;
    color: var(--white);
    font-family: var(--font);
    font-size: 1rem;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #555;
}

.field input:focus,
.field textarea:focus {
    border-bottom-color: var(--red);
}

.field textarea {
    resize: vertical;
}

button[type="submit"] {
    align-self: flex-start;
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: 4px;
    padding: 0.85rem 1.75rem;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

button[type="submit"]:hover {
    background: #ff2f42;
}

/* ---------- footer ---------- */

.site-footer {
    padding: 1.75rem 0;
    background: var(--black);
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
    .project-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .site-nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .mobile-nav {
        display: flex;
    }

    .hero {
        padding: 3.5rem 0 3rem;
    }

    .section {
        padding: 3.5rem 0;
    }
}

@media (max-width: 560px) {
    .about-content {
        flex-direction: column;
    }

    .about-content p {
        min-width: 0;
    }

    .fact-list li {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}