/* The observatory fills the first screen. Reading keeps its own paper and measure. */
.public-page main { max-width: none; margin: 0; padding: 0; }
.home-content { max-width: 1420px; margin: auto; padding: 30px clamp(24px, 6vw, 96px) 24px; }
.public-page .home-hero {
  --gutter: clamp(26px, 5.6vw, 100px);
  --pale: #f3f2fd;
  --soft: #c5c9df;
  --hairline: rgba(187, 196, 242, .22);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  height: 100vh;
  height: 100svh;
  min-height: 540px;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
  color: var(--pale);
}
.home-hero ::selection { background: #7154b5; color: white; }
.home-hero::before {
  content:""; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(180deg,#080c1c70,transparent 13%,transparent 88%,#080c1c45);
}
.public-page .home-hero :focus-visible { outline: 2px solid #9de8fc; outline-offset: 3px; }
.atlas-mast, .atlas-rail { flex: none; margin: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.atlas-mast { position:relative; z-index:4; height: clamp(62px, 8.4svh, 86px); border-bottom: 1px solid var(--hairline); }
.sky-switch { display:flex; align-items:center; margin-right:auto; padding:2px; border:1px solid #a7b7e342; border-radius:24px; background:#0c1125e8; }
.sky-switch a { display:inline-flex; align-items:center; gap:6px; min-height:34px; padding:0 12px; border-radius:20px; text-decoration:none; color:#b6bdd4; font:500 12px/1.3 system-ui,sans-serif; letter-spacing:.04em; }
.sky-switch a[aria-current] { color:#fff5ff; background:#343955; box-shadow:inset 0 0 0 1px #c5c6ff33; }
.sky-switch svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.3; stroke-linecap:round; }
.sky-switch [data-sky=map] svg { color:#addef5; }
.sky-switch [data-sky=planet] svg { color:#edc2d9; }
.atlas-brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; color: var(--pale); font: 600 25px/1.4 'Songti SC','Noto Serif CJK SC',serif; letter-spacing: .12em; }
.atlas-mark { position: relative; display: inline-grid; place-items: center; width: 29px; height: 29px; }
.atlas-mark::before { content: ''; width: 14px; height: 17px; background: #d6e5ff; clip-path: polygon(50% 0,63% 37%,100% 50%,63% 60%,50% 100%,39% 62%,0 50%,38% 38%); }
.atlas-mark::after { content:''; position:absolute; inset:1px; background:radial-gradient(circle at 12% 79%,#b4ebf6 0 1.8px,transparent 2.2px),radial-gradient(circle at 85% 16%,#decaef 0 1.8px,transparent 2.3px),linear-gradient(-40deg,transparent 48%,#bfcfec 49% 51%,transparent 52%) center / 72% 64% no-repeat; }
.atlas-mast nav { display: flex; align-items: center; gap: clamp(16px, 3.1vw, 52px); }
.atlas-mast nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--soft); font-size: 13px; letter-spacing: .06em; }
.atlas-mast nav a:last-child span:last-child { margin-left: .25em; }
.atlas-mast a:hover, .constellation-links a:hover { color: white; }
.constellation-stage { position: relative; min-height: 0; flex: 1; overflow: hidden; container-type: size; }
.planet-poster { display:none; }
.home-hero[data-view=planet]:not(.planet-ready) .planet-poster { display:block; position:absolute; left:50%; top:50%; width:min(106cqw,155cqh); aspect-ratio:1088/704; transform:translate(-50%,-50%); background:url("/static/star-poster.webp?v=20261109.1") center/contain no-repeat; pointer-events:none; }
.home-hero[data-view=planet]:not(.planet-ready) :is(#constellation-canvas,.atlas-stars) { visibility:hidden; }
.home-hero .planet-retry { position:absolute; z-index:3; top:12px; right:var(--gutter); padding:8px 12px; border:1px solid var(--hairline); background:#101629; font-size:12px; }
#constellation-canvas { display:block; position:absolute; inset:0; width:100%; height:100%; cursor:grab; touch-action:pan-y; }
.atlas-stars { position:absolute; inset:0; pointer-events:none; }
.home-hero .atlas-star {
  position:absolute; left:0; top:0; width:30px; height:30px; margin:-15px; padding:0;
  border:0; border-radius:50%; color:inherit; background:transparent; pointer-events:auto; touch-action:pan-y;
}
.home-hero .atlas-star:enabled:hover, .home-hero .atlas-star:focus-visible { background:transparent; }
.constellation-stage.over-link #constellation-canvas { cursor:pointer; }
.constellation-stage.is-dragging, .constellation-stage.is-dragging * { cursor:grabbing; }
.constellation-stage { user-select:none; -webkit-user-select:none; }
.constellation-reading { z-index:3; user-select:text; -webkit-user-select:text; max-height:88%; overflow:auto; }
#constellation-related { list-style:none; padding:5px 0; margin:7px 0; border-block:1px solid #38465e; }
#constellation-related button { display:flex; width:100%; align-items:baseline; gap:9px; min-height:34px; padding:5px 1px; text-align:left; font-size:12px; }
.relation-kind { color:#a5dce4; white-space:nowrap; max-width:45%; flex:none; overflow:hidden; text-overflow:ellipsis; font-size:11px; }
.relation-title { color:#e9e9fb; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.relation-icon { width:15px; height:1px; background:currentColor; position:relative; transform:rotate(-28deg); }
.relation-icon::before,.relation-icon::after { content:""; width:4px; height:4px; border:1px solid currentColor; border-radius:50%; background:#11182c; position:absolute; top:-2.5px; }
.relation-icon::before { left:-1px; } .relation-icon::after { right:-1px; }
.public-page #constellation-canvas:focus-visible { outline-offset: -4px; }
#constellation-canvas:active { cursor: grabbing; }
.atlas-rail { min-height: 76px; padding: 12px 0; border-top: 1px solid var(--hairline); }
.atlas-latest { display: flex; align-items: center; gap: 15px; flex: 0 1 auto; min-width: 0; min-height: 44px; color: var(--pale); text-decoration: none; font-size: 13px; }
.latest-kicker { flex: none; color: #bbcadf; font-size: 11px; letter-spacing: .12em; }
.latest-title { max-width: 44ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.latest-arrow { color: #b9cde1; }
.atlas-latest:hover .latest-title { text-decoration: underline; text-underline-offset: 4px; }
.constellation-controls { flex: none; display: flex; align-items: center; }
.home-hero button { background: none; border: 0; border-radius: 5px; color: var(--soft); filter: none; }
.constellation-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 42px; min-height: 44px; padding: 0 8px; font: 20px/1 system-ui,sans-serif; }
.constellation-controls .control-text { font-family: inherit; font-size: 13px; line-height: 1.4; padding-inline: 13px; white-space: nowrap; }
.constellation-controls .control-text:last-child { padding-right: 4px; }
#constellation-layout { margin-left: 6px; }
#constellation-layout[aria-pressed=true] { color: #a3f2ff; background: #22384c; }
.home-hero button:enabled:hover, .home-hero button:focus-visible { color: white; background-color: #273143; }
.home-hero button:disabled { opacity: .36; cursor: default; }
.turn-icon { display: inline-block; width: 10px; height: 13px; border-inline: 3px solid currentColor; }
#constellation-turn.is-paused .turn-icon { width: 0; height: 0; border: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 11px solid currentColor; }
.constellation-reading { position: absolute; right: var(--gutter); bottom: 12px; width: min(350px, calc(100% - 2 * var(--gutter))); border-radius: 10px; border: 1px solid #65728a; background: #101629f7; color: var(--pale); padding: 10px 16px 11px; box-shadow: 0 8px 36px #03061270; }
.constellation-meta, .constellation-links { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.constellation-meta { color: #b7c2dc; font-size: 11px; }
.constellation-meta button { min-width: 36px; min-height: 36px; padding: 0; font: 23px/1 system-ui; }
.public-page .constellation-reading h2 { font-family: inherit; font-size: 16px; font-weight: 500; line-height: 1.55; margin: 2px 0 6px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.constellation-links button, .constellation-links a { display: inline-flex; align-items: center; min-height: 36px; padding: 0; color: #c6dff2; font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.feed-anchor { display: block; height: 0; }
@media (max-width: 800px), (max-width: 1000px) and (orientation: portrait) {
  .public-page .home-hero { --gutter: clamp(16px, 5.4vw, 38px); min-height: 510px; }
  .atlas-mast { height: 56px; }
  .atlas-rail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-height: 99px; padding: 4px 0 max(5px, env(safe-area-inset-bottom)); }
  .atlas-latest { gap: 12px; padding-block: 2px; }
  .latest-title { flex: 0 1 auto; max-width: none; }
  .atlas-latest .latest-arrow { margin-left: auto; }
  .constellation-controls { justify-content: space-between; border-top: 1px solid #a9b7dc20; }
  .constellation-controls button { min-width: 44px; }
  .constellation-controls .control-text { padding-inline: 8px; }
  #constellation-layout { margin: 0; }
  .constellation-reading { bottom: 6px; max-height:70%; }
  #constellation-related button { min-height:38px; }
  .constellation-meta button, .constellation-links button, .constellation-links a { min-height: 44px; }
  .home-content { padding: 15px var(--content-pad, 5.4vw) 20px; }
}
@media (max-width: 580px) {
  .atlas-mast { gap: 12px; }
  .sky-switch { position:absolute; left:0; top:calc(100% + 8px); }
  .sky-switch a { min-height:38px; padding-inline:11px; }
  .atlas-brand { font-size: 20px; gap: 7px; }
  .atlas-mark { width: 23px; transform: scale(.86); }
  .atlas-mast nav { gap: clamp(10px, 3.6vw, 18px); }
  .atlas-mast nav a { font-size: 12px; }
  .atlas-mast .nav-long { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
}
@media (max-width:699px) { .home-hero[data-view=planet]:not(.planet-ready) .planet-poster { width:min(142.8cqw,148cqh); } }
@media (max-width: 360px) {
  .constellation-controls .control-text { padding-inline: 3px; gap: 4px; }
}
@media (max-height: 550px) and (orientation: landscape) {
  .public-page .home-hero { min-height: 355px; --gutter: 4vw; }
  .atlas-mast { height: 48px; }
  .atlas-rail { display: flex; min-height: 52px; padding: 3px 0; gap: 15px; }
  .constellation-controls { border: 0; }
}
.public-page #courses, .public-page #reading, .public-page article[id] { scroll-margin-top: 16px; }
@media print {
  .public-page .home-hero { display: none; }
  .home-content { padding: 0; }
}


@media (pointer:coarse) {
  .home-hero .atlas-star { width:38px; height:38px; margin:-19px; }
}
@media (max-width:360px) { .constellation-controls .relation-icon { display:none; } }
