/* ================================================
   THORNVAEL - Landing Page Styles
   A mix of modern clean layout with retro accents
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500&display=swap');

/* Alagard - Retro Fantasy Font (same as game) */
@font-face {
    font-family: 'Alagard';
    src: url('assets/fonts/alagard.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

:root {
    --bg-abyss: #06060f;
    --bg-deep: #0a0a1a;
    --bg-surface: #0f0f24;
    --bg-card: #12122a;
    --bg-card-hover: #1a1a3a;

    --gold: #d4a017;
    --gold-bright: #f0c040;
    --gold-dim: #8a6a10;
    --gold-glow: rgba(212, 160, 23, 0.3);

    --ember: #c45e20;
    --ember-glow: rgba(196, 94, 32, 0.2);

    --text-primary: #e8e4dc;
    --text-secondary: #a09888;
    --text-muted: #605848;
    --text-bright: #fff8f0;

    --border-subtle: rgba(212, 160, 23, 0.12);
    --border-glow: rgba(212, 160, 23, 0.25);

    --font-pixel: 'Alagard', 'Press Start 2P', monospace;
    --font-display: 'Cormorant Garamond', 'Georgia', serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-body: 'Cormorant Garamond', 'Georgia', serif;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-abyss);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--gold-bright); }

::selection {
    background: var(--gold);
    color: var(--bg-abyss);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-abyss); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ================================================
   STAR FIELD CANVAS (behind hero)
   ================================================ */
#star-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ================================================
   NAVIGATION
   ================================================ */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.4s, backdrop-filter 0.4s;
}

.nav.scrolled {
    background: rgba(6, 6, 15, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-logo {
    font-family: var(--font-pixel);
    font-size: 1.1rem;
    color: var(--gold);
    letter-spacing: 3px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 1px;
    background: var(--gold);
    transition: width 0.3s var(--ease-out);
}

.nav-links a:hover { color: var(--gold); }
.nav-links a:hover::after { width: 100%; }

/* ================================================
   HERO SECTION
   ================================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    z-index: 1;
}

/* Fog / mist at the bottom of hero */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--bg-abyss), transparent);
    pointer-events: none;
    z-index: 2;
}

/* Decorative rune line above title */
.hero-rune-line {
    font-family: var(--font-pixel);
    font-size: 0.9rem;
    color: var(--gold-dim);
    letter-spacing: 8px;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeSlideUp 1s var(--ease-out) 0.3s forwards;
}

/* Main title */
.hero-title {
    font-family: var(--font-pixel);
    font-size: clamp(2.8rem, 7vw, 5rem);
    color: var(--gold);
    letter-spacing: 16px;
    margin-bottom: 0.5rem;
    position: relative;
    opacity: 0;
    animation: titleReveal 1.2s var(--ease-out) 0.6s forwards;
    text-shadow:
        0 0 20px rgba(212, 160, 23, 0.4),
        0 0 60px rgba(212, 160, 23, 0.15),
        0 0 120px rgba(212, 160, 23, 0.05);
}

.hero-title-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(212, 160, 23, 0.08) 0%, transparent 70%);
    pointer-events: none;
    animation: glowPulse 4s ease-in-out infinite;
}

/* Subtitle */
.hero-subtitle {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    font-weight: 300;
    font-style: italic;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.8;
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeSlideUp 1s var(--ease-out) 1s forwards;
}

.hero-subtitle em {
    color: var(--gold);
    font-style: italic;
}

/* Scroll indicator */
.hero-scroll {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    opacity: 0;
    animation: fadeSlideUp 1s var(--ease-out) 1.8s forwards;
}

.hero-scroll span {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.scroll-arrow {
    width: 20px; height: 20px;
    margin: 0 auto;
    border-right: 1px solid var(--gold-dim);
    border-bottom: 1px solid var(--gold-dim);
    transform: rotate(45deg);
    animation: scrollBounce 2s ease-in-out infinite;
}

/* ================================================
   SECTION SHARED STYLES
   ================================================ */
.section {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.section-label {
    font-family: var(--font-pixel);
    font-size: 1rem;
    color: var(--gold-dim);
    letter-spacing: 6px;
    margin-bottom: 1.5rem;
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    color: var(--text-bright);
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.section-heading strong {
    color: var(--gold);
    font-weight: 600;
}

.section-text {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 700px;
    line-height: 1.9;
}

/* Decorative divider */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 0;
    max-width: 1100px;
    margin: 0 auto;
    z-index: 1;
    position: relative;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-glow), transparent);
}

.divider-diamond {
    width: 6px; height: 6px;
    background: var(--gold-dim);
    transform: rotate(45deg);
}

/* ================================================
   VISION SECTION
   ================================================ */
.vision {
    text-align: center;
}

.vision .section-text {
    margin: 0 auto;
    font-size: 1.3rem;
    max-width: 750px;
}

.vision-quote {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 300;
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 2.5rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.vision-quote cite {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-style: normal;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 1rem;
}

/* ================================================
   FEATURES SECTION
   ================================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    padding: 2.5rem 2rem;
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    transform: translateY(-2px);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    font-family: var(--font-pixel);
    font-size: 2rem;
    margin-bottom: 1.2rem;
    display: block;
}

.feature-title {
    font-family: var(--font-pixel);
    font-size: 1.1rem;
    color: var(--gold);
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.feature-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ================================================
   SCREENSHOTS / PREVIEW SECTION
   ================================================ */
.screenshots-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.2rem;
    margin-top: 3rem;
}

.screenshot-card {
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    transition: border-color 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.screenshot-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
}

.screenshot-large {
    grid-column: 1 / -1;
}

.screenshot-card img {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: auto;
    transition: transform 0.6s var(--ease-out);
}

.screenshot-card:hover img {
    transform: scale(1.02);
}

.screenshot-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(to top, rgba(6, 6, 15, 0.9) 0%, rgba(6, 6, 15, 0.4) 60%, transparent 100%);
    font-family: var(--font-pixel);
    font-size: 0.85rem;
    color: var(--gold);
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    .screenshots-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   ALPHA REGISTRATION SECTION
   ================================================ */
.alpha {
    text-align: center;
}

.alpha-box {
    max-width: 560px;
    margin: 3rem auto 0;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    padding: 3rem 2.5rem;
    position: relative;
}

.alpha-box::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--gold-dim), transparent 40%, transparent 60%, var(--gold-dim));
    z-index: -1;
    opacity: 0.3;
}

.form-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-abyss);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.form-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.password-wrap {
    position: relative;
}
.password-wrap .form-input {
    padding-right: 2.8rem;
}
.pw-toggle {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.pw-toggle:hover {
    color: var(--gold);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-hint {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Submit button */
.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 2rem;
    margin-top: 0.5rem;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: var(--font-pixel);
    font-size: 1.1rem;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: var(--gold);
    transition: left 0.4s var(--ease-out);
    z-index: -1;
}

.btn-submit:hover {
    color: var(--bg-abyss);
}

.btn-submit:hover::before {
    left: 0;
}

.btn-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-submit:disabled:hover::before {
    left: -100%;
}

.btn-submit:disabled:hover {
    color: var(--gold);
}

/* Form messages */
.form-message {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(0, 170, 0, 0.1);
    border: 1px solid rgba(0, 170, 0, 0.3);
    color: #4caf50;
}

.form-message.error {
    display: block;
    background: rgba(170, 0, 0, 0.1);
    border: 1px solid rgba(170, 0, 0, 0.3);
    color: #ef5350;
}

/* Already registered - login link */
.alpha-login {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.alpha-login a {
    color: var(--gold);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.alpha-login a:hover {
    border-bottom-color: var(--gold);
}

/* ================================================
   STATUS BADGE (post-registration)
   ================================================ */
.status-pending {
    display: none;
    text-align: center;
    padding: 2rem;
}

.status-pending .status-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.status-pending h3 {
    font-family: var(--font-pixel);
    font-size: 1.1rem;
    color: var(--gold);
    letter-spacing: 3px;
    margin-bottom: 1rem;
}

.status-pending p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ================================================
   FOOTER
   ================================================ */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--border-subtle);
}

.footer-logo {
    font-family: var(--font-pixel);
    font-size: 1rem;
    color: var(--gold-dim);
    letter-spacing: 4px;
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.8rem;
    letter-spacing: 1px;
}

/* ================================================
   LOGIN MODAL
   ================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 6, 15, 0.9);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    transform: translateY(20px);
    animation: modalIn 0.4s var(--ease-out) forwards;
}

.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s;
    font-family: var(--font-mono);
}

.modal-close:hover { color: var(--text-primary); }

.modal h2 {
    font-family: var(--font-pixel);
    font-size: 1.2rem;
    color: var(--gold);
    letter-spacing: 3px;
    margin-bottom: 2rem;
}

/* ================================================
   ANIMATIONS
   ================================================ */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes titleReveal {
    0% { opacity: 0; letter-spacing: 40px; filter: blur(8px); }
    100% { opacity: 1; letter-spacing: 16px; filter: blur(0); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(6px); }
}

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

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

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    html { font-size: 16px; }

    .nav { padding: 1rem; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 0.6rem; }

    .hero-title { letter-spacing: 6px; }

    .features-grid { grid-template-columns: 1fr; }

    .form-row { grid-template-columns: 1fr; }

    .alpha-box { padding: 2rem 1.5rem; }

    .section { padding: 4rem 1.5rem; }
}

@media (max-width: 480px) {
    .nav-logo { font-size: 0.9rem; }
    .nav-links { gap: 0.8rem; }
    .nav-links a { font-size: 0.5rem; }

    .hero-rune-line { font-size: 0.7rem; letter-spacing: 4px; }
}
