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

:root {
    --navy:      #0a1628;
    --navy-mid:  #0f2240;
    --navy-light:#1a3560;
    --gold:      #c9a84c;
    --gold-light:#e8c87a;
    --gold-dark: #8b6914;
    --sand:      #f5e6c8;
    --text:      #e8dcc8;
    --text-muted:#a89880;
    --red:       #8b2020;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Crimson Text', Georgia, serif;
    background-color: var(--navy);
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    line-height: 1.2;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* ===== Loading Screen ===== */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--navy);
}

.loading-anchor {
    font-size: 4rem;
    color: var(--gold);
    animation: bob 1.5s ease-in-out infinite;
}

.loading-text {
    font-family: 'Cinzel', serif;
    color: var(--text-muted);
    margin-top: 1rem;
    letter-spacing: 0.15em;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-12px); }
}

/* ===== Error UI ===== */
#blazor-error-ui {
    background: #5a1010;
    color: #ffd;
    bottom: 0; left: 0;
    padding: 0.75rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
    display: none;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.6rem;
}

/* ===== Navigation ===== */
.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 3rem;
    background: linear-gradient(to bottom, rgba(10,22,40,0.97), rgba(10,22,40,0));
    transition: background 0.3s;
}

.nav-brand a {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--text);
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--gold-light); }

.nav-cta {
    background: var(--gold);
    color: var(--navy) !important;
    padding: 0.45rem 1.25rem;
    border-radius: 2px;
    font-weight: 700;
    transition: background 0.2s !important;
}

.nav-cta:hover { background: var(--gold-light) !important; }

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(to bottom, rgba(10,22,40,0.55) 0%, rgba(10,22,40,0.85) 70%, var(--navy) 100%),
        radial-gradient(ellipse at 30% 60%, rgba(139,105,20,0.15) 0%, transparent 60%),
        linear-gradient(160deg, #0a2040 0%, #060e1e 50%, #0a1a35 100%);
    padding: 8rem 2rem 6rem;
}

/* Decorative wave lines */
.hero::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 200px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 200'%3E%3Cpath fill='%230a1628' fill-opacity='1' d='M0,160L48,144C96,128,192,96,288,96C384,96,480,128,576,138.7C672,149,768,139,864,122.7C960,107,1056,85,1152,90.7C1248,96,1344,128,1392,144L1440,160L1440,200L1392,200L1344,200L1248,200L1152,200L1056,200L960,200L864,200L768,200L672,200L576,200L480,200L384,200L288,200L192,200L96,200L48,200L0,200Z'%3E%3C/path%3E%3C/svg%3E") no-repeat bottom;
    background-size: cover;
}

.hero-eyebrow {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 30px rgba(0,0,0,0.7);
    margin-bottom: 0.5rem;
}

.hero-title span {
    color: var(--gold);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-style: italic;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary-gold {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--navy);
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.08em;
    padding: 0.9rem 2.5rem;
    border-radius: 2px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(201,168,76,0.35);
}

.btn-primary-gold:hover {
    color: var(--navy);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(201,168,76,0.5);
}

.btn-outline-gold {
    display: inline-block;
    border: 2px solid var(--gold);
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.08em;
    padding: 0.9rem 2.5rem;
    border-radius: 2px;
    transition: background 0.2s, color 0.2s;
}

.btn-outline-gold:hover {
    background: rgba(201,168,76,0.1);
    color: var(--gold-light);
}

/* ===== Section Shared ===== */
section {
    padding: 6rem 2rem;
}

.section-label {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: var(--gold);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.75rem;
    text-align: center;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: #fff;
    text-align: center;
    margin-bottom: 1rem;
}

.section-divider {
    width: 60px;
    height: 2px;
    background: var(--gold);
    margin: 0 auto 1.5rem;
}

.section-lead {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 4rem;
    font-style: italic;
}

/* ===== Features Section ===== */
.features {
    background: var(--navy-mid);
    position: relative;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.feature-card {
    background: var(--navy);
    border: 1px solid rgba(201,168,76,0.15);
    border-radius: 4px;
    padding: 2.5rem 2rem;
    transition: border-color 0.3s, transform 0.3s;
    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.3s;
}

.feature-card:hover {
    border-color: rgba(201,168,76,0.4);
    transform: translateY(-4px);
}

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

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-card h3 {
    font-size: 1.1rem;
    color: var(--gold-light);
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.65;
}

/* ===== Screenshots Section ===== */
.screenshots {
    background: var(--navy);
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

.screenshot-placeholder {
    background: var(--navy-mid);
    border: 1px solid rgba(201,168,76,0.12);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    gap: 0.75rem;
    transition: border-color 0.3s;
    min-height: 220px;
}

.screenshot-placeholder:hover {
    border-color: rgba(201,168,76,0.3);
}

.screenshot-placeholder.featured {
    grid-column: 1 / 3;
    min-height: 320px;
    font-size: 1rem;
}

.screenshot-icon {
    font-size: 2.5rem;
    opacity: 0.4;
}

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

/* ===== Download Section ===== */
.download-section {
    background: var(--navy-mid);
    text-align: center;
    border-top: 1px solid rgba(201,168,76,0.1);
}

.download-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    max-width: 680px;
    margin: 0 auto;
    background: var(--navy);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 4px;
    padding: 2rem 2.5rem;
    flex-wrap: wrap;
}

.download-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    text-align: left;
}

.download-icon {
    font-size: 2.25rem;
    opacity: 0.8;
}

.download-name {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.download-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .download-box { flex-direction: column; text-align: center; }
    .download-info { flex-direction: column; text-align: center; }
}

/* ===== CTA Section ===== */
.cta-section {
    background:
        linear-gradient(to bottom, var(--navy) 0%, var(--navy-mid) 100%);
    text-align: center;
    border-top: 1px solid rgba(201,168,76,0.1);
    padding: 7rem 2rem;
}

.cta-section .section-title {
    margin-bottom: 1rem;
}

.cta-section p {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 520px;
    margin: 0 auto 2.5rem;
    font-style: italic;
}

.signup-form {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 480px;
    margin: 0 auto 1rem;
}

.signup-form input[type="email"] {
    flex: 1;
    min-width: 220px;
    padding: 0.85rem 1.25rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 2px;
    color: var(--text);
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.signup-form input[type="email"]::placeholder { color: var(--text-muted); }
.signup-form input[type="email"]:focus { border-color: var(--gold); }

.cta-disclaimer {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* ===== Register Page ===== */
.register-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 1.5rem 4rem;
    background:
        linear-gradient(to bottom, rgba(10,22,40,0.6) 0%, var(--navy) 100%),
        linear-gradient(160deg, #0a2040 0%, #060e1e 50%, #0a1a35 100%);
}

.register-card {
    background: var(--navy-mid);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 4px;
    padding: 3rem 3.5rem;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.register-header {
    text-align: center;
    margin-bottom: 2rem;
}

.register-title {
    font-size: 1.75rem;
    color: #fff;
    margin-bottom: 0.75rem;
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-field label {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.form-field input {
    padding: 0.8rem 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 2px;
    color: var(--text);
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-field input::placeholder { color: var(--text-muted); opacity: 0.6; }
.form-field input:focus { border-color: var(--gold); }

.form-error {
    background: rgba(139,32,32,0.25);
    border: 1px solid rgba(139,32,32,0.5);
    border-radius: 2px;
    padding: 0.65rem 1rem;
    color: #f4a0a0;
    font-size: 0.95rem;
}

.register-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.9rem;
    cursor: pointer;
    border: none;
}

.register-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.register-success {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.register-success-icon {
    font-size: 3rem;
    color: var(--gold);
}

.register-success h2 {
    font-size: 1.5rem;
    color: #fff;
}

.register-success p {
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 520px) {
    .register-card { padding: 2rem 1.5rem; }
}

/* ===== Footer ===== */
.site-footer {
    background: #060d1a;
    padding: 2.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-brand {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 0.9rem;
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .site-nav { padding: 1rem 1.5rem; }
    .nav-links a:not(.nav-cta) { display: none; }
    .site-footer { flex-direction: column; text-align: center; }
    .features-grid { grid-template-columns: 1fr; }
}
