:root {
    color-scheme: dark;
    --color-void: #000;
    --color-bone: #fff;
    --color-smoke: #9a9a9a;
    --color-plum: #8052ff;
    --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-width: 280px; }

body {
    background: var(--color-void);
    color: var(--color-bone);
    font-family: var(--font-body);
    letter-spacing: .01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

a:focus-visible, button:focus-visible {
    outline: 2px solid #b59aff;
    outline-offset: 5px;
}

.starfield-fallback, #particle-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

.starfield-fallback {
    background: #000 url("./galaxy-fallback.svg") center / cover no-repeat;
}

#particle-canvas { opacity: 0; transition: opacity 1.2s ease; }
body[data-renderer="webgl"] #particle-canvas { opacity: 1; }

.landing-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 10;
    padding: max(24px, env(safe-area-inset-top)) max(48px, env(safe-area-inset-right)) 24px max(48px, env(safe-area-inset-left));
    display: flex;
    align-items: center;
    justify-content: flex-end;
    pointer-events: none;
}

.landing-nav > * { pointer-events: auto; }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.outline-button, .motion-toggle {
    color: rgba(255, 255, 255, .6);
    background: rgba(0, 0, 0, .16);
    border: 1px solid rgba(255, 255, 255, .12);
    transition: color .25s ease, background .25s ease, border-color .25s ease;
}

.outline-button {
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .04em;
}

#back-button { text-transform: uppercase; }

.outline-button:hover, .motion-toggle:hover {
    color: var(--color-bone);
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .3);
}

.motion-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 10px;
    border-radius: 50%;
}

.motion-toggle svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.motion-toggle .play-icon { display: none; }
.motion-toggle[aria-pressed="true"] .play-icon { display: block; }
.motion-toggle[aria-pressed="true"] .pause-icon { display: none; }

.landing-container {
    position: relative;
    min-height: min(380px, 100svh);
    height: 100vh;
    height: 100svh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}

.hero-content {
    position: relative;
    width: 100%;
    max-width: 800px;
    padding: 0 48px max(80px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 1;
    transform: translateY(0);
    transition: opacity .65s ease, transform .65s ease, visibility .65s;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 24px;
    padding: 6px 12px;
    color: var(--color-plum);
    background: rgba(128, 82, 255, .15);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: .04em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
}

h1 {
    margin: 0 0 24px;
    font-size: clamp(16px, 1.8vw, 20px);
    font-weight: 500;
    line-height: 1.7;
    letter-spacing: .04em;
    text-wrap: balance;
    text-shadow: 0 0 40px rgba(128, 82, 255, .5), 0 4px 12px rgba(0, 0, 0, .9), 0 2px 4px #000;
}

.go-button { pointer-events: auto; }
.go-button span { display: inline-block; margin-left: 3px; transition: transform .25s ease; }
.go-button:hover span { transform: translateX(3px); }

.viewing-hint {
    position: fixed;
    inset: auto 24px max(32px, env(safe-area-inset-bottom));
    margin: 0;
    text-align: center;
    color: var(--color-smoke);
    font-size: 11px;
    letter-spacing: .2em;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .65s ease, visibility .65s;
}

.touch-hint { display: none; }

body[data-exploring="true"] .hero-content {
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
}

body[data-exploring="true"] .viewing-hint { opacity: .65; visibility: visible; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1200px) {
    .hero-content { padding-bottom: max(60px, env(safe-area-inset-bottom)); }
    h1 { font-size: 16px; }
}

@media (max-width: 768px) {
    .landing-nav {
        padding: max(16px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 16px max(24px, env(safe-area-inset-left));
    }
    .hero-content { padding: 0 24px max(40px, env(safe-area-inset-bottom)); }
    h1 { font-size: 15px; }
    .nav-actions { gap: 8px; }
    .outline-button, .motion-toggle { min-height: 44px; }
    .motion-toggle { width: 44px; height: 44px; }
}

@media (max-width: 480px) {
    .quote-break { display: block; }
    .eyebrow { font-size: 10px; margin-bottom: 20px; }
}

@media (max-height: 500px) and (min-width: 481px) {
    .hero-content { padding-bottom: 24px; }
    .eyebrow { margin-bottom: 12px; }
    h1 { margin-bottom: 12px; }
}

@media (hover: none) {
    .pointer-hint { display: none; }
    .touch-hint { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
