/* ═══════════════════════════════════════════════════════
   Project LIGHTHOUSE — Splash / Loading Screen
   Responsive, cinematic, modern aesthetic
   ═══════════════════════════════════════════════════════ */

/* ── Overlay ── */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #041520 0%, #063a58 35%, #0d6090 65%, #041520 100%);
    overflow: hidden;
    transition: opacity .6s cubic-bezier(.4,0,.2,1), visibility .6s;
}
.splash-screen.splash-hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ── Background effects ── */
.splash-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(240,176,0,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240,176,0,.06) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: splashGridDrift 20s linear infinite;
}
@keyframes splashGridDrift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

.splash-glow {
    position: absolute;
    width: 420px; height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240,176,0,.10) 0%, transparent 70%);
    animation: splashGlowPulse 3s ease-in-out infinite;
    pointer-events: none;
}
@keyframes splashGlowPulse {
    0%, 100% { transform: scale(1); opacity: .6; }
    50% { transform: scale(1.15); opacity: 1; }
}

/* ── Floating particles ── */
.splash-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.splash-particle {
    position: absolute;
    color: rgba(240, 176, 0, .10);
    animation: splashFloat linear infinite;
}
.splash-particle svg {
    width: 100%; height: 100%;
}
@keyframes splashFloat {
    0% { transform: translateY(100vh) rotate(0deg) scale(0); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translateY(45vh) rotate(180deg) scale(1); }
    90% { opacity: .6; }
    100% { transform: translateY(-10vh) rotate(360deg) scale(.6); opacity: 0; }
}

/* ── Icon container ── */
.splash-icon-wrap {
    position: relative;
    width: 110px; height: 110px;
    margin-bottom: 32px;
    z-index: 2;
}

/* Ring behind icon */
.splash-icon-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid rgba(240,176,0,.18);
    animation: splashRingSpin 8s linear infinite;
}
.splash-icon-ring::before {
    content: '';
    position: absolute;
    top: -3px; left: 50%;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #f0b000;
    box-shadow: 0 0 12px rgba(240,176,0,.6);
    transform: translateX(-50%);
}
@keyframes splashRingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Second ring (counter-rotate) */
.splash-icon-ring-2 {
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    border: 1px dashed rgba(240,176,0,.10);
    animation: splashRingSpin 12s linear infinite reverse;
}

/* The SVG icon */
.splash-icon {
    width: 100%; height: 100%;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d6090, #1a80b8);
    box-shadow:
        0 0 40px rgba(240,176,0,.20),
        0 8px 32px rgba(0,0,0,.3),
        inset 0 1px 0 rgba(255,255,255,.1);
    animation: splashIconFloat 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}
.splash-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255,255,255,.08), transparent 60%);
}
@keyframes splashIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.splash-icon svg {
    width: 62px; height: 62px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.2));
    position: relative;
    z-index: 1;
}

/* ── Text area ── */
.splash-text {
    text-align: center;
    z-index: 2;
    opacity: 0;
    transform: translateY(16px);
    animation: splashTextIn .8s cubic-bezier(.4,0,.2,1) .5s forwards;
}
@keyframes splashTextIn {
    to { opacity: 1; transform: translateY(0); }
}

.splash-label {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(240, 176, 0, .7);
    margin-bottom: 4px;
}

.splash-title {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: 12px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 40px rgba(240, 176, 0, .25);
    position: relative;
}

/* Letter-by-letter reveal */
.splash-title .splash-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px) scale(.8);
    animation: splashLetterIn .5s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes splashLetterIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Underline accent */
.splash-accent {
    width: 0;
    height: 3px;
    margin: 10px auto 0;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #d4960c, #f0b000, #d4960c, transparent);
    animation: splashAccent .8s cubic-bezier(.4,0,.2,1) 1.2s forwards;
}
@keyframes splashAccent {
    to { width: 120px; }
}

/* Version subscript */
.splash-version {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: .62rem;
    font-weight: 500;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(240, 176, 0, .40);
    margin-top: 6px;
    opacity: 0;
    animation: splashVersionIn .6s ease 1.4s forwards;
}
@keyframes splashVersionIn {
    to { opacity: 1; }
}

/* ── Tagline ── */
.splash-tagline {
    z-index: 2;
    margin-top: 18px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: .72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(148, 163, 184, .5);
    opacity: 0;
    animation: splashFadeIn .6s ease 1.6s forwards;
}
@keyframes splashFadeIn {
    to { opacity: 1; }
}

/* ── Acronym breakdown ── */
.splash-acronym {
    z-index: 2;
    display: flex;
    gap: 24px;
    margin-top: 28px;
    opacity: 0;
    animation: splashFadeIn .6s ease 2.4s forwards;
}
.splash-acr-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transform: translateY(12px);
    animation: splashAcrIn .5s cubic-bezier(.34,1.56,.64,1) forwards;
}
.splash-acr-item:nth-child(1) { animation-delay: 2.6s; }
.splash-acr-item:nth-child(2) { animation-delay: 2.85s; }
.splash-acr-item:nth-child(3) { animation-delay: 3.1s; }
.splash-acr-item:nth-child(4) { animation-delay: 3.35s; }
.splash-acr-item:nth-child(5) { animation-delay: 3.6s; }
@keyframes splashAcrIn {
    to { opacity: 1; transform: translateY(0); }
}
.splash-acr-letter {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: #f0b000;
    text-shadow: 0 0 16px rgba(240, 176, 0, .4);
    line-height: 1;
}
.splash-acr-word {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: .58rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(148, 163, 184, .55);
    line-height: 1;
    white-space: nowrap;
}

/* ── Loading bar ── */
.splash-loader {
    position: absolute;
    bottom: 60px;
    width: 180px;
    z-index: 2;
}
.splash-loader-track {
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,.06);
    border-radius: 1px;
    overflow: hidden;
}
.splash-loader-bar {
    height: 100%;
    width: 0%;
    border-radius: 1px;
    background: linear-gradient(90deg, #d4960c, #f0b000);
    transition: width .3s;
}
.splash-loader-text {
    text-align: center;
    margin-top: 8px;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: .65rem;
    color: rgba(148, 163, 184, .4);
    letter-spacing: 1px;
}

/* ── Responsive ── */

/* Tablets */
@media (max-width: 768px) {
    .splash-icon-wrap { width: 96px; height: 96px; margin-bottom: 28px; }
    .splash-icon svg { width: 54px; height: 54px; }
    .splash-title { font-size: 2.8rem; letter-spacing: 10px; }
    .splash-tagline { font-size: .65rem; padding: 0 20px; text-align: center; }
    .splash-version { font-size: .58rem; letter-spacing: 2px; }
    .splash-acronym { gap: 18px; margin-top: 24px; }
    .splash-glow { width: 320px; height: 320px; }
}

/* Phones */
@media (max-width: 576px) {
    .splash-screen { padding: 20px 16px; }
    .splash-icon-wrap { width: 72px; height: 72px; margin-bottom: 20px; }
    .splash-icon { border-radius: 16px; }
    .splash-icon svg { width: 40px; height: 40px; }
    .splash-icon-ring { inset: -8px; }
    .splash-icon-ring-2 { inset: -14px; }
    .splash-title { font-size: 2rem; letter-spacing: 8px; }
    .splash-label { font-size: .7rem; letter-spacing: 3px; }
    .splash-version { font-size: .52rem; letter-spacing: 1.5px; margin-top: 4px; }
    .splash-tagline { font-size: .6rem; letter-spacing: 1.5px; padding: 0 12px; word-break: break-word; }
    .splash-glow { width: 220px; height: 220px; }
    .splash-acronym { gap: 12px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
    .splash-acr-letter { font-size: .95rem; }
    .splash-acr-word { font-size: .48rem; letter-spacing: .5px; }
    .splash-loader { bottom: 36px; width: 140px; }
    .splash-loader-text { font-size: .58rem; }
    .splash-accent { animation-name: splashAccentSm; }
    @keyframes splashAccentSm { to { width: 80px; } }
}

/* Very small phones */
@media (max-width: 360px) {
    .splash-screen { padding: 16px 12px; }
    .splash-icon-wrap { width: 60px; height: 60px; margin-bottom: 16px; }
    .splash-icon { border-radius: 14px; }
    .splash-icon svg { width: 34px; height: 34px; }
    .splash-icon-ring { inset: -6px; border-width: 1.5px; }
    .splash-icon-ring-2 { inset: -12px; }
    .splash-title { font-size: 1.7rem; letter-spacing: 6px; }
    .splash-label { font-size: .62rem; letter-spacing: 2px; }
    .splash-version { font-size: .48rem; letter-spacing: 1px; margin-top: 3px; }
    .splash-tagline { font-size: .55rem; letter-spacing: 1px; }
    .splash-acronym { gap: 8px; margin-top: 14px; }
    .splash-acr-letter { font-size: .82rem; }
    .splash-acr-word { font-size: .42rem; letter-spacing: 0; }
    .splash-loader { bottom: 28px; width: 120px; }
}

/* Landscape phones — reduce vertical space */
@media (max-height: 500px) {
    .splash-screen { padding: 10px 16px; }
    .splash-icon-wrap { width: 52px; height: 52px; margin-bottom: 12px; }
    .splash-icon { border-radius: 12px; }
    .splash-icon svg { width: 30px; height: 30px; }
    .splash-icon-ring { inset: -6px; }
    .splash-icon-ring-2 { inset: -10px; }
    .splash-title { font-size: 1.6rem; letter-spacing: 6px; }
    .splash-label { font-size: .6rem; margin-bottom: 2px; }
    .splash-text { margin-bottom: 0; }
    .splash-version { font-size: .46rem; margin-top: 2px; }
    .splash-tagline { margin-top: 10px; font-size: .55rem; }
    .splash-acronym { margin-top: 10px; gap: 10px; }
    .splash-acr-letter { font-size: .8rem; }
    .splash-acr-word { font-size: .42rem; }
    .splash-accent { margin-top: 6px; }
    .splash-glow { width: 180px; height: 180px; }
    .splash-loader { bottom: 14px; width: 120px; }
    .splash-loader-text { font-size: .55rem; margin-top: 4px; }
}

/* ── Mobile/Portrait: Sequential Acronym Reveal ── */
.splash-seq-letter {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: #f0b000;
    text-shadow: 0 0 30px rgba(240,176,0,.5), 0 0 60px rgba(240,176,0,.2);
    line-height: 1;
    opacity: 0;
    transform: scale(0.5) translateY(20px);
    animation: splashSeqLetterIn .35s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes splashSeqLetterIn {
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.splash-seq-word {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(148, 163, 184, .7);
    margin-top: 6px;
    opacity: 0;
    animation: splashSeqWordIn .3s ease .1s forwards;
}
@keyframes splashSeqWordIn {
    to { opacity: 1; }
}

.splash-seq-complete {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: .6rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(148, 163, 184, .5);
    line-height: 1.8;
    max-width: 280px;
    margin: 0 auto;
    word-spacing: 4px;
    opacity: 0;
    animation: splashSeqFadeIn .5s ease forwards;
}
@keyframes splashSeqFadeIn {
    to { opacity: 1; }
}

/* On small screens, make the title slightly smaller for sequential mode */
@media (max-width: 576px) {
    .splash-seq-letter { font-size: 3rem; }
    .splash-seq-word { font-size: .75rem; letter-spacing: 2px; }
    .splash-seq-complete { font-size: .52rem; max-width: 240px; }
}
@media (max-width: 360px) {
    .splash-seq-letter { font-size: 2.5rem; }
    .splash-seq-word { font-size: .65rem; letter-spacing: 1.5px; }
    .splash-seq-complete { font-size: .48rem; max-width: 200px; }
}
