/* ppuzzl.com - Corporate / Monochrome / Generative Art */

/* ========== Reset & Base ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #fafafa;
    color: #2a2a2a;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Palette tokens for reference:
   #fafafa - bg primary
   #f5f5f5 - blob fill alt
   #f0f0f0 - bg secondary/hover
   #e8e8e8 - blob fill
   #d4d4d4 - grid cell border hover
   #b0b0b0 - footer/muted
   #aaaaaa - metadata/accents
   #888888 - descriptor text
   #2a2a2a - body text
   #1a1a1a - heading/nav underline
*/

/* ========== Intro Section ========== */
.intro {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fafafa;
}

.intro-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    animation: blobBreathe1 10s ease-in-out infinite;
    z-index: 0;
    fill: #f0f0f0;
}

.intro-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.intro-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: #1a1a1a;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.intro-tagline {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    color: #888888;
    margin-top: 0.75rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: pulseChevron 2.5s ease-in-out infinite;
    color: #b0b0b0;
}

.scroll-indicator svg {
    stroke: #b0b0b0;
}

@keyframes pulseChevron {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
    50% { opacity: 1; transform: translateX(-50%) translateY(6px); }
}

/* ========== Header ========== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fafafa;
    padding: 0 clamp(2rem, 8vw, 10rem);
}

.header-inner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 1.25rem 0;
}

.site-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: #1a1a1a;
    letter-spacing: -0.02em;
}

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

.nav-link {
    position: relative;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1a1a1a;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
}

.nav-link .underline-svg {
    display: block;
    height: 2px;
    width: 100%;
    margin-top: 2px;
}

.nav-link .underline-svg line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover .underline-svg line {
    stroke-dashoffset: 0;
}

.header-rule {
    width: 100%;
    height: 1px;
    background: #d4d4d4;
}

/* ========== Portfolio Section ========== */
.portfolio {
    position: relative;
    padding: clamp(2rem, 4vw, 4rem) clamp(2rem, 8vw, 10rem);
}

.grid-blob {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    fill: #e8e8e8;
}

.grid-blob-2,
.about-blob-right {
    fill: #f5f5f5;
}

.grid-blob-1 {
    width: 250px;
    height: 250px;
    top: 10%;
    left: -60px;
    animation: blobBreathe2 9s ease-in-out infinite;
}

.grid-blob-2 {
    width: 180px;
    height: 180px;
    bottom: 15%;
    right: -40px;
    animation: blobBreathe3 11s ease-in-out infinite;
}

.portfolio-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(400px, 2fr) minmax(200px, 1fr);
    grid-auto-rows: minmax(280px, auto);
    gap: clamp(1rem, 2vw, 2.5rem);
}

/* Grid cell placement */
.grid-cell:nth-child(1) { grid-column: 2; grid-row: span 2; } /* Featured center */
.grid-cell:nth-child(2) { grid-column: 1; }
.grid-cell:nth-child(3) { grid-column: 3; }
.grid-cell:nth-child(4) { grid-column: 1; }
.grid-cell:nth-child(5) { grid-column: 2; grid-row: span 2; } /* Featured center */
.grid-cell:nth-child(6) { grid-column: 3; }
.grid-cell:nth-child(7) { grid-column: 1; }
.grid-cell:nth-child(8) { grid-column: 3; }

/* ========== Grid Cells ========== */
.grid-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    border: 1px solid transparent;
    transition: border-color 400ms ease-out;
    overflow: hidden;
}

.grid-cell:hover {
    border-color: #d4d4d4;
}

.gen-canvas {
    width: 100%;
    flex: 1 1 65%;
    display: block;
}

.cell-info {
    padding: 1rem 1.25rem 1.25rem;
    flex: 0 0 auto;
}

.cell-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    color: #1a1a1a;
    letter-spacing: -0.01em;
    line-height: 1.3;
    display: inline-flex;
    flex-direction: column;
}

.cell-title .underline-svg {
    display: block;
    height: 2px;
    width: 100%;
    margin-top: 2px;
}

.cell-title .underline-svg line {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-cell:hover .cell-title .underline-svg line {
    stroke-dashoffset: 0;
}

.cell-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    color: #888888;
    margin-top: 0.3rem;
}

.cell-meta {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: #aaaaaa;
    margin-top: 0.25rem;
}

/* ========== About Section ========== */
.about {
    position: relative;
    padding: clamp(4rem, 8vw, 8rem) clamp(2rem, 8vw, 10rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.about-blob {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

.about-blob-left {
    width: 350px;
    height: 350px;
    left: -120px;
    top: 20%;
    animation: blobBreathe1 12s ease-in-out infinite;
}

.about-blob-right {
    width: 280px;
    height: 280px;
    right: -100px;
    bottom: 10%;
    animation: blobBreathe3 8s ease-in-out infinite;
}

.about-rule {
    width: 200px;
    height: 1px;
    background: #d4d4d4;
    margin-bottom: 2.5rem;
}

.about-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    text-align: left;
}

.about-content p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    color: #2a2a2a;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* ========== Contact / Footer ========== */
.contact {
    padding: clamp(3rem, 6vw, 6rem) clamp(2rem, 8vw, 10rem);
    text-align: center;
}

.contact-link {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    color: #b0b0b0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.contact-link .underline-svg {
    display: block;
    height: 2px;
    width: 100%;
    margin-top: 2px;
}

.contact-link .underline-svg line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-link:hover .underline-svg line {
    stroke-dashoffset: 0;
}

/* ========== Blob Breathing Animations ========== */
@keyframes blobBreathe1 {
    0%, 100% { transform: translate(-50%, -55%) scale(1); }
    50% { transform: translate(-50%, -55%) scale(1.03); }
}

@keyframes blobBreathe2 {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@keyframes blobBreathe3 {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ========== Responsive ========== */

/* Tablet */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: minmax(240px, auto);
    }

    .grid-cell:nth-child(1) { grid-column: 1 / -1; grid-row: span 1; }
    .grid-cell:nth-child(2) { grid-column: 1; }
    .grid-cell:nth-child(3) { grid-column: 2; }
    .grid-cell:nth-child(4) { grid-column: 1; }
    .grid-cell:nth-child(5) { grid-column: 1 / -1; grid-row: span 1; }
    .grid-cell:nth-child(6) { grid-column: 2; }
    .grid-cell:nth-child(7) { grid-column: 1; }
    .grid-cell:nth-child(8) { grid-column: 2; }
}

/* Mobile */
@media (max-width: 640px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: clamp(2rem, 5vw, 4rem);
    }

    .grid-cell:nth-child(n) {
        grid-column: 1;
        grid-row: span 1;
    }

    .nav {
        gap: 1.2rem;
    }

    .intro-blob {
        width: 320px;
        height: 320px;
    }

    .about-blob-left,
    .about-blob-right {
        display: none;
    }
}