/* ============================================================
   gunsul.quest — Structural Specification Stylesheet
   Brutalist Design System / Monochrome + Oxide Red (#C62828)
   Fonts: Bebas Neue (display), IBM Plex Mono (body)
   Palette: #F0F0F0, #1A1A1A, #2C2C2C, #D4D4D4, #E8E8E8,
            #3A3A3A, #C62828, #000000
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.1vw, 1rem);
    line-height: 1.75;
    color: #2C2C2C;
    background-color: #F0F0F0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Engineering Grid Overlay ---
   Persistent 1px grid at 48px intervals, #3A3A3A at 8% opacity.
   Fixed position — never scrolls. The drafting surface beneath all content. */
#grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M 48 0 L 0 0 0 48' fill='none' stroke='%233A3A3A' stroke-width='1' opacity='0.08'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-attachment: fixed;
}

/* --- Bay Base Styles ---
   Each bay occupies 80-100vh, stacked in single-column vertical descent. */
.bay {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.bay-statement {
    min-height: 100vh;
}

.bay-evidence {
    min-height: 80vh;
    padding: 96px 0;
}

.bay-foundation {
    min-height: 60vh;
}

/* --- Bay Surface Colors ---
   Light bays: #F0F0F0 (off-white concrete)
   Dark bays:  #1A1A1A (charcoal formwork) */
.bay-light {
    background-color: #F0F0F0;
    color: #2C2C2C;
}

.bay-dark {
    background-color: #1A1A1A;
    color: #E8E8E8;
}

/* --- Bay Content Column ---
   720px centered on desktop, narrow concrete corridor. */
.bay-content {
    width: 720px;
    max-width: calc(100vw - 96px);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* --- Bay Numbers ---
   11px Bebas Neue at 40% opacity, like stamped numbers on precast panels. */
.bay-number {
    position: absolute;
    top: 24px;
    left: 24px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    opacity: 0;
    z-index: 3;
    transition: opacity 200ms ease, color 200ms ease;
    letter-spacing: 0.05em;
}

.bay-light .bay-number {
    color: #2C2C2C;
}

.bay-dark .bay-number {
    color: #E8E8E8;
}

.bay-number.visible {
    opacity: 0.4;
}

/* On hover, bay numbers turn oxide red at higher opacity */
.bay:hover .bay-number.visible {
    color: #C62828;
    opacity: 0.8;
}

/* --- Bay Annotations ---
   10px Bebas Neue, letter-spacing 0.2em, #3A3A3A at 50% opacity.
   Labels: ELEVATION, SECTION, DETAIL */
.bay-annotation {
    position: absolute;
    top: 24px;
    left: 60px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0;
    z-index: 3;
    transition: opacity 200ms ease;
}

.bay-light .bay-annotation {
    color: #3A3A3A;
}

.bay-dark .bay-annotation {
    color: #3A3A3A;
}

.bay-annotation.visible {
    opacity: 0.5;
}

/* --- Bay Dividers (Oxide Red Rules) ---
   2px #C62828 horizontal rules separating bays.
   Pulse animation: opacity oscillates 0.7-1.0 over 3s (laser level effect). */
.bay-divider {
    width: 100%;
    height: 2px;
    background-color: #C62828;
    position: relative;
    z-index: 5;
    animation: redLinePulse 3s ease-in-out infinite;
}

@keyframes redLinePulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1.0; }
}

/* Double-line section divider: two 1px rules spaced 8px apart,
   like a cut-line on an engineering drawing. */
.bay-divider::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background-color: #C62828;
    margin-top: 8px;
    animation: redLinePulse 3s ease-in-out infinite;
}

/* --- Cross-Hatch Overlay (hover effect) ---
   Diagonal lines at 45deg, 1px, #3A3A3A at 12% opacity.
   Simulates section-cut hatching in architectural drawings. */
.cross-hatch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 400ms ease;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cline x1='0' y1='0' x2='20' y2='20' stroke='%233A3A3A' stroke-width='0.5'/%3E%3Cline x1='20' y1='0' x2='0' y2='20' stroke='%233A3A3A' stroke-width='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

.bay:hover .cross-hatch {
    opacity: 0.12;
}

/* --- Hero Title (Bay 01) ---
   Bebas Neue at max size, flush-left. The domain name IS the statement. */
.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(3.5rem, 10vw, 8rem);
    line-height: 0.95;
    color: #E8E8E8;
    text-transform: uppercase;
    text-align: left;
}

/* Stagger reveal: opacity 0->1, translateY 24px->0, 600ms cubic-bezier */
.hero-line {
    display: block;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.hero-line.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ".QUEST" line with extending oxide-red rule to the right margin */
.hero-line-quest {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
}

.red-line-extend {
    display: inline-block;
    height: 2px;
    background-color: #C62828;
    flex-grow: 1;
    margin-left: 16px;
    min-width: 60px;
    animation: redLinePulse 3s ease-in-out infinite;
}

/* --- Statement Headings (Bay 03) ---
   Bebas Neue secondary size, flush-left. Blunt declarations. */
.statement-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.1;
    color: #E8E8E8;
    text-transform: uppercase;
    text-align: left;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.statement-heading.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Red Line Marker ---
   Structural oxide-red rule above statement text. */
.red-line-marker {
    width: 100%;
    height: 2px;
    background-color: #C62828;
    margin-bottom: 32px;
    animation: redLinePulse 3s ease-in-out infinite;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.red-line-marker.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Image Containers ---
   Full column width (720px), no rounded corners, concrete panels. */
.image-container {
    width: 100%;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.image-container.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* 1px solid #3A3A3A border — the edge of a formwork mold */
.image-reveal {
    overflow: hidden;
    border: 1px solid #3A3A3A;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

/* Monochrome filter + horizontal wipe reveal via clip-path.
   The wipe mimics pulling a blueprint from a flat file drawer. */
.bay-image {
    display: block;
    width: 100%;
    height: auto;
    filter: grayscale(100%) contrast(1.2);
    clip-path: inset(0 100% 0 0);
    transition: clip-path 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.image-container.revealed .bay-image {
    clip-path: inset(0 0 0 0);
}

/* --- Image Captions ---
   L-bracket dimension line (16px horizontal, 8px vertical) + Bebas Neue label. */
.image-caption {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
}

.caption-bracket {
    display: inline-block;
    width: 16px;
    height: 8px;
    border-left: 1px solid #3A3A3A;
    border-bottom: 1px solid #3A3A3A;
    flex-shrink: 0;
    margin-top: 4px;
}

.caption-on-dark .caption-bracket {
    border-color: #D4D4D4;
}

.caption-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.5;
}

.bay-light .caption-text {
    color: #3A3A3A;
}

.bay-dark .caption-text {
    color: #D4D4D4;
}

/* --- Bay Text ---
   IBM Plex Mono body text, flush-left, ragged-right. No justified text. */
.bay-text {
    text-align: left;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.bay-text.revealed {
    opacity: 1;
    transform: translateY(0);
}

.bay-text p {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.1vw, 1rem);
    line-height: 1.75;
    margin-bottom: 32px;
}

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

.bay-light .bay-text p {
    color: #2C2C2C;
}

.bay-dark .bay-text p {
    color: #D4D4D4;
}

/* --- Foundation Bay (Final) ---
   Domain name repeated at 2rem, centered, with oxide-red rule above.
   Copyright notice at 12px IBM Plex Mono. */
.bay-foundation .bay-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.foundation-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: 2rem;
    color: #E8E8E8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.foundation-title.revealed {
    opacity: 1;
    transform: translateY(0);
}

.foundation-designation {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: #D4D4D4;
    opacity: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transform: translateY(24px);
    transition: opacity 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.foundation-designation.revealed {
    opacity: 0.5;
    transform: translateY(0);
}

.red-line-marker + .foundation-title {
    margin-top: 0;
}

/* --- Hover States ---
   Faint oxide-red blush: #C62828 at 15% opacity as background fill. */
.bay-light:hover {
    box-shadow: inset 0 0 0 9999px rgba(198, 40, 40, 0.03);
}

.bay-dark:hover {
    box-shadow: inset 0 0 0 9999px rgba(198, 40, 40, 0.03);
}

/* --- Responsive: Tablet ---
   Column width: calc(100vw - 96px), maintaining 48px margins. */
@media (max-width: 960px) {
    .bay-content {
        width: calc(100vw - 96px);
        max-width: calc(100vw - 96px);
    }
}

/* --- Responsive: Mobile ---
   Column width: calc(100vw - 32px), 16px margins. */
@media (max-width: 600px) {
    .bay-content {
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
    }

    .bay-evidence {
        padding: 64px 0;
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .statement-heading {
        font-size: clamp(1.5rem, 6vw, 3rem);
    }

    .bay-number {
        top: 16px;
        left: 16px;
    }

    .bay-annotation {
        top: 16px;
        left: 48px;
    }
}

/* --- No border-radius anywhere ---
   Brutalism demands right angles. */
img, div, section, svg {
    border-radius: 0 !important;
}

/* --- Selection color ---
   Oxide-red at 20% opacity */
::selection {
    background-color: rgba(198, 40, 40, 0.2);
    color: inherit;
}
