/* --- Landing Screen Overlay --- */
.landing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 9999;
    transition: transform 0.8s cubic-bezier(0.85, 0, 0.15, 1), opacity 0.5s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Viewport-locked atmosphere — stays visible for entire landing scroll */
.landing-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(circle at center, #0a0a0f 0%, #000 100%);
    overflow: hidden;
}

.landing-overlay.fade-out {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.landing-content {
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 10;
    pointer-events: auto;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 0;
    padding-bottom: 80px;
}

.landing-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    justify-content: center;
    padding: 20px 24px 72px;
    box-sizing: border-box;
}

/* --- Visual Infrastructure --- */
#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0.6;
}

.landing-visual-layers {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.layer {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    will-change: transform;
    transform: translateX(var(--x-offset, 0px)) translateY(var(--y-offset, 0px));
}

.layer-bg {
    background-image: radial-gradient(circle at center, rgba(138, 43, 226, 0.05) 0%, transparent 70%);
    filter: blur(30px);
    z-index: 1;
}

.layer-mid {
    background-image: 
        linear-gradient(rgba(0, 242, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 2;
}

.layer-fg {
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 3;
}

.landing-logo {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    margin-top: -10px;
    margin-bottom: -80px; /* Optimized to reveal more text/buttons below the crest */
    z-index: 101;
    pointer-events: auto;
    cursor: crosshair;
    
    /* Edge Blending */
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 95%);
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 95%);
}

.landing-title {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 10px;
    background: linear-gradient(to right, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
    margin: 0;
}

.landing-pqc-protocol {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: rgba(0, 210, 220, 0.55);
    margin: 4px 0 10px;
    padding: 0 12px;
    line-height: 1.5;
}

.landing-subtitle {
    font-size: 14px;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 20px;
}

.landing-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.landing-actions .btn-neon-open:hover {
    border-color: #00F2FF;
    box-shadow: 0 0 28px rgba(0, 242, 255, 0.45), 0 0 56px rgba(255, 0, 229, 0.12);
}

.landing-actions .btn-enter-public {
    border-color: rgba(0, 242, 255, 0.35);
}

.landing-actions .btn-enter-public:disabled {
    opacity: 0.55;
    cursor: wait;
}

.landing-actions .btn-neon-secondary {
    margin-top: 0;
}

.landing-actions .btn-neon-secondary:hover {
    border-color: #FF00E5;
    color: #fff;
    box-shadow: 0 0 22px rgba(255, 0, 229, 0.35), 0 0 44px rgba(0, 242, 255, 0.1);
    background: rgba(255, 0, 229, 0.06);
}

/* Scroll cue */
.landing-scroll-cue {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(0, 242, 255, 0.35);
    text-decoration: none;
    transition: opacity 0.5s ease, color 0.3s ease;
    pointer-events: auto;
}

.landing-scroll-cue.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.landing-scroll-cue-line {
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, transparent, rgba(0, 242, 255, 0.5));
    animation: landing-scroll-pulse 2s ease-in-out infinite;
}

.landing-scroll-cue i {
    font-size: 10px;
    animation: landing-scroll-bob 2s ease-in-out infinite;
}

.landing-scroll-cue:hover {
    color: rgba(0, 242, 255, 0.7);
}

@keyframes landing-scroll-pulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.85); }
    50% { opacity: 1; transform: scaleY(1); }
}

@keyframes landing-scroll-bob {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(4px); opacity: 0.9; }
}

/* Below-the-fold depth layer */
.landing-depth {
    width: 100%;
    padding: 0 24px 60px;
    text-align: left;
    box-sizing: border-box;
}

.landing-section-header {
    text-align: center;
    margin-bottom: 32px;
}

.landing-section-header--left {
    text-align: left;
}

.landing-section-tag {
    display: block;
    font-size: 9px;
    letter-spacing: 0.25em;
    color: rgba(0, 242, 255, 0.45);
    margin-bottom: 8px;
    font-weight: 700;
}

.landing-section-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    text-transform: uppercase;
}

.landing-pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.landing-pillar-card {
    padding: 24px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    cursor: default;
}

.landing-pillar-card:hover {
    border-color: rgba(0, 242, 255, 0.45);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25), 0 0 18px rgba(0, 242, 255, 0.18);
    transform: translateY(-3px) scale(1.02);
}

.landing-pillar-card:hover .landing-pillar-icon {
    background: rgba(0, 242, 255, 0.14);
    box-shadow: 0 0 12px rgba(0, 242, 255, 0.2);
}

.landing-pillar-card--accent {
    border-color: rgba(255, 0, 229, 0.14);
    background: rgba(255, 0, 229, 0.03);
}

.landing-pillar-card--accent:hover {
    border-color: rgba(255, 0, 229, 0.5);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25), 0 0 18px rgba(255, 0, 229, 0.22);
    transform: translateY(-3px) scale(1.02);
}

.landing-pillar-card--accent:hover .landing-pillar-icon {
    background: rgba(255, 0, 229, 0.18);
    box-shadow: 0 0 12px rgba(255, 0, 229, 0.25);
}

.landing-pillar-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(0, 242, 255, 0.08);
    color: var(--accent-cyan);
    font-size: 16px;
    margin-bottom: 14px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.landing-pillar-card--accent .landing-pillar-icon {
    background: rgba(255, 0, 229, 0.1);
    color: #FF00E5;
}

.landing-pillar-card h3 {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 10px;
}

.landing-pillar-card p {
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.64);
    margin: 0;
    transition: color 0.3s ease;
}

.landing-pillar-card:hover p {
    color: rgba(220, 248, 255, 0.92);
}

.landing-pillar-card--accent:hover p {
    color: rgba(255, 228, 248, 0.92);
}

/* Tactical defense panel */
.landing-tactical-panel {
    margin-bottom: 48px;
    padding: 24px !important;
    border-color: rgba(0, 242, 255, 0.12) !important;
}

.landing-tactical-header-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    align-items: start;
}

.landing-tactical-heading {
    grid-column: 1;
    min-width: 0;
}

.landing-tactical-heading .landing-section-tag {
    margin-bottom: 8px;
}

.landing-tactical-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    margin: 0;
    padding: 0;
}

.landing-tactical-tag {
    grid-column: 3;
    justify-self: end;
    align-self: start;
    font-size: 8px;
    letter-spacing: 0.2em;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

.landing-tactical-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.landing-tactical-stat {
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.landing-tactical-label {
    display: block;
    font-size: 8px;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 6px;
}

.landing-tactical-value {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Fira Code', 'Courier New', monospace;
}

.landing-tactical-value--cyan {
    color: var(--accent-cyan);
    text-shadow: 0 0 12px rgba(0, 242, 255, 0.3);
}

.landing-tactical-ticker {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 242, 255, 0.1);
    border-radius: 6px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 10px;
    overflow: hidden;
}

.landing-ticker-prefix {
    color: var(--accent-cyan);
    opacity: 0.6;
    flex-shrink: 0;
}

.landing-ticker-text {
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.28s ease;
}

/* Roadmap timeline */
.landing-roadmap {
    margin-bottom: 20px;
}

.landing-roadmap-timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 8px;
    border-left: 1px solid rgba(0, 242, 255, 0.15);
}

.landing-roadmap-phase {
    position: relative;
    padding: 0 0 32px 28px;
}

.landing-roadmap-phase:last-child {
    padding-bottom: 0;
}

.landing-roadmap-marker {
    position: absolute;
    left: -17px;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #0a0a0f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
}

.landing-roadmap-phase--current .landing-roadmap-marker {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 16px rgba(0, 242, 255, 0.25);
}

.landing-roadmap-status {
    display: inline-block;
    font-size: 8px;
    letter-spacing: 0.2em;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 6px;
}

.landing-roadmap-status--next {
    color: var(--accent-purple);
}

.landing-roadmap-status--evaluating {
    color: rgba(255, 180, 80, 0.75);
}

.landing-roadmap-phase--evaluating .landing-roadmap-marker {
    border-color: rgba(255, 180, 80, 0.35);
    color: rgba(255, 180, 80, 0.7);
}

.landing-roadmap-body h4 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    margin: 0 0 8px;
}

.landing-roadmap-body p {
    font-size: 12px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    max-width: 640px;
}

@media (max-width: 768px) {
    .landing-pillars,
    .landing-tactical-grid,
    .landing-tactical-header-row {
        grid-template-columns: 1fr;
    }

    .landing-tactical-tag {
        grid-column: 1;
        justify-self: start;
    }

    .landing-pillar-card:hover {
        transform: translateY(-2px) scale(1.01);
    }

    .landing-title {
        font-size: 28px;
        letter-spacing: 6px;
    }

    .landing-pqc-protocol {
        font-size: 8px;
        letter-spacing: 0.22em;
    }

    .landing-hero {
        min-height: auto;
        padding-top: 40px;
        padding-bottom: 100px;
    }
}

/* --- Modal Base --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    padding: 40px;
    border: 1px solid var(--accent-cyan);
    box-shadow: 0 0 30px var(--glow-cyan);
}

#about-modal .modal-content {
    max-width: 1000px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 16px;
}

.modal-title {
    font-size: 20px;
    letter-spacing: 3px;
    color: var(--accent-cyan);
}

.modal-close {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--accent-pink);
    transform: rotate(90deg);
}

.modal-body {
    padding-top: 10px;
}

.modal-intro {
    font-size: 16px;
    color: white;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
}

.modal-footer-info {
    border-top: 1px solid var(--border-glass);
    padding-top: 20px;
    margin-top: 20px;
}

.modal-footer-info p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.modal-footer-info i {
    color: var(--accent-purple);
    margin-right: 8px;
}

/* --- Magic Invite Portal --- */
.magic-portal {
    background: var(--surface-glass);
    backdrop-filter: blur(15px);
    border: 1px solid var(--accent-cyan);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    width: 320px;
    max-width: 95%;
    animation: slideInUp 0.5s ease-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--glow-cyan);
    z-index: 102;
    transition: var(--transition);
}

.magic-portal.hidden {
    display: none;
}

/* --- Magic Terminal Sequence --- */
.magic-terminal {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 4px;
    padding: 10px;
    height: 120px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 9px;
    color: var(--accent-cyan);
    text-align: left;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 1);
}

.terminal-lines div {
    margin-bottom: 4px;
    line-height: 1.2;
}

.terminal-cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
}

.magic-portal.decryption-pulse {
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 40px var(--glow-cyan), inset 0 0 20px var(--glow-cyan) !important;
    transform: scale(1.02);
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

.magic-portal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--accent-cyan);
}

.magic-portal-header h3 {
    font-size: 14px;
    letter-spacing: 2px;
    font-weight: 700;
}

.magic-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 15px;
}

.magic-trigger {
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    padding: 0 5px;
}

.magic-trigger:hover {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px var(--glow-cyan);
    transform: translateY(-1px);
}

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

.result-field {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    margin-bottom: 5px;
    font-family: monospace;
}

.res-label {
    opacity: 0.5;
}

.res-value {
    font-weight: bold;
    word-break: break-all;
}

.error-active {
    animation: neon-pink-pulse 0.5s infinite alternate !important;
    border-color: var(--accent-pink) !important;
    box-shadow: 0 0 30px rgba(255, 0, 229, 0.6) !important;
}

@keyframes neon-pink-pulse {
    from {
        box-shadow: 0 0 10px rgba(255, 0, 229, 0.4);
        transform: scale(1);
    }
    to {
        box-shadow: 0 0 25px rgba(255, 0, 229, 0.8);
        transform: scale(1.01);
    }
}

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

.landing-footer {
    width: 100%;
    padding: 24px 24px 8px;
    margin-top: 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.landing-footer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.btn-privacy-policy {
    background: transparent;
    border: 1px solid rgba(0, 242, 255, 0.25);
    color: rgba(255, 255, 255, 0.55);
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
    padding: 8px 18px;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.btn-privacy-policy:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 242, 255, 0.2);
}

.privacy-policy-body {
    text-align: left;
}

.privacy-policy-body .modal-intro,
.legal-page-intro {
    text-align: left;
    margin-bottom: 24px;
    font-size: 16px;
    color: white;
    font-weight: 600;
    line-height: 1.6;
}

.privacy-policy-body code,
.legal-page-panel code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.92em;
    color: var(--accent-cyan);
    background: rgba(0, 242, 255, 0.08);
    padding: 1px 6px;
    border-radius: 3px;
}

.privacy-policy-section {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-glass);
}

.privacy-policy-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.privacy-policy-section h2,
.privacy-policy-section h3 {
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.privacy-policy-section h3 {
    margin-top: 18px;
    font-size: 12px;
    letter-spacing: 1px;
    color: rgba(0, 242, 255, 0.82);
}

.privacy-policy-section h3:first-of-type {
    margin-top: 4px;
}

.privacy-policy-section h2 i,
.privacy-policy-section h3 i {
    font-size: 14px;
    opacity: 0.85;
}

.privacy-policy-section p {
    font-size: 14px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
    margin: 0;
}

.privacy-policy-section p + p,
.privacy-policy-note {
    margin-top: 12px;
}

/* --- Standalone legal pages --- */
body.legal-page {
    margin: 0;
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    display: block;
    color: #fff;
    background: #0A0A0B;
    font-family: Inter, system-ui, sans-serif;
}

body.legal-page .landing-backdrop {
    position: fixed;
}

.legal-page-shell {
    position: relative;
    z-index: 1;
    max-width: 820px;
    margin: 0 auto;
    padding: 28px 20px 40px;
    box-sizing: border-box;
}

.legal-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.legal-back-link {
    color: var(--accent-cyan);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.legal-back-link:hover {
    text-shadow: 0 0 10px var(--glow-cyan);
}

.legal-brand {
    color: var(--accent-cyan);
    font-weight: 700;
    letter-spacing: 0.18em;
    font-size: 12px;
}

.legal-page-panel {
    padding: 36px 32px;
    border: 1px solid rgba(0, 242, 255, 0.25);
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.08);
    text-align: left;
}

.legal-page-title {
    font-size: 22px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin: 0 0 20px;
    line-height: 1.35;
}

.legal-page-footer {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

@media (max-width: 640px) {
    .legal-page-panel {
        padding: 24px 18px;
    }

    .legal-page-title {
        font-size: 18px;
    }
}
