/* ========================================
   gunsul.quest - Construction Site Golden Hour
   ======================================== */

:root {
    --kiln-wash: #F0E0CE;
    --fired-clay: #C2704F;
    --charred-timber: #2E1F14;
    --dust-trail: #7A5C48;
    --kiln-orange: #D4714E;
    --patina-sage: #8B9E7A;
    --concrete-mist: #E8D5C0;
    --ember-glow: #E8915A;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    background-color: var(--kiln-wash);
    color: var(--charred-timber);
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* --- Grain Overlay --- */
.grain-overlay {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    pointer-events: none;
    z-index: 9998;
    mix-blend-mode: multiply;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='1 0.1 0 0 0 0 0.9 0.1 0 0 0 0 0.8 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* --- Typography --- */
h1 {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--charred-timber);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 3.6rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

p {
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    margin-bottom: 1.5rem;
}

.material-label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    letter-spacing: 0.06em;
    color: var(--dust-trail);
    display: block;
    margin-top: 0.5rem;
}

.material-annotation {
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    color: var(--kiln-orange);
    display: block;
    margin-top: 0.5rem;
}

/* --- Construction Grid --- */
.construction-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4vw;
}

/* --- Sections --- */
.section {
    position: relative;
    scroll-snap-align: start;
}

/* Section 0: Foundation */
.section-foundation {
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    padding-bottom: 15vh;
}

.foundation-name {
    grid-column: 1 / span 3;
}

/* Section 1: Scaffolding */
.section-scaffolding {
    min-height: 120vh;
    padding: 15vh 0;
    display: flex;
    align-items: center;
}

.scaffolding-content {
    grid-column: 3 / span 4;
}

.scaffolding-text {
    line-height: 2.4;
    font-size: clamp(1rem, 1.4vw, 1.15rem);
}

/* Section 2: Materials */
.section-materials {
    min-height: 150vh;
    padding: 10vh 0;
}

.material-block {
    padding: 2rem 0;
}

.material-left {
    grid-column: 2 / span 3;
}

.material-right {
    grid-column: 7 / span 4;
}

.material-center {
    grid-column: 3 / span 3;
}

.material-spacer {
    height: 18vh;
}

.material-body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    letter-spacing: 0.01em;
    line-height: 1.75;
}

/* Section 3: Horizon */
.section-horizon {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.horizon-content {
    grid-column: 5 / span 4;
    text-align: center;
}

.horizon-text {
    font-family: 'Space Mono', monospace;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    letter-spacing: 0.08em;
    color: var(--charred-timber);
    margin-bottom: 0.5rem;
}

.horizon-subtext {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: var(--dust-trail);
}

/* --- Construction Lines --- */
.construction-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.cline {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.2s ease;
}

.construction-lines.drawn .cline {
    stroke-dashoffset: 100;
}

/* --- Blueprint Ghosts --- */
.blueprint-ghost {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.ghost-1 {
    width: 150px;
    height: 150px;
    top: 20%;
    right: 15%;
}

.ghost-2 {
    width: 180px;
    height: 120px;
    bottom: 25%;
    left: 8%;
}

/* --- Bubble System --- */
.bubble-system {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9997;
}

.bubble {
    position: absolute;
    will-change: transform;
}

.bubble-1 {
    width: 120px;
    height: 120px;
    animation: bubbleWobble1 5s ease-in-out infinite;
}

.bubble-2 {
    width: 80px;
    height: 80px;
    animation: bubbleWobble2 4.5s ease-in-out infinite;
}

.bubble-3 {
    width: 50px;
    height: 50px;
    animation: bubbleWobble1 6s ease-in-out infinite;
}

.bubble-4 {
    width: 30px;
    height: 30px;
    animation: bubbleWobble2 4s ease-in-out infinite;
}

@keyframes bubbleWobble1 {
    0%, 100% { border-radius: 50% 48% 52% 50% / 50% 52% 48% 50%; }
    33% { border-radius: 48% 52% 50% 50% / 52% 50% 50% 48%; }
    66% { border-radius: 52% 50% 48% 50% / 48% 50% 52% 50%; }
}

@keyframes bubbleWobble2 {
    0%, 100% { border-radius: 50% 52% 48% 50% / 48% 50% 52% 50%; }
    50% { border-radius: 48% 50% 52% 50% / 52% 48% 50% 50%; }
}

/* --- Reveal --- */
[data-reveal] {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .foundation-name { grid-column: 1 / span 6; }
    .scaffolding-content { grid-column: 2 / span 8; }
    .material-left { grid-column: 1 / span 8; }
    .material-right { grid-column: 3 / span 9; }
    .material-center { grid-column: 2 / span 8; }
    .horizon-content { grid-column: 2 / span 10; }
    .material-spacer { height: 10vh; }
}
