/* diplomatic.boo - Coastal Blend Nordic Design */
/* Palette: Coastal Fog #EDF2F4, Nordic Slate #2B3A42, Driftwood Sand #C9B99A,
   Sea Glass #7FB5B0, Birch White #FAFBFC, Fjord Blue #B8CDD6,
   Lichen Grey #A3B4A2, Ember #D4785C, Dark Slate #3D4F5A */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: #2B3A42;
    background-color: #EDF2F4;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== Ghost Background Layer ========== */
#ghost-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ghost-shape {
    position: absolute;
    border-radius: 4px;
    will-change: transform;
}

.ghost-shape-1 {
    width: 280px;
    height: 180px;
    background-color: #B8CDD6;
    opacity: 0.06;
    top: 15%;
    left: 10%;
    transform: rotate(5deg);
}

.ghost-shape-2 {
    width: 200px;
    height: 260px;
    background-color: #C9B99A;
    opacity: 0.04;
    top: 40%;
    right: 8%;
    transform: rotate(-3deg);
}

.ghost-shape-3 {
    width: 160px;
    height: 160px;
    background-color: #7FB5B0;
    opacity: 0.05;
    top: 65%;
    left: 25%;
    border-radius: 50%;
}

.ghost-shape-4 {
    width: 240px;
    height: 140px;
    background-color: #A3B4A2;
    opacity: 0.04;
    top: 20%;
    right: 30%;
    transform: rotate(2deg);
}

.ghost-shape-5 {
    width: 120px;
    height: 200px;
    background-color: #B8CDD6;
    opacity: 0.05;
    top: 80%;
    right: 15%;
    transform: rotate(-7deg);
}

/* ========== Navigation Monogram ========== */
#nav-monogram {
    position: fixed;
    top: 32px;
    left: 32px;
    z-index: 100;
    cursor: pointer;
    color: #B8CDD6;
    opacity: 0.12;
    transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#nav-monogram:hover {
    opacity: 1;
    color: #D4785C;
    transform: scale(1.08);
}

#nav-monogram.nav-active {
    opacity: 1;
    color: #D4785C;
    transform: scale(1.08);
}

.monogram-svg {
    display: block;
}

/* ========== Navigation Overlay ========== */
#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(43, 58, 66, 0.92);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#nav-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.nav-constellation {
    position: relative;
    width: 100%;
    height: 100%;
}

.nav-point {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #FAFBFC;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#nav-overlay.active .nav-point {
    opacity: 1;
    transform: translateY(0);
}

#nav-overlay.active .nav-point:nth-child(1) { transition-delay: 0.1s; }
#nav-overlay.active .nav-point:nth-child(2) { transition-delay: 0.18s; }
#nav-overlay.active .nav-point:nth-child(3) { transition-delay: 0.26s; }
#nav-overlay.active .nav-point:nth-child(4) { transition-delay: 0.34s; }
#nav-overlay.active .nav-point:nth-child(5) { transition-delay: 0.42s; }

.nav-marker {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #7FB5B0;
    flex-shrink: 0;
    transition: background-color 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-point:hover .nav-marker {
    background-color: #D4785C;
    transform: scale(1.4);
}

.nav-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.nav-point:hover .nav-label {
    color: #D4785C;
}

.world-outline {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    max-width: 700px;
    height: auto;
    opacity: 0.4;
}

/* ========== Sections ========== */
.section {
    position: relative;
    z-index: 1;
}

.section-narrow {
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

.section-wide {
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* ========== The Threshold (Hero) ========== */
.section-threshold {
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background-color: #EDF2F4;
}

.threshold-composition {
    position: absolute;
    top: 40%;
    left: 55%;
    transform: translate(-50%, -50%);
}

.treaty-rect {
    position: absolute;
    border-radius: 4px;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.treaty-rect.visible {
    transform: scale(1);
}

.treaty-rect-1 {
    width: 220px;
    height: 300px;
    background-color: #C9B99A;
    top: -150px;
    left: -140px;
    transform: scale(0.92) rotate(3deg);
}

.treaty-rect-1.visible {
    opacity: 0.6;
    transform: scale(1) rotate(3deg);
}

.treaty-rect-2 {
    width: 180px;
    height: 260px;
    background-color: #7FB5B0;
    top: -120px;
    left: -60px;
    transform: scale(0.92) rotate(-2deg);
}

.treaty-rect-2.visible {
    opacity: 0.4;
    transform: scale(1) rotate(-2deg);
}

.treaty-rect-3 {
    width: 200px;
    height: 280px;
    background-color: #B8CDD6;
    top: -140px;
    left: -100px;
    transform: scale(0.92) rotate(1deg);
}

.treaty-rect-3.visible {
    opacity: 0.3;
    transform: scale(1) rotate(1deg);
}

.threshold-title {
    position: absolute;
    top: 70%;
    left: 50%;
    transform: translateX(-50%);
    text-align: left;
    max-width: 540px;
    width: 100%;
    padding: 0 24px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.threshold-title.visible {
    opacity: 1;
}

.site-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    color: #2B3A42;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.site-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 17px;
    color: #3D4F5A;
    margin-top: 8px;
    opacity: 0.7;
}

.hairline-connection {
    position: absolute;
    pointer-events: none;
}

.hairline-threshold {
    width: 120px;
    height: 60px;
    bottom: 15%;
    right: 20%;
    opacity: 0.5;
}

/* ========== Section Labels ========== */
.section-label {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #A3B4A2;
    margin-bottom: 20px;
}

/* ========== Content Sections ========== */
.section-corridor {
    padding-top: clamp(6rem, 12vh, 10rem);
    padding-bottom: clamp(6rem, 12vh, 10rem);
    background-color: #EDF2F4;
}

.section-corridor-alt {
    background: linear-gradient(180deg, #FAFBFC 0%, #EDF2F4 100%);
}

.section-corridor h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    color: #2B3A42;
    letter-spacing: -0.01em;
    line-height: 1.25;
    margin-bottom: 24px;
}

.section-corridor p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    color: #2B3A42;
    margin-bottom: 16px;
}

.section-corridor p:last-child {
    margin-bottom: 0;
}

/* Ember accent word */
.ember-word {
    color: #D4785C;
    font-weight: 500;
}

/* ========== The Chamber ========== */
.section-chamber {
    padding-top: clamp(6rem, 12vh, 10rem);
    padding-bottom: clamp(6rem, 12vh, 10rem);
    background: linear-gradient(180deg, #EDF2F4 0%, #FAFBFC 50%, #EDF2F4 100%);
}

.chamber-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.chamber-illustration {
    position: relative;
    margin-left: -8%;
}

.archipelago-svg {
    width: 100%;
    height: auto;
    mix-blend-mode: multiply;
}

.hairline-chamber {
    position: absolute;
    right: -20px;
    top: 50%;
    width: 60px;
    height: 100px;
}

.chamber-content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    color: #2B3A42;
    letter-spacing: -0.01em;
    line-height: 1.25;
    margin-bottom: 24px;
}

.chamber-content p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    color: #2B3A42;
    margin-bottom: 16px;
}

.chamber-content p:last-child {
    margin-bottom: 0;
}

/* ========== Signals Section ========== */
.section-signals {
    padding-top: clamp(6rem, 12vh, 10rem);
    padding-bottom: clamp(6rem, 12vh, 10rem);
    background-color: #EDF2F4;
}

.signals-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.signals-content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    color: #2B3A42;
    letter-spacing: -0.01em;
    line-height: 1.25;
    margin-bottom: 24px;
}

.signals-content p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    color: #2B3A42;
    margin-bottom: 16px;
}

.signals-content p:last-child {
    margin-bottom: 0;
}

.signals-illustration {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: flex-end;
    margin-right: -10%;
}

.signal-flag {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    border-radius: 4px;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.signal-flag.visible {
    opacity: 1;
    transform: scale(1);
}

.signal-flag-1 {
    width: 120px;
    height: 80px;
}

.signal-flag-1 .fq-tl { background-color: #7FB5B0; }
.signal-flag-1 .fq-tr { background-color: #C9B99A; }
.signal-flag-1 .fq-bl { background-color: #EDF2F4; }
.signal-flag-1 .fq-br { background-color: #2B3A42; }

.signal-flag-2 {
    width: 100px;
    height: 70px;
    margin-right: 30px;
}

.signal-flag-2 .fq-tl { background-color: #B8CDD6; }
.signal-flag-2 .fq-tr { background-color: #A3B4A2; }
.signal-flag-2 .fq-bl { background-color: #C9B99A; }
.signal-flag-2 .fq-br { background-color: #7FB5B0; }

.signal-flag-3 {
    width: 140px;
    height: 90px;
    margin-right: 10px;
}

.signal-flag-3 .fq-tl { background-color: #2B3A42; }
.signal-flag-3 .fq-tr { background-color: #B8CDD6; }
.signal-flag-3 .fq-bl { background-color: #7FB5B0; }
.signal-flag-3 .fq-br { background-color: #EDF2F4; }

.flag-quadrant {
    width: 100%;
    height: 100%;
}

/* ========== The Archive (Footer) ========== */
.section-archive {
    background-color: #FAFBFC;
    padding: clamp(6rem, 12vh, 10rem) 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.archive-monogram {
    margin-bottom: 60px;
    opacity: 0.8;
}

.archive-directory {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    max-width: 820px;
    margin-bottom: 60px;
}

.archive-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.archive-marker {
    width: 6px;
    height: 6px;
    background-color: #A3B4A2;
    border-radius: 1px;
    transform: rotate(45deg);
    flex-shrink: 0;
}

.archive-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #A3B4A2;
}

.archive-value {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 15px;
    color: #2B3A42;
}

.archive-footer-line {
    text-align: center;
}

.archive-footer-line p {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #A3B4A2;
}

/* ========== Content Reveal Animations ========== */
.content-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.content-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Arch shapes for staggered entrance */
.arch-shape {
    opacity: 0;
    transform-origin: center;
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.arch-shape.visible {
    opacity: 1;
}

/* ========== Link Styles ========== */
a {
    color: #2B3A42;
    text-decoration: none;
    position: relative;
}

.section-corridor a::after,
.chamber-content a::after,
.signals-content a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #7FB5B0;
    transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section-corridor a:hover::after,
.chamber-content a:hover::after,
.signals-content a:hover::after {
    width: 100%;
}

.section-corridor a:hover,
.chamber-content a:hover,
.signals-content a:hover {
    color: #3D4F5A;
}

/* ========== Grid Dot Background Pattern ========== */
@media (min-width: 769px) {
    .section-corridor::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: radial-gradient(circle, #B8CDD6 1px, transparent 1px);
        background-size: 40px 40px;
        opacity: 0.08;
        pointer-events: none;
        z-index: -1;
    }

    .section-corridor {
        position: relative;
    }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .chamber-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .chamber-illustration {
        margin-left: 0;
        order: -1;
    }

    .signals-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .signals-illustration {
        margin-right: 0;
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .signal-flag-2 {
        margin-right: 0;
    }

    .signal-flag-3 {
        margin-right: 0;
    }

    .threshold-composition {
        left: 50%;
    }

    .treaty-rect-1 {
        width: 160px;
        height: 220px;
    }

    .treaty-rect-2 {
        width: 140px;
        height: 190px;
    }

    .treaty-rect-3 {
        display: none;
    }

    #nav-monogram {
        opacity: 0.16;
        top: 20px;
        left: 20px;
    }

    .archive-directory {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .hairline-threshold,
    .hairline-chamber {
        display: none;
    }

    body {
        font-size: 16px;
    }

    .section-corridor p,
    .chamber-content p,
    .signals-content p {
        font-size: 16px;
        line-height: 1.65;
    }
}

@media (max-width: 640px) {
    .ghost-shape {
        display: none;
    }

    .section-narrow {
        padding-left: 20px;
        padding-right: 20px;
    }

    .section-wide {
        padding-left: 20px;
        padding-right: 20px;
    }

    .nav-point {
        position: relative;
        top: auto !important;
        left: auto !important;
    }

    .nav-constellation {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 32px;
        padding-top: 100px;
    }

    .world-outline {
        display: none;
    }
}
