:root {
  --bg: #000;
  --ink: #f7f7f7;
  --muted: #a6a6a6;
  --dim: #575757;
  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.34);
  --blue: #64a6ff;
  --red: #ff4e64;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", "Noto Sans TC", sans-serif;
  letter-spacing: 0;
}

.language-switch {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(10px);
}

.language-switch button {
  min-width: 42px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.language-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

button,
input {
  font: inherit;
}

.mobile-experience {
  display: none;
}

.scene {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 80px);
  isolation: isolate;
}

.scene-copy {
  width: min(980px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.hero-scene {
  min-height: 140svh;
}

.void-canvas {
  position: sticky;
  top: 0;
  width: 100vw;
  height: 100svh;
  z-index: -1;
  opacity: 0.88;
}

.hero-copy {
  position: absolute;
  top: 50svh;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0 22px;
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.78rem, 1.4vw, 0.96rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  display: grid;
  gap: 10px;
  font-size: clamp(1.8rem, 5vw, 4.9rem);
  font-weight: 820;
  line-height: 0.94;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 3.4rem);
  font-weight: 780;
  line-height: 0.98;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  line-height: 1;
}

.translation,
.hint,
.scene-copy > p:not(.statement):not(.kicker) {
  max-width: 840px;
  color: var(--muted);
  font-size: clamp(0.92rem, 1.35vw, 1.08rem);
  line-height: 1.75;
}

.statement {
  max-width: 1050px;
  font-size: clamp(1.25rem, 3vw, 3rem);
  font-weight: 760;
  line-height: 1.08;
}

.compact-scene {
  min-height: 90svh;
}

.story-stack {
  display: grid;
}

.story-line {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 6vw, 84px);
}

.story-stack-tight .story-line {
  min-height: 86svh;
}

.story-line p {
  width: min(1120px, 100%);
  color: var(--ink);
  font-size: clamp(1.25rem, 3.1vw, 3.4rem);
  font-weight: 740;
  line-height: 1.1;
  text-align: center;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.story-line.is-visible p {
  opacity: 1;
  transform: translateY(0);
}

.test-card {
  width: min(760px, 100%);
  display: grid;
  gap: 22px;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 0%, rgba(100, 166, 255, 0.12), transparent 45%),
    rgba(255, 255, 255, 0.025);
  box-shadow: 0 0 70px rgba(100, 166, 255, 0.14);
}

.test-card h2,
.test-card p {
  text-align: left;
}

.test-card p:not(.kicker) {
  color: var(--muted);
  font-size: clamp(0.98rem, 1.45vw, 1.16rem);
  line-height: 1.72;
}

.action-button,
.choice-grid button,
.subscribe button {
  min-height: 54px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-weight: 800;
  cursor: pointer;
}

.action-button:hover,
.subscribe button:hover {
  background: #dcdcdc;
}

.countdown {
  min-height: clamp(80px, 18vw, 160px);
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 840;
  line-height: 1;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.choice-grid button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  text-align: left;
  padding: 0 18px;
}

.choice-grid button:first-child {
  border-color: rgba(255, 78, 100, 0.52);
}

.choice-grid button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.test-card.shake {
  animation: shake 520ms ease;
}

.result-scene {
  background: radial-gradient(circle at 50% 50%, rgba(255, 78, 100, 0.1), transparent 36%), #000;
}

.crash-window {
  width: min(900px, 100%);
  display: grid;
  gap: 18px;
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid rgba(100, 166, 255, 0.5);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(100, 166, 255, 0.16), rgba(100, 166, 255, 0.04)),
    #02070f;
  box-shadow: 0 0 80px rgba(100, 166, 255, 0.18);
}

.terminal-tag {
  color: var(--blue);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.crash-window h2 {
  color: #d8e9ff;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: clamp(1rem, 2.5vw, 2.5rem);
  overflow-wrap: anywhere;
}

.crash-window p:last-child {
  color: var(--muted);
  font-size: clamp(0.98rem, 1.5vw, 1.2rem);
}

.solution-scene {
  min-height: 120svh;
  grid-template-rows: 1fr auto;
  gap: clamp(42px, 8vw, 96px);
}

.cube-wrap {
  width: clamp(110px, 22vw, 250px);
  height: clamp(110px, 22vw, 250px);
  perspective: 900px;
}

.zen-cube {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: cube-spin 13s linear infinite;
}

.zen-cube span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 34%, rgba(255, 255, 255, 0.08)),
    #030303;
  box-shadow: inset 0 0 36px rgba(255, 255, 255, 0.05), 0 0 42px rgba(255, 255, 255, 0.06);
}

.zen-cube span:nth-child(1) { transform: translateZ(calc(clamp(110px, 22vw, 250px) / 2)); }
.zen-cube span:nth-child(2) { transform: rotateY(180deg) translateZ(calc(clamp(110px, 22vw, 250px) / 2)); }
.zen-cube span:nth-child(3) { transform: rotateY(90deg) translateZ(calc(clamp(110px, 22vw, 250px) / 2)); }
.zen-cube span:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(clamp(110px, 22vw, 250px) / 2)); }
.zen-cube span:nth-child(5) { transform: rotateX(90deg) translateZ(calc(clamp(110px, 22vw, 250px) / 2)); }
.zen-cube span:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(clamp(110px, 22vw, 250px) / 2)); }

.solution-copy {
  margin-bottom: clamp(28px, 7vw, 90px);
}

.toolkit {
  min-height: 100svh;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.toolkit article {
  min-height: 100svh;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(26px, 4vw, 58px);
  background: var(--bg);
}

.toolkit span {
  color: var(--dim);
  font-size: 1rem;
  font-weight: 900;
}

.toolkit p {
  color: var(--muted);
  font-size: clamp(0.98rem, 1.4vw, 1.16rem);
}

.subscribe {
  min-height: 86svh;
  display: grid;
  align-content: center;
  gap: 26px;
  padding: clamp(28px, 7vw, 92px);
}

.subscribe h2 {
  max-width: 1120px;
}

.subscribe form {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.subscribe input {
  min-height: 68px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  padding: 0 20px;
  font-size: clamp(0.98rem, 1.35vw, 1.08rem);
}

.subscribe input::placeholder {
  color: var(--dim);
}

.subscribe button {
  padding: 0 24px;
}

.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;
}

@keyframes cube-spin {
  from { transform: rotateX(-18deg) rotateY(0deg); }
  to { transform: rotateX(-18deg) rotateY(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 760px) {
  .desktop-experience {
    display: none;
  }

  .mobile-experience {
    display: block;
    min-height: 100svh;
    background: #000;
  }

  .language-switch {
    top: 10px;
    right: 10px;
  }

  .mobile-hero,
  .mobile-section,
  .mobile-card-section,
  .mobile-tools article {
    padding-left: 22px;
    padding-right: 22px;
  }

  .mobile-hero {
    min-height: 88svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding-top: 86px;
    padding-bottom: 56px;
  }

  .mobile-brand,
  .mobile-kicker {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .mobile-hero h1,
  .mobile-section h2,
  .mobile-card h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(2.35rem, 10.5vw, 3.35rem);
    line-height: 1.08;
    font-weight: 820;
  }

  .mobile-hero p:not(.mobile-brand),
  .mobile-section > p:not(.mobile-kicker),
  .mobile-card p:not(.mobile-kicker),
  .mobile-copy-list p,
  .mobile-tools p {
    margin: 0;
    color: var(--muted);
    font-size: clamp(1.05rem, 4.7vw, 1.28rem);
    line-height: 1.72;
  }

  .mobile-section {
    display: grid;
    gap: 18px;
    padding-top: 56px;
    padding-bottom: 56px;
    border-top: 1px solid var(--line);
  }

  .mobile-copy-list {
    display: grid;
    gap: 16px;
  }

  .mobile-card-section {
    padding-top: 56px;
    padding-bottom: 56px;
    border-top: 1px solid var(--line);
  }

  .mobile-card {
    display: grid;
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.035);
  }

  .mobile-button,
  .mobile-choice-grid button,
  .mobile-subscribe button {
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--bg);
    font-weight: 850;
  }

  .mobile-countdown {
    min-height: 70px;
    display: grid;
    place-items: center;
    color: var(--ink);
    font-size: 3.4rem;
    font-weight: 840;
  }

  .mobile-choice-grid {
    display: grid;
    gap: 10px;
  }

  .mobile-choice-grid button {
    background: transparent;
    color: var(--ink);
    padding: 14px 16px;
    text-align: left;
    line-height: 1.45;
  }

  .mobile-result {
    background: rgba(255, 78, 100, 0.06);
  }

  .mobile-tools {
    border-top: 1px solid var(--line);
  }

  .mobile-tools article {
    display: grid;
    gap: 10px;
    padding-top: 34px;
    padding-bottom: 34px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-tools span {
    color: var(--dim);
    font-weight: 900;
  }

  .mobile-tools h3 {
    margin: 0;
    font-size: 1.7rem;
  }

  .mobile-subscribe {
    padding-bottom: 82px;
  }

  .mobile-subscribe form {
    display: grid;
    gap: 12px;
  }

  .mobile-subscribe input {
    width: 100%;
    min-height: 58px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink);
    padding: 0 16px;
    font-size: 1rem;
  }

  /*
    The remaining rules keep the old desktop scrollytelling layout harmless if a
    browser briefly paints before the mobile-only markup takes over.
  */
  .language-switch {
    top: 12px;
    right: 12px;
  }

  .language-switch button {
    min-width: 38px;
    min-height: 30px;
  }

  .scene {
    min-height: auto;
    display: block;
    padding: 72px 22px;
  }

  .hero-scene {
    min-height: 74svh;
    display: grid;
    align-items: center;
    padding-top: 88px;
  }

  .void-canvas {
    position: absolute;
    inset: 0;
    height: 74svh;
    opacity: 0.52;
  }

  .compact-scene {
    min-height: auto;
  }

  .hero-copy {
    position: relative;
    width: 100%;
    top: auto;
    left: auto;
    transform: none;
    align-items: start;
    justify-items: start;
    padding: 0;
  }

  .scene-copy {
    width: 100%;
    max-width: none;
    justify-items: start;
    gap: 16px;
    text-align: left;
  }

  .story-line {
    min-height: auto;
    display: block;
    padding: 34px 22px;
  }

  .story-stack-tight .story-line {
    min-height: auto;
  }

  h1 {
    width: 100%;
    gap: 8px;
    font-size: clamp(2.45rem, 10.2vw, 3.8rem);
    line-height: 1.04;
  }

  h2 {
    width: 100%;
    font-size: clamp(1.9rem, 8vw, 2.9rem);
    line-height: 1.08;
  }

  h3 {
    font-size: clamp(1.65rem, 7vw, 2.3rem);
  }

  .kicker {
    font-size: 0.86rem;
  }

  .statement {
    width: 100%;
    max-width: none;
    font-size: clamp(1.9rem, 8vw, 2.9rem);
    line-height: 1.16;
  }

  .translation,
  .hint,
  .scene-copy > p:not(.statement):not(.kicker) {
    width: 100%;
    max-width: none;
    font-size: clamp(1rem, 4.5vw, 1.28rem);
    line-height: 1.72;
  }

  .story-line p {
    width: 100%;
    max-width: none;
    font-size: clamp(1.45rem, 6.2vw, 2.25rem);
    line-height: 1.35;
    text-align: left;
    opacity: 1;
    transform: none;
  }

  .test-scene,
  .crash-scene {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .test-card {
    width: 100%;
    gap: 18px;
    padding: 24px 18px;
  }

  .test-card p:not(.kicker) {
    font-size: clamp(1.2rem, 5vw, 1.48rem);
  }

  .action-button,
  .choice-grid button,
  .subscribe button {
    width: 100%;
    min-height: 58px;
  }

  .choice-grid button {
    padding: 14px 16px;
    line-height: 1.45;
  }

  .countdown {
    min-height: 104px;
    font-size: clamp(4rem, 20vw, 5.6rem);
  }

  .crash-window {
    padding: 24px 18px;
  }

  .crash-window h2 {
    font-size: clamp(1.7rem, 8vw, 2.5rem);
    line-height: 1.12;
  }

  .crash-window p:last-child {
    font-size: clamp(1.08rem, 4.5vw, 1.32rem);
  }

  .solution-scene {
    min-height: auto;
    display: grid;
    gap: 34px;
    align-content: center;
    padding-top: 64px;
  }

  .cube-wrap {
    width: clamp(128px, 38vw, 170px);
    height: clamp(128px, 38vw, 170px);
  }

  .toolkit {
    grid-template-columns: 1fr;
  }

  .toolkit article {
    min-height: auto;
    padding: 42px 22px;
  }

  .toolkit span {
    font-size: 0.92rem;
  }

  .toolkit p {
    font-size: clamp(1.2rem, 5vw, 1.5rem);
    line-height: 1.7;
  }

  .subscribe {
    min-height: auto;
    padding: 72px 22px 84px;
  }

  .subscribe h2 {
    line-height: 1.14;
  }

  .subscribe form {
    grid-template-columns: 1fr;
  }

  .subscribe input {
    min-height: 62px;
    font-size: 1.08rem;
  }
}
