/* Solar System: techteki.com/solar-system. Full-screen 3D model. */
/* Layout: full-bleed 3D scene with three glass instruments floating on top (body list left, dossier right, time console bottom). */
:root {
  color-scheme: dark;
  --void: #04060b;
  --glass: rgba(9, 13, 22, 0.76);
  --glass-hi: rgba(18, 24, 38, 0.9);
  --line: rgba(170, 190, 235, 0.12);
  --fg: #e8ecf5;
  --muted: #94a0b6;
  --faint: #5f6a82;
  --sol: #f3b44f;
  --sol-soft: rgba(243, 180, 79, 0.16);
  --display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --gx: max(16px, env(safe-area-inset-left, 0px));
  --gr: max(16px, env(safe-area-inset-right, 0px));
  --gt: calc(env(safe-area-inset-top, 0px) + 14px);
  --gb: calc(env(safe-area-inset-bottom, 0px) + 14px);
}
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--void); color: var(--fg); font-family: var(--body); font-size: 14px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sol); outline-offset: 2px; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.glass { background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); border-radius: 14px; }

/* header */
.brand { position: fixed; top: var(--gt); left: var(--gx); display: flex; align-items: center; gap: 10px; pointer-events: none; z-index: 5; }
.brand .tt { pointer-events: auto; display: block; width: 26px; height: 24px; opacity: 0.9; }
.brand .tt:hover { opacity: 1; }
.brand .tt img { width: 100%; height: 100%; display: block; }
.brand p a { pointer-events: auto; color: inherit; text-decoration: none; }
.brand p a:hover { color: var(--fg); }
.brand h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 0.02em; }
.brand h1 span { color: var(--sol); }
.brand p { margin: 0; font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

/* body list */
#nav { position: fixed; left: var(--gx); top: calc(var(--gt) + 46px); width: 206px; max-height: calc(100% - var(--gt) - var(--gb) - 140px); overflow: auto; padding: 8px; z-index: 4; scrollbar-width: thin; }
#nav .nh { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); padding: 6px 8px 8px; }
#navlist, #navlist ul { list-style: none; margin: 0; padding: 0; }
.nav-i { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.nav-i:hover { background: rgba(255, 255, 255, 0.05); }
.nav-i.on { background: var(--sol-soft); }
.nav-i.on .nm { color: #fff; }
.nav-i .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px -1px var(--c); flex: none; }
.nav-i .nm { flex: 1; font-weight: 500; }
.nav-i .ct { font-family: var(--mono); font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.nav-i.sub { padding: 5px 8px 5px 30px; font-size: 13px; color: var(--muted); }
.nav-i.sub .sw { width: 7px; height: 7px; box-shadow: none; }
.subl { display: none; }
.subl.open { display: block; padding-bottom: 4px; }

/* dossier panel */
#panel { position: fixed; right: var(--gr); top: var(--gt); width: 360px; max-height: calc(100% - var(--gt) - var(--gb) - 86px); overflow: auto; padding: 16px 18px 18px; z-index: 6; transform: translateX(calc(100% + 40px)); opacity: 0; transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s; scrollbar-width: thin; }
#panel.open { transform: none; opacity: 1; }
.ph { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.crumb { border: 0; background: none; padding: 4px 0; color: var(--muted); cursor: pointer; font-size: 13px; }
.crumb:hover { color: var(--fg); }
.x { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: none; cursor: pointer; font-size: 18px; line-height: 1; color: var(--muted); }
.x:hover { color: var(--fg); border-color: var(--muted); }
.eyebrow { margin: 6px 0 2px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sol); }
#panel h2 { margin: 0 0 8px; font-family: var(--display); font-weight: 700; font-size: 32px; line-height: 1.05; text-wrap: balance; }
.lede { margin: 0 0 14px; color: #c9d1e0; line-height: 1.55; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -2px 14px; }
.tabs button { border: 0; background: none; padding: 8px 10px 9px; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--sol); }
.tabs button:hover { color: var(--fg); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 14px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stats div { background: var(--glass-hi); padding: 9px 11px; min-width: 0; }
.stats dt { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 3px; }
.stats dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.size { margin: 0 0 14px; }
.size svg { width: 100%; max-width: 240px; height: auto; display: block; }
.size .base { stroke: var(--line); stroke-width: 1; }
.size figcaption { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.size figcaption b { color: var(--fg); font-variant-numeric: tabular-nums; }
#panel h3 { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin: 4px 0 8px; }
.notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.notes li { padding-left: 14px; position: relative; line-height: 1.5; color: #cdd4e2; }
.notes li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--sol); }
.inside { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; margin-bottom: 14px; }
.xsec { width: 120px; height: 120px; }
.layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.layers li { display: flex; gap: 9px; align-items: flex-start; }
.layers .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; margin-top: 4px; }
.layers b { display: block; font-weight: 600; font-size: 13px; }
.layers small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.cta { width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid rgba(243, 180, 79, 0.5); background: var(--sol-soft); color: #ffe2b0; font-weight: 600; cursor: pointer; }
.cta:hover { background: rgba(243, 180, 79, 0.26); }
.cta.on { background: var(--sol); color: #1b1204; }
.fine { color: var(--faint); font-size: 12px; line-height: 1.5; margin: 10px 0 0; }
.tb > .fine:first-child { margin: 0 0 10px; }
.moonlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.moonlist button { width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass-hi); cursor: pointer; text-align: left; }
.moonlist button:hover { border-color: rgba(243, 180, 79, 0.45); }
.moonlist .sw { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4 0, transparent 55%), var(--c); flex: none; }
.moonlist b { display: block; font-weight: 600; }
.moonlist small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.moonlist span:nth-child(2) { flex: 1; min-width: 0; }
.moonlist .go { font-family: var(--mono); font-size: 11px; color: var(--sol); letter-spacing: 0.06em; text-transform: uppercase; }

/* time console */
#timebar { position: fixed; left: 50%; bottom: var(--gb); transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 7px; z-index: 5; max-width: calc(100% - 32px); }
.tbtn { height: 36px; min-width: 36px; padding: 0 11px; border-radius: 9px; border: 0; background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.tbtn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); color: var(--fg); }
.tbtn.on { color: var(--fg); background: rgba(255, 255, 255, 0.07); }
.tbtn:disabled { opacity: 0.35; cursor: default; }
.tbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#t-play { color: var(--fg); background: rgba(255, 255, 255, 0.07); }
#t-play .i-play { display: none; } #t-play.paused .i-play { display: block; } #t-play.paused .i-pause { display: none; }
.clock { display: grid; gap: 1px; padding: 0 8px; min-width: 128px; }
#date { font-family: var(--mono); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
#speedlabel { font-size: 11px; color: var(--muted); }
#speed { width: 110px; accent-color: var(--sol); }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }

/* labels and tooltip */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 6px 2px 0; cursor: pointer; color: #dfe5f0; font-size: 12px; font-weight: 500; letter-spacing: 0.02em; text-shadow: 0 1px 3px #000, 0 0 8px #000; margin: -9px 0 0 -4px; }
.lbl i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--c); flex: none; }
.lbl span { opacity: 0.88; }
.lbl:hover span { opacity: 1; color: #fff; }
.moonlbl { font-size: 11px; color: var(--muted); }
.moonlbl i { width: 5px; height: 5px; }
.sunlbl { font-family: var(--display); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
#tip { position: fixed; left: 0; top: 0; z-index: 8; pointer-events: none; padding: 5px 9px; border-radius: 7px; background: var(--glass-hi); border: 1px solid var(--line); font-size: 12px; font-weight: 500; }
#hint { position: fixed; left: var(--gx); bottom: var(--gb); z-index: 3; color: var(--faint); font-size: 12px; line-height: 1.6; max-width: 230px; }
#hint kbd { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
#bgload { position: fixed; right: var(--gr); bottom: var(--gb); z-index: 3; color: var(--faint); font-family: var(--mono); font-size: 11px; }

/* loader: a small card so the system shows behind it */
#loader { position: fixed; left: 50%; top: 50%; transform: translate(-50%, 120px); z-index: 9; width: 260px; padding: 14px 16px; transition: opacity 0.6s; }
#loader.done { opacity: 0; }
#loadlabel { font-size: 12.5px; color: var(--muted); margin-bottom: 9px; }
.track { height: 3px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; overflow: hidden; }
#loadbar { height: 100%; background: var(--sol); transform-origin: left; transform: scaleX(0.02); transition: transform 0.3s; }
#fail { position: fixed; inset: 0; display: grid; place-items: center; z-index: 10; padding: 24px; text-align: center; color: var(--muted); background: var(--void); }
#fail p { max-width: 34ch; line-height: 1.5; }

@media (max-width: 1100px) { #hint { display: none; } }
@media (max-width: 760px) {
  .brand { gap: 8px; } .brand h1 { font-size: 18px; } .brand p { display: none; }
  #nav { top: calc(var(--gt) + 34px); left: 0; right: 0; width: auto; max-height: none; overflow-x: auto; overflow-y: hidden; padding: 0 var(--gr) 0 var(--gx); background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 0; scrollbar-width: none; }
  #nav::-webkit-scrollbar { display: none; }
  #nav .nh { display: none; }
  #navlist { display: flex; gap: 6px; width: max-content; }
  #navlist > li > .nav-i { background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 9px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  #navlist > li > .nav-i.on { background: rgba(243, 180, 79, 0.22); border-color: rgba(243, 180, 79, 0.5); }
  .nav-i .ct { display: none; }
  .subl, .subl.open { display: none; }
  #panel { left: var(--gx); right: var(--gr); top: auto; bottom: calc(var(--gb) + 72px); width: auto; max-height: 46%; transform: translateY(calc(100% + 120px)); padding: 12px 14px 14px; }
  #panel h2 { font-size: 24px; }
  .lede { font-size: 13px; }
  #timebar { left: var(--gx); right: var(--gr); transform: none; max-width: none; justify-content: space-between; gap: 2px; padding: 5px; }
  #speed { width: 64px; }
  .clock { min-width: 0; padding: 0 4px; }
  #speedlabel { display: none; }
  .tbtn { padding: 0 8px; min-width: 34px; }
  .tbtn .tx { display: none; }
  .sep { display: none; }
  #bgload { display: none; }
  .inside { grid-template-columns: 96px 1fr; } .xsec { width: 96px; height: 96px; }
}
#date { white-space: nowrap; }
@media (max-width: 420px) {
  #t-today { display: none; }
  #speed { flex: 1 1 40px; width: auto; min-width: 34px; }
  .clock { flex: none; }
  .tbtn { padding: 0 6px; min-width: 32px; }
  #date { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { #panel, #loader, #loadbar { transition: none; } }
