:root {
  --bg: #f3f1eb;
  --bg-2: #e8eef7;
  --paper: #ffffff;
  --ink: #1a2330;
  --muted: #5c6878;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --gold: #b45309;
  --line: #d5dce6;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 12% 18%, var(--bg-2), transparent 55%),
    radial-gradient(900px 500px at 90% 80%, #f0e6d6, transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

html:has(body.clock-page),
body.clock-page {
  overflow: auto;
  height: auto;
  min-height: 100%;
}

#deck {
  height: 100%;
  overflow: hidden;
}

.slide {
  height: 100%;
  width: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 5.5vh 7vw 8vh;
  position: relative;
}

.slide.is-current {
  display: flex;
}

.hero,
.split {
  width: min(1180px, 100%);
  display: grid;
  gap: 3.5vw;
  align-items: center;
}

.hero {
  grid-template-columns: minmax(240px, 0.88fr) 1.12fr;
}

.split {
  grid-template-columns: 1.08fr 0.92fr;
}

.split.reverse {
  grid-template-columns: 0.92fr 1.08fr;
}

.split.reverse .copy {
  order: -1;
}

.pi-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 68vh;
  position: relative;
}

.pi-ring {
  position: absolute;
  width: min(72vw, 28rem);
  height: min(72vw, 28rem);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 50%;
  pointer-events: none;
}

.pi-ring.r2 {
  width: min(58vw, 22rem);
  height: min(58vw, 22rem);
  border-style: dashed;
}

.pi-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(10rem, 26vw, 20rem);
  line-height: 0.85;
  color: var(--accent);
  font-weight: 400;
  letter-spacing: -0.06em;
  position: relative;
  animation: pi-breathe 8s ease-in-out infinite;
}

.pi-digits {
  max-width: 18rem;
  margin: 1.4rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  word-break: break-all;
  text-align: center;
  position: relative;
}

.copy h1,
.copy h2 {
  margin: 0 0 0.85rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.18;
}

.copy h1 {
  font-size: clamp(1.9rem, 3.8vw, 3.15rem);
}

.copy h2 {
  font-size: clamp(1.55rem, 2.8vw, 2.35rem);
}

.kicker {
  margin: 0 0 0.55rem;
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.lead {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
  max-width: 38rem;
}

.lead + .lead {
  margin-top: -0.2rem;
}

.hint {
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.points {
  margin: 0.2rem 0 0.9rem;
  padding: 0;
  list-style: none;
}

.points li {
  position: relative;
  padding: 0.38rem 0 0.38rem 1.15rem;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.55;
}

.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.8rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.scenes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.scene {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}

.scene h3 {
  margin: 0 0 0.28rem;
  font-size: 0.82rem;
  font-weight: 650;
}

.scene p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.scene-wide {
  grid-column: 1 / -1;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0 0;
}

.pill {
  display: inline-block;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: #e8eefc;
  color: var(--accent-2);
  font-size: 0.75rem;
}

.art {
  margin: 0;
}

.art svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 16px 28px rgba(37, 60, 110, 0.08));
}

.reveal,
.reveal-img {
  opacity: 0;
  transform: translateY(22px);
}

.slide.is-current.is-shown .reveal,
.slide.is-current.is-shown .reveal-img {
  animation: rise 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.slide.is-current.is-shown .reveal:nth-child(1) {
  animation-delay: 0.1s;
}
.slide.is-current.is-shown .reveal:nth-child(2) {
  animation-delay: 0.32s;
}
.slide.is-current.is-shown .reveal:nth-child(3) {
  animation-delay: 0.54s;
}
.slide.is-current.is-shown .reveal:nth-child(4) {
  animation-delay: 0.76s;
}
.slide.is-current.is-shown .reveal:nth-child(5) {
  animation-delay: 0.98s;
}
.slide.is-current.is-shown .reveal:nth-child(6) {
  animation-delay: 1.18s;
}
.slide.is-current.is-shown .points .reveal:nth-child(1) {
  animation-delay: 0.82s;
}
.slide.is-current.is-shown .points .reveal:nth-child(2) {
  animation-delay: 1.02s;
}
.slide.is-current.is-shown .points .reveal:nth-child(3) {
  animation-delay: 1.2s;
}
.slide.is-current.is-shown .points .reveal:nth-child(4) {
  animation-delay: 1.36s;
}
.slide.is-current.is-shown .cta.reveal {
  animation-delay: 1.5s;
}
.slide.is-current.is-shown .reveal-img {
  animation-delay: 0.22s;
  animation-duration: 1.4s;
}

.btn {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
}

.btn:hover {
  background: var(--accent-2);
}

.dots {
  position: fixed;
  right: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  z-index: 4;
}

.dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #c5ceda;
  cursor: pointer;
}

.dots button.on {
  background: var(--accent);
  transform: scale(1.25);
}

.top-actions {
  position: fixed;
  top: 1.05rem;
  right: 1.5rem;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.to-demo,
.to-download,
.to-ghost {
  font-size: 0.82rem;
  font-family: inherit;
  border-radius: 8px;
  padding: 0.38rem 0.72rem;
  text-decoration: none;
  line-height: 1.3;
  border: 1px solid transparent;
  cursor: pointer;
}

.to-ghost {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
}

.to-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.to-demo {
  color: #fff;
  background: var(--accent);
}

.to-demo:hover {
  background: var(--accent-2);
  color: #fff;
}

.to-download {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  cursor: not-allowed;
}

.to-download:disabled {
  opacity: 0.55;
}

.to-download:not(:disabled) {
  cursor: pointer;
}

.to-download:not(:disabled):hover {
  border-color: var(--accent);
  color: var(--accent);
}

.storage-panel {
  position: fixed;
  top: 3.4rem;
  right: 1.5rem;
  z-index: 5;
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(70vh, 28rem);
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem 1rem;
  box-shadow: 0 12px 32px rgba(26, 35, 48, 0.12);
}

.storage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.storage-close {
  border: 0;
  background: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.storage-note,
.storage-path {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.storage-path {
  color: var(--ink);
  word-break: break-all;
}

.storage-list {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  max-height: 12rem;
  overflow: auto;
}

.storage-list li {
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--line);
}

.storage-pick {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: #eef3ff;
  color: var(--accent-2);
  font-family: inherit;
  cursor: pointer;
}

@media (max-width: 900px) {
  .top-actions {
    right: 0.6rem;
    left: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pi-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.025);
  }
}

@media (max-width: 900px) {
  .hero,
  .split,
  .split.reverse {
    grid-template-columns: 1fr;
  }

  .split.reverse .copy {
    order: 0;
  }

  .pi-col {
    min-height: 26vh;
  }

  .pi-mark {
    font-size: 7.2rem;
  }

  .scenes {
    grid-template-columns: 1fr;
  }

  .art {
    max-height: 34vh;
    overflow: hidden;
  }

  .dots {
    right: auto;
    left: 50%;
    top: auto;
    bottom: 1rem;
    flex-direction: row;
    transform: translateX(-50%);
  }
}

.clock-page {
  overflow: auto;
  height: auto;
  min-height: 100%;
}

.clock-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.clock-bar h1 {
  margin: 0;
  font-size: 1.1rem;
  flex: 1;
}

.clock-bar a {
  color: var(--accent-2);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.clock-bar a:hover {
  text-decoration: underline;
}

.clock-live {
  font-size: 0.85rem;
  color: var(--muted);
}

.clock-live.ok {
  color: #15803d;
}

.clock-live.err {
  color: #b91c1c;
}

.clock-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.clock-lead {
  color: var(--muted);
  line-height: 1.65;
}

.clock-lead code {
  background: #eef4ff;
  color: var(--accent-2);
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font-size: 0.88em;
}

.clock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.clock-grid article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  box-shadow: 0 8px 24px rgba(26, 35, 48, 0.04);
}

.clock-grid h2 {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.clock-grid .metric {
  margin: 0;
  font-size: 1.35rem;
  font-family: Consolas, "SF Mono", monospace;
}

.clock-grid .wide {
  grid-column: 1 / -1;
}

.clock-grid .salt {
  margin: 0;
  font-family: Consolas, "SF Mono", monospace;
  font-size: 0.88rem;
  word-break: break-all;
  line-height: 1.5;
  color: var(--accent-2);
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
}

.enter-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.4rem 1.5rem 1.2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 28px rgba(37, 60, 110, 0.08);
}

.enter-actions .btn {
  margin-top: 0;
  text-align: center;
}

.enter-actions .enter-outline {
  background: #fff;
  color: var(--accent-2);
  border: 2px solid var(--accent);
}

.enter-actions .enter-outline:hover {
  background: #eef3ff;
  color: var(--accent-2);
}

.enter-actions .hint {
  margin: 0.4rem 0 0;
}
