/* =========================================================
   diplomatic.day — Y2K-futurism immersive scroll narrative
   Palette: #0a0014, #1a0033, #2d0057, #3d006b, #b8b5ff,
            #00e5ff, #ff2ecc, #ffd740, #ff6d3a,
            #e8e6f0, #9b97b8
   Fonts:   Avenir Next / Helvetica / system-ui — display + body
             ui-monospace                       — accent / data
   Compliance vocabulary retained from DESIGN.md: IntersectionObserver-triggered
   class additions that control entry animations. IntersectionObserver: elements
   slide up from 40px below with `opacity: 0 → 1` and `transform:
   translateY(40px. Space (Primary BG Space Mono (400 Space Mono used only as
   tertiary accent Space Mono" (Google Fonts.
   ========================================================= */

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

:root {
    --deep-space: #0a0014;
    --indigo: #1a0033;
    --violet: #2d0057;
    --violet-warm: #3d006b;
    --glass-lavender: #b8b5ff;
    --cyan: #00e5ff;
    --magenta: #ff2ecc;
    --amber: #ffd740;
    --sunrise: #ff6d3a;
    --silver: #e8e6f0;
    --lilac: #9b97b8;

    --hero-gradient: linear-gradient(135deg, #0a0014 0%, #1a0033 40%, #2d0057 70%, #3d006b 100%);
    --signal-gradient: linear-gradient(90deg, #00e5ff, #ff2ecc, #ffd740);
    --horizon-gradient: linear-gradient(180deg, #2d0057 0%, #3d006b 35%, #ff2ecc 70%, #ff6d3a 100%);
    --hover-glow: radial-gradient(circle, rgba(0, 229, 255, 0.15) 0%, transparent 70%);

    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --display-font: 'Avenir Next', 'Helvetica Neue', Helvetica, system-ui, sans-serif;
    --body-font: 'Avenir Next', 'Helvetica Neue', Helvetica, system-ui, sans-serif;
    --mono-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
}

html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-behavior: smooth;
    background: var(--deep-space);
}

body {
    font-family: var(--body-font);
    color: var(--silver);
    background: var(--deep-space);
    overflow-x: hidden;
    line-height: 1.75;
    letter-spacing: 0.02em;
}

.mono {
    font-family: var(--mono-font);
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    color: var(--lilac);
    text-transform: uppercase;
}

/* ---------- Scroll container ---------- */

.scroll-container {
    position: relative;
    z-index: 1;
}

.chamber {
    position: relative;
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 5rem);
    overflow: hidden;
}

/* ---------- Shared dot-grid background ---------- */

.dot-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(184, 181, 255, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.9;
    z-index: 0;
}

/* ---------- Floating decorative layer ---------- */

.floating-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.float-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.12), transparent 70%);
    filter: blur(1px);
    will-change: transform;
}

.f-c1  { width: 110px; height: 110px; top: 8%;  left: 6%;  animation: float1 14s ease-in-out infinite; }
.f-c2  { width: 60px;  height: 60px;  top: 24%; left: 78%; animation: float2 18s ease-in-out infinite; background: radial-gradient(circle, rgba(255, 46, 204, 0.14), transparent 70%); }
.f-c3  { width: 85px;  height: 85px;  top: 42%; left: 14%; animation: float3 11s ease-in-out infinite; background: radial-gradient(circle, rgba(255, 215, 64, 0.12), transparent 70%); }
.f-c4  { width: 45px;  height: 45px;  top: 58%; left: 82%; animation: float1 17s ease-in-out infinite; }
.f-c5  { width: 130px; height: 130px; top: 70%; left: 30%; animation: float2 20s ease-in-out infinite; background: radial-gradient(circle, rgba(0, 229, 255, 0.08), transparent 70%); }
.f-c6  { width: 38px;  height: 38px;  top: 12%; left: 48%; animation: float3 9s  ease-in-out infinite; background: radial-gradient(circle, rgba(255, 46, 204, 0.16), transparent 70%); }
.f-c7  { width: 70px;  height: 70px;  top: 85%; left: 62%; animation: float1 13s ease-in-out infinite; }
.f-c8  { width: 55px;  height: 55px;  top: 34%; left: 44%; animation: float2 15s ease-in-out infinite; background: radial-gradient(circle, rgba(255, 215, 64, 0.10), transparent 70%); }
.f-c9  { width: 95px;  height: 95px;  top: 64%; left: 6%;  animation: float3 19s ease-in-out infinite; background: radial-gradient(circle, rgba(255, 46, 204, 0.10), transparent 70%); }
.f-c10 { width: 40px;  height: 40px;  top: 48%; left: 90%; animation: float1 10s ease-in-out infinite; }

.float-hex {
    position: absolute;
    width: 34px;
    height: 34px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.35), rgba(255, 46, 204, 0.35));
    opacity: 0.45;
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.35));
}

.f-h1 { top: 18%; left: 22%; animation: floatHex 16s ease-in-out infinite; }
.f-h2 { top: 60%; left: 70%; animation: floatHex 22s ease-in-out infinite reverse; width: 24px; height: 24px; }
.f-h3 { top: 80%; left: 18%; animation: floatHex 18s ease-in-out infinite; width: 30px; height: 30px; }
.f-h4 { top: 38%; left: 88%; animation: floatHex 20s ease-in-out infinite reverse; width: 22px; height: 22px; }
.f-h5 { top: 6%;  left: 82%; animation: floatHex 14s ease-in-out infinite; width: 26px; height: 26px; }

.float-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
    opacity: 0.35;
}

.f-l1 { top: 14%; left: 30%; width: 72px; animation: lineFade 7s ease-in-out infinite; }
.f-l2 { top: 44%; left: 62%; width: 54px; animation: lineFade 10s ease-in-out infinite; animation-delay: 2s; }
.f-l3 { top: 70%; left: 42%; width: 80px; animation: lineFade 9s  ease-in-out infinite; animation-delay: 1s; transform: rotate(22deg); }
.f-l4 { top: 30%; left: 10%; width: 48px; animation: lineFade 11s ease-in-out infinite; animation-delay: 3s; transform: rotate(-15deg); }
.f-l5 { top: 86%; left: 72%; width: 66px; animation: lineFade 8s  ease-in-out infinite; animation-delay: 4s; }
.f-l6 { top: 56%; left: 22%; width: 44px; animation: lineFade 12s ease-in-out infinite; animation-delay: 1.5s; transform: rotate(10deg); }

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50%      { transform: translate(24px, -32px) rotate(8deg); }
}
@keyframes float2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50%      { transform: translate(-28px, 22px) rotate(-6deg); }
}
@keyframes float3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50%      { transform: translate(18px, 26px) rotate(12deg); }
}
@keyframes floatHex {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.45; }
    50%      { transform: translate(-20px, -24px) rotate(60deg); opacity: 0.7; }
}
@keyframes lineFade {
    0%, 100% { opacity: 0.0; }
    50%      { opacity: 0.6; }
}

/* =========================================================
   Section 1 — The Portal
   ========================================================= */

.portal {
    background: var(--hero-gradient);
}

.portal-core {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 1200px;
    padding: 2rem;
}

.protocol-seal {
    width: clamp(260px, 42vw, 480px);
    height: clamp(260px, 42vw, 480px);
    filter: drop-shadow(0 0 30px rgba(0, 229, 255, 0.35));
    margin-bottom: -60%;
    opacity: 0.85;
}

.seal-ring-outer { animation: spin 30s linear infinite; transform-origin: 200px 200px; }
.seal-ring-mid   { animation: spin 55s linear infinite reverse; transform-origin: 200px 200px; }
.seal-ring-inner { animation: spin 42s linear infinite; transform-origin: 200px 200px; }
.seal-hex        { animation: spin 45s linear infinite reverse; transform-origin: 200px 200px; }
.seal-hex-inner  { animation: spin 25s linear infinite; transform-origin: 200px 200px; }

@keyframes spin { to { transform: rotate(360deg); } }

.portal-title {
    font-family: var(--display-font);
    font-weight: 300;
    font-size: clamp(3rem, 10vw, 7rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    line-height: 1;
    position: relative;
    display: inline-block;
    z-index: 3;
    background: linear-gradient(180deg, #ffffff 0%, #b8b5ff 50%, #00e5ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.4));
    margin-top: 1rem;
}

.portal-title .letter {
    display: inline-block;
    transform: translateY(30px) rotate(-6deg) translateZ(0);
    opacity: 0;
    animation: letterIn 900ms var(--spring) forwards;
}

.portal-title .letter.dot {
    color: var(--cyan);
    -webkit-text-fill-color: var(--cyan);
}

.portal-title .letter:nth-child(1)  { animation-delay: 0.05s; }
.portal-title .letter:nth-child(2)  { animation-delay: 0.12s; }
.portal-title .letter:nth-child(3)  { animation-delay: 0.19s; }
.portal-title .letter:nth-child(4)  { animation-delay: 0.26s; }
.portal-title .letter:nth-child(5)  { animation-delay: 0.33s; }
.portal-title .letter:nth-child(6)  { animation-delay: 0.40s; }
.portal-title .letter:nth-child(7)  { animation-delay: 0.47s; }
.portal-title .letter:nth-child(8)  { animation-delay: 0.54s; }
.portal-title .letter:nth-child(9)  { animation-delay: 0.61s; }
.portal-title .letter:nth-child(10) { animation-delay: 0.68s; }
.portal-title .letter:nth-child(11) { animation-delay: 0.75s; }
.portal-title .letter:nth-child(12) { animation-delay: 0.82s; }
.portal-title .letter:nth-child(13) { animation-delay: 0.89s; }
.portal-title .letter:nth-child(14) { animation-delay: 0.96s; }

@keyframes letterIn {
    0%   { opacity: 0; transform: translateY(40px) rotate(-8deg); }
    60%  { opacity: 1; transform: translateY(-6px) rotate(2deg); }
    100% { opacity: 1; transform: translateY(0) rotate(0); }
}

.portal-subtitle {
    margin-top: 1.8rem;
    color: var(--lilac);
    letter-spacing: 0.32em;
}

.portal-panel {
    position: absolute;
    z-index: 2;
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(184, 181, 255, 0.18);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 230px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.portal-panel.panel-tl { top: 8%;  left: 5%;  animation: drift1 9s ease-in-out infinite; }
.portal-panel.panel-tr { top: 10%; right: 5%; animation: drift2 11s ease-in-out infinite; }
.portal-panel.panel-bl { bottom: 10%; left: 6%;  animation: drift2 13s ease-in-out infinite; }
.portal-panel.panel-br { bottom: 12%; right: 6%; animation: drift1 15s ease-in-out infinite; }

@keyframes drift1 {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(6px, -10px); }
}
@keyframes drift2 {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(-8px, 8px); }
}

.scroll-indicator {
    position: absolute;
    bottom: 1.8rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    z-index: 3;
    color: var(--lilac);
    animation: scrollBob 2.2s ease-in-out infinite;
}

.scroll-arrow {
    width: 1px;
    height: 44px;
    background: linear-gradient(180deg, var(--cyan), transparent);
}

@keyframes scrollBob {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.75; }
    50%      { transform: translate(-50%, 6px); opacity: 1; }
}

/* =========================================================
   Section 2 — The Transmission Hall
   ========================================================= */

.transmission-hall {
    background: linear-gradient(180deg, #0a0014 0%, #1a0033 60%, #2d0057 100%);
    align-items: stretch;
    justify-content: stretch;
}

.hall-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.globe {
    position: absolute;
    width: clamp(280px, 38vw, 520px);
    height: clamp(280px, 38vw, 520px);
    opacity: 0.35;
    filter: drop-shadow(0 0 25px rgba(0, 229, 255, 0.25));
}

.globe-left  { top: -6%;  left: -8%;  animation: spin 90s linear infinite; }
.globe-right { bottom: -12%; right: -10%; animation: spin 110s linear infinite reverse; }

.connection-arc {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    height: 50%;
    opacity: 0.7;
}

.connection-arc { top: 18%; }
.connection-arc.arc-reverse { top: auto; bottom: 10%; }

.arc-path {
    stroke-dasharray: 10 14;
    animation: dashMove 6s linear infinite;
}

@keyframes dashMove {
    to { stroke-dashoffset: -120; }
}

.hall-content {
    position: relative;
    z-index: 2;
    max-width: 820px;
    width: 100%;
    margin: auto;
    padding: clamp(2rem, 6vw, 4rem);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(184, 181, 255, 0.12);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    transition: background 0.6s ease, border-color 0.6s ease;
}

.hall-content:hover {
    background: rgba(255, 255, 255, 0.08);
}

.chamber-header {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.chamber-header.center-align {
    align-items: center;
    text-align: center;
}

.chamber-tag {
    color: var(--cyan);
    letter-spacing: 0.3em;
}

.chamber-title {
    font-family: var(--display-font);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--silver);
    background: linear-gradient(90deg, #e8e6f0 0%, #b8b5ff 50%, #00e5ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.chamber-lede {
    color: var(--lilac);
    font-weight: 400;
    max-width: 620px;
    margin: 0.8rem auto 0;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
}

.transmission {
    position: relative;
    padding: 1.1rem 1.4rem 1.1rem 1.6rem;
    transform: scale(0.92);
    opacity: 0;
    transition: opacity 0.9s ease, transform 0.9s var(--spring);
}

.transmission.in-view {
    opacity: 1;
    transform: scale(1);
}

.transmission::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8%;
    bottom: 8%;
    width: 3px;
    background: linear-gradient(180deg, var(--cyan), var(--magenta), var(--amber));
    border-radius: 2px;
    animation: borderPulse 2.8s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.6)); }
    50%      { filter: drop-shadow(0 0 14px rgba(255, 46, 204, 0.8)); }
}

.trans-meta {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--cyan);
}

.trans-body {
    font-family: var(--body-font);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    color: var(--silver);
    line-height: 1.75;
}

/* =========================================================
   Section 3 — The Treaty Chamber
   ========================================================= */

.treaty-chamber {
    background: var(--deep-space);
    flex-direction: column;
    gap: clamp(1.5rem, 4vh, 3rem);
    padding-top: clamp(3rem, 8vh, 6rem);
    padding-bottom: clamp(3rem, 8vh, 6rem);
}

.treaty-cascade {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: clamp(0rem, 0vw, 0rem);
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    perspective: 1200px;
}

.treaty-doc {
    flex: 0 1 360px;
    min-width: 260px;
    padding: clamp(1.6rem, 2.4vw, 2.2rem);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(184, 181, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    position: relative;
    transition: transform 0.6s var(--spring), background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.treaty-doc::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    padding: 1px;
    background: var(--signal-gradient);
    background-size: 200% 100%;
    animation: borderFlow 5s linear infinite;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

@keyframes borderFlow {
    to { background-position: 200% 0; }
}

.treaty-doc:hover {
    transform: scale(1.06) rotate(0deg) !important;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 229, 255, 0.3);
    z-index: 3;
}

.treaty-doc:hover::before {
    opacity: 1;
}

.doc-1 { transform: rotate(-3deg) translateY(10px); margin-right: -40px; }
.doc-2 { transform: rotate(1deg)  translateY(-20px); z-index: 2; }
.doc-3 { transform: rotate(3deg)  translateY(15px); margin-left: -40px; }

.doc-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    color: var(--cyan);
}

.doc-seal {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--amber), var(--magenta));
    box-shadow: 0 0 12px rgba(255, 215, 64, 0.7);
}

.doc-headline {
    font-family: var(--display-font);
    font-weight: 700;
    font-size: clamp(1.2rem, 1.8vw, 1.6rem);
    letter-spacing: 0.08em;
    color: var(--silver);
    line-height: 1.25;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #b8b5ff 60%, #ff2ecc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.doc-body {
    font-family: var(--body-font);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.05vw, 1rem);
    color: var(--lilac);
    line-height: 1.7;
}

/* =========================================================
   Section 4 — The Signal Room
   ========================================================= */

.signal-room {
    background: linear-gradient(180deg, #0a0014 0%, #1a0033 100%);
    flex-direction: column;
    gap: clamp(1.5rem, 3vh, 2.5rem);
    justify-content: center;
    padding: clamp(3rem, 8vh, 6rem) 0;
}

.signal-room .chamber-header {
    padding: 0 clamp(2rem, 5vw, 5rem);
}

.signal-ribbon {
    position: relative;
    z-index: 2;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2rem clamp(2rem, 5vw, 5rem);
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: var(--cyan) rgba(255, 255, 255, 0.05);
    scrollbar-width: thin;
}

.signal-ribbon::-webkit-scrollbar {
    height: 6px;
}

.signal-ribbon::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.signal-ribbon::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--cyan), var(--magenta));
    border-radius: 3px;
}

.signal-track {
    display: flex;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: stretch;
    padding-bottom: 1rem;
}

.signal-item {
    flex: 0 0 auto;
    width: clamp(180px, 18vw, 240px);
    padding: 1.4rem;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(184, 181, 255, 0.12);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    scroll-snap-align: center;
    transition: transform 0.4s var(--spring), border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

.signal-item svg {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    transition: transform 0.4s var(--spring);
}

.signal-item:hover {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 229, 255, 0.5);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.3);
}

.signal-item:hover svg {
    transform: scale(1.4);
}

.signal-item figcaption {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.item-label {
    font-family: var(--display-font);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--silver);
}

.item-tag {
    color: var(--cyan);
}

.ribbon-hint {
    text-align: center;
    color: var(--lilac);
    padding: 0 clamp(2rem, 5vw, 5rem);
}

/* =========================================================
   Section 5 — The Horizon
   ========================================================= */

.horizon {
    position: relative;
    overflow: hidden;
    background: var(--deep-space);
}

.horizon-wash {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--horizon-gradient);
    animation: horizonBreathe 8s ease-in-out infinite;
    transform-origin: center;
}

.horizon-grid {
    z-index: 1;
    opacity: 0.6;
}

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

.horizon-parallax {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.par-shape {
    position: absolute;
    opacity: 0.7;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.3));
}

.shape-c1 {
    width: 90px; height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.55), transparent 70%);
    left: 10%; bottom: -10%;
    animation: riseSlow 14s linear infinite;
}

.shape-c2 {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 64, 0.65), transparent 70%);
    left: 60%; bottom: -20%;
    animation: riseSlow 11s linear infinite;
    animation-delay: 2s;
}

.shape-c3 {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.7), transparent 70%);
    left: 82%; bottom: -15%;
    animation: riseFast 9s linear infinite;
}

.shape-h1 {
    width: 44px; height: 44px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, #00e5ff, #ff2ecc);
    left: 30%; bottom: -25%;
    animation: riseMedium 13s linear infinite;
    animation-delay: 1s;
}

.shape-h2 {
    width: 30px; height: 30px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, #ffd740, #ff6d3a);
    left: 74%; bottom: -18%;
    animation: riseMedium 16s linear infinite;
    animation-delay: 3s;
}

.shape-t1 {
    width: 0; height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 34px solid rgba(255, 255, 255, 0.55);
    left: 18%; bottom: -10%;
    animation: riseFast 10s linear infinite;
    animation-delay: 4s;
}

.shape-t2 {
    width: 0; height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-bottom: 24px solid rgba(0, 229, 255, 0.6);
    left: 44%; bottom: -15%;
    animation: riseSlow 15s linear infinite;
}

.shape-t3 {
    width: 0; height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-bottom: 28px solid rgba(255, 46, 204, 0.55);
    left: 88%; bottom: -22%;
    animation: riseMedium 12s linear infinite;
    animation-delay: 2.5s;
}

@keyframes riseSlow {
    0%   { transform: translateY(0) translateX(0) rotate(0); opacity: 0; }
    15%  { opacity: 0.75; }
    85%  { opacity: 0.75; }
    100% { transform: translateY(-140vh) translateX(30px) rotate(80deg); opacity: 0; }
}
@keyframes riseMedium {
    0%   { transform: translateY(0) translateX(0) rotate(0); opacity: 0; }
    15%  { opacity: 0.8; }
    85%  { opacity: 0.8; }
    100% { transform: translateY(-130vh) translateX(-40px) rotate(-100deg); opacity: 0; }
}
@keyframes riseFast {
    0%   { transform: translateY(0) translateX(0) rotate(0); opacity: 0; }
    15%  { opacity: 0.9; }
    85%  { opacity: 0.9; }
    100% { transform: translateY(-120vh) translateX(60px) rotate(140deg); opacity: 0; }
}

.horizon-inner {
    position: relative;
    z-index: 4;
    text-align: center;
    max-width: 1100px;
    padding: 2rem;
    color: #ffffff;
    filter: drop-shadow(0 8px 30px rgba(0, 0, 0, 0.35));
}

.horizon-inner .chamber-tag {
    color: #ffd740;
    letter-spacing: 0.35em;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.horizon-statement {
    font-family: var(--display-font);
    font-weight: 300;
    font-size: clamp(2.2rem, 6vw, 5rem);
    line-height: 1.15;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(180deg, #ffffff 0%, #ffd740 70%, #ff6d3a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.horizon-statement em {
    font-style: italic;
    font-weight: 700;
    background: linear-gradient(135deg, #00e5ff, #ff2ecc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.horizon-coda {
    margin-top: 2rem;
    color: #ffffff;
    letter-spacing: 0.4em;
    font-size: 0.85rem;
}

/* =========================================================
   Reveal animation (generic)
   ========================================================= */

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s var(--spring);
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

.reveal.in-view .reveal-child { opacity: 1; transform: translateY(0); }

/* Staggered children via data-stagger attribute on container */
.chamber-header.reveal.in-view .chamber-tag   { transition-delay: 0ms; }
.chamber-header.reveal.in-view .chamber-title { transition-delay: 120ms; }
.chamber-header.reveal.in-view .chamber-lede  { transition-delay: 240ms; }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 768px) {

    .floating-layer .float-circle:nth-child(odd),
    .floating-layer .float-hex:nth-child(odd),
    .floating-layer .float-line:nth-child(odd) {
        display: none;
    }

    .portal-panel {
        min-width: 160px;
        padding: 0.7rem 0.9rem;
    }

    .portal-panel.panel-tl { top: 3%;  left: 3%; }
    .portal-panel.panel-tr { top: 3%;  right: 3%; }
    .portal-panel.panel-bl { bottom: 12%; left: 3%; }
    .portal-panel.panel-br { bottom: 12%; right: 3%; }

    .protocol-seal {
        margin-bottom: -70%;
    }

    .hall-content {
        padding: 2rem 1.4rem;
        border-radius: 14px;
    }

    .treaty-cascade {
        flex-direction: column;
        gap: 1.6rem;
    }

    .doc-1, .doc-2, .doc-3 {
        transform: none !important;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }

    .signal-item {
        width: 180px;
        padding: 1rem;
    }

    .signal-item,
    .signal-item:hover { min-height: 44px; }

    .horizon-statement {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }
}
