:root {
    --site-bg: #ffffff;
    --site-primary: #2563eb;
    --site-accent: #06b6d4;
    --site-text: #111827;
    --site-muted: #6b7280;
    --site-card: rgba(255, 255, 255, 0.78);
    --site-border: rgba(17, 24, 39, 0.12);
    --site-soft: #f3f4f6;
}

* { box-sizing: border-box; }

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--site-primary), transparent 86%), transparent 34%),
        radial-gradient(circle at bottom right, color-mix(in srgb, var(--site-accent), transparent 86%), transparent 34%),
        var(--site-bg);
    color: var(--site-text);
}

body.viewer-body { overflow: hidden; }
a { color: inherit; text-decoration: none; }

code {
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--site-soft);
    color: var(--site-primary);
}

.theme-picker {
    position: fixed;
    right: 18px;
    top: 18px;
    z-index: 9999;
}

.theme-toggle {
    width: 50px;
    height: 50px;
    border: 1px solid var(--site-border);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--site-primary), var(--site-accent));
    color: #ffffff;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.24);
}

.theme-panel {
    display: none;
    width: 245px;
    margin-top: 12px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--site-border);
    color: #111827;
    backdrop-filter: blur(18px);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.theme-picker.open .theme-panel { display: block; }
.theme-panel h3 { margin: 0 0 14px; font-size: 16px; }

.theme-panel label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
}

.theme-panel input[type="color"] {
    width: 44px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}

.theme-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin: 10px 0 12px;
}

.theme-presets button,
.reset-theme {
    border: 1px solid var(--site-border);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
}

.theme-presets button {
    padding: 8px 6px;
    background: #f9fafb;
    color: #111827;
    font-size: 12px;
}

.reset-theme {
    width: 100%;
    padding: 11px 12px;
    background: linear-gradient(135deg, var(--site-primary), var(--site-accent));
    color: #ffffff;
}

.landing {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 90px 0 50px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
    gap: 28px;
    align-items: stretch;
    margin-bottom: 28px;
}

.hero-content,
.hero-card,
.panel,
.empty-state {
    border: 1px solid var(--site-border);
    background: var(--site-card);
    color: var(--site-text);
    border-radius: 28px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
}

.hero-content { padding: 52px; }

.eyebrow {
    display: inline-block;
    margin: 0 0 16px;
    color: var(--site-primary);
    font-weight: 800;
    letter-spacing: 0.03em;
}

.hero h1 {
    max-width: 780px;
    margin: 0;
    font-size: clamp(38px, 6vw, 76px);
    line-height: 0.97;
    letter-spacing: -0.06em;
}

.hero-text {
    max-width: 680px;
    margin: 24px 0 0;
    color: var(--site-muted);
    font-size: 18px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 13px 20px;
    border-radius: 999px;
    font-weight: 800;
}

.btn.primary,
.video-controls button,
.switch,
.back {
    background: linear-gradient(135deg, var(--site-primary), var(--site-accent));
    color: #ffffff;
    border: 1px solid transparent;
}

.btn.secondary {
    background: #ffffff;
    color: var(--site-text);
    border: 1px solid var(--site-border);
}

.hero-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px;
    min-height: 280px;
}

.hero-card h2 { margin: 0 0 12px; font-size: 30px; }
.hero-card p { margin: 0; color: var(--site-muted); line-height: 1.6; }

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.panel { padding: 26px; }
.panel h2 { margin: 0 0 12px; }
.panel p, .panel li { color: var(--site-muted); line-height: 1.7; }

.media-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.media-list a {
    padding: 12px 14px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid var(--site-border);
    color: var(--site-text);
    word-break: break-word;
}

.media-list a:hover { border-color: var(--site-primary); }
.muted { color: var(--site-muted); }
.instructions ol { padding-left: 20px; }

.topbar {
    position: fixed;
    top: 14px;
    left: 14px;
    right: 84px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--site-border);
    color: var(--site-text);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.back,
.switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 800;
    white-space: nowrap;
}

.selector {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.selector label {
    font-weight: 800;
    color: var(--site-text);
    white-space: nowrap;
}

select {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--site-border);
    background: #ffffff;
    color: var(--site-text);
}

.video-controls {
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--site-border);
    backdrop-filter: blur(18px);
}

.video-controls button {
    min-height: 38px;
    padding: 9px 13px;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
}

.gallery-strip {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 20;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--site-border);
    backdrop-filter: blur(18px);
}

.thumb {
    width: 94px;
    height: 58px;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 12px;
    border: 3px solid transparent;
}

.thumb.active { border-color: var(--site-accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

a-scene { width: 100vw; height: 100vh; }

.empty-state {
    width: min(560px, calc(100% - 32px));
    margin: 130px auto 0;
    padding: 34px;
    text-align: center;
}

.empty-state h1 { margin: 0 0 12px; }
.empty-state p { color: var(--site-muted); }

@media (max-width: 850px) {
    .landing { padding-top: 86px; }
    .hero, .content-grid { grid-template-columns: 1fr; }
    .hero-content { padding: 32px; }
    .topbar { right: 14px; flex-wrap: wrap; }
    .selector { order: 3; flex-basis: 100%; }
    .theme-picker { right: 14px; top: 14px; }
    .theme-panel { width: 225px; }
}
