:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: #020812;
  color: #edf8ff;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #020812;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

button,
a,
input {
  font: inherit;
}

button {
  color: inherit;
}

.scene-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 48%, rgba(25, 86, 105, 0.13), transparent 34%),
    radial-gradient(circle at 72% 22%, rgba(20, 50, 87, 0.16), transparent 37%),
    #020812;
}

.scene-stage::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle at center, transparent 46%, rgba(0, 3, 9, 0.42) 100%);
}

.webgl-root,
.webgl-root canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.webgl-root canvas {
  display: block;
  transition: opacity 320ms ease, filter 320ms ease;
}

.scene-stage[data-view="earth"] .webgl-root canvas {
  opacity: 0.28;
  filter: saturate(0.72) blur(1px);
}

.scene-stage[data-view="earth"] .sunlight-label {
  opacity: 0.42;
}

.title-block {
  position: absolute;
  z-index: 2;
  top: max(24px, env(safe-area-inset-top));
  left: max(28px, env(safe-area-inset-left));
  pointer-events: none;
  letter-spacing: 0.18em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.7);
}

.eyebrow,
.artwork-subtitle,
.subtitle,
.title-block h1 {
  margin: 0;
}

.artwork-subtitle {
  margin-top: 6px;
  color: rgba(230, 241, 243, 0.76);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(0.62rem, 0.8vw, 0.74rem);
  letter-spacing: 0.15em;
}

.eyebrow {
  margin-bottom: 8px;
  color: rgba(160, 213, 220, 0.7);
  font-size: clamp(0.55rem, 0.8vw, 0.68rem);
  font-weight: 500;
}

.title-block h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3.1vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.13em;
}

.subtitle {
  margin-top: 5px;
  color: rgba(224, 239, 244, 0.62);
  font-size: clamp(0.55rem, 0.72vw, 0.64rem);
}

.utility-nav {
  position: absolute;
  z-index: 5;
  top: max(24px, env(safe-area-inset-top));
  right: max(28px, env(safe-area-inset-right));
  display: flex;
  gap: 7px;
}

.utility-nav button,
.utility-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 6px 11px;
  border: 1px solid rgba(143, 205, 214, 0.2);
  background: rgba(4, 15, 27, 0.7);
  color: rgba(229, 242, 244, 0.74);
  font-size: 0.55rem;
  letter-spacing: 0.11em;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.utility-nav span {
  display: none;
}

.sunlight-label {
  position: absolute;
  z-index: 2;
  top: 49%;
  left: max(20px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 235, 181, 0.72);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  pointer-events: none;
}

.sunlight-line {
  display: block;
  width: clamp(24px, 4vw, 54px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 231, 166, 0.72));
}

.chapter-two-ui {
  display: none;
}

.scene-stage[data-chapter="eclipses"] .chapter-one-ui {
  display: none;
}

.scene-stage[data-chapter="eclipses"] .eclipse-controls {
  display: grid;
}

.scene-stage[data-chapter="eclipses"] .eclipse-panel {
  display: block;
}

.panel-toggle {
  display: none;
}

.chapter-switcher,
.view-switcher {
  position: absolute;
  z-index: 4;
  top: max(24px, env(safe-area-inset-top));
  left: 50%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(310px, calc(100vw - 430px));
  min-width: 250px;
  padding: 3px;
  border: 1px solid rgba(143, 205, 214, 0.18);
  background: rgba(4, 15, 27, 0.7);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.chapter-switcher {
  grid-template-columns: repeat(2, 1fr);
  width: min(390px, calc(100vw - 430px));
  min-width: 310px;
}

.view-switcher {
  top: max(82px, calc(env(safe-area-inset-top) + 58px));
}

.chapter-switcher button,
.view-switcher button {
  min-height: 42px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: rgba(218, 235, 239, 0.56);
  cursor: pointer;
}

.chapter-switcher button + button,
.view-switcher button + button {
  border-left: 1px solid rgba(143, 205, 214, 0.12);
}

.chapter-switcher button[aria-pressed="true"],
.view-switcher button[aria-pressed="true"] {
  background: rgba(111, 181, 190, 0.14);
  color: #effcff;
}

.chapter-switcher span,
.chapter-switcher small,
.view-switcher span,
.view-switcher small {
  display: block;
}

.chapter-switcher span,
.view-switcher span {
  font-size: 0.66rem;
  letter-spacing: 0.15em;
}

.chapter-switcher small,
.view-switcher small {
  margin-top: 2px;
  font-size: 0.52rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  opacity: 0.62;
}

.eclipse-controls {
  position: absolute;
  z-index: 4;
  top: max(82px, calc(env(safe-area-inset-top) + 58px));
  left: 50%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  width: min(500px, calc(100vw - 430px));
  min-width: 410px;
  padding: 5px;
  border: 1px solid rgba(143, 205, 214, 0.18);
  background: rgba(4, 15, 27, 0.75);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.eclipse-control-group > p {
  margin: 0 0 4px;
  color: rgba(198, 220, 226, 0.48);
  font-size: 0.48rem;
  letter-spacing: 0.1em;
}

.eclipse-control-group > p span {
  margin-left: 4px;
  letter-spacing: 0.04em;
}

.eclipse-control-group > div {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.eclipse-control-group button {
  min-height: 38px;
  padding: 5px 8px;
  border: 1px solid rgba(143, 205, 214, 0.1);
  background: transparent;
  color: rgba(218, 235, 239, 0.55);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.eclipse-control-group button[aria-pressed="true"] {
  border-color: rgba(143, 205, 214, 0.25);
  background: rgba(111, 181, 190, 0.15);
  color: #effcff;
}

.eclipse-control-group button small {
  display: block;
  margin-top: 2px;
  font-size: 0.48rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  opacity: 0.62;
}

.phase-panel {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: max(28px, env(safe-area-inset-right));
  width: min(360px, calc(100vw - 56px));
  padding: 22px 22px 19px;
  border: 1px solid rgba(143, 205, 214, 0.2);
  background: linear-gradient(145deg, rgba(6, 20, 34, 0.83), rgba(3, 12, 24, 0.72));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
  transform: translateY(-50%);
  backdrop-filter: blur(14px);
}

.phase-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.phase-kicker,
.phase-name,
.phase-name-en,
.phase-description,
.phase-relation,
.view-note,
.model-note,
.scale-note,
.earth-preview,
.earth-preview-kicker,
.earth-preview figcaption,
.illumination,
.phase-age p {
  margin: 0;
}

.phase-kicker {
  margin-bottom: 7px;
  color: rgba(143, 211, 216, 0.72);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.17em;
}

.phase-name {
  font-family: Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.08em;
}

.phase-name-en {
  margin-top: 3px;
  color: rgba(219, 235, 240, 0.61);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.74rem;
  letter-spacing: 0.13em;
}

.phase-icon {
  flex: 0 0 auto;
  font-size: 2.3rem;
  line-height: 1;
  filter: saturate(0.7) drop-shadow(0 0 12px rgba(220, 235, 229, 0.13));
}

.scene-stage[data-view="split"] .phase-icon,
.scene-stage[data-view="earth"] .phase-icon {
  display: none;
}

.earth-preview {
  margin-top: 17px;
  padding: 13px;
  border: 1px solid rgba(146, 199, 207, 0.14);
  background:
    radial-gradient(circle at 50% 58%, rgba(79, 116, 127, 0.08), transparent 54%),
    rgba(1, 7, 15, 0.35);
  text-align: center;
}

.scene-stage[data-view="space"] .earth-preview {
  display: none;
}

.earth-preview-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.earth-preview-kicker {
  color: rgba(143, 211, 216, 0.68);
  font-size: 0.54rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.earth-preview figcaption {
  margin-top: 3px;
  color: rgba(233, 244, 246, 0.77);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.illumination {
  color: rgba(208, 225, 231, 0.48);
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.earth-preview canvas {
  display: block;
  width: 150px;
  height: 150px;
  margin: 5px auto -3px;
}

.scene-stage[data-view="earth"] .earth-preview canvas {
  width: 190px;
  height: 190px;
}

.phase-age {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 11px 0;
  border-top: 1px solid rgba(149, 197, 207, 0.14);
  border-bottom: 1px solid rgba(149, 197, 207, 0.14);
  color: rgba(211, 231, 237, 0.68);
  font-size: 0.72rem;
}

.phase-age p {
  text-align: right;
}

.phase-age strong {
  display: block;
  color: #f4f1dd;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.phase-age small {
  display: block;
  min-height: 1.2em;
  margin-top: 2px;
  color: rgba(235, 223, 191, 0.65);
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.phase-description {
  margin-top: 15px;
  color: rgba(239, 247, 248, 0.88);
  font-size: 0.82rem;
  line-height: 1.8;
}

.phase-relation {
  margin-top: 9px;
  padding-left: 11px;
  border-left: 1px solid rgba(241, 217, 158, 0.44);
  color: rgba(235, 223, 191, 0.72);
  font-size: 0.73rem;
  line-height: 1.65;
}

.view-note,
.model-note,
.scale-note {
  color: rgba(207, 224, 232, 0.55);
  font-size: 0.61rem;
  line-height: 1.6;
}

.view-note {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid rgba(149, 197, 207, 0.12);
  color: rgba(162, 216, 219, 0.66);
}

.model-note {
  margin-top: 5px;
}

.scale-note {
  margin-top: 3px;
}

.eclipse-panel {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: max(28px, env(safe-area-inset-right));
  width: min(380px, calc(100vw - 56px));
  padding: 22px 22px 19px;
  border: 1px solid rgba(143, 205, 214, 0.2);
  background: linear-gradient(145deg, rgba(6, 20, 34, 0.88), rgba(3, 12, 24, 0.76));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.3);
  transform: translateY(-50%);
  backdrop-filter: blur(14px);
}

.eclipse-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.eclipse-kicker,
.eclipse-panel h2,
.eclipse-name-en,
.eclipse-status,
.eclipse-description,
.alignment-description,
.inclination-note,
.eclipse-model-note {
  margin: 0;
}

.eclipse-kicker {
  margin-bottom: 7px;
  color: rgba(143, 211, 216, 0.72);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.15em;
}

.eclipse-panel h2 {
  font-family: Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.08em;
}

.eclipse-name-en {
  margin-top: 3px;
  color: rgba(219, 235, 240, 0.61);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.eclipse-status {
  flex: 0 0 auto;
  padding: 7px 9px 6px;
  border: 1px solid rgba(226, 199, 140, 0.3);
  color: rgba(244, 226, 181, 0.88);
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  text-align: center;
}

.eclipse-status span {
  display: block;
  margin-top: 2px;
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  opacity: 0.72;
}

.eclipse-status[data-status="miss"] {
  border-color: rgba(150, 196, 207, 0.24);
  color: rgba(196, 220, 226, 0.72);
}

.alignment-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  padding: 12px 10px;
  border-top: 1px solid rgba(149, 197, 207, 0.14);
  border-bottom: 1px solid rgba(149, 197, 207, 0.14);
  color: rgba(223, 237, 240, 0.74);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.alignment-diagram span,
.alignment-diagram small {
  display: block;
}

.alignment-diagram span {
  position: relative;
  padding-top: 20px;
}

.alignment-diagram span::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  content: "";
  transform: translateX(-50%);
}

.alignment-diagram .diagram-sun::before {
  background: #e8ca82;
  box-shadow: 0 0 10px rgba(232, 202, 130, 0.42);
}

.alignment-diagram .diagram-moon::before {
  width: 8px;
  height: 8px;
  margin-top: 3px;
  background: #aaa79f;
}

.alignment-diagram .diagram-earth::before {
  background: #4c91a9;
  box-shadow: 0 0 7px rgba(76, 145, 169, 0.38);
}

.alignment-diagram small {
  margin-top: 2px;
  font-size: 0.48rem;
  letter-spacing: 0.04em;
  opacity: 0.55;
}

.alignment-diagram i {
  color: rgba(231, 214, 170, 0.45);
  font-style: normal;
}

.eclipse-description {
  margin-top: 15px;
  color: rgba(239, 247, 248, 0.88);
  font-size: 0.8rem;
  line-height: 1.75;
}

.alignment-description {
  margin-top: 9px;
  padding-left: 11px;
  border-left: 1px solid rgba(241, 217, 158, 0.44);
  color: rgba(235, 223, 191, 0.74);
  font-size: 0.72rem;
  line-height: 1.6;
}

.shadow-legend {
  display: grid;
  gap: 7px;
  margin: 15px 0 0;
  padding: 12px 0;
  border-top: 1px solid rgba(149, 197, 207, 0.12);
  border-bottom: 1px solid rgba(149, 197, 207, 0.12);
}

.shadow-legend > div {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
}

.shadow-legend dt,
.shadow-legend dd {
  margin: 0;
  font-size: 0.62rem;
  line-height: 1.45;
}

.shadow-legend dt {
  color: rgba(226, 238, 240, 0.8);
}

.shadow-legend dd {
  color: rgba(203, 222, 228, 0.55);
}

.shadow-legend dt span {
  display: inline-block;
  width: 14px;
  height: 5px;
  margin-right: 6px;
  border-radius: 999px;
  vertical-align: 1px;
}

.umbra-swatch {
  background: rgba(31, 36, 51, 0.95);
  box-shadow: 0 0 0 1px rgba(193, 204, 221, 0.26);
}

.penumbra-swatch {
  background: rgba(106, 122, 146, 0.42);
  box-shadow: 0 0 0 1px rgba(193, 204, 221, 0.18);
}

.node-swatch {
  background: rgba(129, 205, 204, 0.7);
}

.inclination-note,
.eclipse-model-note {
  color: rgba(207, 224, 232, 0.56);
  font-size: 0.59rem;
  line-height: 1.55;
}

.inclination-note {
  margin-top: 13px;
}

.eclipse-model-note {
  margin-top: 5px;
}

.time-controls {
  position: absolute;
  z-index: 4;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: calc((100% - 388px) / 2);
  width: min(500px, calc(100vw - 450px));
  min-width: 300px;
  padding: 12px 15px 10px;
  border: 1px solid rgba(143, 205, 214, 0.18);
  background: rgba(4, 15, 27, 0.76);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.playback-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.playback-row button {
  min-width: 76px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(153, 211, 221, 0.28);
  background: rgba(107, 173, 187, 0.1);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.playback-row p {
  margin: 0;
  color: rgba(202, 222, 228, 0.48);
  font-size: 0.53rem;
  letter-spacing: 0.11em;
}

.playback-row strong {
  color: rgba(240, 246, 244, 0.78);
  font-weight: 500;
}

.playback-row output {
  margin-left: auto;
  color: #f4f1dd;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82rem;
}

.time-controls > label {
  display: block;
  margin-top: 7px;
  color: rgba(214, 232, 236, 0.68);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

.time-controls input[type="range"] {
  width: 100%;
  height: 20px;
  margin: 2px 0 0;
  accent-color: #9ed8d8;
  cursor: pointer;
}

.phase-marks {
  display: flex;
  justify-content: space-between;
  margin-top: -2px;
  color: rgba(205, 225, 230, 0.42);
  font-size: 0.48rem;
}

.chapter-switcher button:focus-visible,
.view-switcher button:focus-visible,
.eclipse-control-group button:focus-visible,
.playback-row button:focus-visible,
.time-controls input:focus-visible {
  outline: 2px solid #b8f4f0;
  outline-offset: 3px;
}

.intro-card {
  position: absolute;
  z-index: 7;
  top: 50%;
  left: clamp(28px, 8vw, 120px);
  width: min(410px, calc(100vw - 56px));
  padding: 24px;
  border: 1px solid rgba(143, 205, 214, 0.24);
  background: linear-gradient(145deg, rgba(5, 18, 31, 0.94), rgba(2, 10, 20, 0.9));
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.42);
  transform: translateY(-50%);
  backdrop-filter: blur(16px);
  transition: opacity 280ms ease, transform 280ms ease;
}

.intro-card.is-leaving {
  opacity: 0;
  transform: translateY(calc(-50% - 8px));
  pointer-events: none;
}

.intro-kicker,
.intro-card h2,
.intro-card > p:not(.intro-kicker) {
  margin: 0;
}

.intro-kicker {
  color: rgba(143, 211, 216, 0.72);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
}

.intro-card h2 {
  margin-top: 10px;
  font-family: Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.22rem, 2.3vw, 1.8rem);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.05em;
}

.intro-card > p:not(.intro-kicker) {
  margin-top: 12px;
  color: rgba(221, 235, 239, 0.68);
  font-size: 0.76rem;
  line-height: 1.75;
}

.intro-card button {
  min-height: 44px;
  margin-top: 18px;
  padding: 9px 16px;
  border: 1px solid rgba(153, 211, 221, 0.3);
  background: rgba(107, 173, 187, 0.12);
  color: #effcff;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.guide-scrim {
  position: absolute;
  z-index: 9;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: rgba(0, 5, 12, 0.68);
  backdrop-filter: blur(8px);
}

.guide-scrim[hidden] {
  display: none;
}

.guide-panel {
  width: min(560px, 100%);
  max-height: calc(100dvh - 36px);
  padding: 24px;
  overflow-y: auto;
  border: 1px solid rgba(143, 205, 214, 0.28);
  background: rgba(4, 16, 28, 0.97);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}

.guide-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.guide-heading p,
.guide-heading h2 {
  margin: 0;
}

.guide-heading p {
  color: rgba(143, 211, 216, 0.7);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
}

.guide-heading h2 {
  margin-top: 5px;
  font-family: Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: 0.07em;
}

.guide-heading button {
  min-height: 40px;
  padding: 7px 11px;
  border: 1px solid rgba(143, 205, 214, 0.2);
  background: transparent;
  color: rgba(224, 239, 242, 0.72);
  font-size: 0.54rem;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.guide-list {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: guide-step;
}

.guide-list li {
  display: grid;
  grid-template-columns: 22px 116px 1fr;
  gap: 9px;
  align-items: baseline;
  counter-increment: guide-step;
}

.guide-list li::before {
  color: rgba(143, 211, 216, 0.58);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.72rem;
  content: counter(guide-step, decimal-leading-zero);
}

.guide-list strong {
  color: rgba(239, 247, 248, 0.85);
  font-size: 0.72rem;
  font-weight: 500;
}

.guide-list span,
.guide-scale-note {
  color: rgba(207, 225, 230, 0.62);
  font-size: 0.68rem;
  line-height: 1.65;
}

.guide-scale-note {
  margin: 20px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(149, 197, 207, 0.13);
}

.guide-panel > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 13px;
  color: rgba(188, 225, 228, 0.8);
  font-size: 0.65rem;
  letter-spacing: 0.07em;
  text-decoration: none;
}

.utility-nav button:focus-visible,
.utility-nav a:focus-visible,
.intro-card button:focus-visible,
.guide-heading button:focus-visible,
.guide-panel > a:focus-visible,
.panel-toggle:focus-visible {
  outline: 2px solid #b8f4f0;
  outline-offset: 3px;
}

.error-panel {
  position: absolute;
  z-index: 12;
  top: 50%;
  left: 50%;
  width: min(520px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid rgba(140, 201, 215, 0.28);
  background: rgba(3, 13, 24, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(14px);
}

.error-panel[hidden] {
  display: none;
}

.error-kicker {
  margin: 0 0 10px;
  color: #8fd3d8;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
}

.error-panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  font-weight: 400;
  line-height: 1.35;
}

.error-panel > p:not(.error-kicker) {
  color: rgba(231, 242, 246, 0.72);
  line-height: 1.7;
}

.error-panel .error-detail {
  margin-top: 8px;
  color: rgba(183, 211, 218, 0.6);
  font-size: 0.72rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.error-actions button,
.error-actions a {
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid rgba(153, 211, 221, 0.34);
  border-radius: 2px;
  background: rgba(107, 173, 187, 0.1);
  color: #effcff;
  text-decoration: none;
  cursor: pointer;
}

.error-actions button:focus-visible,
.error-actions a:focus-visible {
  outline: 2px solid #b8f4f0;
  outline-offset: 3px;
}

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

@media (max-width: 680px) {
  .eyebrow {
    display: none;
  }

  .title-block {
    top: max(18px, env(safe-area-inset-top));
    left: max(18px, env(safe-area-inset-left));
  }

  .title-block h1 {
    font-size: clamp(1.45rem, 8vw, 2rem);
  }

  .artwork-subtitle {
    margin-top: 4px;
    font-size: 0.58rem;
  }

  .subtitle {
    margin-top: 3px;
    font-size: 0.5rem;
  }

  .utility-nav {
    top: max(16px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    gap: 4px;
  }

  .utility-nav button,
  .utility-nav a {
    min-height: 44px;
    padding: 5px 8px;
    font-size: 0.47rem;
  }

  .sunlight-label {
    top: 45%;
    left: max(10px, env(safe-area-inset-left));
    gap: 6px;
    font-size: 0.5rem;
  }

  .chapter-switcher {
    top: max(90px, calc(env(safe-area-inset-top) + 78px));
    width: calc(100% - 32px);
    min-width: 0;
  }

  .view-switcher,
  .eclipse-controls {
    top: max(140px, calc(env(safe-area-inset-top) + 128px));
    width: calc(100% - 32px);
    min-width: 0;
  }

  .chapter-switcher button,
  .view-switcher button {
    min-height: 44px;
    padding: 4px 8px;
  }

  .chapter-switcher span,
  .view-switcher span {
    font-size: 0.59rem;
  }

  .chapter-switcher small,
  .view-switcher small {
    font-size: 0.48rem;
  }

  .eclipse-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px;
  }

  .eclipse-control-group > p {
    font-size: 0.44rem;
  }

  .eclipse-control-group button {
    min-height: 44px;
    padding: 3px 5px;
    font-size: 0.52rem;
  }

  .time-controls {
    top: max(192px, calc(env(safe-area-inset-top) + 180px));
    right: max(16px, env(safe-area-inset-right));
    bottom: auto;
    left: max(16px, env(safe-area-inset-left));
    width: auto;
    min-width: 0;
    padding: 8px 11px 7px;
    transform: none;
  }

  .playback-row {
    gap: 9px;
  }

  .playback-row button {
    min-width: 68px;
    min-height: 44px;
    padding: 5px 8px;
  }

  .time-controls > label {
    margin-top: 3px;
  }

  .time-controls input[type="range"] {
    height: 28px;
  }

  .phase-panel {
    top: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(16px, env(safe-area-inset-left));
    width: auto;
    padding: 15px 17px 13px;
    transform: none;
    backdrop-filter: blur(11px);
  }

  .panel-toggle {
    position: absolute;
    z-index: 2;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 44px;
    padding: 4px 7px;
    border: 1px solid rgba(143, 205, 214, 0.18);
    background: rgba(4, 15, 27, 0.58);
    color: rgba(220, 237, 240, 0.72);
    font-size: 0.52rem;
    letter-spacing: 0.1em;
    cursor: pointer;
  }

  .panel-toggle small {
    margin-top: 2px;
    font-size: 0.46rem;
    font-weight: 400;
    letter-spacing: 0.02em;
  }

  .phase-heading,
  .eclipse-heading {
    padding-right: 64px;
  }

  .phase-panel.is-collapsed,
  .eclipse-panel.is-collapsed {
    min-height: 60px;
  }

  .phase-panel.is-collapsed > :not(.panel-toggle),
  .eclipse-panel.is-collapsed > :not(.panel-toggle) {
    display: none;
  }

  .eclipse-panel {
    top: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(16px, env(safe-area-inset-left));
    width: auto;
    padding: 15px 17px 13px;
    transform: none;
    backdrop-filter: blur(11px);
  }

  .alignment-diagram {
    margin-top: 10px;
    padding: 8px;
  }

  .eclipse-description {
    margin-top: 9px;
    font-size: 0.72rem;
    line-height: 1.55;
  }

  .alignment-description {
    margin-top: 6px;
    font-size: 0.66rem;
    line-height: 1.45;
  }

  .shadow-legend {
    gap: 4px;
    margin-top: 8px;
    padding: 7px 0;
  }

  .shadow-legend dt,
  .shadow-legend dd {
    font-size: 0.56rem;
  }

  .inclination-note,
  .eclipse-model-note {
    font-size: 0.53rem;
    line-height: 1.4;
  }

  .inclination-note {
    margin-top: 8px;
  }

  .intro-card {
    top: 50%;
    right: max(16px, env(safe-area-inset-right));
    left: max(16px, env(safe-area-inset-left));
    width: auto;
    padding: 19px;
  }

  .guide-panel {
    padding: 19px;
  }

  .guide-heading button {
    min-height: 44px;
  }

  .guide-list li {
    grid-template-columns: 20px 1fr;
    gap: 5px 8px;
  }

  .guide-list span {
    grid-column: 2;
  }

  .earth-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    align-items: center;
    min-height: 92px;
    margin-top: 10px;
    padding: 7px 9px;
  }

  .earth-preview-heading {
    display: block;
    grid-column: 1;
    text-align: left;
  }

  .illumination {
    margin-top: 7px;
    white-space: normal;
  }

  .earth-preview canvas,
  .scene-stage[data-view="earth"] .earth-preview canvas {
    grid-column: 2;
    grid-row: 1;
    width: 92px;
    height: 92px;
    margin: 0;
  }

  .scene-stage[data-view="earth"] .earth-preview {
    grid-template-columns: minmax(0, 1fr) 122px;
    min-height: 122px;
  }

  .scene-stage[data-view="earth"] .earth-preview canvas {
    width: 122px;
    height: 122px;
  }

  .phase-icon {
    font-size: 1.9rem;
  }

  .phase-age {
    margin-top: 10px;
    padding: 7px 0;
  }

  .phase-description {
    margin-top: 9px;
    font-size: 0.76rem;
    line-height: 1.6;
  }

  .phase-relation {
    margin-top: 6px;
    font-size: 0.68rem;
    line-height: 1.5;
  }

  .view-note {
    margin-top: 8px;
    padding-top: 7px;
  }

  .view-note,
  .model-note,
  .scale-note {
    font-size: 0.55rem;
    line-height: 1.45;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .title-block {
    top: max(10px, env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
  }

  .eyebrow {
    display: none;
  }

  .title-block h1 {
    font-size: 1.25rem;
  }

  .subtitle {
    margin-top: 3px;
    font-size: 0.5rem;
  }

  .artwork-subtitle {
    display: none;
  }

  .utility-nav {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
  }

  .utility-nav button,
  .utility-nav a {
    min-height: 34px;
    padding: 4px 7px;
    font-size: 0.45rem;
  }

  .chapter-switcher {
    top: max(8px, env(safe-area-inset-top));
    left: 48%;
    width: min(260px, 31vw);
    min-width: 220px;
  }

  .view-switcher,
  .eclipse-controls {
    top: max(50px, calc(env(safe-area-inset-top) + 42px));
    left: 48%;
    width: min(330px, 38vw);
    min-width: 280px;
  }

  .chapter-switcher button,
  .view-switcher button {
    min-height: 34px;
    padding: 3px 6px;
  }

  .chapter-switcher small,
  .view-switcher small {
    display: none;
  }

  .eclipse-controls {
    padding: 3px;
  }

  .eclipse-control-group > p {
    display: none;
  }

  .eclipse-control-group button {
    min-height: 30px;
    padding: 2px 4px;
    font-size: 0.48rem;
  }

  .eclipse-control-group button small {
    display: none;
  }

  .time-controls {
    top: auto;
    right: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(14px, env(safe-area-inset-left));
    width: min(470px, 52vw);
    min-width: 340px;
    padding: 7px 10px 6px;
    transform: none;
  }

  .playback-row button {
    min-height: 28px;
  }

  .time-controls > label,
  .phase-marks {
    font-size: 0.46rem;
  }

  .phase-panel {
    top: 50%;
    right: max(10px, env(safe-area-inset-right));
    bottom: auto;
    left: auto;
    width: min(310px, 42vw);
    padding: 11px 14px 10px;
    transform: translateY(-50%);
  }

  .eclipse-panel {
    top: 50%;
    right: max(10px, env(safe-area-inset-right));
    bottom: auto;
    left: auto;
    width: min(330px, 42vw);
    padding: 10px 13px 9px;
    transform: translateY(-50%);
  }

  .panel-toggle {
    position: absolute;
    z-index: 2;
    top: 6px;
    right: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    min-height: 40px;
    padding: 3px 5px;
    border: 1px solid rgba(143, 205, 214, 0.18);
    background: rgba(4, 15, 27, 0.58);
    color: rgba(220, 237, 240, 0.72);
    font-size: 0.46rem;
    cursor: pointer;
  }

  .panel-toggle small {
    margin-top: 1px;
    font-size: 0.4rem;
    font-weight: 400;
  }

  .phase-heading,
  .eclipse-heading {
    padding-right: 52px;
  }

  .phase-panel.is-collapsed,
  .eclipse-panel.is-collapsed {
    min-height: 52px;
  }

  .phase-panel.is-collapsed > :not(.panel-toggle),
  .eclipse-panel.is-collapsed > :not(.panel-toggle) {
    display: none;
  }

  .intro-card {
    left: max(14px, env(safe-area-inset-left));
    width: min(360px, 45vw);
    padding: 15px;
  }

  .intro-card h2 {
    margin-top: 6px;
    font-size: 1rem;
  }

  .intro-card > p:not(.intro-kicker) {
    margin-top: 7px;
    font-size: 0.62rem;
    line-height: 1.5;
  }

  .intro-card button {
    min-height: 36px;
    margin-top: 9px;
  }

  .eclipse-kicker {
    margin-bottom: 4px;
    font-size: 0.48rem;
  }

  .eclipse-panel h2 {
    font-size: 1.12rem;
  }

  .eclipse-name-en,
  .eclipse-status {
    font-size: 0.5rem;
  }

  .alignment-diagram {
    margin-top: 6px;
    padding: 5px;
    font-size: 0.48rem;
  }

  .alignment-diagram span {
    padding-top: 15px;
  }

  .alignment-diagram span::before {
    width: 10px;
    height: 10px;
  }

  .eclipse-description {
    margin-top: 6px;
    font-size: 0.61rem;
    line-height: 1.4;
  }

  .alignment-description {
    margin-top: 4px;
    font-size: 0.56rem;
    line-height: 1.35;
  }

  .shadow-legend {
    gap: 2px;
    margin-top: 5px;
    padding: 4px 0;
  }

  .shadow-legend > div {
    grid-template-columns: 62px 1fr;
  }

  .shadow-legend dt,
  .shadow-legend dd,
  .inclination-note,
  .eclipse-model-note {
    font-size: 0.47rem;
    line-height: 1.3;
  }

  .inclination-note {
    margin-top: 5px;
  }

  .phase-name {
    font-size: 1.18rem;
  }

  .phase-kicker,
  .phase-name-en {
    font-size: 0.53rem;
  }

  .phase-icon {
    font-size: 1.55rem;
  }

  .earth-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    align-items: center;
    min-height: 76px;
    margin-top: 6px;
    padding: 5px 7px;
  }

  .earth-preview-heading {
    display: block;
    grid-column: 1;
  }

  .illumination {
    margin-top: 4px;
    white-space: normal;
  }

  .earth-preview canvas,
  .scene-stage[data-view="earth"] .earth-preview canvas {
    grid-column: 2;
    grid-row: 1;
    width: 76px;
    height: 76px;
    margin: 0;
  }

  .phase-age {
    margin-top: 7px;
    padding: 5px 0;
    font-size: 0.62rem;
  }

  .phase-age strong {
    font-size: 0.82rem;
  }

  .phase-description {
    margin-top: 6px;
    font-size: 0.66rem;
    line-height: 1.45;
  }

  .phase-relation {
    margin-top: 4px;
    font-size: 0.59rem;
    line-height: 1.4;
  }

  .view-note {
    margin-top: 5px;
    padding-top: 4px;
  }

  .view-note,
  .model-note,
  .scale-note {
    font-size: 0.49rem;
    line-height: 1.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .error-panel,
  .phase-panel,
  .chapter-switcher,
  .view-switcher,
  .eclipse-controls,
  .eclipse-panel,
  .utility-nav button,
  .utility-nav a,
  .intro-card,
  .guide-scrim,
  .time-controls {
    backdrop-filter: none;
  }

  .webgl-root canvas {
    transition: none;
  }

  .intro-card {
    transition: none;
  }
}
