/* gabs.report - Flat-Design Urban Intelligence Briefing */
/* Colors: #2b303a (slate), #e07a5f (terracotta), #f0ece2 (parchment), #1a1c20 (text-dark), #c8cad0 (text-light), #6b7280 (diagram), #3d3d3d (body-dark) */

:root {
    --slate: #2b303a;
    --terracotta: #e07a5f;
    --parchment: #f0ece2;
    --text-dark: #1a1c20;
    --text-light: #c8cad0;
    --diagram: #6b7280;
    --body-dark: #3d3d3d;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 300;
    color: var(--text-dark);
    background: var(--parchment);
    overflow-x: hidden;
}

/* ====== GRID CANVAS (magnetic background) ====== */
#gridCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* ====== SPINE NAVIGATION ====== */
#spine {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 40px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#spine.visible {
    opacity: 1;
}

.spine-line {
    position: absolute;
    left: 50%;
    top: 15%;
    bottom: 15%;
    width: 1px;
    background: var(--diagram);
    opacity: 0.3;
}

.spine-dot {
    position: relative;
    width: 8px;
    height: 8px;
    background: var(--diagram);
    cursor: pointer;
    z-index: 1;
    transition: background 0.3s ease;
}

.spine-dot.active {
    background: var(--terracotta);
}

.spine-dot::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--terracotta);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.spine-dot.active::after {
    transform: scaleX(1);
}

.spine-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--terracotta);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.spine-dot:hover .spine-label {
    opacity: 1;
}

/* ====== REPORT SECTIONS ====== */
.report-section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    will-change: transform;
}

/* Grid patterns */
.grid-pattern {
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 140%;
    background-size: 40px 40px;
}

.dark-grid {
    background-image:
        linear-gradient(to right, rgba(240,236,226,0.05) 0.5px, transparent 0.5px),
        linear-gradient(to bottom, rgba(240,236,226,0.05) 0.5px, transparent 0.5px);
}

.light-grid {
    background-image:
        linear-gradient(to right, rgba(43,48,58,0.08) 0.5px, transparent 0.5px),
        linear-gradient(to bottom, rgba(43,48,58,0.08) 0.5px, transparent 0.5px);
}

/* ====== COVER SECTION ====== */
.cover-section {
    background: var(--slate);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.cover-content {
    position: relative;
    z-index: 2;
    padding: 12vh 8vw;
}

.cover-title {
    font-family: "Libre Baskerville", serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 5rem);
    letter-spacing: 0.03em;
    line-height: 1.1;
    color: var(--parchment);
}

.cover-rule {
    width: 100%;
    height: 1px;
    background: var(--diagram);
    margin: 3vh 0;
}

.cover-subtitle {
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.6rem);
    color: var(--text-light);
    letter-spacing: 0.05em;
}

.cover-date {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--terracotta);
    margin-top: 2vh;
}

.cover-watermark {
    position: absolute;
    right: -5vw;
    top: 50%;
    transform: translateY(-50%);
    font-family: "Noto Sans KR", sans-serif;
    font-weight: 900;
    font-size: 40vw;
    line-height: 1;
    color: var(--parchment);
    opacity: 0.04;
    z-index: 1;
    pointer-events: none;
    user-select: none;
}

/* ====== INTERSTITIAL BANDS ====== */
.interstitial-band {
    position: relative;
    height: 12vh;
    background: var(--terracotta);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 2;
    will-change: transform;
}

.interstitial-text {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--parchment);
}

.interstitial-glyph {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--parchment);
}

.glyph-equals {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.glyph-bar {
    display: block;
    width: 20px;
    height: 3px;
    background: var(--parchment);
}

.glyph-won {
    font-family: "IBM Plex Mono", monospace;
    font-size: 1.4rem;
    font-weight: 400;
}

.glyph-arrow {
    display: flex;
    align-items: center;
}

.glyph-arrow-line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--parchment);
}

.glyph-arrow-head {
    display: block;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid var(--parchment);
}

.glyph-grid-icon {
    display: grid;
    grid-template-columns: 8px 8px;
    gap: 3px;
}

.glyph-cell {
    display: block;
    width: 8px;
    height: 8px;
    background: var(--parchment);
}

/* ====== CONTENT SECTIONS ====== */
.content-section[data-theme="light"] {
    background: var(--parchment);
}

.content-section[data-theme="dark"] {
    background: var(--slate);
}

.section-inner {
    position: relative;
    z-index: 2;
    display: flex;
    min-height: 100vh;
    padding: 8vh 4vw 8vh 60px;
    gap: 5%;
}

.diagram-zone {
    flex: 0 0 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

.annotation-zone {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4vh 2vw;
}

/* ====== TYPOGRAPHY ====== */
.section-heading {
    font-family: "Libre Baskerville", serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 5rem);
    letter-spacing: 0.03em;
    line-height: 1.1;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.section-heading.light-text {
    color: var(--parchment);
}

.section-number {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--terracotta);
    margin-bottom: 2rem;
}

.body-text {
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    color: var(--body-dark);
    margin-bottom: 1.5rem;
}

.body-text.light-body {
    color: var(--text-light);
}

.inline-tag {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--terracotta);
    padding: 2px 6px;
    border: 1px solid var(--terracotta);
}

.cross-ref {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--terracotta);
    margin-top: 1rem;
}

.cross-ref.light-ref {
    color: var(--terracotta);
}

/* ====== CITY BLOCK DIAGRAMS ====== */
.city-block-diagram {
    width: 100%;
    max-width: 500px;
}

.diagram-title-label {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--diagram);
    margin-bottom: 1.5rem;
}

.diagram-title-label.light-label {
    color: var(--text-light);
}

.city-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    padding: 20px;
    border: 1px solid var(--diagram);
}

.grid-comparative {
    grid-template-columns: repeat(5, 1fr);
}

.building {
    height: calc(var(--h) * 12px + 20px);
    background: var(--col);
    align-self: end;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.building.animated {
    transform: scaleY(1);
}

.diagram-legend {
    display: flex;
    gap: 20px;
    margin-top: 1rem;
}

.diagram-legend.light-legend .legend-text {
    color: var(--text-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-swatch {
    display: block;
    width: 12px;
    height: 12px;
}

.legend-text {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--diagram);
}

/* ====== TRANSIT DIAGRAM ====== */
.transit-diagram {
    width: 100%;
    max-width: 500px;
}

.transit-svg {
    width: 100%;
    height: auto;
}

.transit-line {
    stroke-linecap: square;
}

.line-primary, .line-secondary {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s ease;
}

.line-primary.animated, .line-secondary.animated {
    stroke-dashoffset: 0;
}

.line-tertiary {
    opacity: 0;
    transition: opacity 0.5s ease 1.8s;
}

.line-tertiary.animated {
    opacity: 1;
}

.station-node {
    opacity: 0;
    transition: opacity 0s ease;
}

.station-node.animated {
    opacity: 1;
}

.station-label {
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    fill: var(--text-light);
    letter-spacing: 0.05em;
}

.label-secondary {
    fill: var(--diagram);
    font-size: 8px;
}

/* ====== SECTION CUT DIAGRAM ====== */
.section-cut-diagram {
    width: 100%;
    max-width: 500px;
}

.section-cut {
    border: 1px solid var(--diagram);
    overflow: hidden;
}

.cut-layer {
    position: relative;
    padding: 20px 24px;
    border-bottom: 1px solid var(--diagram);
}

.cut-layer:last-child {
    border-bottom: none;
}

.cut-layer.ground {
    background: var(--parchment);
    min-height: 60px;
}

.cut-layer.layer-1 {
    background: #e8e4da;
    min-height: 80px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.cut-layer.layer-2 {
    background: #ddd9cf;
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cut-layer.layer-3 {
    background: #d4cfc5;
    min-height: 60px;
}

.cut-label {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--diagram);
    position: absolute;
    bottom: 6px;
    right: 12px;
}

.cut-structure {
    width: 40px;
    background: var(--diagram);
    opacity: 0.5;
}

.struct-1 { height: 35px; }
.struct-2 { height: 25px; }
.struct-3 { height: 45px; }

.cut-pipe {
    height: 6px;
    background: var(--terracotta);
    opacity: 0.6;
}

.pipe-1 { width: 80px; }
.pipe-2 { width: 120px; }
.pipe-3 { width: 60px; }
.pipe-4 { width: 100px; }

.cut-foundation {
    width: 100%;
    height: 20px;
    background: var(--slate);
    opacity: 0.3;
}

/* ====== TERMINAL SECTION ====== */
.terminal-section {
    background: var(--parchment);
    display: flex;
    align-items: center;
    justify-content: center;
}

.terminal-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 8vh 8vw;
}

.terminal-gabs {
    font-family: "Noto Sans KR", sans-serif;
    font-weight: 900;
    font-size: 30vh;
    line-height: 1;
    color: var(--text-dark);
    transform: scale(0.9);
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.terminal-gabs.animated {
    transform: scale(1);
}

.terminal-annotations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.terminal-anno {
    position: absolute;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--diagram);
}

.anno-top {
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
}

.anno-right {
    top: 50%;
    right: 8%;
    transform: translateY(-50%);
}

.anno-bottom {
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
}

.anno-left {
    top: 50%;
    left: 8%;
    transform: translateY(-50%);
}

.terminal-summary {
    max-width: 600px;
    text-align: center;
    margin-top: 4vh;
}

.terminal-text {
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    color: var(--body-dark);
    margin-bottom: 1.5rem;
}

.terminal-text em {
    font-style: italic;
    color: var(--terracotta);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 900px) {
    .section-inner {
        flex-direction: column;
        padding: 6vh 5vw 6vh 50px;
    }

    .diagram-zone {
        flex: none;
        width: 100%;
    }

    .annotation-zone {
        flex: none;
        width: 100%;
        padding: 2vh 0;
    }

    .cover-watermark {
        font-size: 60vw;
        right: -10vw;
    }

    .terminal-gabs {
        font-size: 20vh;
    }

    .terminal-anno {
        font-size: 0.6rem;
    }
}

@media (max-width: 600px) {
    #spine {
        display: none;
    }

    .section-inner {
        padding: 6vh 5vw;
    }

    .cover-content {
        padding: 10vh 5vw;
    }

    .section-heading {
        font-size: clamp(1.8rem, 4vw, 3rem);
    }
}
