/* ============================================================
   matsurika.quest — Architectural Fragment Portfolio
   Colors: #1A1610, #2C2416, #5C4A2A, #8B6914, #A07040, #C49A3C, #D4C4A0, #E8DFC8
   Fonts: Space Mono 700, Roboto Mono, Share Tech Mono
   ============================================================ */

/* --- Google Fonts already loaded in HTML --- */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #1A1610;
    color: #D4C4A0;
    font-family: 'Roboto Mono', 'Share Tech Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- SVG filters (hidden utility) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* --- Blueprint Grid Underlay --- */
.blueprint-grid {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 39px,
            rgba(196, 154, 60, 0.06) 39px,
            rgba(196, 154, 60, 0.06) 40px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 39px,
            rgba(196, 154, 60, 0.06) 39px,
            rgba(196, 154, 60, 0.06) 40px
        );
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* --- Fixed Coordinate Label --- */
.coord-label {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.coord-level {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.15em;
    color: #C49A3C;
    display: block;
}

.coord-pos {
    font-family: 'Roboto Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.1em;
    color: #8B6914;
    display: block;
}

/* --- Zones (Sections) --- */
.zone {
    position: relative;
    overflow: hidden;
}

/* ============================================================
   Zone 1 — GROUND LEVEL (Hero)
   ============================================================ */
.zone--ground {
    height: 100vh;
    min-height: 600px;
    background-color: #1A1610;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Facade — CSS concrete block composition */
.hero-facade {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: stretch;
}

.facade-block {
    position: absolute;
}

.facade-block--main {
    left: 50%;
    top: 10%;
    transform: translateX(-50%);
    width: 60%;
    height: 80%;
    background: linear-gradient(160deg, #2C2416 0%, #1A1610 40%, #0D0B09 100%);
    box-shadow:
        inset 0 0 60px rgba(0, 0, 0, 0.6),
        inset 4px 0 20px rgba(139, 105, 20, 0.08),
        0 0 0 1px rgba(139, 105, 20, 0.15);
    overflow: hidden;
}

.facade-block--side-left {
    left: 0;
    top: 25%;
    width: 22%;
    height: 55%;
    background: linear-gradient(180deg, #1A1610 0%, #2C2416 100%);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
    border-right: 1px solid rgba(139, 105, 20, 0.12);
}

.facade-block--side-right {
    right: 0;
    top: 15%;
    width: 18%;
    height: 65%;
    background: linear-gradient(180deg, #2C2416 0%, #1A1610 100%);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
    border-left: 1px solid rgba(139, 105, 20, 0.12);
}

/* Grain overlay on facade blocks */
.facade-grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 300px 300px;
    pointer-events: none;
    opacity: 0.5;
}

/* Window grid on main facade block */
.facade-window-grid {
    position: absolute;
    inset: 15% 10%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 12px;
}

.facade-window {
    background-color: #0D0B09;
    box-shadow:
        inset 0 0 15px rgba(0,0,0,0.8),
        0 0 0 1px rgba(196, 154, 60, 0.1);
    transition: box-shadow 0.4s ease;
}

.facade-window:hover {
    box-shadow:
        inset 0 0 15px rgba(0,0,0,0.8),
        0 0 0 1px rgba(196, 154, 60, 0.4),
        0 0 20px rgba(196, 154, 60, 0.05);
}

/* Hero content overlay */
.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.hero-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(48px, 8vw, 96px);
    letter-spacing: 0.08em;
    color: #C49A3C;
    text-transform: uppercase;
    line-height: 1;
    /* 45° long shadow — architectural raking light effect */
    text-shadow:
        1px 1px 0 #8B6914,
        2px 2px 0 #8B6914,
        3px 3px 0 #7A5C10,
        4px 4px 0 #7A5C10,
        5px 5px 0 #6B5010,
        6px 6px 0 #6B5010,
        7px 7px 0 #5C4A2A,
        8px 8px 0 #5C4A2A,
        9px 9px 0 #4E3E20,
        10px 10px 0 #4E3E20,
        11px 11px 0 #3F3018,
        12px 12px 0 #3F3018,
        13px 13px 0 #302518,
        14px 14px 0 #302518,
        15px 15px 0 #241C10,
        16px 16px 0 #241C10,
        17px 17px 0 #1A1610,
        18px 18px 0 #1A1610,
        19px 19px 0 #1A1610,
        20px 20px 0 #1A1610,
        22px 22px 0 rgba(26,22,16,0.8),
        24px 24px 0 rgba(26,22,16,0.7),
        28px 28px 0 rgba(26,22,16,0.6),
        32px 32px 0 rgba(26,22,16,0.5),
        40px 40px 0 rgba(26,22,16,0.4),
        50px 50px 0 rgba(26,22,16,0.3),
        60px 60px 0 rgba(26,22,16,0.2),
        70px 70px 0 rgba(26,22,16,0.1),
        80px 80px 0 rgba(26,22,16,0.05);
    transition: text-shadow 0.4s ease;
}

.hero-subtitle {
    font-family: 'Roboto Mono', monospace;
    font-size: clamp(11px, 1.5vw, 14px);
    letter-spacing: 0.25em;
    color: #8B6914;
    text-transform: uppercase;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.hero-meta-item {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    color: #5C4A2A;
    text-transform: uppercase;
}

.hero-meta-sep {
    color: #C49A3C;
    opacity: 0.5;
    font-size: 12px;
}

/* Hero annotation labels */
.hero-annotation {
    position: absolute;
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.15em;
    color: #5C4A2A;
    text-transform: uppercase;
    z-index: 5;
}

.hero-annotation--tl {
    top: 20px;
    right: 24px;
}

.hero-annotation--br {
    bottom: 20px;
    right: 24px;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 10;
    opacity: 0.5;
}

.scroll-indicator__line {
    display: block;
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, transparent, #C49A3C);
    animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-indicator__text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.3em;
    color: #8B6914;
    text-transform: uppercase;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ============================================================
   Zone 2 — FIELD (Portfolio Grid)
   ============================================================ */
.zone--field {
    background-color: #1A1610;
    padding: 80px 0 80px;
}

/* Section header */
.field-header,
.elevation-header,
.roof-header {
    position: relative;
    z-index: 1;
    padding: 0 40px;
    margin-bottom: 48px;
}

.section-id {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.2em;
    color: #8B6914;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.section-rule {
    height: 1px;
    background: linear-gradient(90deg, #C49A3C 0%, rgba(196, 154, 60, 0.2) 40%, transparent 100%);
}

/* Portfolio Grid */
.portfolio-grid {
    position: relative;
    z-index: 1;
    padding: 0 40px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Grid rows — row-synchronous reveals */
.grid-row {
    display: flex;
    gap: 2px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.grid-row.row-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Row 1: 1 wide + 1 portrait */
.grid-row--1 {
    align-items: stretch;
}

/* Row 2: 3 cards */
.grid-row--2 {
    align-items: stretch;
}

/* Row 3: 1 portrait + 1 wide */
.grid-row--3 {
    align-items: stretch;
}

/* Project Cards */
.project-card {
    background-color: #1A1610;
    border: 1px solid rgba(139, 105, 20, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color 0.3s ease;
}

.project-card:hover {
    border-color: rgba(196, 154, 60, 0.4);
}

/* Card size variants */
.project-card--wide {
    flex: 2;
    min-height: 280px;
}

.project-card--portrait {
    flex: 1;
    min-height: 360px;
}

.project-card--square {
    flex: 1;
    min-height: 320px;
}

/* Card render area (the "3D render" / SVG section) */
.card-render {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 160px;
}

.card-render--concrete {
    background: linear-gradient(135deg, #2C2416 0%, #1A1610 60%, #0D0B09 100%);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}

.card-render--elevation {
    background: linear-gradient(160deg, #2C2416 0%, #1A1610 100%);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}

.card-render--dark {
    background: linear-gradient(180deg, #1A1610 0%, #0D0B09 100%);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}

.card-render--bridge {
    background: linear-gradient(120deg, #1A1610 0%, #2C2416 50%, #1A1610 100%);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}

/* Grain overlay for cards */
.card-grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
    pointer-events: none;
    z-index: 1;
}

.card-cross-section {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.project-card:hover .card-cross-section {
    opacity: 0.8;
}

/* Card body (text area) */
.card-body {
    padding: 20px;
    border-top: 1px solid rgba(139, 105, 20, 0.2);
    background-color: #1A1610;
    flex-shrink: 0;
}

.card-index {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.3em;
    color: #5C4A2A;
    margin-bottom: 6px;
}

.card-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.1em;
    color: #D4C4A0;
    text-transform: uppercase;
    margin-bottom: 8px;
    line-height: 1.3;
}

.project-card:hover .card-title {
    color: #C49A3C;
}

.card-desc {
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    color: #5C4A2A;
    line-height: 1.6;
    margin-bottom: 12px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: #8B6914;
    border: 1px solid rgba(139, 105, 20, 0.3);
    padding: 2px 8px;
    text-transform: uppercase;
}

.project-card:hover .tag {
    border-color: rgba(196, 154, 60, 0.3);
    color: #A07040;
}

/* ============================================================
   Zone 3 — ELEVATION (Project Detail)
   ============================================================ */
.zone--elevation {
    background-color: #2C2416;
    padding: 80px 0;
    border-top: 1px solid rgba(139, 105, 20, 0.2);
    border-bottom: 1px solid rgba(139, 105, 20, 0.2);
}

.elevation-content {
    position: relative;
    z-index: 1;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    align-items: start;
}

.elevation-drawing {
    background-color: #1A1610;
    border: 1px solid rgba(139, 105, 20, 0.2);
    overflow: hidden;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.4);
}

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

/* Annotation panel */
.elevation-annotations {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid rgba(139, 105, 20, 0.2);
}

.annotation-block {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(139, 105, 20, 0.15);
}

.annotation-block:last-child {
    border-bottom: none;
}

.annotation-block--highlight {
    background-color: rgba(196, 154, 60, 0.05);
}

.annotation-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: #5C4A2A;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.annotation-value {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #C49A3C;
    text-transform: uppercase;
    line-height: 1.4;
}

/* ============================================================
   Zone 4 — ROOF (Footer)
   ============================================================ */
.zone--roof {
    background-color: #1A1610;
    padding: 80px 0 48px;
}

.roof-content {
    position: relative;
    z-index: 1;
    padding: 0 40px;
}

.roof-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 60px;
}

/* Roof columns */
.roof-logo {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: 0.08em;
    color: #C49A3C;
    text-transform: uppercase;
    margin-bottom: 16px;
    text-shadow:
        2px 2px 0 #8B6914,
        4px 4px 0 rgba(139, 105, 20, 0.5),
        6px 6px 0 rgba(139, 105, 20, 0.2);
}

.roof-tagline {
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    color: #5C4A2A;
    line-height: 2;
    letter-spacing: 0.05em;
}

.roof-col-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.25em;
    color: #8B6914;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(139, 105, 20, 0.2);
}

/* Coordinate list */
.coord-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.coord-item {
    display: flex;
    gap: 12px;
    align-items: baseline;
}

.coord-key {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: #5C4A2A;
    text-transform: uppercase;
    min-width: 44px;
}

.coord-val {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    color: #A07040;
    letter-spacing: 0.05em;
}

/* Index list */
.index-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.index-item {
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(139, 105, 20, 0.08);
}

.index-num {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    color: #C49A3C;
    letter-spacing: 0.1em;
    min-width: 60px;
}

.index-title {
    font-family: 'Roboto Mono', monospace;
    font-size: 10px;
    color: #5C4A2A;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Architect stamp */
.roof-stamp {
    display: flex;
    justify-content: center;
}

.stamp-border {
    border: 2px solid rgba(196, 154, 60, 0.4);
    padding: 3px;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stamp-inner {
    border: 1px solid rgba(196, 154, 60, 0.25);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    padding: 12px;
}

.stamp-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.12em;
    color: #C49A3C;
    text-transform: uppercase;
}

.stamp-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.15em;
    color: #8B6914;
    text-transform: uppercase;
}

.stamp-line {
    font-family: 'Roboto Mono', monospace;
    font-size: 9px;
    color: #5C4A2A;
    letter-spacing: 0.1em;
}

.stamp-seal {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 28px;
    color: rgba(196, 154, 60, 0.15);
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Roof footer */
.roof-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid rgba(139, 105, 20, 0.15);
}

.roof-copy,
.roof-hash {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.15em;
    color: #2C2416;
    text-transform: uppercase;
}

/* ============================================================
   Hover interactions on project cards
   ============================================================ */
.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(196, 154, 60, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.project-card:hover::before {
    opacity: 1;
}

/* ============================================================
   Elevation zone reveal
   ============================================================ */
.elevation-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.elevation-content.content-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Roof reveal
   ============================================================ */
.roof-grid {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.roof-grid.content-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Hero title reveal on load
   ============================================================ */
.hero-content {
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

.hero-content.hero-loaded {
    opacity: 1;
}

/* ============================================================
   Responsive breakpoints
   ============================================================ */
@media (max-width: 1024px) {
    .elevation-content {
        grid-template-columns: 1fr;
    }

    .roof-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .portfolio-grid,
    .field-header,
    .elevation-header,
    .roof-header,
    .elevation-content,
    .roof-content {
        padding-left: 20px;
        padding-right: 20px;
    }

    .grid-row--1,
    .grid-row--2,
    .grid-row--3 {
        flex-direction: column;
    }

    .project-card--wide,
    .project-card--portrait,
    .project-card--square {
        flex: none;
        width: 100%;
        min-height: 240px;
    }

    .roof-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .hero-title {
        font-size: 40px;
    }

    .facade-block--main {
        width: 90%;
    }

    .facade-block--side-left,
    .facade-block--side-right {
        display: none;
    }

    .roof-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
