/* LOCAL FONTS */

@font-face {
    font-family: "Roboto";
    src: url("./fonts/Roboto-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Roboto";
    src: url("./fonts/Roboto-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Roboto Mono";
    src: url("./fonts/RobotoMono-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ROOT ELEMENTS & VARIABLES */

:root {
    --font-family: "Roboto", sans-serif;
    --font-family-mono: "Roboto Mono", serif;
    --glass-blur: blur(20px) saturate(180%);
    --radius-pill: 999px;
    --text-muted: rgba(242, 242, 244, 0.7);
}

/* CSS RESET */

html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

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

input,
button,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

button {
    cursor: pointer;
    /* buttons keep native widget chrome and system text color by default, unlike <a> — this neutralizes both so classes like .cta-btn render identically on either element */
    appearance: none;
    background: none;
    border: none;
    color: inherit;
}

img {
    display: block;
    max-inline-size: 100%;
}

/* GENERAL SETTINGS */

body {
    font-family: var(--font-family);
    /* lives on body, not main, so it fills the page from y=0 and shows through the navbar's glass immediately, not just once you scroll past the header */
    /* flat color, not a gradient — keeps things minimal, though it means the navbar's blur has nothing textured to distort; the effect will read more once real content sits behind it */
    background-color: #121214;
    color: #f2f2f4;
    min-height: 100vh;
}

li {
    list-style: none;
}

a {
    text-decoration: none;
    color: #f2f2f4;
}

/* ACCESSIBILITY */

.skip-link {
    /* parked just off the top of the viewport instead of the usual clip-path hack — simpler, and this page has nothing else living up there */
    position: absolute;
    top: -3rem;
    left: 1rem;
    z-index: 100;
    background-color: #000000;
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    transition: top 0.2s ease;
}

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

.visually-hidden {
    /* clips content to a 1px box instead of display:none, so screen readers still announce it while sighted users never see it */
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* NAVIGATION BAR */

.main-header {
    position: sticky;
    /* top offset (not 0) keeps a gap above the bar once it sticks, so it still reads as "floating" while scrolling */
    top: 1rem;
    z-index: 10;
    margin: 1rem 1.5rem 0;
    border-radius: var(--radius-pill);
    background-color: rgba(28, 28, 30, 0.6);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur); /* Safari requires the prefix to render the blur */
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    padding-inline: 1.8rem;
    padding-block: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header h1 {
    font-size: 1.7rem;
}

.main-nav ul {
    display: flex;
    gap: 3rem;
}

.main-nav a {
    /* padding/radius set on the base state, not just :hover/.active, so the pill doesn't change size and shift layout when a link gets highlighted */
    padding: 0.6rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 1.15rem;
    transition: background-color 0.2s ease;
}

.main-nav a:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.main-nav a.active {
    background-color: rgba(255, 255, 255, 0.14);
    font-weight: 700;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    color: #ffffff;
    /* a touch darker/more opaque than the header's own glass tint, so the chip still reads as a distinct layer now that both are dark */
    background-color: rgba(0, 0, 0, 0.7);
    /* its own blur is needed even though it sits inside an already-blurred bar — backdrop-filter only samples what's directly behind an element, it doesn't inherit */
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-pill);
    padding: 0.5rem 1.1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.github-btn:hover {
    /* lifts off the bar instead of just darkening — the glow comes from the border brightening, not the fill */
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.4);
}

@media (prefers-reduced-motion: reduce) {
    /* the lift-on-hover is real motion (translateY) — vestibular disorders can react badly to it, so drop it for users who've asked for reduced motion; the shadow/border feedback still communicates hover on its own */
    .github-btn:hover {
        transform: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* MAIN SECTION */

main {
    padding-inline: 1.4rem;
}

section {
    max-width: 60rem;
    margin-inline: auto;
    padding-block: 6rem 4rem;
    /* offsets in-page anchor jumps so the sticky floating navbar doesn't cover the top of the section you just jumped to */
    scroll-margin-top: 6rem;
}

section + section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* shared heading size for every section below the hero — hero's is set separately since it's larger */
.projects h2,
.contact h2 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

/* shared call-to-action pill, used by the hero link and the contact form's submit button */
.cta-btn {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-pill);
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.cta-btn:hover {
    background-color: rgba(255, 255, 255, 0.18);
}

/* HERO SECTION */

.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 1.5rem;
}

.hero h2 {
    font-size: 2.5rem;
}

.hero-tagline {
    max-width: 32rem;
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* PROJECTS SECTION */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1.5rem;
}

.project-card {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
}

.project-card h3 {
    margin-bottom: 0.5rem;
}

.project-card p {
    color: var(--text-muted);
}

/* CONTACT SECTION */

.contact-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    max-width: 30rem;
    margin-top: 2rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

.form-field label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-field input,
.form-field textarea {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    padding: 0.7rem 0.9rem;
    color: #f2f2f4;
    font-family: inherit;
    font-size: 1rem;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}
