@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* =========================================================
   1. GLOBAL VARIABLES
   ========================================================= */

:root {
    --paper: #eeeae2;
    --ink: #171715;
    --red: #d93627;

    --line: 2px solid var(--ink);

    --mono: 'DM Mono', monospace;
    --sans: 'Space Grotesk', Arial, sans-serif;
}


/* =========================================================
   2. BASE / RESET STYLES
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    overflow-x: hidden;
}

a {
    color: inherit;
}

a:focus-visible {
    outline: 3px solid var(--red);
    outline-offset: 5px;
}

::selection {
    background: var(--red);
    color: #fff;
}

[hidden] {
    display: none !important;
}


/* =========================================================
   3. PAGE TEXTURE / GRAIN
   ========================================================= */

.grain {
    position: fixed;
    inset: 0;
    z-index: 20;

    pointer-events: none;
    opacity: 0.13;

    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.26'/%3E%3C/svg%3E");
}


/* =========================================================
   4. SHARED TYPOGRAPHY
   ========================================================= */

.site-header nav a,
.edition,
.site-footer,
.section-label,
.hero-topline,
.hero-bottomline,
.eyebrow,
.action-link,
.portrait-caption,
.tag-row,
.project-meta,
.project-number,
.project-placeholder,
.social-link {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
}


/* =========================================================
   5. HEADER
   ========================================================= */

.site-header,
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 17px clamp(20px, 4vw, 72px);
    border-bottom: var(--line);

    position: relative;
    z-index: 2;
}

.site-header {
    background: var(--paper);
}

.wordmark {
    text-decoration: none;
    font-size: 29px;
    font-weight: 700;
    letter-spacing: -0.11em;
    line-height: 1;
}

.star {
    color: var(--red);
    font-size: 19px;
    vertical-align: top;
    margin-left: 5px;
}

.site-header nav {
    display: flex;
    gap: clamp(14px, 3vw, 45px);
}

.site-header nav a {
    text-decoration: none;
    font-weight: 500;
}

.site-header nav a:hover,
.site-footer a:hover {
    color: var(--red);
}

.edition {
    white-space: nowrap;
}


/* =========================================================
   6. GENERAL SECTION LAYOUT
   ========================================================= */

.section-shell {
    padding: clamp(25px, 4vw, 64px) clamp(20px, 4vw, 72px);
    border-bottom: var(--line);
    position: relative;
}

.section-label {
    display: flex;
    justify-content: space-between;
    gap: 16px;

    border-bottom: var(--line);
    padding-bottom: 16px;
    margin-bottom: clamp(40px, 7vw, 105px);
}

.section-heading {
    margin: 0;

    font-size: clamp(65px, 8vw, 140px);
    font-weight: 700;
    line-height: 0.84;
    letter-spacing: -0.095em;
}

.section-heading em {
    font-style: normal;
    color: var(--red);
}


/* =========================================================
   7. HERO SECTION
   ========================================================= */

.hero {
    min-height: min(840px, calc(100svh - 67px));

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    isolation: isolate;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    inset: -40%;
    z-index: -1;

    opacity: 0.63;

    background:
        radial-gradient(
            ellipse 33% 33% at 30% 45%,
            #f5bba5 0%,
            transparent 75%
        ),
        radial-gradient(
            ellipse 32% 32% at 70% 68%,
            #e9a4a1 0%,
            transparent 74%
        ),
        radial-gradient(
            ellipse 40% 40% at 66% 23%,
            #f8e6bc 0%,
            transparent 77%
        );

    filter: blur(40px);
    animation: drift 17s ease-in-out infinite alternate;
}

.hero-topline,
.hero-bottomline,
.portrait-caption {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.hero-topline,
.hero-bottomline {
    font-weight: 500;
}

.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.55fr);
    gap: clamp(25px, 5vw, 100px);
    align-items: center;

    padding: 65px 0;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;

    margin: 0 0 30px;
}

.status-dot {
    width: 8px;
    height: 8px;

    background: var(--red);
    border-radius: 50%;
    box-shadow: 0 0 0 4px #d936271b;
}

.hero h1 {
    margin: 0;

    font-size: clamp(65px, 10.8vw, 192px);
    font-weight: 700;
    line-height: 0.84;
    letter-spacing: -0.095em;
}

.hero h1 span {
    white-space: nowrap;
}

.period {
    color: var(--red);
}

.hero-intro {
    max-width: 480px;
    margin: 38px 0 27px;

    font-size: clamp(17px, 1.6vw, 22px);
    line-height: 1.4;
}

.action-link {
    display: inline-flex;
    align-items: center;
    gap: 35px;

    padding: 16px 19px;

    background: var(--ink);
    border: var(--line);
    color: var(--paper);
    text-decoration: none;

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

.action-link:hover {
    background: var(--red);
    transform: translateY(-4px);
}

.action-link span {
    font-size: 22px;
    line-height: 0.7;
}


/* =========================================================
   8. PORTRAIT / PROFILE IMAGE
   ========================================================= */

.portrait-wrap {
    width: 100%;
    max-width: 390px;

    justify-self: end;
    transform: rotate(3deg);
}

.portrait-frame {
    height: clamp(280px, 35vw, 470px);
    padding: 9px;

    border: var(--line);
    background: var(--ink);
    box-shadow: 14px 14px 0 var(--red);
    overflow: hidden;
}

.portrait-frame img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.portrait-placeholder {
    height: 100%;

    display: grid;
    place-items: center;

    background: linear-gradient(
        135deg,
        #c4beb1 0%,
        #e8e4db 48%,
        #b0a99a 100%
    );

    text-align: center;
    font-weight: 700;
    font-size: clamp(27px, 3.5vw, 55px);
    line-height: 1.03;
    letter-spacing: -0.065em;
}

.portrait-caption {
    margin: 22px -3px 0 14px;
}


/* =========================================================
   9. ABOUT SECTION
   ========================================================= */

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6vw;
    align-items: start;

    padding-bottom: clamp(28px, 6vw, 80px);
}

.about-copy {
    max-width: 630px;
    padding-top: 8px;
}

.about-copy p {
    margin: 0 0 25px;

    font-size: clamp(18px, 2vw, 25px);
    line-height: 1.5;
}

.tag-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;

    margin-top: 38px;
}

.tag-row span:hover{
    background: var(--red);
    transform: translateY(-4px);
}

.tag-row span {
    border: 1px solid var(--ink);
    padding: 9px 12px;
}


/* =========================================================
   10. PROJECTS SECTION
   ========================================================= */

.projects {
    background: #dedad1;
}

.projects-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 35px;

    margin-bottom: 50px;
}

.projects-heading p {
    max-width: 230px;

    font-size: 15px;
    line-height: 1.6;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 2vw, 34px);

    padding-bottom: 50px;
}

.project-card {
    min-width: 0;
}

.project-poster {
    aspect-ratio: 16 / 10;

    display: grid;
    place-items: center;

    position: relative;
    overflow: hidden;

    border: var(--line);
    background: var(--poster-bg, #332e2b);
    color: var(--poster-ink, #f2eee6);
    text-decoration: none;

    transition:
        transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
        box-shadow 0.4s;
}

.project-card:hover .project-poster,
.project-card:focus-within .project-poster {
    transform: translateY(-9px) rotate(-1deg);
    box-shadow: 9px 9px 0 var(--red);
}

.project-poster img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;

    display: block;
    object-fit: cover;
    object-position: left top;
}

.project-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 30%, rgba(8, 12, 18, 0.95) 100%);
    pointer-events: none;
}

.project-caption {
    position: absolute;
    inset: auto 20px 20px;
    z-index: 1;
}

.project-caption h3 {
    margin: 0 0 12px;
}

.project-live-label,
.project-repo-link {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
}

.project-live-label {
    display: inline-block;
    border: 1px solid currentColor;
    padding: 9px 12px;
}

.project-description {
    font-size: 15px;
    line-height: 1.6;
    margin: 16px 0;
}

.project-repo-link {
    display: inline-block;
    padding: 6px 0;
    text-underline-offset: 4px;
}

.project-repo-link:hover {
    color: var(--red);
}

.project-placeholder {
    position: absolute;
    inset: 12px;

    display: grid;
    place-items: center;

    border: 1px solid currentColor;
    padding: 25px;

    text-align: center;
}

.project-placeholder strong {
    visibility: hidden;
    font-family: var(--sans);
    font-size: clamp(32px, 5vw, 77px);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.08em;
    overflow-wrap: anywhere;
}

.project-placeholder small {
    display: none;
}

.project-poster.has-image .project-placeholder {
    display: none;
}

.project-number {
    position: absolute;
    top: 22px;
    left: 22px;
    z-index: 1;

    padding: 6px 8px;

    background: var(--paper);
    color: var(--ink);
}

.project-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;

    border-top: var(--line);
    margin-top: 16px;
    padding-top: 12px;
}

.project-meta span:last-child {
    text-align: right;
}

.project-card h3 {
    margin: 0 0 12px;

    font-size: clamp(20px, 2.5vw, 34px);
    line-height: 1.1;
    letter-spacing: -0.055em;
}


/* =========================================================
   11. CONNECT / SOCIAL LINKS SECTION
   ========================================================= */

.connect {
    padding-bottom: clamp(65px, 9vw, 145px);

    background: var(--ink);
    color: var(--paper);
}

.connect .section-label {
    border-color: var(--paper);
}

.connect .section-heading {
    font-size: clamp(75px, 12vw, 205px);
}

.connect-intro {
    margin: 34px 0 45px;
    font-size: clamp(18px, 2vw, 25px);
}

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

.social-link {
    min-height: 92px;

    display: flex;
    align-items: center;
    gap: 15px;

    border: 1px solid var(--paper);
    padding: clamp(15px, 2vw, 25px);

    text-decoration: none;

    transition:
        background 0.3s,
        color 0.3s,
        transform 0.3s;
}

.social-link svg {
    width: 25px;
    height: 25px;
    flex: none;
}

.social-link:hover {
    background: var(--red);
    color: white;
    transform: translateY(-5px);
}

.social-arrow {
    margin-left: auto;
    font-size: 24px;
}


/* =========================================================
   12. FOOTER
   ========================================================= */

.site-footer {
    border-bottom: 0;
    font-size: 10px;
    flex-wrap: wrap;
}

.site-footer a {
    text-decoration: none;
}


/* =========================================================
   13. SCROLL REVEAL ANIMATIONS
   ========================================================= */

.reveal {
    opacity: 0;
    transform: translateY(25px);

    transition:
        opacity 0.8s ease,
        transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.portrait-wrap.reveal.is-visible {
    transform: rotate(3deg);
}


/* =========================================================
   14. BACKGROUND MOVEMENT
   ========================================================= */

@keyframes drift {
    0% {
        transform: translate(-3%, -2%) rotate(0deg) scale(1);
    }

    50% {
        transform: translate(5%, 2%) rotate(9deg) scale(1.08);
    }

    100% {
        transform: translate(-1%, 5%) rotate(-8deg) scale(1.04);
    }
}


/* =========================================================
   15. TABLET / SMALL LAPTOP
   ========================================================= */

@media (max-width: 850px) {
    .edition {
        display: none;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 55px;
        padding: 70px 0;
    }

    .hero h1 {
        font-size: clamp(64px, 12vw, 120px);
    }

    .portrait-wrap {
        width: 75%;
        max-width: 340px;
        justify-self: center;
    }

    .portrait-frame {
        height: 370px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .projects-heading {
        align-items: start;
        flex-direction: column;
    }

    .projects-heading p {
        max-width: none;
    }

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

    .social-link {
        min-height: 75px;
    }
}


/* =========================================================
   16. MOBILE
   ========================================================= */

@media (max-width: 550px) {
    .site-header {
        padding-block: 13px;
    }

    .site-header nav {
        gap: 12px;
    }

    .site-header nav a {
        font-size: 10px;
    }

    .hero h1 {
        font-size: clamp(52px, 13vw, 77px);
    }

    .hero-intro {
        margin-top: 24px;
    }

    .hero-topline,
    .hero-bottomline,
    .section-label {
        font-size: 9px;
    }

    .portrait-wrap {
        width: 85%;
    }

    .portrait-frame {
        height: 340px;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 44px;
    }

    .project-poster {
        max-height: 550px;
    }

    .project-placeholder strong {
        font-size: 65px;
    }

    .project-card h3 {
        font-size: 28px;
    }

    .connect .section-heading {
        font-size: clamp(62px, 12vw, 100px);
    }
}


/* =========================================================
   17. ACCESSIBILITY: REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero-glow {
        animation: none;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .portrait-wrap.reveal {
        transform: rotate(3deg);
    }

    .project-poster,
    .social-link,
    .action-link {
        transition: none;
    }
}
