/* ============================================
   miris.studio — Brutalist Botanical Atelier
   ============================================ */

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

:root {
    --concrete-base: #e8e6e1;
    --concrete-deep: #2a2a28;
    --concrete-mid: #8a8884;
    --formwork: #d4d2cc;
    --paper-inset: #f0f0ec;
    --botanical: #3a6b4a;
    --root-accent: #6b5a48;
    --ink-black: #1a1a18;
    --canopy-bg: #dddbd6;
    --joint-dark: #3a3a3a;
    --label-gray: #7a7a76;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--concrete-base);
    color: var(--concrete-deep);
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    /* Formwork grain texture */
    background-image: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0.03) 0px,
        rgba(0,0,0,0.03) 0.5px,
        transparent 0.5px,
        transparent 4px
    );
}

/* --- Typography --- */
.headline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    text-transform: uppercase;
    color: var(--concrete-deep);
}

.headline--sm {
    font-size: clamp(1.4rem, 3vw, 2.5rem);
}

.headline--xs {
    font-size: clamp(1rem, 2vw, 1.5rem);
    margin-bottom: 0.75em;
}

.body-text {
    margin-bottom: 1.2em;
    color: var(--concrete-deep);
}

.body-text--sm {
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.65;
}

.subtitle {
    font-style: italic;
    color: var(--concrete-deep);
    opacity: 0;
    transition: opacity 1200ms ease-out;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.subtitle.visible {
    opacity: 0.4;
}

.coord-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--label-gray);
    display: block;
    margin-bottom: 16px;
}

.coord-label--br {
    position: absolute;
    bottom: 40px;
    right: 40px;
    margin-bottom: 0;
}

.annotation-text {
    font-family: 'Space Mono', monospace;
}

/* --- Joint Lines --- */
.joint-line {
    background-color: var(--formwork);
    height: 2px;
}

.joint-line--horizontal {
    width: 40vw;
    max-width: 500px;
    margin-top: 80px;
}

.joint-line--center {
    margin: 24px auto;
    width: 120px;
}

/* --- Site Header --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.site-name {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--concrete-deep);
    pointer-events: auto;
}

.nav-toggle {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    line-height: 1;
    background: none;
    border: none;
    color: var(--ink-black);
    cursor: pointer;
    pointer-events: auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.nav-toggle:hover {
    color: var(--botanical);
}

/* --- Slide Navigation --- */
.slide-nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background-color: var(--concrete-deep);
    z-index: 99;
    padding: 100px 40px 40px;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-nav.open {
    right: 0;
}

.slide-nav ul {
    list-style: none;
}

.slide-nav li {
    margin-bottom: 24px;
}

.slide-nav a {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: var(--formwork);
    text-decoration: none;
    transition: color 0.3s ease;
}

.slide-nav a:hover {
    color: var(--botanical);
}

/* --- Growth Line SVG --- */
#growth-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.35;
}

#growth-path {
    stroke-dasharray: 8000;
    stroke-dashoffset: 8000;
}

/* --- Floors --- */
.floor {
    position: relative;
    z-index: 2;
    min-height: 100vh;
}

/* --- Floor 1: Foundation --- */
.floor--foundation {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 15%;
}

.floor__content {
    position: relative;
    width: 100%;
}

.foundation-title .headline {
    opacity: 0;
    transition: opacity 0ms;
}

.foundation-title .headline.visible {
    opacity: 1;
}

.foundation-title .subtitle {
    margin-top: 16px;
}

/* --- Floor 2: Catalogue --- */
.floor--catalogue {
    padding: 80px 5%;
    display: flex;
    align-items: center;
}

.grid-row {
    display: grid;
    grid-template-columns: 5fr 16px 7fr;
    gap: 0;
    width: 100%;
    min-height: 70vh;
    align-items: stretch;
}

/* --- Block System --- */
.block {
    position: relative;
    padding: 48px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.block--text {
    background-color: var(--concrete-base);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.block--illustration {
    background-color: var(--paper-inset);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Dot screen overlay */
    background-image: radial-gradient(circle, rgba(0,0,0,0.04) 1px, transparent 1px);
    background-size: 6px 6px;
    /* Pressed specimen effect */
    transform: scaleY(0.97);
}

.block--illustration:hover {
    background-image: radial-gradient(circle, rgba(0,0,0,0.08) 1px, transparent 1px);
    background-size: 6px 6px;
}

.block--joint {
    background-color: var(--joint-dark);
    padding: 0;
    min-width: 16px;
    min-height: 16px;
}

.block--joint-v {
    grid-row: span 2;
}

.block--joint-h {
    grid-column: 1 / -1;
    min-height: 8px;
    max-height: 8px;
}

.block--void {
    background-color: var(--concrete-base);
    background-image: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0.025) 0px,
        rgba(0,0,0,0.025) 0.5px,
        transparent 0.5px,
        transparent 4px
    );
    min-height: 120px;
}

/* --- Botanical SVGs --- */
.botanical-svg {
    width: 100%;
    max-width: 350px;
    height: auto;
}

.fern-svg {
    max-width: 300px;
}

.draw-in path,
.draw-in line,
.draw-in ellipse,
.draw-in circle {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2000ms ease-out;
}

.draw-in.drawn path,
.draw-in.drawn line,
.draw-in.drawn ellipse,
.draw-in.drawn circle {
    stroke-dashoffset: 0;
}

/* --- Floor 3: Specimens --- */
.floor--specimens {
    padding: 40px 5%;
}

.grid-specimens {
    display: grid;
    grid-template-columns: 1fr 1fr 16px 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0;
    width: 100%;
}

.grid-specimens .block--sm {
    min-height: 350px;
    padding: 32px;
}

.grid-specimens .block--sm .botanical-svg {
    max-width: 200px;
}

/* --- Floor 4: Canopy --- */
.floor--canopy {
    padding: 40px 5%;
    background-color: var(--canopy-bg);
    background-image: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0.025) 0px,
        rgba(0,0,0,0.025) 0.5px,
        transparent 0.5px,
        transparent 4px
    );
}

.grid-canopy {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    width: 100%;
}

.grid-canopy .block--xs {
    min-height: 280px;
    padding: 28px;
}

.grid-canopy .block--xs .botanical-svg {
    max-width: 160px;
}

.grid-canopy .block--joint-h {
    grid-column: 1 / -1;
}

/* --- Floor 5: Root --- */
.floor--root {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 10%;
}

.root-block {
    width: 80%;
    max-width: 900px;
    background-color: var(--concrete-base);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
    padding: 60px;
    text-align: center;
    position: relative;
}

.root-system-svg {
    max-width: 400px;
    margin: 0 auto 40px;
    display: block;
}

.root-contact {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

.contact-line {
    margin-bottom: 8px;
    color: var(--concrete-deep);
}

/* --- Reveal Animation --- */
.reveal-block {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.reveal-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Cross-hatch hover overlay --- */
.block::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(
            45deg,
            rgba(0,0,0,0.02) 0px,
            rgba(0,0,0,0.02) 0.5px,
            transparent 0.5px,
            transparent 6px
        ),
        repeating-linear-gradient(
            -45deg,
            rgba(0,0,0,0.02) 0px,
            rgba(0,0,0,0.02) 0.5px,
            transparent 0.5px,
            transparent 6px
        );
    transition: opacity 0.4s ease;
}

.block:hover::after {
    opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .grid-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .grid-row .block--joint {
        min-height: 8px;
        min-width: 100%;
    }
    .grid-specimens {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .grid-specimens .block--joint-v {
        display: none;
    }
    .grid-canopy {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .floor--foundation {
        padding: 0 8%;
    }
    .root-block {
        width: 95%;
        padding: 40px 24px;
    }
}

@media (max-width: 600px) {
    .grid-specimens {
        grid-template-columns: 1fr;
    }
    .grid-canopy {
        grid-template-columns: 1fr;
    }
}
