:root {
  --ink: #06131b;
  --paper: #f4ecdd;
  --muted: #9cb0b1;
  --amber: #f5a65a;
  --amber-soft: #ffd092;
  --teal: #63d4c8;
  --teal-soft: #b7f2ec;
  --danger: #f07867;
  --glass: rgba(6, 22, 31, 0.86);
  --glass-heavy: rgba(5, 18, 26, 0.96);
  --line: rgba(148, 211, 208, 0.22);
  --font: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #06131b;
}

body {
  color: var(--paper);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
a,
input {
  font: inherit;
}

button,
a {
  color: inherit;
}

button {
  border: 0;
}

button:disabled {
  cursor: default;
  opacity: 0.58;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.ar-app {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 420px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, #17313c, #07141c 72%),
    #07141c;
}

#camera {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #07141c;
}

#arCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.camera-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(1, 8, 12, 0.68), transparent 18%, transparent 66%, rgba(2, 10, 15, 0.86)),
    radial-gradient(circle at center, transparent 32%, rgba(1, 8, 12, 0.18) 100%);
}

.hud-top {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  display: grid;
  width: 100%;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding:
    calc(12px + env(safe-area-inset-top))
    calc(16px + env(safe-area-inset-right))
    12px
    calc(16px + env(safe-area-inset-left));
  pointer-events: none;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.brand-orbit {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(99, 212, 200, 0.7);
  border-radius: 50%;
  transform: rotate(-24deg) scaleY(0.48);
}

.brand-orbit::before {
  position: absolute;
  inset: 9px;
  content: "";
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px rgba(245, 166, 90, 0.8);
  transform: scaleY(2.08);
}

.brand-orbit i {
  position: absolute;
  top: 14px;
  left: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal-soft);
  box-shadow: 0 0 8px var(--teal);
}

.hud-brand strong,
.hud-brand small {
  display: block;
}

.hud-brand strong {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.hud-brand small {
  margin-top: 1px;
  color: rgba(222, 236, 235, 0.68);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.tracking-pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(225, 239, 230, 0.17);
  border-radius: 999px;
  background: rgba(5, 19, 27, 0.48);
  color: rgba(237, 242, 236, 0.8);
  font-size: 10px;
  white-space: nowrap;
  backdrop-filter: blur(12px);
}

.tracking-pill.is-locked {
  border-color: rgba(99, 212, 200, 0.35);
  color: var(--teal-soft);
}

.tracking-pill.is-lost {
  border-color: rgba(245, 166, 90, 0.4);
  color: var(--amber-soft);
}

.tracking-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7a8b8e;
}

.is-locked .tracking-dot {
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
}

.is-lost .tracking-dot {
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

.hud-actions {
  display: flex;
  justify-self: end;
  gap: 8px;
  pointer-events: auto;
}

.round-button,
.dock-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(219, 238, 234, 0.17);
  border-radius: 50%;
  background: rgba(5, 19, 27, 0.52);
  color: rgba(237, 243, 238, 0.86);
  backdrop-filter: blur(12px);
}

.round-button svg,
.dock-icon svg {
  width: 17px;
  height: 17px;
}

.scan-guide {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: min(50vw, 360px);
  aspect-ratio: 1.6;
  transform: translate(-50%, -53%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.scan-guide.is-visible {
  opacity: 1;
}

.scan-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: rgba(247, 238, 221, 0.78);
  border-style: solid;
  filter: drop-shadow(0 0 8px rgba(99, 212, 200, 0.55));
}

.top-left {
  top: 0;
  left: 0;
  border-width: 2px 0 0 2px;
}

.top-right {
  top: 0;
  right: 0;
  border-width: 2px 2px 0 0;
}

.bottom-left {
  bottom: 0;
  left: 0;
  border-width: 0 0 2px 2px;
}

.bottom-right {
  right: 0;
  bottom: 0;
  border-width: 0 2px 2px 0;
}

.scan-line {
  position: absolute;
  top: 20%;
  right: 6%;
  left: 6%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  box-shadow: 0 0 9px var(--teal);
  animation: scan 2.3s ease-in-out infinite;
}

@keyframes scan {
  0%,
  100% {
    top: 18%;
    opacity: 0;
  }
  16% {
    opacity: 0.9;
  }
  50% {
    top: 82%;
    opacity: 0.9;
  }
  84% {
    opacity: 0;
  }
}

.tracking-hint {
  position: absolute;
  z-index: 4;
  top: calc(50% + min(20vw, 120px));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(4, 16, 23, 0.6);
  color: rgba(238, 241, 234, 0.8);
  font-size: 10px;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.tracking-hint svg {
  width: 14px;
  height: 14px;
}

.ar-scale {
  position: absolute;
  z-index: 4;
  top: calc(68px + env(safe-area-inset-top));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid rgba(214, 237, 230, 0.16);
  border-radius: 999px;
  background: rgba(5, 19, 27, 0.55);
  color: rgba(232, 240, 234, 0.72);
  font-size: 9px;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.ar-scale span {
  padding: 0 6px;
  white-space: nowrap;
}

.ar-scale button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: var(--paper);
  font-size: 19px;
}

.equal-area-proof {
  position: absolute;
  z-index: 8;
  top: calc(76px + env(safe-area-inset-top));
  right: calc(18px + env(safe-area-inset-right));
  width: min(342px, calc(100vw - 36px));
  padding: 10px 12px 8px;
  border: 1px solid rgba(164, 218, 216, 0.24);
  border-radius: 15px;
  background: rgba(4, 18, 27, 0.9);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  pointer-events: none;
  backdrop-filter: blur(15px);
}

.equal-area-proof[hidden] {
  display: none;
}

.equal-area-head,
.equal-area-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.equal-area-head {
  color: #b9cecb;
  font-size: 10px;
}

.equal-area-head strong {
  color: #ffe0a2;
  font-size: 13px;
}

.equal-area-proof svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: -2px;
}

.equal-area-values {
  padding: 4px 8px 0;
  border-top: 1px solid rgba(144, 202, 199, 0.14);
  color: #d8e6e3;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.equal-area-values i {
  color: #f5d38a;
  font-style: normal;
  font-weight: 700;
}

.equal-area-values b {
  color: #fff1c9;
  font-weight: 600;
}

.equal-area-note {
  margin: 5px 0 0;
  color: #829996;
  font-size: 9px;
  line-height: 1.35;
  text-align: center;
}

.equal-area-toggle {
  display: block;
  margin: 7px auto 0;
  padding: 5px 12px;
  border: 1px solid rgba(99, 212, 200, 0.24);
  border-radius: 999px;
  background: rgba(20, 74, 75, 0.4);
  color: #b7d8d4;
  font-size: 9px;
  pointer-events: auto;
}

.lesson-dock {
  position: absolute;
  z-index: 5;
  bottom: calc(78px + env(safe-area-inset-bottom));
  left: 14px;
  width: min(390px, calc(100vw - 28px));
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(9, 29, 40, 0.91), rgba(4, 18, 27, 0.94));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.lesson-heading {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
}

.law-index {
  color: var(--amber);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.lesson-heading p {
  margin: 0 0 2px;
  color: var(--teal);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.lesson-heading h1 {
  margin: 0;
  overflow: hidden;
  color: #f4ecdf;
  font-size: clamp(17px, 4.8vw, 23px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-icon {
  width: 32px;
  height: 32px;
}

.lesson-body {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  color: #b8cac8;
  font-size: 11px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lesson-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.fact-chip {
  padding: 5px 8px;
  border: 1px solid rgba(102, 210, 200, 0.16);
  border-radius: 999px;
  background: rgba(26, 94, 90, 0.12);
  color: #b4ceca;
  font-size: 9px;
}

.lesson-tools {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid rgba(133, 195, 191, 0.12);
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  background: transparent;
  color: #86aaa9;
  font-size: 9px;
}

.text-button svg {
  width: 13px;
  height: 13px;
}

.text-button.is-active {
  color: var(--teal-soft);
}

.law-switcher {
  position: absolute;
  z-index: 6;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  padding: 5px;
  border: 1px solid rgba(154, 207, 204, 0.18);
  border-radius: 15px;
  background: rgba(5, 20, 28, 0.83);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.law-button {
  display: inline-flex;
  min-width: 92px;
  height: 46px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  background: transparent;
  color: #829c9f;
  font-size: 10px;
}

.law-button span {
  color: #506f73;
  font-size: 8px;
}

.law-button.active {
  background: linear-gradient(125deg, rgba(151, 86, 39, 0.6), rgba(84, 53, 30, 0.38));
  color: var(--amber-soft);
  box-shadow: inset 0 0 0 1px rgba(245, 166, 90, 0.16);
}

.law-button.active span {
  color: var(--amber);
}

body.solar-overview #arCanvas {
  cursor: pointer;
}

/* Netlify's floating badge overlaps the law switcher on phones. */
#nl-badge-frame {
  display: none !important;
}

@media (max-width: 430px) {
  .law-button {
    min-width: 78px;
    padding-inline: 7px;
  }

}

.entry-screen {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto;
  background:
    radial-gradient(circle at 75% 20%, rgba(33, 92, 95, 0.26), transparent 36%),
    linear-gradient(145deg, #07151e, #041017 70%);
  transition: opacity 300ms ease, visibility 300ms ease;
}

.entry-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.entry-card {
  position: relative;
  width: min(460px, 100%);
  margin: auto;
  padding: 20px;
  border: 1px solid rgba(137, 204, 200, 0.2);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(14, 41, 51, 0.94), rgba(5, 20, 29, 0.98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.entry-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--teal);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.entry-status {
  color: #789598;
  letter-spacing: 0;
}

.entry-illustration {
  position: relative;
  height: 142px;
  margin: 18px 0 20px;
  overflow: hidden;
  border: 1px solid rgba(129, 193, 190, 0.12);
  border-radius: 15px;
  background:
    linear-gradient(rgba(91, 139, 141, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 139, 141, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 55% 52%, rgba(41, 88, 101, 0.34), transparent 42%),
    #071a23;
  background-size: 22px 22px, 22px 22px, auto, auto;
}

.entry-book {
  position: absolute;
  bottom: 18px;
  left: 9%;
  width: 43%;
  height: 58px;
  border: 1px solid rgba(239, 227, 203, 0.42);
  border-radius: 4px 9px 9px 4px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.13) 2px, transparent 2px),
    #d6c7ad;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.38);
  transform: skewY(6deg);
}

.entry-book::after {
  position: absolute;
  top: 7px;
  right: 10px;
  color: #6c5b49;
  content: "KEPLER";
  font-size: 7px;
  letter-spacing: 0.12em;
}

.entry-illustration img {
  position: absolute;
  right: 9%;
  bottom: 12px;
  width: 66px;
  height: 66px;
  padding: 6px;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  transform: rotate(3deg) skewY(-3deg);
}

.entry-planet {
  position: absolute;
  top: 31px;
  left: 55%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #fff6cf, #f2a24d 40%, #b95123 82%);
  box-shadow: 0 0 24px rgba(245, 166, 90, 0.74);
}

.entry-orbit {
  position: absolute;
  top: 18px;
  left: 43%;
  width: 142px;
  height: 58px;
  border: 1px solid rgba(99, 212, 200, 0.55);
  border-radius: 50%;
  transform: rotate(-14deg);
}

.entry-orbit::after {
  position: absolute;
  top: 8px;
  right: 15px;
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: #66b7dc;
  box-shadow: 0 0 9px #66b7dc;
}

.entry-eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.entry-card h1 {
  margin: 0;
  color: #f6eee0;
  font-size: clamp(34px, 10vw, 48px);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.1;
}

.entry-copy {
  margin: 14px 0 0;
  color: #b1c3c2;
  font-size: 12px;
  line-height: 1.75;
}

.entry-steps {
  display: grid;
  gap: 8px;
  margin: 17px 0;
  padding: 0;
  color: #8ea7a7;
  font-size: 10px;
  list-style: none;
}

.entry-steps li {
  display: flex;
  align-items: center;
  gap: 9px;
}

.entry-steps span {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(99, 212, 200, 0.25);
  border-radius: 50%;
  color: var(--teal);
  font-size: 8px;
}

.start-button {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 12px;
  background: linear-gradient(110deg, #e9974d, #f5bb71);
  color: #1d1209;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(235, 145, 71, 0.22);
}

.start-button svg {
  width: 18px;
  height: 18px;
}

.direct-law-button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid rgba(99, 212, 200, 0.26);
  border-radius: 11px;
  background: rgba(16, 68, 70, 0.42);
  color: var(--teal-soft);
  font-size: 11px;
  font-weight: 600;
}

.direct-law-button svg {
  width: 16px;
  height: 16px;
}

.screen-law-picker {
  margin-top: 10px;
}

.screen-law-picker > span {
  display: block;
  margin-bottom: 7px;
  color: #819d9e;
  font-size: 9px;
  text-align: center;
}

.screen-law-picker > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.screen-law-picker button,
.static-law-tabs button {
  min-height: 38px;
  border: 1px solid rgba(99, 212, 200, 0.2);
  border-radius: 9px;
  background: rgba(16, 68, 70, 0.34);
  color: #a9cac7;
  font-size: 9px;
}

.screen-law-picker button:active,
.static-law-tabs button:active {
  background: rgba(34, 116, 111, 0.48);
  color: #e4fffb;
}

.static-back-button {
  position: fixed;
  z-index: 40;
  top: calc(14px + env(safe-area-inset-top));
  left: calc(14px + env(safe-area-inset-left));
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid rgba(141, 207, 203, 0.24);
  border-radius: 999px;
  background: rgba(4, 18, 27, 0.9);
  color: #b9d3d0;
  font-size: 11px;
  backdrop-filter: blur(12px);
}

.static-back-button svg {
  width: 15px;
  height: 15px;
}

.static-camera-button {
  position: fixed;
  z-index: 40;
  top: calc(14px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(110deg, #e9974d, #f5bb71);
  color: #1d1209;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(235, 145, 71, 0.25);
}

.static-camera-button svg {
  width: 15px;
  height: 15px;
}

body.static-second-law {
  overflow-y: auto;
  background: #06131b;
}

body.static-second-law .ar-app {
  min-height: 100%;
  height: auto;
  overflow: visible;
  padding: 72px 12px 28px;
  background: #06131b;
}

body.static-second-law #camera,
body.static-second-law #arCanvas,
body.static-second-law .camera-shade,
body.static-second-law .hud-top,
body.static-second-law .scan-guide,
body.static-second-law .tracking-hint,
body.static-second-law .ar-scale,
body.static-second-law .law-switcher,
body.static-second-law .lesson-tools,
body.static-second-law .dock-icon {
  display: none !important;
}

body.static-second-law .equal-area-proof {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  width: min(620px, 100%);
  margin: 0 auto 14px;
  transform: none;
}

body.static-second-law .lesson-dock {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: min(620px, 100%);
  margin: 0 auto;
  transform: none;
}

body.static-second-law .lesson-body {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.static-law-screen {
  position: relative;
  z-index: 25;
  width: min(760px, calc(100% - 24px));
  margin: 0 auto;
}

.static-law-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  width: min(520px, 100%);
  margin: 0 auto 12px;
}

.static-law-tabs button.active {
  border-color: rgba(245, 166, 90, 0.55);
  background: rgba(121, 68, 33, 0.48);
  color: #ffd8a7;
}

.static-law-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(148, 211, 208, 0.2);
  border-radius: 20px;
  background: #0a1b24;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

.static-law-visual {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 211, 208, 0.13);
  border-radius: 15px;
  background:
    radial-gradient(circle at 42% 48%, rgba(29, 84, 94, 0.28), transparent 50%),
    rgba(3, 16, 24, 0.72);
}

.static-law-visual svg {
  display: block;
  width: 100%;
  height: auto;
}

.static-law-copy {
  align-self: center;
  padding: 4px 4px 4px 0;
}

.static-law-eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.static-law-copy h1 {
  margin: 0;
  color: #f6eee0;
  font-size: clamp(22px, 4vw, 31px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.static-law-body {
  margin: 12px 0 0;
  color: #b8cac8;
  font-size: 11px;
  line-height: 1.72;
}

.static-law-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.static-law-facts span {
  padding: 6px 9px;
  border: 1px solid rgba(99, 212, 200, 0.16);
  border-radius: 999px;
  background: rgba(26, 94, 90, 0.14);
  color: #b8d3cf;
  font-size: 9px;
}

.static-law-visual.is-animating .law3-fit-line {
  stroke-dasharray: 520;
  animation: law3-line-draw 2.4s ease-out both;
}

.static-law-visual.is-animating .law3-point {
  transform-box: fill-box;
  transform-origin: center;
  animation: law3-point-pulse 1.8s ease-in-out infinite;
}

.law3-point-label {
  fill: rgba(217, 234, 231, 0.68);
  font-size: 8px;
}

@keyframes law3-line-draw {
  from { stroke-dashoffset: 520; }
  to { stroke-dashoffset: 0; }
}

@keyframes law3-point-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  45% { transform: scale(1.28); filter: brightness(1.5); }
}

body.static-law-screen-mode {
  overflow-y: auto;
  background: #06131b;
}

body.static-law-screen-mode .ar-app {
  min-height: 100%;
  height: auto;
  overflow: visible;
  padding: 70px 12px 28px;
  background: #06131b;
}

body.static-law-screen-mode #camera,
body.static-law-screen-mode #arCanvas,
body.static-law-screen-mode .camera-shade,
body.static-law-screen-mode .hud-top,
body.static-law-screen-mode .scan-guide,
body.static-law-screen-mode .tracking-hint,
body.static-law-screen-mode .ar-scale,
body.static-law-screen-mode .law-switcher,
body.static-law-screen-mode .equal-area-proof,
body.static-law-screen-mode .lesson-dock {
  display: none !important;
}

@media (max-width: 640px) {
  .static-law-card {
    grid-template-columns: 1fr;
  }

  .static-law-copy {
    padding: 2px 4px 8px;
  }
}

.target-link {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  margin: 12px auto 0;
  color: #83a3a4;
  font-size: 9px;
  text-decoration: none;
}

.target-link svg {
  width: 13px;
  height: 13px;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 13px 0 0;
  color: #5f7e82;
  font-size: 8px;
}

.privacy-note svg {
  width: 12px;
  height: 12px;
}

.error-banner {
  position: absolute;
  z-index: 30;
  top: calc(66px + env(safe-area-inset-top));
  left: 50%;
  display: flex;
  width: min(460px, calc(100vw - 28px));
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 15px;
  border: 1px solid rgba(240, 120, 103, 0.38);
  border-radius: 12px;
  background: rgba(47, 15, 15, 0.92);
  color: #ffd8d1;
  font-size: 10px;
  line-height: 1.5;
  transform: translateX(-50%);
}

.error-banner button {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.settings-sheet,
.chart-sheet,
.expanded-copy {
  position: absolute;
  z-index: 24;
  inset: 0;
}

.settings-sheet[hidden],
.chart-sheet[hidden],
.expanded-copy[hidden] {
  display: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 8, 12, 0.62);
  backdrop-filter: blur(4px);
}

.sheet-content {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(430px, calc(100vw - 26px));
  padding: 20px;
  border: 1px solid rgba(145, 207, 202, 0.23);
  border-radius: 20px;
  background: var(--glass-heavy);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
  transform: translate(-50%, -50%);
}

.sheet-content.wide {
  width: min(620px, calc(100vw - 26px));
}

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

.sheet-heading p {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.sheet-heading h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.range-field {
  display: grid;
  gap: 9px;
  margin-top: 20px;
  color: #b9cac7;
  font-size: 11px;
}

.range-field > span {
  display: flex;
  justify-content: space-between;
}

.range-field strong {
  color: var(--amber-soft);
  font-weight: 500;
}

.range-field input {
  width: 100%;
  accent-color: var(--amber);
}

.range-field small,
.calibration-copy {
  color: #6f8b8e;
  font-size: 9px;
  line-height: 1.65;
}

.quality-row {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid rgba(125, 190, 185, 0.13);
  color: #8ca7a7;
  font-size: 10px;
}

.quality-row strong {
  color: var(--teal-soft);
  font-weight: 500;
}

.calibration-copy {
  margin: 12px 0 0;
}

#keplerChart {
  display: block;
  width: 100%;
  max-height: min(56vh, 390px);
  margin-top: 8px;
}

.chart-caption {
  margin: 2px 0 0;
  color: #7d999b;
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}

.expanded-content {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(520px, calc(100vw - 26px));
  max-height: calc(100vh - 42px);
  padding: 24px;
  overflow-y: auto;
  border: 1px solid rgba(145, 207, 202, 0.23);
  border-radius: 20px;
  background: var(--glass-heavy);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
  transform: translate(-50%, -50%);
}

.expanded-content > .round-button {
  float: right;
}

.expanded-content h2 {
  margin: 8px 0 13px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.24;
}

.expanded-content > p {
  margin: 0;
  color: #b7c8c6;
  font-size: 12px;
  line-height: 1.9;
  white-space: pre-line;
}

#expandedFacts {
  display: grid;
  gap: 7px;
  margin: 17px 0;
}

#expandedFacts span {
  padding: 8px 10px;
  border-left: 2px solid var(--amber);
  background: rgba(245, 166, 90, 0.06);
  color: #c5d3cf;
  font-size: 10px;
}

.expanded-content small {
  color: #617e81;
  font-size: 9px;
}

.toast {
  position: absolute;
  z-index: 28;
  bottom: calc(144px + env(safe-area-inset-bottom));
  left: 50%;
  max-width: calc(100vw - 28px);
  padding: 9px 13px;
  border: 1px solid rgba(99, 212, 200, 0.25);
  border-radius: 999px;
  background: rgba(5, 21, 29, 0.9);
  color: #d3e4e0;
  font-size: 9px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: 180ms ease;
  white-space: nowrap;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.lesson-dock.is-collapsed .lesson-body,
.lesson-dock.is-collapsed .lesson-facts {
  display: none;
}

.lesson-dock.is-collapsed .lesson-tools {
  margin-top: 8px;
}

@media (orientation: landscape) {
  .lesson-dock {
    top: auto;
    right: auto;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: calc(14px + env(safe-area-inset-left));
    width: min(640px, calc(100vw - 314px));
    padding: 12px 14px;
    transform: none;
  }

  .lesson-heading {
    grid-template-columns: 36px minmax(0, 1fr) 32px;
  }

  .lesson-heading h1 {
    font-size: clamp(16px, 2.5vw, 21px);
  }

  .lesson-body {
    margin-top: 7px;
    font-size: 10px;
    line-height: 1.55;
  }

  .lesson-facts {
    margin-top: 7px;
  }

  .fact-chip {
    padding-block: 4px;
  }

  .lesson-tools {
    margin-top: 7px;
    padding-top: 7px;
  }

  .law-switcher {
    right: calc(18px + env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: auto;
    transform: none;
  }

  .equal-area-proof {
    top: calc(66px + env(safe-area-inset-top));
  }

  .tracking-hint {
    top: calc(64px + env(safe-area-inset-top));
    bottom: auto;
  }
}

@media (orientation: portrait) {
  .equal-area-proof {
    top: calc(88px + env(safe-area-inset-top));
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

@media (orientation: landscape) and (min-width: 720px) {
  .entry-card {
    display: grid;
    width: min(760px, calc(100vw - 40px));
    grid-template-columns: 0.95fr 1.05fr;
    column-gap: 24px;
  }

  .entry-kicker,
  .entry-illustration,
  .entry-eyebrow,
  .entry-card h1,
  .entry-copy,
  .entry-steps {
    grid-column: 1;
  }

  .entry-illustration {
    grid-row: 2 / span 4;
    height: 270px;
    margin: 18px 0 0;
  }

  .entry-eyebrow,
  .entry-card h1,
  .entry-copy,
  .entry-steps,
  .start-button,
  .target-link,
  .privacy-note {
    grid-column: 2;
  }

  .entry-eyebrow {
    align-self: end;
  }

  .entry-card h1 {
    font-size: clamp(32px, 4.6vw, 48px);
  }

  .entry-steps {
    margin-block: 12px;
  }
}

@media (max-height: 520px) and (orientation: portrait) {
  .entry-card {
    padding: 15px;
  }

  .entry-illustration {
    height: 102px;
    margin-block: 12px;
  }

  .entry-card h1 {
    font-size: 32px;
  }

  .entry-copy,
  .entry-steps {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
