:root {
    /* Color Palette - Premium Time-Travel Theme */
    --primary-gold: #D4AF37;
    --gold-glow: rgba(212, 175, 55, 0.4);
    --gold-dark: #B8860B;
    --accent-amber: #FFBF00;
    
    --bg-dark: #0A0E14;
    --card-bg: #161B22;
    --card-border: #30363D;
    --text-primary: #F0F6FC;
    --text-muted: #8B949E;
    --text-gold: #D4AF37;
    
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-gold: 0 0 15px rgba(212, 175, 55, 0.2);
    --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.5);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    
    --font-cinzel: 'Cinzel', serif;
    --font-inter: 'Inter', sans-serif;
}

/* Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

.cinzel-font {
    font-family: var(--font-cinzel);
}

.gold-text {
    color: var(--text-gold);
}

.gold-glow {
    box-shadow: 0 0 10px var(--gold-glow);
}

.hidden {
    display: none !important;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header & Navigation */
.main-header {
    background: rgba(10, 14, 20, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-image {
    height: 32px;
    margin-right: 10px;
}

.brand-name {
    font-weight: 700;
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition-smooth);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-gold);
}

.mobile-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background: var(--bg-dark);
    padding: 2rem;
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    z-index: 999;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 6rem 1rem;
    position: relative;
    overflow: hidden;
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.hero-subtext {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

.hero-visual {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
}

.orbit-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto;
}

.orbit-ring {
    position: absolute;
    border: 1px solid var(--primary-gold);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: rotate 20s linear infinite;
}

.orbit-ring:nth-child(1) { width: 300px; height: 300px; }
.orbit-ring:nth-child(2) { width: 500px; height: 500px; animation-direction: reverse; }

@keyframes rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Buttons */
.primary-btn {
    background: linear-gradient(135deg, var(--primary-gold), var(--gold-dark));
    color: var(--bg-dark);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-family: var(--font-cinzel);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px var(--gold-glow);
}

.secondary-btn {
    background: transparent;
    color: var(--primary-gold);
    border: 1px solid var(--primary-gold);
    padding: 1rem 2.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-family: var(--font-cinzel);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.secondary-btn:hover {
    background: var(--primary-gold);
    color: var(--bg-dark);
}

/* Wizard Progress Bar */
.progress-container {
    margin-bottom: 3rem;
}

.progress-bar {
    height: 4px;
    background: var(--card-border);
    border-radius: 2px;
    margin-bottom: 1.5rem;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gold);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--primary-gold);
    transition: width 0.5s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    width: 80px;
}

.step span {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: var(--transition-smooth);
}

.step.active {
    color: var(--primary-gold);
}

.step.active span {
    border-color: var(--primary-gold);
    background: var(--primary-gold);
    color: var(--bg-dark);
}

/* Wizard Form */
.wizard-section {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-premium);
}

.form-step h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.input-group input, 
.input-group select, 
.input-group textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition-smooth);
}

.input-group input:focus, 
.input-group select:focus, 
.input-group textarea:focus {
    border-color: var(--primary-gold);
    outline: none;
    box-shadow: 0 0 5px var(--gold-glow);
}

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

/* Tag Pills */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag-pill {
    padding: 0.5rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tag-pill:hover {
    border-color: var(--primary-gold);
}

.tag-pill.selected {
    background: var(--primary-gold);
    color: var(--bg-dark);
    border-color: var(--primary-gold);
    font-weight: 600;
}

/* Personality Sliders */
.personality-grid {
    display: grid;
    gap: 2rem;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.gold-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--card-border);
    outline: none;
    border-radius: 2px;
}

.gold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-gold);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--gold-glow);
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.portal-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 2rem;
}

.portal-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-gold);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.portal-ring:nth-child(2) { width: 80%; height: 80%; top: 10%; left: 10%; animation-duration: 2s; animation-direction: reverse; }
.portal-ring:nth-child(3) { width: 60%; height: 60%; top: 20%; left: 20%; animation-duration: 3s; }

.hourglass {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 60px;
}

.loading-status {
    font-family: var(--font-cinzel);
    color: var(--primary-gold);
    font-size: 1.2rem;
    letter-spacing: 1px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Section */
.results-section {
    animation: fadeIn 1s ease;
}

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

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.results-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 0.75rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tab-btn.active {
    background: var(--primary-gold);
    color: var(--bg-dark);
    border-color: var(--primary-gold);
}

/* Historical Card */
.parchment {
    background: radial-gradient(circle, #f4e4bc 0%, #e2d1a3 100%);
    color: #4a3728;
    padding: 3rem;
    border-radius: 8px;
    position: relative;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.1), 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
}

.parchment::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.6" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.05"/></svg>');
    pointer-events: none;
}

.era-badge {
    display: inline-block;
    background: #4a3728;
    color: #f4e4bc;
    padding: 0.25rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.historical-card h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.location-text {
    font-style: italic;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.narrative-body {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.fun-facts h4 {
    border-bottom: 1px solid rgba(74, 55, 40, 0.2);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.fun-facts ul {
    list-style: none;
}

.fun-facts li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.fun-facts li::before {
    content: "📜";
    position: absolute;
    left: 0;
}

/* Future Timeline */
.timeline-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline-line {
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--primary-gold), transparent);
}

.timeline-node {
    position: relative;
    padding-left: 60px;
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateX(-20px);
    transition: var(--transition-smooth);
}

.timeline-node.visible {
    opacity: 1;
    transform: translateX(0);
}

.node-marker {
    position: absolute;
    left: 11px;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--primary-gold);
    box-shadow: 0 0 10px var(--primary-gold);
    z-index: 2;
}

.node-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
}

.period-label {
    display: inline-block;
    color: var(--primary-gold);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.key-metric {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-amber);
}

/* Focus Recommendations */
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.rec-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    transition: var(--transition-smooth);
}

.rec-card:hover {
    border-color: var(--primary-gold);
    transform: translateY(-5px);
}

.rec-action {
    color: var(--primary-gold);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.rec-why {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.impact-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.8rem;
}

.score-bar {
    height: 4px;
    flex: 1;
    background: var(--card-border);
    border-radius: 2px;
}

.score-fill {
    height: 100%;
    background: var(--accent-amber);
    border-radius: 2px;
}

/* FAQ Section */
.faq-section {
    margin-top: 8rem;
    padding-top: 4rem;
    border-top: 1px solid var(--card-border);
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.faq-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
}

.faq-question {
    padding: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-muted);
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

/* Footer */
.main-footer {
    margin-top: 8rem;
    padding: 4rem 1rem;
    border-top: 1px solid var(--card-border);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-brand p:first-child {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.footer-links a:hover {
    color: var(--primary-gold);
}

.openclaw-badge-container {
    margin: 1rem 0;
}

.openclaw-badge {
    display: inline-flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    background: var(--card-bg);
}

.openclaw-badge span { font-size: 0.7rem; color: var(--text-muted); }
.openclaw-badge strong { font-size: 0.9rem; }

.copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 { font-size: 2.5rem; }
    .nav-links { display: none; }
    .mobile-toggle { display: block; }
    .wizard-section { padding: 2rem 1.5rem; }
    .input-grid { grid-template-columns: 1fr; }
    .results-tabs { flex-wrap: wrap; }
    .parchment { padding: 1.5rem; }
}

@media (max-width: 480px) {
    .hero-section h1 { font-size: 2rem; }
    .primary-btn, .secondary-btn { width: 100%; padding: 1rem; }
    .hero-cta { display: flex; flex-direction: column; gap: 1rem; }
    .step label { display: none; }
    .step { width: 40px; }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* Offline Banner */
.offline-banner {
    background: #4a3728;
    color: #f4e4bc;
    padding: 0.75rem;
    text-align: center;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    font-weight: 600;
    border: 1px solid var(--primary-gold);
}

/* 44px touch targets */
button, input, select, .tag-pill, .nav-link, .faq-question, .tab-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-pill {
    padding: 0 1rem;
}

.results-actions {
    display: flex;
    gap: 1rem;
}

@media (max-width: 480px) {
    .results-actions {
        flex-direction: column;
        width: 100%;
    }
    .results-header {
        flex-direction: column;
        gap: 1.5rem;
    }
    .tag-cloud {
        justify-content: center;
    }
}

/* Historical Card Polish */
.parchment {
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.1), inset 0 0 50px rgba(0,0,0,0.1);
}

.parchment:hover {
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2), inset 0 0 50px rgba(0,0,0,0.1);
    border-color: rgba(212, 175, 55, 0.5);
    transition: var(--transition-smooth);
}

/* Recommendations Impact Score Visual */
.impact-score {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.score-dots {
    display: flex;
    gap: 4px;
}

.score-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--card-border);
}

.score-dot.filled {
    background: var(--accent-amber);
    box-shadow: 0 0 5px var(--accent-amber);
}

.slider-value {
    color: var(--primary-gold);
    font-size: 0.9rem;
    font-weight: 700;
}

/* Utility */
.margin-top-sm { margin-top: 0.5rem; }
.margin-top-lg { margin-top: 2rem; }

/* 44px touch targets */
button, input, select, .tag-pill, .nav-link, .faq-question {
    min-height: 44px;
}

/* Print Styles */
@media print {
    .main-header, .wizard-nav, .results-tabs, .faq-section, .main-footer, #startOverBtn {
        display: none !important;
    }
    .container { width: 100%; max-width: none; padding: 0; }
    .parchment { background: white; color: black; border: 1px solid #ddd; box-shadow: none; }
    .timeline-node { opacity: 1; transform: none; }
}

/* ABSOLUTE LAST RULE */
.hidden { display: none !important; }
