/* gabs.boo - Design Language Stylesheet */
/* Colors: #3d1b5e #5a5a6e #b89c6a #6b1d3a #1a1a1f #f0e8d8 #143d2b #0f1b3d #0a0a14 #e8dcc8 */
/* Fonts: Commissioner, Space Mono */

:root {
    --amethyst: #3d1b5e;
    --slate: #5a5a6e;
    --gold: #b89c6a;
    --garnet: #6b1d3a;
    --near-black: #1a1a1f;
    --cream: #f0e8d8;
    --emerald: #143d2b;
    --sapphire: #0f1b3d;
    --deep-black: #0a0a14;
    --parchment: #e8dcc8;

    --font-display: 'Commissioner', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    font-family: var(--font-display);
    background-color: var(--deep-black);
    color: var(--cream);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* SVG Filters - Hidden */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Global Noise Overlay */
.noise-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.08;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* Courtyard Base */
.courtyard {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
}

.courtyard-inner {
    width: 100%;
    max-width: 1200px;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
}

/* Section Markers */
.section-marker {
    position: absolute;
    top: 3rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.marker-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    opacity: 0.4;
    color: var(--gold);
}

.marker-line {
    display: block;
    width: 40px;
    height: 1px;
    background-color: var(--gold);
    opacity: 0.3;
}

/* ============================================
   COURTYARD 1: THE THRESHOLD
   ============================================ */
.courtyard-threshold {
    background-color: var(--near-black);
    min-height: 100vh;
}

.courtyard-threshold .courtyard-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.threshold-annotation {
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 1.2s ease 0.5s forwards;
}

.threshold-annotation .annotation-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--slate);
}

.title-main {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    opacity: 0;
    animation: fadeIn 1.5s ease 0.8s forwards;
}

.title-korean {
    font-family: var(--font-display);
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 100;
    color: var(--cream);
    letter-spacing: 0.02em;
    line-height: 1;
}

.title-divider {
    display: block;
    width: 1px;
    height: 4rem;
    background-color: var(--gold);
    opacity: 0.5;
    align-self: center;
}

.title-english {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 6rem);
    font-weight: 300;
    letter-spacing: 0.06em;
    color: var(--parchment);
    text-transform: lowercase;
}

.title-suffix {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--garnet);
    letter-spacing: 0.3em;
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeIn 1.5s ease 1.2s forwards;
}

.threshold-subtitle {
    margin-top: 3rem;
    opacity: 0;
    animation: fadeIn 1.5s ease 1.6s forwards;
}

.subtitle-line {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    color: var(--slate);
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeIn 1.5s ease 2.2s forwards;
}

.scroll-line {
    display: block;
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, var(--gold), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 0.8; transform: scaleY(1.3); }
}

/* ============================================
   COURTYARD 2: THE ETYMOLOGY
   ============================================ */
.courtyard-etymology {
    background-color: var(--sapphire);
}

.etymology-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
    padding-top: 4rem;
}

.etymology-character {
    text-align: center;
}

.char-large {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(6rem, 15vw, 14rem);
    font-weight: 100;
    color: var(--cream);
    line-height: 1;
    opacity: 0.9;
    filter: url(#noise-coarse);
}

.char-romanization {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    color: var(--gold);
    margin-top: 1.5rem;
    text-transform: uppercase;
}

.etymology-definitions {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.definition-item {
    display: grid;
    grid-template-columns: 2rem auto;
    grid-template-rows: auto auto;
    gap: 0.25rem 1rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(184, 156, 106, 0.15);
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.definition-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.def-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--gold);
    opacity: 0.6;
    grid-row: 1 / 3;
    padding-top: 0.2rem;
}

.def-term {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 300;
    letter-spacing: 0.04em;
    color: var(--cream);
}

.def-desc {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--slate);
    line-height: 1.6;
}

/* ============================================
   COURTYARD 3: THE WEIGHT OF THINGS
   ============================================ */
.courtyard-weight {
    background-color: var(--amethyst);
    position: relative;
}

.courtyard-weight .courtyard-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.weight-content {
    max-width: 700px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.weight-quote {
    position: relative;
    border: none;
    padding: 0;
}

.weight-quote p {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-weight: 200;
    line-height: 1.6;
    letter-spacing: 0.02em;
    color: var(--cream);
}

.quote-mark {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 100;
    color: var(--gold);
    opacity: 0.4;
    line-height: 0;
    display: block;
    margin-bottom: 1rem;
}

.quote-mark-close {
    margin-top: 1.5rem;
    margin-bottom: 0;
    text-align: right;
}

.weight-annotation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
}

.weight-annotation .annotation-line {
    display: block;
    width: 30px;
    height: 1px;
    background-color: var(--gold);
    opacity: 0.4;
}

.weight-annotation .annotation-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--slate);
}

.weight-pattern {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    opacity: 0.06;
    z-index: 0;
    pointer-events: none;
}

.pattern-row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    padding: 0.5rem 0;
    white-space: nowrap;
}

.pattern-row span {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 100;
    color: var(--cream);
}

.pattern-row[data-row="2"] {
    transform: translateX(1rem);
}

/* ============================================
   COURTYARD 4: THE EXCHANGE
   ============================================ */
.courtyard-exchange {
    background-color: var(--near-black);
}

.courtyard-exchange .courtyard-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.exchange-content {
    width: 100%;
    max-width: 900px;
}

.exchange-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 200;
    letter-spacing: 0.06em;
    color: var(--cream);
    text-align: center;
    margin-bottom: 4rem;
}

.exchange-columns {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
}

.exchange-col {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.exchange-col-left {
    text-align: right;
}

.exchange-col-right {
    text-align: left;
}

.exchange-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.exchange-col-left .exchange-item {
    align-items: flex-end;
    transform: translateX(-20px);
}

.exchange-col-right .exchange-item {
    align-items: flex-start;
    transform: translateX(20px);
}

.exchange-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.exchange-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.5;
}

.exchange-value {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 300;
    letter-spacing: 0.04em;
    color: var(--cream);
}

.exchange-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
}

.divider-symbol {
    font-size: 1.5rem;
    color: var(--gold);
    opacity: 0.4;
}

/* ============================================
   COURTYARD 5: THE HAUNTING
   ============================================ */
.courtyard-haunting {
    background-color: var(--garnet);
    position: relative;
}

.courtyard-haunting .courtyard-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.haunting-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 900px;
}

.haunting-title {
    font-family: var(--font-mono);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    color: var(--cream);
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
}

.haunting-body {
    font-family: var(--font-display);
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    font-weight: 300;
    line-height: 1.9;
    color: var(--parchment);
    opacity: 0.85;
}

.haunting-glyphs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.glyph {
    font-size: clamp(3rem, 6vw, 5rem);
    color: var(--cream);
    opacity: 0.12;
    transition: opacity 1.5s ease;
    font-weight: 100;
}

.glyph.glyph-active {
    opacity: 0.35;
}

/* ============================================
   COURTYARD 6: THE CONTEMPLATION
   ============================================ */
.courtyard-contemplation {
    background-color: var(--emerald);
}

.courtyard-contemplation .courtyard-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.contemplation-content {
    width: 100%;
    max-width: 1000px;
}

.contemplation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background-color: rgba(184, 156, 106, 0.1);
}

.contemplation-cell {
    padding: 3rem 2.5rem;
    background-color: var(--emerald);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    cursor: default;
    transition: background-color 0.6s ease;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease, transform 0.6s ease, background-color 0.6s ease;
}

.contemplation-cell.visible {
    opacity: 1;
    transform: translateY(0);
}

.contemplation-cell:hover {
    background-color: rgba(20, 61, 43, 0.7);
}

.cell-number {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--gold);
    opacity: 0.5;
}

.cell-question {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 300;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--cream);
}

/* ============================================
   COURTYARD 7: THE COLOPHON
   ============================================ */
.courtyard-colophon {
    background-color: var(--deep-black);
}

.courtyard-colophon .courtyard-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.colophon-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.colophon-character {
    font-family: var(--font-display);
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 100;
    color: var(--cream);
    opacity: 0.15;
    line-height: 1;
}

.colophon-domain {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.3em;
    color: var(--gold);
    text-transform: lowercase;
}

.colophon-line {
    width: 40px;
    height: 1px;
    background-color: var(--gold);
    opacity: 0.3;
    margin: 1rem 0;
}

.colophon-note {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.note-text {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--slate);
    letter-spacing: 0.04em;
    line-height: 1.6;
}

.colophon-year {
    margin-top: 2rem;
}

.colophon-year span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    color: var(--slate);
    opacity: 0.4;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Courtyard threshold transitions */
.courtyard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(10, 10, 20, 0.5), transparent);
    pointer-events: none;
    z-index: 1;
}

.courtyard::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, rgba(10, 10, 20, 0.5), transparent);
    pointer-events: none;
    z-index: 1;
}

.courtyard-threshold::before,
.courtyard-colophon::after {
    display: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .courtyard-inner {
        padding: 3rem 1.5rem;
    }

    .title-main {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .title-divider {
        width: 40px;
        height: 1px;
    }

    .etymology-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .exchange-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .exchange-col-left {
        text-align: center;
    }

    .exchange-col-right {
        text-align: center;
    }

    .exchange-col-left .exchange-item,
    .exchange-col-right .exchange-item {
        align-items: center;
    }

    .exchange-divider {
        width: 100%;
        padding: 1rem 0;
    }

    .haunting-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .contemplation-grid {
        grid-template-columns: 1fr;
    }

    .contemplation-cell {
        padding: 2rem 1.5rem;
    }

    .section-marker {
        top: 2rem;
        left: 1.5rem;
    }

    .definition-item {
        grid-template-columns: 1.5rem auto;
    }
}

@media (max-width: 480px) {
    .title-korean {
        font-size: 5rem;
    }

    .title-english {
        font-size: 2.5rem;
    }

    .char-large {
        font-size: 6rem;
    }

    .weight-quote p {
        font-size: 1.3rem;
    }
}
