/* ==========================================================================
   diplomatic.day - Styles
   Seapunk meets diplomatic ceremony
   ========================================================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #f4ede4;
    color: #3d2e1f;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ---------- Compass Rose (fixed) ---------- */
.compass-rose {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    animation: compassSpin 120s linear infinite;
    opacity: 0.7;
}

@keyframes compassSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---------- Sections (stacked, 100vh) ---------- */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8vh 6vw;
    overflow: hidden;
}

/* Noise texture overlay - light sections */
.section__noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.section__noise--light::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url(#noiseFilter);
    opacity: 0.04;
    mix-blend-mode: multiply;
}

.section__noise--dark::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url(#noiseFilter);
    opacity: 0.03;
    mix-blend-mode: overlay;
}

.section__content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    max-width: 1200px;
}

/* Tide lines on light sections */
.section--atrium,
.section--archive,
.section--passage,
.section--seal {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 31px,
        rgba(61,139,139,0.08) 31px,
        rgba(61,139,139,0.08) 32px
    );
    background-color: #f4ede4;
}

/* Section headings */
.section__heading {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-size: clamp(42px, 6vw, 72px);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.05;
    color: #3d2e1f;
    margin-bottom: 4vh;
}

.section__heading--light {
    color: #e8ddd0;
}

/* Scroll fade-in transitions */
.section__content > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.section.visible .section__content > *:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0ms; }
.section.visible .section__content > *:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 150ms; }
.section.visible .section__content > *:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 300ms; }
.section.visible .section__content > *:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 450ms; }
.section.visible .section__content > *:nth-child(5) { opacity: 1; transform: translateY(0); transition-delay: 600ms; }

/* ==========================================================================
   Section 1: THE ATRIUM
   ========================================================================== */
.section--atrium {
    background: linear-gradient(170deg, #3d8b8b 0%, #5a8a7a 30%, #b8d4ce 60%, #f4ede4 100%);
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 31px,
            rgba(61,139,139,0.05) 31px,
            rgba(61,139,139,0.05) 32px
        ),
        linear-gradient(170deg, #3d8b8b 0%, #5a8a7a 30%, #b8d4ce 60%, #f4ede4 100%);
}

.atrium__title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-size: clamp(48px, 8vw, 96px);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.05;
    color: #f4ede4;
    text-shadow: 0 2px 24px rgba(42,26,18,0.15);
    margin-bottom: 4vh;
}

.atrium__divider {
    display: flex;
    justify-content: center;
    margin-bottom: 4vh;
}

/* Small seal divider */
.seal-divider {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #c98060, #b5704f 50%, #8b5638 100%);
    box-shadow:
        0 0 0 3px #5a8a7a,
        0 0 0 6px rgba(90,138,122,0.3),
        inset 0 2px 4px rgba(255,255,255,0.15),
        inset 0 -2px 4px rgba(0,0,0,0.2),
        0 4px 12px rgba(42,26,18,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.seal-divider__text {
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    color: #f4ede4;
    letter-spacing: 0.1em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.atrium__quote {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(18px, 2.5vw, 24px);
    color: #2a1a12;
    max-width: 600px;
    margin: 0 auto 1vh;
    line-height: 1.5;
    min-height: 2.5em;
}

.atrium__attribution {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #5a8a7a;
    display: block;
}

/* ==========================================================================
   Section 2: THE ARCHIVE
   ========================================================================== */
.section--archive {
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 31px,
            rgba(61,139,139,0.08) 31px,
            rgba(61,139,139,0.08) 32px
        ),
        linear-gradient(to bottom, #f4ede4, #ebe2d6);
}

.archive__strips {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3vh;
    margin-top: 2vh;
}

.archive__strip {
    position: relative;
    width: min(80vw, 900px);
    height: 120px;
    background: linear-gradient(135deg, #f4ede4 0%, #ebe2d6 100%);
    border: 1px solid rgba(90,138,122,0.2);
    padding: 20px 32px;
    overflow: hidden;
    cursor: default;
    transition: height 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(42,26,18,0.06);
}

.archive__strip:hover {
    height: 200px;
}

/* Folded corner */
.archive__strip-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 32px 32px 0;
    border-color: transparent #e8ddd0 transparent transparent;
    z-index: 3;
}

.archive__strip-corner::after {
    content: '';
    position: absolute;
    top: 0;
    right: -32px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 32px 32px;
    border-color: transparent transparent rgba(42,26,18,0.06) transparent;
}

/* Crease line */
.archive__strip-crease {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent 45%, rgba(61,46,31,0.06) 50%, transparent 55%);
    pointer-events: none;
    z-index: 2;
}

.archive__strip-label {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #5a8a7a;
    margin-bottom: 12px;
    text-align: left;
    position: relative;
    z-index: 1;
}

.archive__strip-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 16px;
    line-height: 1.65;
    color: #3d2e1f;
    text-align: left;
    position: relative;
    z-index: 1;
    opacity: 0.4;
    transition: opacity 0.6s ease;
}

.archive__strip:hover .archive__strip-text {
    opacity: 1;
}

/* ==========================================================================
   Section 3: THE TABLE
   ========================================================================== */
.section--table {
    background: linear-gradient(to bottom, #1a2a2e 0%, #1a2a2e 80%, #1a2a2e 100%);
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 31px,
            rgba(184,212,206,0.03) 31px,
            rgba(184,212,206,0.03) 32px
        ),
        linear-gradient(to bottom, #1a2a2e, #1a2a2e);
}

.table__subtitle {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 20px;
    color: #b8d4ce;
    margin-bottom: 6vh;
}

.table__scene {
    position: relative;
    width: min(600px, 80vw);
    height: 300px;
    margin: 0 auto 4vh;
}

.table__surface {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(500px, 70vw);
    height: 160px;
    border-radius: 12px;
    background: linear-gradient(to bottom, #2a1a12, #3d2e1f);
    box-shadow:
        0 4px 32px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.05);
    overflow: hidden;
}

.table__grain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 4px,
        rgba(255,255,255,0.01) 4px,
        rgba(255,255,255,0.01) 5px
    );
}

.table__seat {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    animation: seatPulse 3s ease-in-out infinite;
}

.table__seat--1 {
    background: #3d8b8b;
    top: 10%;
    left: 25%;
    animation-delay: 0s;
}

.table__seat--2 {
    background: #b5704f;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0.5s;
}

.table__seat--3 {
    background: #5a8a7a;
    top: 10%;
    right: 25%;
    animation-delay: 1s;
}

.table__seat--4 {
    background: #b8d4ce;
    bottom: 10%;
    left: 25%;
    animation-delay: 1.5s;
}

.table__seat--5 {
    background: #e8ddd0;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 2s;
}

.table__seat--6 {
    background: #f4ede4;
    bottom: 10%;
    right: 25%;
    animation-delay: 2.5s;
}

@keyframes seatPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
}

.table__seat--2 {
    animation: seatPulse2 3s ease-in-out infinite 0.5s;
}

.table__seat--5 {
    animation: seatPulse5 3s ease-in-out infinite 2s;
}

@keyframes seatPulse2 {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.8; }
    50% { transform: translateX(-50%) scale(1.15); opacity: 1; }
}

@keyframes seatPulse5 {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.8; }
    50% { transform: translateX(-50%) scale(1.15); opacity: 1; }
}

.table__caption {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #5a8a7a;
}

/* ==========================================================================
   Section 4: THE PASSAGE
   ========================================================================== */
.section--passage {
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 31px,
            rgba(61,139,139,0.08) 31px,
            rgba(61,139,139,0.08) 32px
        ),
        linear-gradient(to bottom, #ebe2d6, #f4ede4);
}

.passage__column {
    max-width: 520px;
    margin: 0 auto;
    text-align: left;
}

/* Treaty line (double border) */
.treaty-line {
    width: 60%;
    margin: 3vh auto;
    border: none;
    border-top: 3px double #5a8a7a;
    opacity: 0.6;
}

.passage__text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.75;
    color: #3d2e1f;
    margin-bottom: 2em;
    letter-spacing: 0.01em;
}

.passage__text:last-of-type {
    margin-bottom: 0;
}

/* fade-in for passage children */
.passage__column > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.section--passage.visible .passage__column > *:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0ms; }
.section--passage.visible .passage__column > *:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 150ms; }
.section--passage.visible .passage__column > *:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 300ms; }
.section--passage.visible .passage__column > *:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 450ms; }
.section--passage.visible .passage__column > *:nth-child(5) { opacity: 1; transform: translateY(0); transition-delay: 600ms; }
.section--passage.visible .passage__column > *:nth-child(6) { opacity: 1; transform: translateY(0); transition-delay: 750ms; }

/* ==========================================================================
   Section 5: THE SEAL
   ========================================================================== */
.section--seal {
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 31px,
            rgba(61,139,139,0.08) 31px,
            rgba(61,139,139,0.08) 32px
        ),
        linear-gradient(to bottom, #f4ede4, #e8ddd0);
}

.seal {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto 5vh;
}

.seal__outer-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #c98060, #b5704f 40%, #8b5638 80%, #6b3f28 100%);
    box-shadow:
        0 0 0 4px #5a8a7a,
        0 0 0 8px rgba(90,138,122,0.2),
        inset 0 4px 12px rgba(255,255,255,0.12),
        inset 0 -4px 12px rgba(0,0,0,0.25),
        0 8px 32px rgba(42,26,18,0.35);
}

.seal__inner-ring {
    position: absolute;
    top: 30px;
    left: 30px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 2px solid rgba(244,237,228,0.2);
    box-shadow:
        inset 0 0 0 2px rgba(244,237,228,0.08);
}

.seal__center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.seal__initials {
    font-family: 'DM Mono', monospace;
    font-size: 32px;
    font-weight: 400;
    color: #f4ede4;
    letter-spacing: 0.15em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.seal__label {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 20px;
    color: #3d2e1f;
    margin-bottom: 1vh;
    letter-spacing: 0.04em;
}

.seal__counter {
    font-family: 'DM Mono', monospace;
    font-size: 48px;
    font-weight: 400;
    color: #b5704f;
    letter-spacing: 0.05em;
    margin-bottom: 2vh;
}

.seal__tagline {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #5a8a7a;
}

/* ==========================================================================
   Section transitions (gradient spans between sections)
   ========================================================================== */
.section--atrium::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20vh;
    background: linear-gradient(to bottom, transparent, #f4ede4);
    pointer-events: none;
    z-index: 1;
}

.section--archive::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20vh;
    background: linear-gradient(to bottom, transparent, #1a2a2e);
    pointer-events: none;
    z-index: 1;
}

.section--table::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20vh;
    background: linear-gradient(to bottom, transparent, #ebe2d6);
    pointer-events: none;
    z-index: 1;
}

.section--passage::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20vh;
    background: linear-gradient(to bottom, transparent, #f4ede4);
    pointer-events: none;
    z-index: 1;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .section {
        padding: 6vh 5vw;
    }

    .archive__strip {
        width: 92vw;
        height: 100px;
        padding: 16px 20px;
    }

    .archive__strip:hover {
        height: 180px;
    }

    .table__scene {
        height: 250px;
    }

    .table__surface {
        width: 85vw;
        height: 120px;
    }

    .seal {
        width: 180px;
        height: 180px;
    }

    .seal__outer-ring {
        width: 180px;
        height: 180px;
    }

    .seal__inner-ring {
        top: 22px;
        left: 22px;
        width: 136px;
        height: 136px;
    }

    .seal__counter {
        font-size: 36px;
    }

    .passage__column {
        max-width: 90vw;
    }
}
