/* ═══════════════════════════════════════════════════════
   THE SAME SKY — Stylesheet
   A scientific instrument for visualizing cross-cultural
   astronomical convergence across 100,000 years.
   ═══════════════════════════════════════════════════════ */

/* Hide site footer — this page uses a fixed bottom bar */
#magna-site-footer,
.magna-footer {
    display: none !important;
}

:root {
    --sky-void: #000011;
    --sky-deep: #0a1628;
    --sky-surface: #1a1a2e;
    --sky-amber: #d4a373;
    --sky-gold: #e8c87a;
    --sky-pleiades: #aaccff;
    --sky-text: #f0ead6;
    --sky-text-dim: #c0b8a8;
    --sky-text-muted: #808080;
    --sky-panel: rgba(5, 5, 17, 0.92);
    --sky-panel-border: rgba(212, 163, 115, 0.15);
    --sky-panel-border-hover: rgba(212, 163, 115, 0.3);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--sky-void);
    color: var(--sky-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Container ─────────────────────────────────────── */

#same-sky-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 36px);
    overflow: visible;
    z-index: 1;
}

#same-sky-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ─── Cinematic Overlay ─────────────────────────────── */

#cinematic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 48px;
}

.cinematic-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(14px, 2vw, 22px);
    font-weight: 400;
    font-style: italic;
    color: var(--sky-text);
    text-align: center;
    opacity: 0;
    transition: opacity 1.5s ease;
    max-width: 600px;
    padding: 0 40px;
    letter-spacing: 0.02em;
    line-height: 1.6;
    text-shadow: 0 0 30px rgba(0, 0, 17, 0.8);
}

.cinematic-text.visible {
    opacity: 1;
}

.culture-counter {
    position: absolute;
    bottom: 60px;
    right: 60px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: var(--sky-text-dim);
    opacity: 0;
    transition: opacity 0.5s ease;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.culture-counter.visible {
    opacity: 1;
}

/* ─── Culture Labels (appear during dispersal) ──────── */

.culture-label {
    position: absolute;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--sky-amber);
    opacity: 0;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 0 20px rgba(0, 0, 17, 0.9);
    transition: opacity 0.8s ease;
    letter-spacing: 0.05em;
}

.culture-label.visible {
    opacity: 1;
}

.culture-label .culture-label-script {
    display: block;
    font-family: 'Noto Sans', 'Noto Sans Arabic', 'Noto Sans Devanagari', 'Noto Sans Cherokee', sans-serif;
    font-size: 11px;
    color: var(--sky-text-dim);
    margin-top: 2px;
}

/* ─── Tagline ───────────────────────────────────────── */

.tagline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 15;
    gap: 16px;
    padding-top: 48px;
}

.tagline-stats {
    font-family: 'Inter', sans-serif;
    font-size: clamp(11px, 1.4vw, 15px);
    font-weight: 300;
    color: var(--sky-text-dim);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

.tagline-primary {
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(28px, 5vw, 64px);
    font-weight: 400;
    color: var(--sky-text);
    letter-spacing: 0.08em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 2s ease 0.5s, transform 2s ease 0.5s;
    text-shadow: 0 0 60px rgba(212, 163, 115, 0.2);
}

.tagline-secondary {
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(22px, 3.5vw, 48px);
    font-weight: 400;
    color: var(--sky-amber);
    letter-spacing: 0.06em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 2s ease 1.5s, transform 2s ease 1.5s;
    text-shadow: 0 0 40px rgba(212, 163, 115, 0.3);
}

.tagline-overlay.visible .tagline-stats,
.tagline-overlay.visible .tagline-primary,
.tagline-overlay.visible .tagline-secondary {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Title ─────────────────────────────────────────── */

.title-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 20;
    gap: 40px;
    padding-top: 48px;
}

.title-main {
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(32px, 6vw, 80px);
    font-weight: 500;
    color: var(--sky-text);
    letter-spacing: 0.2em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 2s ease, transform 2s ease;
    text-shadow: 0 0 80px rgba(170, 204, 255, 0.15);
}

.title-overlay.visible .title-main {
    opacity: 1;
    transform: translateY(0);
}

.explore-btn {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sky-amber);
    background: transparent;
    border: 1px solid var(--sky-panel-border);
    padding: 14px 48px;
    cursor: pointer;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1.5s ease 0.8s, transform 1.5s ease 0.8s, border-color 0.3s ease, background 0.3s ease;
}

.title-overlay.visible .explore-btn {
    opacity: 1;
    transform: translateY(0);
}

.explore-btn:hover {
    border-color: var(--sky-amber);
    background: rgba(212, 163, 115, 0.08);
}

/* ─── Skip Button ───────────────────────────────────── */

.skip-btn {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sky-text-muted);
    background: transparent;
    border: 1px solid rgba(128, 128, 128, 0.2);
    padding: 8px 24px;
    cursor: pointer;
    transition: opacity 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.skip-btn:hover {
    color: var(--sky-text-dim);
    border-color: rgba(128, 128, 128, 0.4);
}

.skip-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ─── Audio Toggle ──────────────────────────────────── */

.audio-toggle {
    position: absolute;
    top: 56px;
    right: 20px;
    z-index: 30;
    background: transparent;
    border: 1px solid rgba(128, 128, 128, 0.2);
    color: var(--sky-text-muted);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.audio-toggle:hover {
    color: var(--sky-text-dim);
    border-color: rgba(128, 128, 128, 0.4);
}

.audio-toggle .hidden {
    display: none;
}

/* ─── Interactive UI ────────────────────────────────── */

.interactive-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    overflow: visible;
}

.interactive-ui > * {
    pointer-events: auto;
}

/* Star Navigation — bottom status bar */
.star-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateZ(0);
    will-change: transform;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    background: rgba(16, 16, 28, 0.98);
    border-top: 1px solid rgba(212, 163, 115, 0.12);
    padding: 0 12px;
    overflow-x: auto;
    scrollbar-width: none;
    z-index: 200;
}

.star-nav::-webkit-scrollbar { display: none; }

.star-nav-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.star-nav-group-label {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    user-select: none;
    opacity: 0.65;
    margin-right: 2px;
}

.star-nav-group-pills {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.star-nav-divider {
    width: 1px;
    height: 18px;
    background: rgba(240, 234, 214, 0.06);
    flex-shrink: 0;
    margin: 0 4px;
}

.star-nav-btn {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: rgba(220, 214, 200, 0.85);
    background: transparent;
    border: 1px solid var(--cat-border, rgba(170, 204, 255, 0.15));
    border-radius: 12px;
    padding: 4px 10px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

/* Fill bar — proportional to convergence score */
.star-nav-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--fill, 0%);
    background: var(--cat-fill, rgba(170, 204, 255, 0.06));
    border-radius: 12px;
    transition: width 0.5s ease, background 0.3s ease;
    pointer-events: none;
}

/* Category: Stellar — cool blue */
.star-nav-stellar {
    --cat-fill: rgba(170, 204, 255, 0.06);
    --cat-border: rgba(170, 204, 255, 0.10);
}
.star-nav-stellar:hover {
    --cat-fill: rgba(170, 204, 255, 0.12);
    color: rgba(220, 230, 255, 0.9);
    border-color: rgba(170, 204, 255, 0.22);
}

/* Category: Solar — warm gold */
.star-nav-solar {
    --cat-fill: rgba(255, 200, 60, 0.06);
    --cat-border: rgba(255, 200, 60, 0.10);
}
.star-nav-solar:hover {
    --cat-fill: rgba(255, 200, 60, 0.14);
    color: rgba(255, 220, 100, 0.9);
    border-color: rgba(255, 200, 60, 0.25);
}

/* Category: Lunar — cool silver */
.star-nav-lunar {
    --cat-fill: rgba(200, 215, 255, 0.06);
    --cat-border: rgba(200, 215, 255, 0.10);
}
.star-nav-lunar:hover {
    --cat-fill: rgba(200, 215, 255, 0.12);
    color: rgba(210, 220, 255, 0.9);
    border-color: rgba(200, 215, 255, 0.22);
}

.star-nav-btn:hover {
    color: rgba(220, 214, 200, 0.85);
    background: rgba(255, 255, 255, 0.03);
}

.star-nav-btn.active {
    font-weight: 500;
    color: var(--star-color, var(--sky-pleiades));
    border-color: color-mix(in srgb, var(--star-color, var(--sky-pleiades)) 40%, transparent);
    background: rgba(255, 255, 255, 0.03);
}
.star-nav-btn.active::before {
    opacity: 0.5;
}

/* Group label category colors */
.star-nav-label-stellar { color: rgba(170, 204, 255, 0.6); }
.star-nav-label-solar { color: rgba(255, 200, 60, 0.6); }
.star-nav-label-lunar { color: rgba(200, 215, 255, 0.6); }

/* Explainer text — hidden, not needed with bottom bar */
.star-nav-explainer {
    display: none;
}

.star-nav-explainer.faded {
    opacity: 0;
}

/* Legacy divider label — no longer used, kept for compat */
.star-nav-divider-label {
    display: none;
}

/* Convergence score — the hero number */
.star-nav-score {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: var(--cat-score, rgba(170, 204, 255, 0.5));
    margin-left: 4px;
    position: relative;
    z-index: 1;
    opacity: 0.7;
    transition: opacity 0.25s ease;
}
.star-nav-stellar .star-nav-score { --cat-score: rgba(170, 204, 255, 0.6); }
.star-nav-solar .star-nav-score { --cat-score: rgba(255, 200, 60, 0.6); }
.star-nav-lunar .star-nav-score { --cat-score: rgba(200, 215, 255, 0.6); }
.star-nav-btn:hover .star-nav-score { opacity: 0.9; }
.star-nav-btn.active .star-nav-score { opacity: 1; }

/* Info Panel */
.info-panel {
    position: absolute;
    right: 0;
    top: 0;
    width: 380px;
    max-width: 90vw;
    height: 100%;
    background: var(--sky-panel);
    border-left: 1px solid var(--sky-panel-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 60px 30px 30px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 25;
}

.info-panel.visible {
    transform: translateX(0);
}

.info-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--sky-text-muted);
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.info-close:hover {
    color: var(--sky-text);
}

/* Info Panel Content */
.info-culture-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 22px;
    font-weight: 500;
    color: var(--sky-amber);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.info-cultural-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--sky-text);
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.info-original-script {
    font-family: 'Noto Sans', 'Noto Sans Arabic', 'Noto Sans Devanagari', 'Noto Sans Cherokee', sans-serif;
    font-size: 18px;
    color: var(--sky-text-dim);
    margin-bottom: 16px;
}

.info-region {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 300;
    color: var(--sky-text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.info-story {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 17px;
    font-weight: 400;
    font-style: italic;
    color: var(--sky-text);
    line-height: 1.7;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--sky-panel-border);
}

.info-lost-sister {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--sky-text-dim);
    margin-bottom: 16px;
    padding: 12px 16px;
    background: rgba(170, 204, 255, 0.04);
    border-left: 2px solid var(--sky-pleiades);
    line-height: 1.5;
}

.info-lost-sister strong {
    color: var(--sky-pleiades);
    font-weight: 500;
}

.info-encoding {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: var(--sky-amber);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding: 6px 10px;
    background: rgba(212, 163, 115, 0.06);
    border: 1px solid rgba(212, 163, 115, 0.1);
    display: inline-block;
}

.info-citation {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 300;
    color: var(--sky-text-muted);
    line-height: 1.6;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--sky-panel-border);
}

.info-key-finding {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--sky-text);
    line-height: 1.6;
    margin-top: 16px;
    padding: 16px;
    background: rgba(212, 163, 115, 0.04);
    border: 1px solid rgba(212, 163, 115, 0.08);
}

/* Convergence Display — inline in bottom bar */
.convergence-display {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    color: rgba(192, 184, 168, 0.35);
    letter-spacing: 0.03em;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.5s ease;
    flex-shrink: 0;
}

.convergence-display.visible {
    opacity: 1;
}

#convergence-label {
    display: none;
}

#convergence-score {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: var(--sky-pleiades);
    font-weight: 600;
}

.star-nav-spacer {
    flex: 1;
}

/* Overview Play Button — inline in bottom bar */
.overview-play-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px 0 0;
    border-radius: 0;
    border: none;
    border-right: 1px solid rgba(240, 234, 214, 0.06);
    background: transparent;
    color: rgba(200, 178, 110, 0.7);
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-right: 4px;
    cursor: pointer;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.overview-play-btn:hover {
    color: rgba(200, 178, 110, 0.9);
}

.overview-play-btn.playing {
    color: rgba(170, 204, 255, 0.8);
}

/* About Button — top right corner */
.about-btn {
    position: absolute;
    top: 52px;
    right: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.06em;
    color: rgba(128, 128, 128, 0.4);
    background: transparent;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    transition: color 0.2s ease;
    white-space: nowrap;
    z-index: 22;
}

.about-btn:hover {
    color: var(--sky-text-dim);
    border-color: rgba(128, 128, 128, 0.3);
}

/* About Modal */
.about-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 17, 0.9);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.about-content {
    background: var(--sky-panel);
    border: 1px solid var(--sky-panel-border);
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
}

.about-content h2 {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 24px;
    font-weight: 500;
    color: var(--sky-text);
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

.about-content h3 {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--sky-amber);
    letter-spacing: 0.05em;
    margin-top: 28px;
    margin-bottom: 12px;
}

.about-content p,
.about-content li {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 300;
    color: var(--sky-text-dim);
    line-height: 1.7;
    margin-bottom: 10px;
}

.about-lead {
    font-family: 'Cormorant Garamond', Georgia, serif !important;
    font-size: 17px !important;
    font-style: italic;
    color: var(--sky-text) !important;
}

.about-content ul {
    list-style: none;
    padding-left: 0;
}

.about-content ul li {
    padding-left: 16px;
    position: relative;
}

.about-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 4px;
    height: 4px;
    background: var(--sky-amber);
    border-radius: 50%;
}

.citations li {
    font-size: 12px !important;
    color: var(--sky-text-muted) !important;
}

.citations em {
    color: var(--sky-text-dim);
}

.about-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--sky-text-muted);
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-close:hover {
    color: var(--sky-text);
}

.about-footer {
    margin-top: 28px !important;
    padding-top: 16px;
    border-top: 1px solid var(--sky-panel-border);
    color: var(--sky-text-muted) !important;
    font-size: 11px !important;
}

.about-footer a {
    color: var(--sky-amber);
    text-decoration: none;
}

/* ─── Star Info (when clicking a star, not a culture) ── */

.star-info-header {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--sky-pleiades);
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.star-info-type {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 300;
    color: var(--sky-text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.star-info-description {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 16px;
    color: var(--sky-text);
    line-height: 1.7;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--sky-panel-border);
}

.star-cultures-list {
    list-style: none;
    padding: 0;
}

.star-cultures-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(128, 128, 128, 0.08);
    cursor: pointer;
    transition: background 0.2s ease;
}

.star-cultures-list li:hover {
    background: rgba(170, 204, 255, 0.04);
}

.star-culture-name {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--sky-amber);
}

.star-culture-cultural-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 16px;
    color: var(--sky-text);
    margin-top: 2px;
}

.star-culture-summary {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 300;
    color: var(--sky-text-dim);
    margin-top: 4px;
    line-height: 1.5;
}

/* ─── Utility ───────────────────────────────────────── */

.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.2);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.4);
}

/* ─── Touch Devices ─────────────────────────────────── */

@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for all interactive elements */
    .star-nav-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 14px;
    }

    .skip-btn,
    .explore-btn,
    .about-btn,
    .audio-toggle,
    .info-close,
    .about-close {
        min-height: 44px;
        min-width: 44px;
    }

    .star-cultures-list li {
        padding: 16px 0;
    }
}

/* ─── Responsive: Tablet Portrait (iPad) ────────────── */

@media (max-width: 1024px) {
    .info-panel {
        width: 340px;
    }

    .star-nav {
        gap: 8px;
        max-width: 98vw;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 6px 8px 4px;
    }

    .star-nav::-webkit-scrollbar { display: none; }

    .star-nav-group-pills {
        gap: 3px;
    }

    .star-nav-btn {
        padding: 6px 10px;
        font-size: 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .star-nav-explainer {
        font-size: 10px;
        top: 100px;
    }

    .tagline-primary {
        font-size: clamp(24px, 4.5vw, 52px);
    }

    .tagline-secondary {
        font-size: clamp(18px, 3vw, 40px);
    }

    .about-content {
        max-width: 90vw;
        padding: 30px;
    }
}

/* ─── Page orb: push below star nav on mobile ────────── */

@media (max-width: 768px) {
    .companion-orb {
        bottom: 8px !important;
    }
    .companion-orb-transcript {
        bottom: 100px !important;
    }
}

/* ─── Responsive: Phone Landscape / Small Tablet ────── */

@media (max-width: 768px) {
    .star-nav {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        justify-content: flex-start;
        max-width: 100vw;
        gap: 6px;
        padding: 0 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .star-nav::-webkit-scrollbar { display: none; }

    .star-nav-group {
        flex-direction: row;
        gap: 4px;
        flex-shrink: 0;
    }

    .star-nav-group-label {
        font-size: 8px;
        writing-mode: horizontal-tb;
        white-space: nowrap;
        align-self: center;
    }

    .star-nav-group-pills {
        gap: 2px;
    }

    .star-nav-divider {
        width: 1px;
        height: 24px;
        margin-top: 0;
        align-self: center;
    }

    .star-nav-btn {
        font-size: 10px;
        padding: 8px 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .star-nav-explainer {
        display: none;
    }

    .info-panel {
        width: 100%;
        max-width: 100%;
        height: 60vh;
        top: auto;
        bottom: 0;
        border-left: none;
        border-top: 1px solid var(--sky-panel-border);
        transform: translateY(100%);
        border-radius: 12px 12px 0 0;
    }

    .info-panel.visible {
        transform: translateY(0);
    }

    .culture-counter {
        bottom: 80px;
        right: 20px;
        font-size: 12px;
    }

    .about-content {
        padding: 20px;
        margin: 8px;
        max-height: 90vh;
    }

    .about-content h2 {
        font-size: 20px;
    }

    .about-content h3 {
        font-size: 14px;
    }

    .convergence-display {
        bottom: auto;
        top: 56px;
        left: 20px;
        transform: none;
        text-align: left;
        font-size: 11px;
    }

    #convergence-score {
        font-size: 15px;
    }

    .about-btn {
        bottom: 12px;
        right: 12px;
        font-size: 10px;
        padding: 5px 10px;
    }

    .audio-toggle {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }

    .skip-btn {
        bottom: 20px;
        font-size: 11px;
        padding: 8px 20px;
    }

    .tagline-primary {
        font-size: clamp(22px, 6vw, 40px);
        letter-spacing: 0.05em;
    }

    .tagline-secondary {
        font-size: clamp(16px, 4.5vw, 30px);
    }

    .tagline-stats {
        font-size: clamp(10px, 2.5vw, 13px);
    }

    .title-main {
        font-size: clamp(24px, 8vw, 48px);
        letter-spacing: 0.12em;
    }

    .explore-btn {
        font-size: 14px;
        padding: 12px 36px;
    }

    .cinematic-text {
        font-size: clamp(13px, 3.5vw, 18px);
        padding: 0 24px;
    }

    /* Info panel content sizing */
    .info-cultural-name {
        font-size: 22px;
    }

    .info-culture-name {
        font-size: 18px;
    }

    .info-story {
        font-size: 15px;
    }

    .star-info-header {
        font-size: 22px;
    }

    .star-info-description {
        font-size: 14px;
    }
}

/* ─── Responsive: Phone Portrait (iPhone SE → iPhone 15 Pro Max) ── */

@media (max-width: 480px) {
    .star-nav {
        bottom: 0;
        max-width: 100vw;
        padding: 0 6px;
        gap: 4px;
    }

    .star-nav-group-label {
        font-size: 7px;
    }

    .star-nav-btn {
        font-size: 9px;
        padding: 7px 8px;
        letter-spacing: 0;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .star-nav-score { display: none; }

    .info-panel {
        height: 65vh;
        padding: 50px 20px 20px;
    }

    .tagline-primary {
        font-size: clamp(20px, 7vw, 36px);
    }

    .tagline-secondary {
        font-size: clamp(14px, 5vw, 26px);
    }

    .title-main {
        font-size: clamp(22px, 9vw, 40px);
        letter-spacing: 0.1em;
    }

    .explore-btn {
        font-size: 13px;
        padding: 10px 28px;
    }

    .cinematic-text {
        font-size: clamp(12px, 4vw, 16px);
        padding: 0 16px;
    }

    .culture-counter {
        bottom: 70px;
        right: 16px;
        font-size: 11px;
    }

    .about-content {
        padding: 16px;
        margin: 4px;
    }
}

/* ─── Responsive: Very small phones (iPhone SE, 320px) ── */

@media (max-width: 360px) {
    .star-nav-group-label { display: none; }

    .star-nav-btn {
        font-size: 8px;
        padding: 6px 6px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .tagline-primary {
        font-size: 20px;
    }

    .tagline-secondary {
        font-size: 14px;
    }

    .title-main {
        font-size: 22px;
    }
}

/* ─── Landscape phone (short viewport) ──────────────── */

@media (max-height: 500px) {
    .tagline-overlay {
        gap: 8px;
    }

    .tagline-primary {
        font-size: clamp(18px, 4vh, 32px);
    }

    .tagline-secondary {
        font-size: clamp(14px, 3vh, 24px);
    }

    .title-main {
        font-size: clamp(20px, 5vh, 36px);
    }

    .title-overlay {
        gap: 20px;
    }

    .star-nav {
        bottom: 0;
        top: auto;
    }

    .star-nav-explainer {
        display: none;
    }

    .star-nav-group {
        flex-direction: row;
        gap: 4px;
    }

    .info-panel {
        height: 100%;
        width: 50vw;
        top: 0;
        bottom: 0;
        border-top: none;
        border-left: 1px solid var(--sky-panel-border);
        border-radius: 0;
        transform: translateX(100%);
    }

    .info-panel.visible {
        transform: translateX(0);
    }
}

/* ─── Large screens (4K, ultrawide) ─────────────────── */

@media (min-width: 2000px) {
    .tagline-primary {
        font-size: 72px;
    }

    .tagline-secondary {
        font-size: 54px;
    }

    .title-main {
        font-size: 90px;
    }

    .info-panel {
        width: 480px;
    }

    .star-nav-btn {
        font-size: 13px;
        padding: 8px 20px;
    }

    .star-nav-group-label {
        font-size: 10px;
    }

    .star-nav-explainer {
        font-size: 12px;
        top: 110px;
    }

    .cinematic-text {
        font-size: 24px;
        max-width: 800px;
    }

    .culture-counter {
        font-size: 16px;
    }
}

/* ─── Safe areas (iPhone notch / Dynamic Island) ────── */

@supports (padding: env(safe-area-inset-top)) {
    .audio-toggle {
        top: calc(12px + env(safe-area-inset-top));
        right: calc(12px + env(safe-area-inset-right));
    }

    .skip-btn {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .about-btn {
        bottom: calc(12px + env(safe-area-inset-bottom));
        right: calc(12px + env(safe-area-inset-right));
    }

    .star-nav {
        bottom: env(safe-area-inset-bottom);
    }

    .info-panel {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}
