/* ============================================================
   Allen Ma Portfolio
   Embedded Software / Firmware Engineer
   ============================================================ */

/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: #0b0f14;
    color: #d7dde5;
    line-height: 1.7;
    font-size: 16px;
}

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

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

.container {
    width: min(1120px, 90%);
    margin: 0 auto;
}


/* ------------------------------------------------------------
   Typography
   ------------------------------------------------------------ */

h1,
h2,
h3 {
    color: #ffffff;
    line-height: 1.15;
    font-weight: 650;
}

h1 {
    font-size: clamp(3rem, 7vw, 6.5rem);
    letter-spacing: -0.045em;
}

h2 {
    font-size: clamp(2.2rem, 4vw, 4rem);
    letter-spacing: -0.03em;
}

h3 {
    font-size: 1.45rem;
}

p {
    color: #aeb8c5;
}

.eyebrow {
    margin-bottom: 1.25rem;
    color: #7dd3fc;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}


/* ------------------------------------------------------------
   Navigation
   ------------------------------------------------------------ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;

    background: rgba(11, 15, 20, 0.88);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.nav-container {
    min-height: 76px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.navbar nav {
    display: flex;
    gap: 2rem;
}

.navbar nav a {
    position: relative;

    color: #aeb8c5;
    font-size: 0.9rem;
    font-weight: 500;

    transition:
        color 0.25s ease,
        transform 0.25s ease;
}

.navbar nav a:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.navbar nav a::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: -8px;

    width: 0;
    height: 2px;

    background: #7dd3fc;

    transition: width 0.25s ease;
}

.navbar nav a:hover::after {
    width: 100%;
}


/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */

.hero {
    min-height: 100vh;

    display: flex;
    align-items: center;

    position: relative;
    overflow: hidden;

    background:
        radial-gradient(
            circle at 80% 20%,
            rgba(56, 189, 248, 0.10),
            transparent 35%
        ),
        radial-gradient(
            circle at 20% 80%,
            rgba(59, 130, 246, 0.07),
            transparent 35%
        ),
        #0b0f14;
}

.hero::before {
    content: "";

    position: absolute;
    inset: 0;

    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.025) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.025) 1px,
            transparent 1px
        );

    background-size: 50px 50px;

    mask-image: linear-gradient(
        to bottom,
        black,
        transparent 90%
    );

    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;

    padding-top: 76px;
}

.hero h1 {
    max-width: 900px;
}

.hero-description {
    max-width: 680px;
    margin-top: 2rem;

    font-size: 1.2rem;
    line-height: 1.8;
}

.location {
    margin-top: 1rem;

    color: #7f8b99;
    font-size: 0.95rem;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;

    margin-top: 2.5rem;
}


/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 50px;
    padding: 0.75rem 1.5rem;

    border-radius: 6px;

    font-size: 0.9rem;
    font-weight: 650;

    transition:
        transform 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: #ffffff;
    color: #0b0f14;
}

.button-primary:hover {
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.12);
}

.button-secondary {
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.025);
}

.button-secondary:hover {
    border-color: rgba(125, 211, 252, 0.55);
    background: rgba(125, 211, 252, 0.06);
}


/* ------------------------------------------------------------
   Sections
   ------------------------------------------------------------ */

.section {
    padding: 120px 0;
    background: #0b0f14;
}

.section-dark {
    background: #10161e;

    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section-heading {
    max-width: 800px;
    margin-bottom: 4rem;
}

.section-heading h2 {
    margin-bottom: 1.5rem;
}

.section-heading > p:last-child {
    max-width: 700px;
}


/* ------------------------------------------------------------
   About
   ------------------------------------------------------------ */

.about-content {
    max-width: 850px;
}

.about-content p {
    margin-bottom: 1.7rem;
    font-size: 1.08rem;
    line-height: 1.9;
}

.about-content p:first-child {
    color: #e5eaf0;
    font-size: 1.3rem;
}

.about-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;

    margin-top: 2.5rem;
}


/* ------------------------------------------------------------
   Skills
   ------------------------------------------------------------ */

.skills-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 1.25rem;
}

.skill-card {
    min-height: 260px;

    padding: 2rem;

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.035),
            rgba(255, 255, 255, 0.012)
        );

    transition:
        transform 0.3s ease,
        border-color 0.3s ease,
        background 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);

    border-color: rgba(125, 211, 252, 0.35);

    background:
        linear-gradient(
            145deg,
            rgba(125, 211, 252, 0.06),
            rgba(255, 255, 255, 0.015)
        );
}

.skill-card h3 {
    margin-bottom: 1.5rem;
}

.skill-card ul {
    list-style: none;

    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 0.7rem;
}

.skill-card li {
    color: #9da8b5;
    font-size: 0.9rem;
}

.skill-card li::before {
    content: "›";

    margin-right: 0.5rem;

    color: #7dd3fc;
    font-weight: 700;
}


/* ------------------------------------------------------------
   Projects
   ------------------------------------------------------------ */

.projects-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 1.5rem;
}

.project-card {
    position: relative;

    display: flex;
    flex-direction: column;

    min-height: 500px;

    padding: 2.5rem;

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.035),
            rgba(255, 255, 255, 0.01)
        );

    overflow: hidden;

    transition:
        transform 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.project-card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 2px;

    background: #7dd3fc;

    transform: scaleX(0);
    transform-origin: left;

    transition: transform 0.35s ease;
}

.project-card:hover {
    transform: translateY(-7px);

    border-color: rgba(125, 211, 252, 0.25);

    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.25);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-number {
    margin-bottom: 2rem;

    color: rgba(125, 211, 252, 0.65);

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 0.85rem;
    letter-spacing: 0.12em;
}

.project-category {
    margin-bottom: 0.8rem;

    color: #7dd3fc;

    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

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

.project-card p {
    margin-bottom: 1.2rem;

    font-size: 0.96rem;
    line-height: 1.75;
}

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

    margin-top: auto;
    padding-top: 1.5rem;
}

.project-tags span {
    padding: 0.35rem 0.65rem;

    border: 1px solid rgba(125, 211, 252, 0.18);
    border-radius: 4px;

    color: #a9c6d5;

    background: rgba(125, 211, 252, 0.04);

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 0.7rem;
}

.project-link {
    display: inline-block;

    margin-top: 1.75rem;

    color: #ffffff;

    font-size: 0.9rem;
    font-weight: 650;

    transition:
        color 0.25s ease,
        transform 0.25s ease;
}

.project-link:hover {
    color: #7dd3fc;
    transform: translateX(4px);
}


/* ------------------------------------------------------------
   Engineering Focus
   ------------------------------------------------------------ */

.focus-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 2rem;
}

.focus-grid > div {
    padding-top: 1.5rem;

    border-top: 1px solid rgba(125, 211, 252, 0.25);
}

.focus-grid h3 {
    margin-bottom: 1rem;
}

.focus-grid p {
    line-height: 1.8;
}


/* ------------------------------------------------------------
   Contact
   ------------------------------------------------------------ */

.contact {
    text-align: center;
}

.contact .section-heading {
    margin-left: auto;
    margin-right: auto;
}

.contact-text {
    max-width: 700px;

    margin: 0 auto;

    font-size: 1.1rem;
    line-height: 1.9;
}

.contact-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;

    margin-top: 2.5rem;
}


/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */

footer {
    padding: 2rem 0;

    border-top: 1px solid rgba(255, 255, 255, 0.06);

    background: #080b0f;

    text-align: center;
}

footer p {
    color: #687381;
    font-size: 0.8rem;
}


/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 900px) {

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

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

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

    .project-card {
        min-height: auto;
    }
}


@media (max-width: 650px) {

    body {
        font-size: 15px;
    }

    .navbar {
        position: relative;
    }

    .nav-container {
        min-height: 70px;

        flex-direction: column;
        justify-content: center;

        gap: 0.75rem;
    }

    .navbar nav {
        gap: 1rem;
    }

    .navbar nav a {
        font-size: 0.78rem;
    }

    .hero {
        min-height: 90vh;
    }

    .hero-content {
        padding-top: 40px;
    }

    .hero-description {
        font-size: 1rem;
    }

    .section {
        padding: 80px 0;
    }

    .section-heading {
        margin-bottom: 2.5rem;
    }

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

    .skill-card {
        min-height: auto;
    }

    .skill-card ul {
        grid-template-columns: 1fr 1fr;
    }

    .project-card {
        padding: 1.75rem;
    }

    .button {
        width: 100%;
    }

    .hero-buttons,
    .about-buttons,
    .contact-buttons {
        flex-direction: column;
    }
}
