/* ============================================
   Landing Page — modern dark, full-screen video
   Overrides on top of base.css
   ============================================ */
body {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    background: #05070c;
    animation: pageFadeIn 1.2s ease-out;
}

/* Hide the global film grain / shimmer here — the video carries the texture */
body::before { opacity: 0.04; }

/* --- Full-screen video background --- */
.video-background {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: #05070c;
}

.bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: saturate(1.05) contrast(1.02);
}

.video-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 90% at 50% 40%, rgba(5, 7, 12, 0.10) 0%, rgba(5, 7, 12, 0.55) 70%, rgba(5, 7, 12, 0.85) 100%),
        linear-gradient(180deg, rgba(5, 7, 12, 0.45) 0%, rgba(5, 7, 12, 0.20) 35%, rgba(5, 7, 12, 0.75) 100%);
}

/* --- Layout --- */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    padding: 24px;
}

.content {
    text-align: center;
    max-width: 720px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Typography --- */
.brand-kanji {
    font-family: 'Noto Serif JP', serif;
    font-size: clamp(2.4rem, 6.5vw, 4.2rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.18em;
    color: var(--accent-light);
    margin-bottom: 1.1rem;
    padding-left: 0.2em;
    text-shadow: 0 6px 44px rgba(91, 155, 213, 0.45);
}

.brand-eyebrow {
    font-family: var(--font-brand);
    font-size: clamp(0.72rem, 1.6vw, 0.85rem);
    font-weight: 500;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 1.4rem;
    padding-left: 0.42em;
}

.main-title {
    font-family: var(--font-brand);
    /* "OpeningMastermind" is one long unbreakable word; floor must be small
       enough to fit ~320px without clipping (overflow-x is hidden on body). */
    font-size: clamp(1.6rem, 8vw, 6.4rem);
    font-weight: 700;
    line-height: 1.0;
    color: #ffffff;
    margin-bottom: 1.4rem;
    letter-spacing: -0.02em;
    background: linear-gradient(180deg, #ffffff 0%, #bcd4ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 8px 60px rgba(91, 155, 213, 0.25);
}

.subtitle {
    font-family: var(--font-brand);
    font-size: clamp(1rem, 2.4vw, 1.25rem);
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 2.6rem;
    font-weight: 300;
    letter-spacing: 0.01em;
    max-width: 62ch;
}

/* --- Enter button --- */
.enter-cta { margin-top: 0.4rem; }

.enter-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 38px;
    background: rgba(91, 155, 213, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: #ffffff;
    font-family: var(--font-brand);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform var(--ease-snappy), background var(--ease-default),
                border-color var(--ease-default), box-shadow var(--ease-default);
}

.enter-btn svg { transition: transform var(--ease-snappy); }

.enter-btn:hover {
    background: rgba(91, 155, 213, 0.22);
    border-color: rgba(126, 184, 232, 0.7);
    box-shadow: 0 10px 40px rgba(91, 155, 213, 0.35);
    transform: translateY(-2px);
}

.enter-btn:hover svg { transform: translateX(4px); }
.enter-btn:active { transform: translateY(0); }

/* --- Fade-in stagger --- */
.fade-in-element {
    opacity: 0;
    transform: translateY(28px);
    animation: fadeInUp 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.fade-in-element:nth-child(1) { animation-delay: 0.2s; }
.fade-in-element:nth-child(2) { animation-delay: 0.4s; }
.fade-in-element:nth-child(3) { animation-delay: 0.6s; }
.fade-in-element:nth-child(4) { animation-delay: 0.85s; }
.fade-in-element:nth-child(5) { animation-delay: 1.05s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Page fade-out (Enter transition) --- */
.page-fade-out {
    position: fixed;
    inset: 0;
    background: #05070c;
    opacity: 0;
    z-index: 10000;
    pointer-events: none;
    transition: opacity 0.7s ease-out;
}
.page-fade-out.active { opacity: 1; }

/* --- Demo modal --- */
.demo-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 12, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.demo-modal.active { display: flex; }

.demo-modal-content {
    background: rgba(17, 22, 31, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    padding: 34px 30px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    animation: modalSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}

.demo-modal-content h3 {
    color: #ffffff;
    font-family: var(--font-brand);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.demo-modal-content p {
    color: rgba(255, 255, 255, 0.5);
    margin: 10px 0 18px;
    font-size: 0.9rem;
}

#demo-password {
    width: 100%;
    padding: 13px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    margin-bottom: 18px;
    transition: all var(--ease-default);
}
#demo-password::placeholder { color: rgba(255, 255, 255, 0.3); }
#demo-password:focus {
    border-color: var(--accent);
    background: rgba(91, 155, 213, 0.08);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.demo-modal-buttons { display: flex; gap: 10px; }

.demo-modal-buttons button {
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-brand);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--ease-default);
}

#demo-submit {
    background: var(--accent);
    color: #06080e;
}
#demo-submit:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

#demo-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
#demo-cancel:hover {
    background: rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.85);
}

.demo-error {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 14px;
    display: none;
    animation: shake 0.5s ease-in-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* --- Landing theme toggle (sits on dark video) --- */
.theme-toggle-btn {
    left: calc(72px + env(safe-area-inset-left));
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.55);
    border-color: var(--accent);
    color: var(--accent-light);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .container { padding: 18px; }
    .brand-eyebrow { letter-spacing: 0.3em; }
}

@media (max-width: 480px) {
    .main-title { margin-bottom: 1rem; }
    .subtitle { margin-bottom: 1.8rem; }
    .demo-modal-content { padding: 26px 22px; margin: 20px; }
}

/* --- Free-feature links (below Enter) --- */
.prep-links {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
    justify-content: center;
}
.prep-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 9px 20px;
    background: rgba(8, 10, 16, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}
.prep-link:hover {
    color: #cfe7ff;
    border-color: rgba(126, 184, 232, 0.55);
    box-shadow: 0 0 18px rgba(91, 155, 213, 0.18);
    transform: translateY(-1px);
}
.prep-link-glyph { color: #7eb8e8; font-size: 0.95rem; line-height: 1; }
.learn-link:hover {
    color: #ede4ff;
    border-color: rgba(201, 166, 255, 0.55);
    box-shadow: 0 0 18px rgba(150, 110, 230, 0.2);
}
.learn-link .prep-link-glyph { color: #c9a6ff; }
.prep-link-free {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    padding: 2px 8px;
}
.enter-cta { display: flex; flex-direction: column; align-items: center; }
@media (max-width: 520px) {
    .prep-links { flex-direction: column; width: 100%; max-width: 340px; }
    .prep-link { justify-content: center; }
}
