/* ================================================
   diplomacy.day - Luxury Diplomatic Salon
   ================================================ */

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

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

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    background-color: #0D0A14;
    color: #F0E6D3;
    overflow-x: hidden;
}

/* --- Leather Surface Texture --- */
.leather-surface {
    background-color: #3E2F22;
    background-image:
        radial-gradient(ellipse at 30% 40%, rgba(90,70,51,0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(42,31,22,0.6) 0%, transparent 40%),
        repeating-linear-gradient(
            135deg,
            transparent 0px,
            transparent 2px,
            rgba(0,0,0,0.03) 2px,
            rgba(0,0,0,0.03) 4px
        ),
        repeating-linear-gradient(
            45deg,
            transparent 0px,
            transparent 3px,
            rgba(255,255,255,0.02) 3px,
            rgba(255,255,255,0.02) 5px
        );
}

/* --- Scroll Progress Indicator --- */
.scroll-indicator {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    height: 60vh;
}

.scroll-line {
    position: absolute;
    width: 2px;
    height: 100%;
    background: rgba(196,149,106,0.2);
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid #C4956A;
    background: transparent;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.scroll-dot:nth-child(2) { top: 0; }
.scroll-dot:nth-child(3) { top: 25%; }
.scroll-dot:nth-child(4) { top: 50%; }
.scroll-dot:nth-child(5) { top: 75%; }
.scroll-dot:nth-child(6) { top: 100%; }

.scroll-dot.active {
    background: linear-gradient(135deg, #7B4FA0, #3D8B7A);
    border-color: #F0E6D3;
    transform: translateX(-50%) scale(1.4);
}

/* --- Accord Base --- */
.accord {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ================================================
   ACCORD I - The Seal
   ================================================ */
.accord-1 {
    min-height: 100vh;
    background: #0D0A14;
    overflow: hidden;
}

.seal-halo {
    position: absolute;
    width: 600px;
    height: 600px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    background: radial-gradient(circle, rgba(27,10,46,0.8) 0%, rgba(13,10,20,0.4) 50%, transparent 70%);
    pointer-events: none;
}

.seal {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #E8B4B8 0%, #C4956A 40%, #8B4513 100%);
    box-shadow:
        inset 0 4px 12px rgba(0,0,0,0.4),
        inset 0 -2px 6px rgba(255,200,180,0.2),
        0 0 60px rgba(196,149,106,0.15),
        0 0 120px rgba(27,10,46,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    animation: sealBreathe 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transition: border-radius 0.8s ease;
    cursor: default;
}

.seal::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: repeating-conic-gradient(
        from 0deg,
        rgba(196,149,106,0.3) 0deg 10deg,
        transparent 10deg 20deg
    );
    z-index: -1;
    transition: border-radius 0.8s ease;
}

.seal:hover {
    border-radius: 40% 60% 50% 70% / 60% 40% 70% 50%;
    background: radial-gradient(circle at 40% 35%, #E8B4B8 0%, #E8B4B8 20%, #C4956A 50%, #8B4513 100%);
}

.seal:hover::after {
    border-radius: 40% 60% 50% 70% / 60% 40% 70% 50%;
}

@keyframes sealBreathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.seal-monogram {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(3rem, 6vw, 5rem);
    color: #2A1F16;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.seal-tagline {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: #F0E6D3;
    margin-top: 2.5rem;
    letter-spacing: 0.03em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1s ease-out 1.5s, transform 1s ease-out 1.5s;
    position: relative;
    z-index: 2;
}

.seal-tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================
   ACCORD II - The Correspondence
   ================================================ */
.accord-2 {
    min-height: 150vh;
    background: linear-gradient(180deg, #0D0A14 0%, #1B0A2E 20%, #2D1B4E 40%, #1E3A5F 60%, #0B4D3C 80%, #1B0A2E 100%);
    padding: 10vh 0 15vh;
    align-items: stretch;
}

.accord-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(2.4rem, 5.5vw, 4.8rem);
    color: #F0E6D3;
    letter-spacing: 0.03em;
    line-height: 1.12;
    text-align: center;
    margin-bottom: 6vh;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.accord-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.letter-card {
    width: min(80vw, 420px);
    padding: 2rem;
    border-radius: 2px;
    margin-bottom: 4vh;
    position: relative;
    box-shadow:
        0 0 0 1px rgba(196,149,106,0.3),
        inset 0 0 0 1px rgba(196,149,106,0.15),
        0 8px 30px rgba(0,0,0,0.3);
}

.letter-card[data-position='left'] {
    margin-left: 15vw;
    transform: rotate(-2deg);
}
.letter-card[data-position='right'] {
    margin-left: 55vw;
    transform: rotate(2deg);
}
.letter-card[data-position='center-left'] {
    margin-left: 25vw;
    transform: rotate(-1.5deg);
}
.letter-card[data-position='right-far'] {
    margin-left: 65vw;
    transform: rotate(3deg);
}
.letter-card[data-position='left-center'] {
    margin-left: 10vw;
    transform: rotate(-2.5deg);
}
.letter-card[data-position='right-center'] {
    margin-left: 50vw;
    transform: rotate(1.5deg);
}

.seal-mark {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #E8B4B8 0%, #C4956A 50%, #8B4513 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.salutation {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    color: #E8B4B8;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease-out 0.4s, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
}

.body-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    color: #D4C5A9;
    line-height: 1.75;
    letter-spacing: 0.01em;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease-out 0.8s, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.8s;
}

.letter-card.revealed .seal-mark,
.letter-card.revealed .salutation,
.letter-card.revealed .body-text {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================
   ACCORD III - The Aurora Chamber
   ================================================ */
.accord-3 {
    min-height: 120vh;
    overflow: hidden;
    position: relative;
    background: #0D0A14;
}

.aurora-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.aurora-layer {
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
}

.aurora-a {
    background: radial-gradient(ellipse at 30% 40%, rgba(27,10,46,0.7) 0%, rgba(45,27,78,0.4) 30%, transparent 60%);
    animation: auroraA 30s ease-in-out infinite;
    will-change: transform;
}

.aurora-b {
    background: radial-gradient(ellipse at 70% 60%, rgba(30,58,95,0.5) 0%, rgba(11,77,60,0.3) 30%, transparent 60%);
    animation: auroraB 45s ease-in-out infinite;
    will-change: transform;
}

.aurora-c {
    background: radial-gradient(ellipse at 50% 50%, rgba(123,79,160,0.3) 0%, rgba(61,139,122,0.2) 30%, transparent 50%);
    animation: auroraC 60s ease-in-out infinite;
    will-change: transform;
}

@keyframes auroraA {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(10%, 5%); }
    50% { transform: translate(15%, 20%); }
    75% { transform: translate(5%, 10%); }
}

@keyframes auroraB {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-10%, -5%); }
    50% { transform: translate(-20%, -15%); }
    75% { transform: translate(-5%, -10%); }
}

@keyframes auroraC {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.aurora-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120vh;
}

.aurora-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    line-height: 2;
    color: #F0E6D3;
    text-shadow: 0 0 40px currentColor;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease-out, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.aurora-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.calligraphic-flourish {
    width: min(300px, 60vw);
    height: 40px;
    margin: 2rem 0;
    opacity: 0;
    transition: opacity 0.8s ease-out 0.5s;
}

.calligraphic-flourish.visible {
    opacity: 1;
}

.flourish-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 2s ease-out;
}

.calligraphic-flourish.visible .flourish-path {
    stroke-dashoffset: 0;
}

.aurora-attribution {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    color: #8B7D6B;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease-out 1s, transform 0.8s ease-out 1s;
}

.aurora-attribution.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Inverted aurora for Accord V */
.aurora-bg.inverted {
    transform: scaleY(-1);
}

/* ================================================
   ACCORD IV - The Treaty Table
   ================================================ */
.accord-4 {
    min-height: 100vh;
    background: linear-gradient(180deg, #1B0A2E 0%, #0D0A14 30%, #0D0A14 70%, #1B0A2E 100%);
    padding: 10vh 2rem;
}

.treaty-table-wrapper {
    perspective: 1200px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.treaty-table {
    transform: rotateX(2deg);
    padding: 3rem 2.5rem;
    border-radius: 2px;
    box-shadow:
        0 0 0 1px rgba(196,149,106,0.3),
        inset 0 0 0 1px rgba(196,149,106,0.15),
        0 20px 60px rgba(0,0,0,0.5);
    background-image:
        repeating-linear-gradient(90deg, transparent 0px, transparent 60px, rgba(196,149,106,0.08) 60px, rgba(196,149,106,0.08) 61px),
        radial-gradient(ellipse at 30% 40%, rgba(90,70,51,0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(42,31,22,0.6) 0%, transparent 40%),
        repeating-linear-gradient(135deg, transparent 0px, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px),
        repeating-linear-gradient(45deg, transparent 0px, transparent 3px, rgba(255,255,255,0.02) 3px, rgba(255,255,255,0.02) 5px);
    background-color: #5A4633;
}

.treaty-heading {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    color: #E8DCC8;
    letter-spacing: 0.03em;
    line-height: 1.12;
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(196,149,106,0.2);
}

.treaty-clause {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 0;
    border-left: 2px solid #C4956A;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.treaty-clause.visible {
    opacity: 1;
    transform: translateY(0);
}

.clause-number {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 2rem;
    color: #7B4FA0;
    line-height: 1.2;
    flex-shrink: 0;
    min-width: 2rem;
}

.clause-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    color: #D4C5A9;
    line-height: 1.75;
    letter-spacing: 0.01em;
}

/* ================================================
   ACCORD V - The Departure
   ================================================ */
.accord-5 {
    min-height: 80vh;
    position: relative;
    overflow: hidden;
    background: #000;
}

.departure-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    padding: 0 2rem;
}

.departure-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(4rem, 10vw, 8rem);
    color: #F0E6D3;
    letter-spacing: 0;
    transition: letter-spacing 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 1.1;
}

.departure-title.expanded {
    letter-spacing: 0.15em;
}

.departure-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: #8B7D6B;
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.departure-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================
   Responsive
   ================================================ */
@media (max-width: 768px) {
    .scroll-indicator {
        right: 12px;
        height: 40vh;
    }

    .scroll-dot {
        width: 6px;
        height: 6px;
    }

    .letter-card {
        width: min(85vw, 360px);
    }

    .letter-card[data-position='left'],
    .letter-card[data-position='center-left'],
    .letter-card[data-position='left-center'] {
        margin-left: 5vw;
    }

    .letter-card[data-position='right'],
    .letter-card[data-position='right-far'],
    .letter-card[data-position='right-center'] {
        margin-left: 10vw;
    }

    .treaty-table {
        padding: 2rem 1.5rem;
    }

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

@media (max-width: 480px) {
    .letter-card[data-position='left'],
    .letter-card[data-position='center-left'],
    .letter-card[data-position='left-center'],
    .letter-card[data-position='right'],
    .letter-card[data-position='right-far'],
    .letter-card[data-position='right-center'] {
        margin-left: auto;
        margin-right: auto;
    }

    .treaty-table-wrapper {
        perspective: none;
    }

    .treaty-table {
        transform: none;
    }
}