/* continu.st — brutalist stacked-floor architecture */

:root {
    --bg-concrete: #B8B0A8;
    --bg-charred: #3B322B;
    --bg-limestone: #E8DFD4;
    --accent-terracotta: #C4613A;
    --accent-iron: #8B4513;
    --text-anthracite: #2C2622;
    --text-bleached: #F2ECE4;
    --text-weathered: #8B7D6B;
    --grid-line: #C8BFB5;
    --line-thin: #5C5347;

    --font-display: 'Roboto Slab', 'Roboto', serif;
    --font-body: 'Libre Franklin', 'Inter', sans-serif;

    --gutter: 40px;
    --rule: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background: var(--bg-concrete);
    color: var(--text-anthracite);
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow-x: hidden;
}

p {
    max-width: 38em;
    margin-bottom: 1.2em;
}

h1, h2 {
    font-family: var(--font-display);
    text-transform: uppercase;
    color: var(--accent-terracotta);
    line-height: 0.92;
    letter-spacing: -0.02em;
}

h1 {
    font-weight: 900;
    font-size: clamp(4rem, 10vw, 9rem);
    letter-spacing: -0.03em;
}

h2 {
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
}

h2.weight-700 { font-weight: 700; }
h2.weight-900 { font-weight: 900; }
h2.size-step-1 { font-size: clamp(2.25rem, 5.25vw, 5rem); }
h2.size-step-2 { font-size: clamp(2.5rem, 5.5vw, 5.5rem); }
h2.size-step-3 { font-size: clamp(2.75rem, 5.75vw, 6rem); }
h2.size-step-4 { font-size: clamp(3rem, 6vw, 6.5rem); }

/* ---------- Floor index navigation ---------- */
.floor-index {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-right: 1px solid var(--line-thin);
    background: transparent;
    pointer-events: auto;
}

.floor-index ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.floor-num {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.15em;
    color: var(--text-weathered);
    text-decoration: none;
    transition: color 300ms ease, transform 300ms ease;
    display: inline-block;
}

.floor-num.active {
    color: var(--accent-terracotta);
}

.floor-num.pulse {
    animation: floor-pulse 300ms ease;
}

@keyframes floor-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ---------- Floor (section) base ---------- */
.floor {
    position: relative;
    min-height: 100vh;
    width: 100%;
    padding: clamp(6rem, 12vh, 10rem) clamp(4rem, 8vw, 9rem) clamp(6rem, 12vh, 10rem) calc(56px + clamp(2rem, 5vw, 5rem));
    overflow: hidden;
    border-bottom: var(--rule) solid var(--accent-iron);
    transition: opacity 300ms ease, background-color 300ms ease;
    opacity: 0.4;
}

.floor.in-view {
    opacity: 1;
}

.floor-void {
    background: var(--bg-limestone);
    color: var(--text-anthracite);
    --fg: var(--text-anthracite);
}

.floor-void:nth-of-type(odd):not(.hero) {
    background: var(--bg-concrete);
}

.hero {
    background: var(--bg-concrete);
}

.floor-mass {
    background: var(--bg-charred);
    color: var(--text-bleached);
    --fg: var(--text-bleached);
}

.floor-mass h2 {
    color: var(--accent-terracotta);
}

.floor-mass p,
.floor-mass .meta {
    color: var(--text-bleached);
}

/* Concrete grid motif */
.grid-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, var(--grid-line) 0 0.5px, transparent 0.5px 60px),
        repeating-linear-gradient(90deg, var(--grid-line) 0 0.5px, transparent 0.5px 60px);
    opacity: 0.15;
    pointer-events: none;
}

.section-label {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-weathered);
    margin-bottom: clamp(2rem, 4vh, 3.5rem);
}

.floor-mass .section-label {
    color: var(--text-weathered);
}

/* ---------- Hero ---------- */
.hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.hero-inner {
    width: 60%;
    max-width: none;
    padding-bottom: 6vh;
}

.hero-mark {
    color: var(--accent-terracotta);
}

.foundation-line {
    height: 1px;
    background: var(--line-thin);
    width: calc(100vw - 56px - clamp(2rem, 5vw, 5rem));
    margin-top: clamp(2rem, 4vh, 3rem);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero.in-view .foundation-line {
    transform: scaleX(1);
}

/* ---------- 12-column grid inside floors ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--gutter);
    row-gap: clamp(2rem, 5vh, 4rem);
    align-items: start;
}

.col-span-3  { grid-column: span 3; }
.col-span-4  { grid-column: span 4; }
.col-span-5  { grid-column: span 5; }
.col-span-6  { grid-column: span 6; }
.col-span-8  { grid-column: span 8; }
.col-span-9  { grid-column: span 9; }
.col-span-10 { grid-column: span 10; }
.col-span-12 { grid-column: 1 / -1; }

.col-start-2 { grid-column-start: 2; }
.col-start-7 { grid-column-start: 7; }
.col-start-8 { grid-column-start: 8; }
.col-start-9 { grid-column-start: 9; }

/* ---------- Block treatments ---------- */
.block-bordered {
    position: relative;
    padding-left: 1.5rem;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.block-bordered::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-iron);
    transform-origin: top;
    transform: scaleY(0);
    transition: transform 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.in-view .block-bordered::before {
    transform: scaleY(1);
}

.block-shadow {
    position: relative;
    padding: 1.5rem;
    background: var(--bg-limestone);
}

.floor-void.grid-bg .block-shadow {
    background: var(--bg-limestone);
}

.block-shadow::after {
    content: "";
    position: absolute;
    inset: 20px -20px -20px 20px;
    background: var(--text-weathered);
    opacity: 0.3;
    z-index: -1;
    pointer-events: none;
}

.meta {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-weathered);
    margin-bottom: 0.6rem;
    max-width: none;
}

/* ---------- Geometric primitives ---------- */
.beam-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 0.5rem;
}

.beam {
    display: block;
    width: 100%;
    height: 18px;
    background: var(--accent-iron);
}

.beam:nth-child(2) { background: var(--text-weathered); width: 80%; }
.beam:nth-child(3) { background: var(--accent-terracotta); width: 60%; }

.porthole {
    position: relative;
    width: 180px;
    height: 180px;
}

.circle-outer,
.circle-inner {
    position: absolute;
    border-radius: 50%;
    inset: 0;
}

.circle-outer {
    border: 6px solid var(--accent-iron);
}

.circle-inner {
    inset: 24px;
    background: var(--accent-terracotta);
}

.rebar-row {
    position: absolute;
    left: 56px;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 0;
    height: 14px;
}

.rebar-row span {
    flex: 1;
    height: 100%;
    background: var(--accent-iron);
    border-right: 2px solid var(--bg-charred);
}

.rebar-row span:last-child { border-right: none; }

.colophon .meta {
    color: var(--text-bleached);
}

.terminal {
    border-bottom: none;
}

/* ---------- Section markers (between floors) ---------- */
.section-marker {
    position: relative;
    height: 0;
    display: flex;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
}

.shape {
    display: block;
    position: absolute;
    top: -24px;
    transform: translateX(-50%) scale(0);
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section-marker.in-view .shape {
    transform: translateX(-50%) scale(1);
}

.shape-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-terracotta);
}

.shape-square {
    width: 40px;
    height: 40px;
    border: 3px solid var(--accent-iron);
    background: transparent;
    top: -20px;
}

.shape-triangle {
    width: 0;
    height: 0;
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-bottom: 38px solid var(--accent-terracotta);
    background: transparent;
    top: -19px;
}

/* ---------- Zoom-focus animation ---------- */
.zoom-target {
    transform: scale(1.08);
    filter: blur(2px);
    opacity: 0.85;
    transition:
        transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
        filter 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.in-view .zoom-target {
    transform: scale(1);
    filter: blur(0);
    opacity: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    :root { --gutter: 16px; }
    .floor {
        padding-left: calc(56px + 1.25rem);
        padding-right: 1.25rem;
    }
    .grid {
        grid-template-columns: repeat(6, 1fr);
        row-gap: 2rem;
    }
    .col-span-3, .col-span-4, .col-span-5,
    .col-span-6, .col-span-8, .col-span-9, .col-span-10 {
        grid-column: 1 / -1;
    }
    .col-start-2, .col-start-7, .col-start-8, .col-start-9 {
        grid-column-start: 1;
    }
    .hero-inner { width: 100%; }
    .floor-index { width: 44px; }
}
