* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; background: #000; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #fff; }
body:has(#glCanvas) { overflow: hidden; user-select: none; -webkit-user-select: none; }
body:has(.blog-page) { overflow: auto; overflow-x: hidden; user-select: auto; -webkit-user-select: auto; }

/* Canvas */
#glCanvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; touch-action: none; }

/* UI overlay */
#ui-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }
#ui-overlay > * { pointer-events: auto; }

/* Hamburger */
#hamburger { position: fixed; bottom: 20px; left: 16px; width: 44px; height: 44px; border-radius: 50%; background: rgba(20,20,30,0.65); border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; z-index: 20; backdrop-filter: blur(4px); }
#hamburger span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 1px; }

/* Time */
#time-display { position: fixed; bottom: 28px; right: 16px; font-size: 18px; font-weight: 700; text-shadow: 0 0 6px #000, 1px 1px 3px #000; z-index: 20; pointer-events: none; }

/* Menu panel */
#menu-panel { position: fixed; bottom: 76px; left: 16px; right: 16px; max-width: 400px; background: rgba(15,15,25,0.88); border-radius: 16px; padding: 12px; display: none; flex-wrap: wrap; gap: 6px; z-index: 20; backdrop-filter: blur(8px); }
.menu-btn { flex: 1 1 calc(33% - 6px); min-width: 80px; padding: 10px 4px; border: none; border-radius: 10px; background: rgba(255,255,255,0.08); color: rgba(200,200,210,0.55); font-size: 12px; cursor: pointer; transition: all 0.2s; text-align: center; }
.menu-btn.active { background: rgba(100,150,255,0.2); color: #fff; }

/* Labels */
#labels { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 11; }
.star-label { position: absolute; top: 0; left: 0; font-size: 12px; font-weight: 600; color: #fff; text-shadow: 0 0 6px #000, 0 0 3px #000, 1px 1px 2px #000, -1px -1px 2px #000; white-space: nowrap; pointer-events: none; }
.planet-label { color: #ffe8a0; font-weight: 700; font-size: 13px; text-shadow: 0 0 8px #000, 0 0 4px #000, 1px 1px 3px #000, -1px -1px 3px #000; }
.constellation-label { color: rgba(120,180,180,0.5); font-size: 11px; text-align: center; letter-spacing: 1px; text-shadow: 0 0 4px #000, 0 0 2px #000; }
.constellation-label.highlight { color: #70e8e0; font-size: 15px; font-weight: 700; letter-spacing: 2px; text-shadow: 0 0 8px #000, 0 0 4px #000, 1px 1px 3px #000; }

/* Info card */
#info-card { position: fixed; top: 40px; left: 50%; transform: translateX(-50%); width: 85%; max-width: 360px; background: rgba(20,20,35,0.88); border-radius: 16px; padding: 16px 20px; display: none; z-index: 30; backdrop-filter: blur(10px); }
.info-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.info-sub { font-size: 14px; color: rgba(200,215,240,0.8); margin-bottom: 6px; }
.info-detail { font-size: 13px; color: rgba(180,200,230,0.7); }
.info-extra { font-size: 12px; color: rgba(160,185,220,0.6); margin-top: 4px; }

/* Night mode overlay */
#night-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,0,0,0.12); pointer-events: none; display: none; z-index: 50; }

/* Splash screen */
#splash { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(180deg, #050510 0%, #0a0a20 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 100; transition: opacity 0.8s ease; }
#splash-icon { width: 80px; height: 80px; border-radius: 18px; margin-bottom: 16px; }
#splash-title { font-size: 24px; font-weight: 300; letter-spacing: 2px; margin-bottom: 24px; }
.spinner { width: 32px; height: 32px; border: 2px solid rgba(255,255,255,0.15); border-top-color: rgba(255,255,255,0.7); border-radius: 50%; animation: spin 1.2s linear infinite; margin-bottom: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }
#splash-status { font-size: 13px; color: rgba(255,255,255,0.5); }

/* Sensor prompt */
#sensor-prompt { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); width: 85%; max-width: 340px; background: rgba(20,20,35,0.92); border-radius: 16px; padding: 16px 20px; display: none; flex-direction: column; align-items: center; gap: 12px; z-index: 30; backdrop-filter: blur(10px); text-align: center; }
.sp-text { font-size: 14px; color: rgba(220,220,240,0.85); }
.sp-buttons { display: flex; gap: 10px; }
.sp-enable { padding: 8px 20px; border-radius: 8px; background: rgba(80,140,255,0.6); color: #fff; border: none; cursor: pointer; font-size: 14px; }
.sp-dismiss { padding: 8px 20px; border-radius: 8px; background: rgba(255,255,255,0.1); color: rgba(200,200,210,0.7); border: none; cursor: pointer; font-size: 14px; }

/* Landscape support */
@media (orientation: landscape) {
    #menu-panel { max-width: 500px; bottom: 70px; }
    .menu-btn { flex: 1 1 calc(25% - 6px); }
}

/* Safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    #hamburger { bottom: calc(20px + env(safe-area-inset-bottom)); }
    #time-display { bottom: calc(28px + env(safe-area-inset-bottom)); }
    #menu-panel { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* App Install Banner */
#app-banner { position: fixed; top: 0; left: 0; right: 0; background: rgba(10,10,20,0.92); padding: 8px 12px; display: none; align-items: center; gap: 10px; z-index: 25; backdrop-filter: blur(8px); border-bottom: 1px solid rgba(255,255,255,0.08); transition: opacity 0.5s, transform 0.5s; }
#app-banner.hiding { opacity: 0; transform: translateY(-100%); }
#app-banner img { border-radius: 8px; width: 32px; height: 32px; }
.ab-text { flex: 1; }
.ab-title { font-size: 13px; font-weight: 600; color: #fff; }
.ab-sub { font-size: 10px; color: rgba(200,200,210,0.5); }
.ab-btn { padding: 5px 14px; border-radius: 6px; background: #1a65c0; color: #fff; text-decoration: none; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ab-close { background: none; border: none; color: rgba(200,200,210,0.4); font-size: 18px; cursor: pointer; padding: 2px 6px; }

/* ── Blog Design ── */
.blog-page {
    max-width: 720px; margin: 0 auto; padding: 0 20px 60px;
    color: #c8c8d8; background: linear-gradient(180deg, #06060f 0%, #0c0c1a 100%);
    min-height: 100vh; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 17px; line-height: 1.75;
}

/* Nav bar */
.blog-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 0; margin-bottom: 40px;
    border-bottom: 1px solid rgba(100,140,255,0.12);
}
.blog-nav a {
    color: #8ab4ff; text-decoration: none; font-size: 14px; font-weight: 500;
    transition: color 0.2s;
}
.blog-nav a:first-child {
    font-size: 16px; font-weight: 700; color: #fff;
    letter-spacing: 0.5px;
}
.blog-nav a:hover { color: #fff; }

/* Headings */
.blog-page h1 {
    font-size: clamp(28px, 5vw, 38px); font-weight: 800; color: #fff;
    margin-bottom: 12px; line-height: 1.25; letter-spacing: -0.5px;
}
.blog-page h1 + p { font-size: 18px; color: #8888a0; margin-bottom: 32px; }
.blog-page h2 {
    font-size: 22px; font-weight: 700; color: #d0d8ff;
    margin: 40px 0 16px; padding-bottom: 8px;
    border-bottom: 1px solid rgba(100,140,255,0.1);
}
.blog-page h3 { font-size: 18px; font-weight: 600; color: #b8c0e0; margin: 28px 0 12px; }

/* Text */
.blog-page p { font-size: 17px; line-height: 1.8; margin-bottom: 18px; color: #b0b0c8; }
.blog-page strong { color: #e0e0f0; }
.blog-page a { color: #6aa8ff; text-decoration: none; border-bottom: 1px solid rgba(106,168,255,0.25); transition: all 0.2s; }
.blog-page a:hover { color: #9ac4ff; border-bottom-color: #9ac4ff; }

/* Lists */
.blog-page ul, .blog-page ol { margin: 12px 0 20px 0; padding-left: 24px; color: #b0b0c8; }
.blog-page li { margin-bottom: 10px; line-height: 1.7; padding-left: 4px; }
.blog-page ul li::marker { color: #4a7adb; }

/* Article list (blog index) */
.article-list { list-style: none; padding: 0; margin: 0; }
.article-list li {
    padding: 16px 20px; margin-bottom: 6px;
    border-radius: 10px; background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.04);
    transition: all 0.2s;
}
.article-list li:hover { background: rgba(100,140,255,0.06); border-color: rgba(100,140,255,0.12); transform: translateX(4px); }
.article-list a { color: #d4d4e8; text-decoration: none; font-size: 16px; font-weight: 500; border-bottom: none; display: block; }
.article-list a:hover { color: #8ab4ff; border-bottom: none; }
.article-meta { font-size: 12px; color: rgba(160,160,180,0.45); margin-top: 4px; }

/* CTA block */
.blog-cta {
    background: linear-gradient(135deg, rgba(74,144,226,0.12), rgba(100,80,220,0.1));
    border: 1px solid rgba(74,144,226,0.2); border-radius: 16px;
    padding: 28px 24px; margin: 36px 0; text-align: center;
}
.blog-cta p { color: #a0a8d0; font-size: 16px; margin-bottom: 12px; }
.blog-cta a {
    color: #fff; background: linear-gradient(135deg, #4a90e2, #5a6ae2);
    padding: 12px 28px; border-radius: 10px; text-decoration: none;
    display: inline-block; font-weight: 600; font-size: 15px;
    border: none; box-shadow: 0 4px 16px rgba(74,144,226,0.3);
    transition: all 0.2s;
}
.blog-cta a:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(74,144,226,0.45); }

/* Blockquote */
.blog-page blockquote {
    margin: 24px 0; padding: 16px 20px; border-left: 3px solid #4a7adb;
    background: rgba(74,122,219,0.06); border-radius: 0 8px 8px 0;
    color: #a0a8c8; font-style: italic;
}

/* Code */
.blog-page code { background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; color: #c0c8e0; }

/* FAQ */
.faq { margin: 24px 0; }
.faq details { margin-bottom: 8px; padding: 12px 16px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; }
.faq summary { cursor: pointer; font-weight: 600; color: #d0d8ff; }
.faq details[open] summary { margin-bottom: 8px; }
.faq p { margin: 0; font-size: 15px; color: #a0a8c0; }

/* Responsive */
@media (max-width: 480px) {
    .blog-page { padding: 0 16px 40px; }
    .blog-page h1 { font-size: 26px; }
    .blog-page h2 { font-size: 19px; }
    .article-list li { padding: 14px 16px; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    #app-banner { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}
