/* ============================================================
   iggi.dev - Swiss Typographic Grid Design
   Colors: #ffffff, #f7f7f5, #d4d4d4, #c8c8c4, #8a8a8a, #6b6b6b, #3a3a3a, #2a2a28, #1a1a1a, #f0f0ec, #d42b2b
   Fonts: Space Grotesk, Inter
   ============================================================ */

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

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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: #1a1a1a;
    background-color: #ffffff;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Fixed Grid Background --- */
#grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

#grid-svg {
    width: 100%;
    height: 100%;
}

.grid-col-line {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background-color: #d4d4d4;
    opacity: 0.35;
}

/* --- Grid Intersection Markers --- */
#grid-markers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.grid-marker {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #d42b2b;
    transform: scale(0);
    transition: transform 300ms cubic-bezier(0.33, 1, 0.68, 1);
}

.grid-marker.visible {
    transform: scale(1);
}

/* --- Navigation --- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #d4d4d4;
    padding: 12px 0;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.75rem;
    font-variant: all-small-caps;
    letter-spacing: 0.12em;
    color: #8a8a8a;
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
    transition: color 200ms ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #1a1a1a;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 200ms ease;
}

.nav-link:hover {
    color: #1a1a1a;
}

.nav-link:hover::after {
    transform: scaleX(1);
}

.nav-link.active {
    color: #1a1a1a;
}

.nav-link.active::after {
    background-color: #d42b2b;
    transform: scaleX(1);
}

.nav-sep {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #d4d4d4;
    user-select: none;
}

/* --- Zone Base --- */
.zone {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.zone-white {
    background-color: #ffffff;
}

.zone-offwhite {
    background-color: #f7f7f5;
}

.zone-dark {
    background-color: #1a1a1a;
}

.zone-content {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 24px;
}

.zone-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #1a1a1a;
}

.zone-dark .zone-divider {
    background-color: #f0f0ec;
}

/* --- Section Numbers --- */
.section-number {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(0.65rem, 0.8vw, 0.75rem);
    color: #d4d4d4;
    grid-column: 1 / 2;
    padding-top: 96px;
    transition: color 400ms ease;
    align-self: start;
}

.section-number.active {
    color: #1a1a1a;
}

.section-number-inverted {
    color: #3a3a3a;
}

.section-number-inverted.active {
    color: #f0f0ec;
}

/* --- Section Headings --- */
.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: 0em;
    line-height: 1.1;
    color: #1a1a1a;
    grid-column: 2 / 8;
    padding-top: 96px;
    margin-bottom: 48px;
}

.section-heading-inverted {
    color: #f0f0ec;
}

/* --- Zone 1: Title --- */
#zone-title .zone-content {
    min-height: 100vh;
    align-content: start;
}

.title-block {
    grid-column: 2 / 11;
    padding-top: 288px; /* row 6 approximately */
}

.site-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(2.8rem, 6vw, 5.6rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #1a1a1a;
    margin-bottom: 24px;
}

.red-dot {
    color: #d42b2b;
    animation: redDotPulse 4s ease-in-out infinite;
}

@keyframes redDotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.site-descriptor {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.65;
    color: #6b6b6b;
    max-width: 65ch;
}

#zone-title .section-number {
    padding-top: 288px;
}

/* --- Zone 2: Work --- */
#zone-work .zone-content {
    padding-top: 0;
    padding-bottom: 96px;
}

.work-grid {
    grid-column: 2 / 9;
    display: grid;
    grid-template-columns: 4fr 2fr;
    gap: 48px 24px;
}

.project-thumb {
    grid-column: 1 / 2;
}

.thumb-image {
    width: 100%;
    opacity: 0.85;
    transition: opacity 150ms ease;
    display: block;
}

.thumb-image svg {
    display: block;
    width: 100%;
    height: auto;
}

.project-thumb:hover .thumb-image {
    opacity: 1;
}

.project-thumb:hover + .project-caption .caption-text,
.project-thumb:hover + .project-caption .project-title {
    color: #1a1a1a;
}

.project-caption {
    grid-column: 2 / 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 4px;
}

.caption-pilcrow {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    color: #d4d4d4;
    display: block;
    margin-bottom: 8px;
}

.project-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    letter-spacing: 0.02em;
    line-height: 1.1;
    color: #1a1a1a;
    margin-bottom: 8px;
    transition: color 150ms ease;
}

.caption-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    color: #6b6b6b;
    line-height: 1.5;
    transition: color 150ms ease;
}

.footnote-ref {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.65rem;
    color: #d42b2b;
    vertical-align: super;
    margin-top: 8px;
    display: inline-block;
}

/* Marginal Notes */
.marginal-notes {
    grid-column: 9 / 12;
    padding-top: 96px;
}

.work-notes {
    padding-top: 0;
}

.marginal-note {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    color: #6b6b6b;
    line-height: 1.5;
    margin-bottom: 24px;
}

.footnote-target {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    color: #d42b2b;
    vertical-align: super;
    margin-right: 4px;
}

/* --- Zone 3: Process --- */
#zone-process .zone-content {
    padding-bottom: 96px;
}

.process-layout {
    grid-column: 1 / 13;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 24px;
}

.process-text {
    grid-column: 2 / 8;
}

.process-text p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.65;
    color: #1a1a1a;
    max-width: 65ch;
    margin-bottom: 48px;
}

.process-text p:last-child {
    margin-bottom: 0;
}

.process-marginal {
    grid-column: 9 / 12;
    padding-top: 4px;
}

.process-marginal .marginal-note {
    margin-bottom: 48px;
}

/* --- Zone 4: Contact --- */
#zone-contact {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

#zone-contact .zone-content {
    width: 100%;
    padding-top: 96px;
    padding-bottom: 96px;
}

#zone-contact .section-heading {
    margin-bottom: 96px;
}

.contact-divider-top,
.contact-divider-bottom {
    grid-column: 1 / 13;
    height: 2px;
    background-color: #f0f0ec;
}

.contact-block {
    grid-column: 2 / 8;
    padding: 48px 0;
}

.contact-row {
    display: flex;
    align-items: baseline;
    padding: 24px 0;
    border-bottom: 1px solid #3a3a3a;
}

.contact-row:last-child {
    border-bottom: none;
}

.contact-label {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    color: #6b6b6b;
    width: 120px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    color: #f0f0ec;
    letter-spacing: -0.01em;
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
    .zone-content {
        grid-template-columns: repeat(6, 1fr);
        gap: 0 16px;
        padding: 0 16px;
    }

    .section-number {
        grid-column: 1 / 2;
        font-size: 0.65rem;
    }

    .section-heading {
        grid-column: 1 / 7;
        padding-top: 72px;
    }

    .title-block {
        grid-column: 1 / 7;
        padding-top: 192px;
    }

    #zone-title .section-number {
        padding-top: 192px;
    }

    .work-grid {
        grid-column: 1 / 7;
        grid-template-columns: 1fr;
    }

    .project-thumb {
        grid-column: 1 / -1;
    }

    .project-caption {
        grid-column: 1 / -1;
    }

    .marginal-notes {
        grid-column: 1 / 7;
        padding-top: 48px;
    }

    .process-layout {
        grid-column: 1 / 7;
        grid-template-columns: 1fr;
    }

    .process-text {
        grid-column: 1 / -1;
    }

    .process-marginal {
        grid-column: 1 / -1;
        padding-top: 48px;
        border-top: 1px solid #d4d4d4;
    }

    .contact-block {
        grid-column: 1 / 7;
    }

    .contact-divider-top,
    .contact-divider-bottom {
        grid-column: 1 / 7;
    }

    #zone-contact .section-heading {
        margin-bottom: 48px;
    }

    .nav-inner {
        padding: 0 16px;
    }
}

@media (max-width: 600px) {
    .site-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .contact-row {
        flex-direction: column;
        gap: 4px;
    }

    .contact-label {
        width: auto;
    }

    .work-grid {
        gap: 24px 0;
    }
}

/* --- Dark zone grid line adaptation --- */
.zone-dark .grid-col-line {
    background-color: #3a3a3a;
}

/* --- Offwhite zone grid line adaptation (via overlay) --- */
.zone-offwhite {
    position: relative;
}
