/* ==========================================================================
   Bad Astrologer — Base styles
   Dark background, warning yellow accent, responsive
   ========================================================================== */

:root {
    --bg:          #111113;
    --bg-card:     #1b1b1f;
    --bg-input:    #161619;
    --border:      #2e2e35;
    --border-focus:#ffcc33;
    --text:        #d8d8dc;
    --text-muted:  #8e8e96;
    --text-heading:#f0f0f2;
    --accent:      #ffcc33;
    --accent-hover:#ffd754;
    --accent-glow: rgba(255, 204, 51, 0.12);
    --accent-text: #111113;
    --danger:      #ff453a;
    --success:     #30d158;
    --fire:        #f0803c;
    --earth:       #8b9d77;
    --air:         #7eb8da;
    --water:       #6a7fd2;
    --radius:      10px;
    --radius-sm:   6px;
    --shadow:      0 2px 16px rgba(0,0,0,0.45);
    --font:        source-serif-4, Georgia, "Times New Roman", serif;
    --font-sans:   -apple-system, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
    --font-display: westsac, "Didot", Georgia, sans-serif; /* "corsairpe", sans-serif; */
    --max-width:   920px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(17,17,19,0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    overflow: visible;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: relative;
}

.logo {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.main-nav { display: flex; align-items: center; gap: 24px; }
.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
}
.main-nav a:hover { color: var(--text); }
.main-nav a.btn-primary { color: var(--accent-text); }
.main-nav a.btn-primary:hover { color: var(--accent-text); }

/* Burger */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 110;
}
.burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.3s, opacity 0.3s;
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Footer */
.site-footer {
    margin-top: 80px;
    padding: 28px 0;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.footer-inner nav { display: flex; gap: 18px; }
.footer-inner a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.82rem;
}
.footer-inner a:hover { color: var(--text); }

/* Typography */
h1, h2, h3, h4, h5, h6 { color: var(--text-heading); line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-family: var(--font-display); font-size: 2.5rem; }
h2 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 400; }
h3 { font-family: var(--font-display); font-size: 1.4rem; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

p { margin: 0 0 1em; }

hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
    line-height: 1.4;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-text); }

.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--text-heading); }

.btn-sm { padding: 6px 16px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }

.btn-block { display: block; width: 100%; }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}

/* Sign grid */
.sign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin: 32px 0;
}

.sign-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.sign-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    color: var(--text-heading);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.sign-card .sign-symbol {
    font-size: 2.2rem;
    margin-bottom: 6px;
    line-height: 1;
}

.sign-card .sign-img {
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
    object-fit: contain;
    border-radius: 50%;
}

.sign-card .name {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 700;
}

.sign-card .dates {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 3px;
    font-family: var(--font-sans);
}

/* Element colour accents on sign cards */
.sign-card.fire:hover { border-color: var(--fire); box-shadow: 0 6px 24px rgba(240,128,60,0.12); }
.sign-card.earth:hover { border-color: var(--earth); box-shadow: 0 6px 24px rgba(139,157,119,0.12); }
.sign-card.air:hover { border-color: var(--air); box-shadow: 0 6px 24px rgba(126,184,218,0.12); }
.sign-card.water:hover { border-color: var(--water); box-shadow: 0 6px 24px rgba(106,127,210,0.12); }

/* Reading content */
.reading-content {
    line-height: 1.8;
    font-size: 1.05rem;
}
.reading-content h2 { color: var(--accent); margin-top: 1.5em; font-size: 1.25rem; }
.reading-content h3 { color: var(--text-heading); margin-top: 1.2em; }
.reading-content strong { color: var(--text-heading); }
.reading-content em { color: var(--text-muted); font-style: italic; }
.reading-content ul, .reading-content ol { padding-left: 1.5em; }
.reading-content li { margin-bottom: 0.4em; }
.reading-content blockquote {
    border-left: 3px solid var(--accent);
    margin: 1em 0;
    padding: 0.5em 1em;
    color: var(--text-muted);
    font-style: italic;
}

/* Hero / home */
.hero {
    text-align: center;
    padding: 56px 0 36px;
}
.hero-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 16px;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    margin-bottom: 0.3em;
}
.hero .tagline {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Section */
.section { margin: 52px 0; }
.section-title { text-align: center; margin-bottom: 24px; }

/* CTA banner */
.cta-banner {
    background: linear-gradient(135deg, #1b1b1f 0%, #22201a 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    text-align: center;
    margin: 36px 0;
}
.cta-banner h2 { color: var(--accent); margin-bottom: 12px; }
.cta-banner p { color: var(--text-muted); margin-bottom: 20px; }

/* Incompatibility test page */
.test-form {
    max-width: 600px;
    margin: 0 auto;
}

.sign-picker {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 32px 0;
}

.picker-group {
    text-align: center;
}

.picker-group label {
    display: block;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.picker-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
}
.picker-btn:hover {
    border-color: var(--text-muted);
    color: var(--text);
}
.picker-btn.selected {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}
.picker-btn .picker-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
}

.picker-vs {
    text-align: center;
    font-family: var(--font-sans);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.test-submit {
    text-align: center;
    margin-top: 24px;
}

/* Result page */
.result-header {
    text-align: center;
    padding: 32px 0;
}

.result-signs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.result-sign {
    text-align: center;
}

.result-sign-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 50%;
    margin-bottom: 6px;
}

.result-sign .name {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.result-vs {
    font-family: var(--font-sans);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent);
}

/* Loading state */
.loading-state {
    text-align: center;
    padding: 48px 0;
}

.loading-state .spinner-lg {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.loading-state p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Forms */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 1rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--border-focus); }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238e8e96' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}
.alert-error { background: rgba(255,69,58,0.1); border: 1px solid rgba(255,69,58,0.3); color: #ff6961; }
.alert-success { background: rgba(48,209,88,0.1); border: 1px solid rgba(48,209,88,0.3); color: #30d158; }

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sign page header */
.sign-header {
    text-align: center;
    padding: 36px 0 16px;
}

.sign-header-img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: 50%;
    margin-bottom: 12px;
}

.sign-header .element-badge {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 14px;
    border-radius: 20px;
    margin-top: 8px;
}
.sign-header .element-badge.fire { background: rgba(240,128,60,0.15); color: var(--fire); }
.sign-header .element-badge.earth { background: rgba(139,157,119,0.15); color: var(--earth); }
.sign-header .element-badge.air { background: rgba(126,184,218,0.15); color: var(--air); }
.sign-header .element-badge.water { background: rgba(106,127,210,0.15); color: var(--water); }

/* About page */
.about-content {
    max-width: 620px;
    margin: 0 auto;
    padding: 36px 0;
}
.about-content h1 { text-align: center; margin-bottom: 32px; }
.about-content h2 { margin-top: 2em; }

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* Responsive */
@media (max-width: 720px) {
    .site-header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--bg);
    }

    .burger { display: flex; }

    .main-nav {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 72px 24px 32px;
        background: var(--bg-card);
        z-index: 100;
        overflow-y: auto;
    }
    .main-nav.open { display: flex; }

    .main-nav a {
        width: 100%;
        padding: 14px 0;
        font-size: 1rem;
        border-bottom: 1px solid var(--border);
    }
    .main-nav a:last-child { border-bottom: none; }

    .main-nav .btn.btn-sm {
        margin-top: 8px;
        text-align: center;
    }

    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }
}

@media (max-width: 600px) {
    .hero h1 { font-size: 2.2rem; }
    .hero .tagline { font-size: 0.95rem; }
    .sign-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .sign-card { padding: 14px 8px; }
    .sign-card .sign-img { width: 40px; height: 40px; }
    .picker-grid { grid-template-columns: repeat(3, 1fr); }
    .result-signs { gap: 16px; }
    .result-sign-img { width: 56px; height: 56px; }
    .footer-inner { flex-direction: column; text-align: center; }
}
