/* Mercury Microsite — Dark space theme */

:root {
    --bg: #080818;
    --bg-card: #0e0e24;
    --text: #d0d0d8;
    --text-dim: #707088;
    --text-bright: #eeeef4;
    --accent: #8cc8e8;
    --accent-glow: rgba(140, 200, 232, 0.3);
    --retrograde: #e8654a;
    --retrograde-glow: rgba(232, 101, 74, 0.3);
    --direct: #5acea8;
    --shadow-color: #6a5a8a;
    --border: #1a1a3a;
    --card-border: #222244;
    --ingress: #c09ae0;
    --aspect: #e0c878;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

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

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

#starfield {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

.mercury-page {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 4rem 0 3rem;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

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

.mercury-sphere {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%,
        #b8b8c0 0%,
        #8a8a96 25%,
        #5a5a68 50%,
        #3a3a48 75%,
        #1a1a28 100%
    );
    box-shadow:
        inset -20px -10px 40px rgba(0, 0, 0, 0.7),
        inset 10px 10px 20px rgba(255, 255, 255, 0.05);
    animation: spin 30s linear infinite;
    position: relative;
    overflow: hidden;
}

/* Surface texture simulation */
.mercury-sphere::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 60% 30%, rgba(255,255,255,0.08) 0%, transparent 15%),
        radial-gradient(circle at 25% 65%, rgba(0,0,0,0.2) 0%, transparent 20%),
        radial-gradient(circle at 70% 70%, rgba(0,0,0,0.15) 0%, transparent 18%),
        radial-gradient(circle at 45% 20%, rgba(0,0,0,0.12) 0%, transparent 12%),
        radial-gradient(circle at 80% 45%, rgba(255,255,255,0.04) 0%, transparent 10%),
        radial-gradient(circle at 15% 40%, rgba(0,0,0,0.18) 0%, transparent 22%),
        radial-gradient(circle at 55% 55%, rgba(0,0,0,0.1) 0%, transparent 14%);
    animation: spin-reverse 50s linear infinite;
}

/* Terminator / day-night boundary */
.mercury-sphere::after {
    content: '';
    position: absolute;
    top: -5%; left: 30%; right: -20%; bottom: -5%;
    border-radius: 50%;
    background: linear-gradient(to right,
        transparent 0%,
        rgba(0, 0, 0, 0.4) 40%,
        rgba(0, 0, 0, 0.8) 100%
    );
}

.planet-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

body.retrograde-mode .planet-glow {
    background: radial-gradient(circle, var(--retrograde-glow) 0%, transparent 70%);
}

@keyframes spin {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}
@keyframes spin-reverse {
    from { transform: rotateY(360deg); }
    to { transform: rotateY(0deg); }
}

.headline {
    font-size: 2.4rem;
    font-weight: 300;
    color: var(--text-bright);
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
    transition: color 0.5s;
}
.headline.loading { color: var(--text-dim); font-size: 1.4rem; }

body.retrograde-mode .headline {
    color: var(--retrograde);
    text-shadow: 0 0 30px var(--retrograde-glow);
}

.subheadline {
    font-size: 1rem;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}

/* --- Countdown --- */
.countdown {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.countdown-unit {
    text-align: center;
    min-width: 64px;
}

.countdown-value {
    font-size: 2rem;
    font-weight: 200;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

body.retrograde-mode .countdown-value {
    color: var(--retrograde);
}

.countdown-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

.countdown-date {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    width: 100%;
    text-align: center;
}

/* --- Sections --- */
.section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.section h2 {
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--accent);
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.section-intro {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}

.loading-text {
    color: var(--text-dim);
    font-style: italic;
    padding: 2rem 0;
    text-align: center;
}

/* --- Position card --- */
.position-card {
    background: var(--bg-card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.position-item {
    text-align: center;
    padding: 0.8rem;
}

.position-value {
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--text-bright);
    margin-bottom: 0.2rem;
}

.position-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}

.position-sign-big {
    font-size: 2.5rem;
    line-height: 1;
}

.position-movement {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.position-movement.retrograde {
    background: rgba(232, 101, 74, 0.15);
    color: var(--retrograde);
    border: 1px solid rgba(232, 101, 74, 0.3);
}

.position-movement.direct {
    background: rgba(90, 206, 168, 0.15);
    color: var(--direct);
    border: 1px solid rgba(90, 206, 168, 0.3);
}

.position-movement.stationary {
    background: rgba(140, 200, 232, 0.15);
    color: var(--accent);
    border: 1px solid rgba(140, 200, 232, 0.3);
}

.position-paragraph {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text);
}

/* --- Retrograde summary cards --- */
.retrograde-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.rx-period-card {
    background: var(--bg-card);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.2rem;
    border-left: 3px solid var(--retrograde);
}

.rx-period-card.future { opacity: 0.8; }
.rx-period-card.past { opacity: 0.5; }

.rx-period-title {
    font-size: 1rem;
    font-weight: 400;
    color: var(--retrograde);
    margin-bottom: 0.5rem;
}

.rx-period-dates {
    font-size: 0.85rem;
    color: var(--text-dim);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.2rem 0.8rem;
}

.rx-period-dates dt {
    color: var(--text-dim);
    font-weight: 500;
}

.rx-period-dates dd {
    color: var(--text);
}

/* --- Timeline --- */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-event {
    position: relative;
    padding: 0.6rem 0 0.6rem 1.2rem;
    margin-bottom: 0.3rem;
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: -1.95rem;
    top: 0.85rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--bg);
    z-index: 1;
}

/* Event type colors */
.timeline-event.station_retrograde::before { background: var(--retrograde); box-shadow: 0 0 8px var(--retrograde-glow); }
.timeline-event.station_direct::before { background: var(--direct); box-shadow: 0 0 8px rgba(90, 206, 168, 0.4); }
.timeline-event.ingress::before { background: var(--ingress); }
.timeline-event.aspect::before { background: var(--aspect); }

.timeline-event.today-marker::before {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    width: 12px;
    height: 12px;
    left: -2.02rem;
    top: 0.8rem;
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.timeline-desc {
    font-size: 0.9rem;
    color: var(--text);
}

.timeline-event.today-marker .timeline-desc {
    color: var(--accent);
    font-weight: 500;
}

.timeline-event.station_retrograde .timeline-desc { color: var(--retrograde); font-weight: 500; }
.timeline-event.station_direct .timeline-desc { color: var(--direct); font-weight: 500; }

/* Shadow period bands */
.timeline-shadow-band {
    position: relative;
    padding: 0.3rem 0 0.3rem 1.2rem;
    margin-left: -2rem;
    padding-left: 3.2rem;
    background: rgba(106, 90, 138, 0.08);
    border-left: 2px solid transparent;
    font-size: 0.8rem;
    color: var(--shadow-color);
    font-style: italic;
}

/* --- Content sections --- */
.content-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.content-section h2 {
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--accent);
    margin-bottom: 1rem;
}

.content-section p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.8;
}

.content-section p:last-child { margin-bottom: 0; }

/* Quick facts grid */
.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.fact-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.8rem;
    background: var(--bg-card);
    border-radius: 6px;
    font-size: 0.85rem;
}

.fact-label { color: var(--text-dim); }
.fact-value { color: var(--text-bright); font-weight: 400; }

/* Signs grid */
.signs-grid {
    display: grid;
    gap: 0.8rem;
}

.sign-card {
    background: var(--bg-card);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem 1.2rem;
}

.sign-header {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.4rem;
}

.sign-symbol { font-size: 1.2rem; margin-right: 0.4rem; }

.sign-text {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.7;
}

/* --- Teaser --- */
.teaser-section {
    text-align: center;
}

.teaser-text {
    color: var(--text-dim);
    margin-bottom: 1.2rem;
}

.teaser-input {
    position: relative;
    display: inline-block;
}

.teaser-input input {
    background: var(--bg-card);
    border: 1px solid var(--card-border);
    color: var(--text-dim);
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    width: 260px;
    cursor: not-allowed;
}

.teaser-badge {
    position: absolute;
    right: -3rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(140, 200, 232, 0.15);
    color: var(--accent);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* --- Footer --- */
.mercury-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.mercury-footer a {
    color: var(--accent);
    text-decoration: none;
}

.mercury-footer a:hover { text-decoration: underline; }

/* --- Responsive --- */
@media (max-width: 600px) {
    .mercury-page { padding: 0 1rem 2rem; }
    .hero { padding: 2.5rem 0 2rem; min-height: auto; }
    .planet-container { width: 120px; height: 120px; }
    .mercury-sphere { width: 120px; height: 120px; }
    .planet-glow { width: 170px; height: 170px; }
    .headline { font-size: 1.6rem; }
    .countdown-value { font-size: 1.5rem; }
    .countdown-unit { min-width: 50px; }
    .position-grid { grid-template-columns: repeat(2, 1fr); }
    .facts-grid { grid-template-columns: 1fr; }
}
