/* ============================================================
   opensource.bid -- Terracotta Isometric City
   Stacked sections, fade-reveal only, no parallax, no stagger.
   ============================================================ */

:root {
    /* Palette */
    --color-kiln-fire:      #C67B4F;
    --color-fired-earth:    #8B4513;
    --color-sandstone:      #F5E1D0;
    --color-kiln-wash:      #FFF8F0;
    --color-verdigris:      #5B8C7A;
    --color-kiln-smoke:     #3A2E28;
    --color-ember-glow:     #D4602E;
    --color-dry-dust:       #E8C9A0;

    /* Type families */
    --font-display: "Nunito", "Inter", system-ui, sans-serif;
    --font-label:   "Quicksand", "Inter", system-ui, sans-serif;
    --font-body:    "Nunito Sans", "Inter", system-ui, sans-serif;
    --font-mono:    "Source Code Pro", "Space Mono", ui-monospace, monospace;

    /* Spacing */
    --gap-section: 48px;
    --rail-width: 8px;
}

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

html {
    background: var(--color-kiln-wash);
    color: var(--color-kiln-smoke);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--color-kiln-wash);
    overflow: hidden;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ----------------------------------------------------------------
   Fixed Wordmark (top-left)
   ---------------------------------------------------------------- */

.wordmark {
    position: fixed;
    top: 28px;
    left: 36px;
    z-index: 60;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.01em;
    color: var(--color-kiln-smoke);
    text-decoration: none;
    padding: 8px 14px;
    background: var(--color-kiln-wash);
    border: 2px solid var(--color-kiln-smoke);
    box-shadow: 4px 4px 0 var(--color-kiln-fire);
    transition: box-shadow 0.25s ease-out, transform 0.25s ease-out;
}

.wordmark:hover {
    box-shadow: 6px 6px 0 var(--color-ember-glow);
    transform: translate(-2px, -2px);
}

.wordmark-bracket {
    color: var(--color-kiln-fire);
    font-size: 22px;
    line-height: 1;
}

.wordmark-text {
    font-size: 15px;
}

/* ----------------------------------------------------------------
   Vertical Progress Rail (right edge)
   ---------------------------------------------------------------- */

.progress-rail {
    position: fixed;
    top: 50%;
    right: 32px;
    transform: translateY(-50%);
    z-index: 60;
    width: var(--rail-width);
    height: 50vh;
    pointer-events: none;
}

.progress-track {
    position: absolute;
    inset: 0;
    background: var(--color-sandstone);
    border: 1px solid var(--color-kiln-smoke);
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: var(--color-kiln-fire);
    transition: height 0.5s ease-out;
}

.progress-dots {
    position: absolute;
    inset: -4px -8px -4px -8px;
    list-style: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: auto;
}

.progress-dot {
    display: block;
    width: 22px;
    height: 22px;
    background: var(--color-kiln-wash);
    border: 2px solid var(--color-kiln-smoke);
    transform: rotate(45deg);
    cursor: pointer;
    transition: background 0.25s ease-out, transform 0.25s ease-out;
}

.progress-dot.active {
    background: var(--color-kiln-fire);
}

.progress-dot:hover {
    background: var(--color-ember-glow);
}

/* ----------------------------------------------------------------
   Scroll Container with snap
   ---------------------------------------------------------------- */

.scroll-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

.scroll-container::-webkit-scrollbar { width: 0; }
.scroll-container { scrollbar-width: none; }

/* ----------------------------------------------------------------
   Sections
   ---------------------------------------------------------------- */

.section {
    position: relative;
    height: 100vh;
    width: 100vw;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 4px solid var(--color-fired-earth);
}

.section:last-child {
    border-bottom: none;
}

.section-hero {
    background: var(--color-kiln-wash);
}

.section-repository {
    background: linear-gradient(180deg, var(--color-kiln-wash) 0%, var(--color-sandstone) 100%);
}

.section-forge {
    background: var(--color-sandstone);
}

.section-commons {
    background: linear-gradient(180deg, var(--color-sandstone) 0%, var(--color-dry-dust) 100%);
}

.section-marketplace {
    background: var(--color-dry-dust);
}

/* faint isometric grid backdrop */
.iso-grid-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(
            60deg,
            transparent 0,
            transparent 39px,
            rgba(58, 46, 40, 0.05) 39px,
            rgba(58, 46, 40, 0.05) 40px
        ),
        repeating-linear-gradient(
            -60deg,
            transparent 0,
            transparent 39px,
            rgba(58, 46, 40, 0.05) 39px,
            rgba(58, 46, 40, 0.05) 40px
        );
}

/* watermark glyphs at section edges */
.watermark {
    position: absolute;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 180px;
    line-height: 1;
    color: var(--color-dry-dust);
    opacity: 0.55;
    pointer-events: none;
    user-select: none;
    transform: rotate(-15deg);
    z-index: 1;
    letter-spacing: -0.05em;
}

.watermark-tl { top: -20px; left: -10px; }
.watermark-tr { top: 60px; right: -20px; }
.watermark-bl { bottom: 40px; left: -30px; }
.watermark-br { bottom: -30px; right: -20px; }

/* ----------------------------------------------------------------
   Section Grid: 60/40 split
   ---------------------------------------------------------------- */

.section-grid {
    position: relative;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 80px 96px;
    display: grid;
    grid-template-columns: 60% 40%;
    align-items: center;
    gap: 64px;
    z-index: 2;
}

.scene-pane {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iso-scene {
    width: 100%;
    max-width: 600px;
    height: auto;
    filter: drop-shadow(0 12px 0 rgba(58, 46, 40, 0.08));
}

.text-pane {
    display: flex;
    flex-direction: column;
    gap: var(--gap-section);
    max-width: 460px;
}

/* ----------------------------------------------------------------
   Typography
   ---------------------------------------------------------------- */

.eyebrow {
    font-family: var(--font-label);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-fired-earth);
    display: inline-block;
    padding: 4px 0;
    border-top: 2px solid var(--color-kiln-fire);
    border-bottom: 2px solid var(--color-kiln-fire);
    align-self: flex-start;
}

.display {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(40px, 5.2vw, 68px);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--color-kiln-smoke);
}

.display .accent {
    color: var(--color-kiln-fire);
    position: relative;
    white-space: nowrap;
}

.display .accent::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    bottom: -4px;
    height: 6px;
    background: var(--color-dry-dust);
    z-index: -1;
}

.lede {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    color: var(--color-kiln-smoke);
    max-width: 560px;
}

.lede code {
    font-family: var(--font-mono);
    font-size: 0.92em;
    background: var(--color-sandstone);
    padding: 2px 8px;
    border-radius: 2px;
    color: var(--color-fired-earth);
    border: 1px solid var(--color-dry-dust);
}

.muted-note {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-fired-earth);
    font-style: italic;
    line-height: 1.55;
}

/* meta pills */
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.meta-pill {
    font-family: var(--font-label);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-kiln-smoke);
    padding: 8px 14px;
    background: var(--color-kiln-wash);
    border: 2px solid var(--color-kiln-smoke);
    box-shadow: 3px 3px 0 var(--color-kiln-fire);
}

.meta-pill em {
    color: var(--color-kiln-fire);
    font-style: normal;
    font-weight: 800;
    margin-right: 6px;
}

/* bullet list */
.bullet-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bullet-list li {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--color-kiln-smoke);
    display: flex;
    gap: 12px;
    align-items: baseline;
    line-height: 1.5;
}

.bullet-bracket {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--color-kiln-fire);
    font-size: 18px;
    flex-shrink: 0;
}

/* quote */
.quote-block {
    position: relative;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 22px;
    line-height: 1.35;
    color: var(--color-fired-earth);
    padding: 16px 36px;
    background: var(--color-kiln-wash);
    border-left: 4px solid var(--color-kiln-fire);
    border-right: 4px solid var(--color-kiln-fire);
}

.quote-block p {
    display: inline;
    font-style: italic;
}

.quote-bracket {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 64px;
    line-height: 1;
    color: var(--color-dry-dust);
    position: absolute;
    pointer-events: none;
}

.quote-bracket:first-child {
    top: -12px;
    left: 6px;
}

.quote-bracket:last-child {
    bottom: -34px;
    right: 6px;
}

/* code block */
.code-block {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    background: var(--color-kiln-smoke);
    color: var(--color-sandstone);
    padding: 20px 24px;
    border: 2px solid var(--color-kiln-smoke);
    box-shadow: 6px 6px 0 var(--color-kiln-fire);
    overflow-x: auto;
    position: relative;
}

.code-block code {
    color: var(--color-kiln-wash);
    display: block;
}

.code-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--color-verdigris);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}

/* ----------------------------------------------------------------
   Section 5: Marketplace stall grid
   ---------------------------------------------------------------- */

.stall-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stall-card {
    background: var(--color-kiln-wash);
    border: 2px solid var(--color-kiln-smoke);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 4px 4px 0 var(--color-fired-earth);
    transition: box-shadow 0.25s ease-out, transform 0.25s ease-out;
}

.stall-card:hover {
    box-shadow: 6px 6px 0 var(--color-kiln-fire);
    transform: translate(-2px, -2px);
}

.stall-icon {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 22px;
    color: var(--color-kiln-fire);
    line-height: 1;
}

.stall-card h3 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 18px;
    color: var(--color-kiln-smoke);
    letter-spacing: -0.01em;
}

.stall-card p {
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-fired-earth);
}

/* ----------------------------------------------------------------
   Footer (inside last section)
   ---------------------------------------------------------------- */

.city-footer {
    position: absolute;
    bottom: 24px;
    left: 96px;
    right: 96px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-label);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-fired-earth);
    padding-top: 16px;
    border-top: 2px solid var(--color-fired-earth);
    z-index: 3;
}

.footer-mark {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--color-kiln-fire);
    font-size: 14px;
    letter-spacing: 0.04em;
}

/* ----------------------------------------------------------------
   Chevron Divider strip (bottom of each section)
   ---------------------------------------------------------------- */

.chevron-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 24px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'><polyline points='0,24 24,0 48,24' fill='none' stroke='%23C67B4F' stroke-width='3'/></svg>");
    background-repeat: repeat-x;
    background-position: 0 0;
    background-size: 48px 24px;
    pointer-events: none;
    z-index: 4;
}

/* ----------------------------------------------------------------
   Scroll Cue (bottom-center pulsing chevron)
   ---------------------------------------------------------------- */

.scroll-cue {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-kiln-wash);
    border: 2px solid var(--color-kiln-fire);
    text-decoration: none;
    z-index: 5;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}

/* ----------------------------------------------------------------
   Fade-Reveal: opacity-only, no transforms.
   Initial state: hidden. Active section reveals children.
   ---------------------------------------------------------------- */

[data-fade] {
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.section.in-view [data-fade] {
    opacity: 1;
}

/* ----------------------------------------------------------------
   Responsive: stack at 768px and below.
   ---------------------------------------------------------------- */

@media (max-width: 1024px) {
    .section-grid {
        padding: 64px 48px;
        gap: 40px;
    }
    .text-pane { gap: 32px; }
    .display { font-size: clamp(34px, 5vw, 52px); }
}

@media (max-width: 768px) {
    html { font-size: 15px; }

    .wordmark {
        top: 16px;
        left: 16px;
        font-size: 14px;
        padding: 6px 10px;
        box-shadow: 3px 3px 0 var(--color-kiln-fire);
    }

    .progress-rail {
        top: auto;
        right: auto;
        bottom: 12px;
        left: 50%;
        transform: translateX(-50%) rotate(-90deg);
        transform-origin: center center;
        height: 8px;
        width: 40vh;
    }

    .section-grid {
        grid-template-columns: 1fr;
        padding: 56px 24px;
        gap: 24px;
        height: 100%;
        align-content: center;
    }

    .scene-pane {
        height: 38vh;
    }

    .iso-scene {
        max-width: 320px;
        transform: scale(0.92);
    }

    .text-pane {
        gap: 20px;
        max-width: 100%;
    }

    .display { font-size: clamp(28px, 7vw, 36px); }
    .lede { font-size: 15px; }

    .stall-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .city-footer {
        left: 24px;
        right: 24px;
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .watermark { font-size: 110px; }
}

/* prefers-reduced-motion: turn off scroll-cue pulse and snap force */
@media (prefers-reduced-motion: reduce) {
    .scroll-cue { animation: none; opacity: 0.7; }
    [data-fade] { transition: opacity 0.2s linear; }
}
