:root {
  color-scheme: light;
  --ink: #14211f;
  --muted: #5e6f6a;
  --line: #dbe5df;
  --paper: #f7f4ed;
  --surface: #ffffff;
  --teal: #0f9b91;
  --teal-dark: #08766f;
  --coral: #e86d56;
  --gold: #d99a27;
  --moss: #7a9463;
  --night: #0d1b1c;
  --shadow: 0 18px 50px rgba(20, 33, 31, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

body::selection {
  color: #ffffff;
  background: var(--teal-dark);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 32px;
  color: #ffffff;
  background: rgba(13, 27, 28, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.brand,
.nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--night);
  background: #baf4ec;
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: 0;
}

.nav {
  gap: 8px;
}

.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.nav a:hover,
.nav a:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.hero {
  position: relative;
  display: grid;
  min-height: min(760px, calc(100vh - 64px));
  overflow: hidden;
  background: var(--night);
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 21, 22, 0.94) 0%, rgba(8, 21, 22, 0.7) 38%, rgba(8, 21, 22, 0.08) 100%),
    linear-gradient(0deg, rgba(13, 27, 28, 0.62) 0%, rgba(13, 27, 28, 0) 42%);
}

.hero-content {
  position: relative;
  z-index: 1;
  align-self: center;
  width: min(720px, calc(100% - 48px));
  margin-left: clamp(24px, 8vw, 112px);
  padding: 84px 0 120px;
  color: #ffffff;
}

.eyebrow,
.panel-kicker,
.toolbar-label {
  margin: 0;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #93efe5;
}

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

h1 {
  max-width: 11ch;
  margin-bottom: 18px;
  font-size: clamp(56px, 8vw, 112px);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.25;
}

.hero-copy {
  max-width: 590px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 19px;
}

.hero-actions,
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.button {
  padding: 0 18px;
  font-weight: 800;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: var(--night);
  background: #9af1e6;
  box-shadow: 0 14px 36px rgba(50, 235, 215, 0.22);
}

.button.ghost {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.button.compact {
  min-height: 38px;
  color: #ffffff;
  background: var(--ink);
  font-size: 14px;
}

.icon-button {
  width: 38px;
  height: 38px;
  color: var(--ink);
  background: #e7eee9;
  font-weight: 900;
}

.metric-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.metric-band > div {
  min-width: 0;
  padding: 26px 32px;
  background: #fbfaf6;
}

.metric-value,
.metric-label {
  display: block;
}

.metric-value {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.metric-label {
  color: var(--muted);
  font-size: 14px;
}

.section {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 86px 0;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(240px, 0.8fr));
  gap: 18px;
}

.summary-panel,
.flow article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(20, 33, 31, 0.03);
}

.summary-panel {
  padding: 28px;
}

.summary-panel.strong {
  color: #ffffff;
  background: var(--night);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.summary-panel.strong .panel-kicker {
  color: #93efe5;
}

.summary-panel.strong p {
  color: rgba(255, 255, 255, 0.8);
}

.summary-panel p,
.flow p,
.section-heading p {
  color: var(--muted);
}

.clean-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.clean-list li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
}

.clean-list li::before {
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--coral);
  border-radius: 2px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.demo-section {
  width: min(1440px, calc(100% - 32px));
}

.demo-shell {
  display: grid;
  gap: 10px;
  overflow: hidden;
  padding: 10px;
  background: var(--night);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.playfield-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 240px) auto;
  gap: 10px;
  align-items: center;
}

.room-switch {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.identity-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  outline: none;
}

input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 155, 145, 0.14);
}

.room-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 6px 10px;
  color: rgba(255, 255, 255, 0.76);
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
}

.room-button:hover,
.room-button.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.room-button small,
.person small,
.event-list small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.room-icon,
.avatar {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #ffffff;
  border-radius: 6px;
  font-weight: 900;
}

.teal {
  background: var(--teal);
}

.coral {
  background: var(--coral);
}

.gold {
  background: var(--gold);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 13px;
}

.pulse {
  width: 10px;
  height: 10px;
  background: #29c484;
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(41, 196, 132, 0.15);
}

body[data-connection="connecting"] .pulse {
  background: var(--gold);
  box-shadow: 0 0 0 7px rgba(217, 154, 39, 0.18);
}

body[data-connection="offline"] .pulse {
  background: var(--coral);
  box-shadow: 0 0 0 7px rgba(232, 109, 86, 0.18);
}

.playfield {
  position: relative;
  min-height: min(720px, 68vh);
  overflow: hidden;
  isolation: isolate;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(232, 109, 86, 0.18), transparent 30%),
    radial-gradient(circle at 78% 20%, rgba(15, 155, 145, 0.22), transparent 28%),
    radial-gradient(circle at 48% 80%, rgba(217, 154, 39, 0.2), transparent 30%),
    linear-gradient(135deg, #0d1b1c 0%, #142f2e 48%, #2b2920 100%);
  border: 1px solid rgba(20, 33, 31, 0.18);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.playfield::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
}

.playfield-copy {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 2;
  display: grid;
  max-width: 360px;
  gap: 4px;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.playfield-copy strong {
  font-size: 28px;
  line-height: 1;
}

.playfield-copy span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
}

.spark-layer,
.cursor-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.spark {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spark-pop 900ms ease-out both;
  box-shadow:
    0 0 0 7px color-mix(in srgb, var(--spark-color) 18%, transparent),
    0 0 24px color-mix(in srgb, var(--spark-color) 62%, transparent);
}

.spark::after {
  position: absolute;
  inset: -8px;
  content: "";
  border: 1px solid color-mix(in srgb, var(--spark-color) 64%, white);
  border-radius: 50%;
}

.remote-cursor {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  left: 0;
  top: 0;
  transition: transform 45ms linear;
  will-change: transform;
}

.remote-pointer {
  display: block;
  width: 16px;
  height: 20px;
  background: var(--cursor-color);
  clip-path: polygon(0 0, 0 100%, 34% 72%, 54% 100%, 74% 89%, 55% 64%, 100% 64%);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.remote-label {
  max-width: 120px;
  overflow: hidden;
  padding: 4px 7px;
  color: var(--night);
  text-overflow: ellipsis;
  white-space: nowrap;
  background: color-mix(in srgb, var(--cursor-color) 28%, white);
  border: 1px solid color-mix(in srgb, var(--cursor-color) 64%, white);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.playfield-hud {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  pointer-events: none;
}

.playfield-hud > span,
.score-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(13, 27, 28, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.score-pills {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow: hidden;
}

.score-pill {
  gap: 6px;
  max-width: 150px;
  white-space: nowrap;
}

.score-pill i {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.score-pill b {
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes spark-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0.82;
    transform: translate(-50%, -50%) scale(1);
  }
}

.presence-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.person {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  flex: 1 1 180px;
}

.person.active {
  border-color: rgba(15, 155, 145, 0.42);
  box-shadow: 0 0 0 3px rgba(15, 155, 145, 0.1);
}

.person strong,
.room-button strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border-left: 1px solid var(--line);
}

.score-list {
  display: grid;
  gap: 8px;
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}

.score-row span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-row i {
  display: inline-block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.event-list li {
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
}

.event-list strong {
  display: block;
  font-size: 14px;
}

.architecture {
  width: 100%;
  max-width: none;
  padding-inline: max(24px, calc((100vw - 1180px) / 2));
  background: #eef3ee;
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.flow article {
  position: relative;
  min-height: 230px;
  padding: 26px;
}

.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 26px;
  color: #ffffff;
  background: var(--ink);
  border-radius: 8px;
  font-weight: 900;
}

.rollout-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 32px;
  color: rgba(255, 255, 255, 0.72);
  background: var(--night);
  font-size: 14px;
}

@media (max-width: 980px) {
  .metric-band,
  .intro-grid,
  .flow,
  .rollout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intro-grid .strong {
    grid-column: 1 / -1;
  }

  .playfield-toolbar {
    grid-template-columns: 1fr;
  }

  .room-switch {
    flex-wrap: wrap;
  }

  .connection-status {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .hero {
    min-height: 680px;
  }

  .hero-art {
    object-position: 58% center;
  }

  .hero-shade {
    background:
      linear-gradient(180deg, rgba(8, 21, 22, 0.94) 0%, rgba(8, 21, 22, 0.7) 56%, rgba(8, 21, 22, 0.36) 100%);
  }

  .hero-content {
    align-self: start;
    width: min(100% - 32px, 640px);
    margin: 0 auto;
    padding: 58px 0 120px;
  }

  h1 {
    font-size: 56px;
  }

  .hero-copy {
    font-size: 17px;
  }

  .metric-band,
  .intro-grid,
  .flow,
  .rollout-grid {
    grid-template-columns: 1fr;
  }

  .section {
    width: min(100% - 32px, 1180px);
    padding: 64px 0;
  }

  .playfield {
    min-height: 420px;
  }

  .playfield-copy {
    max-width: calc(100% - 32px);
  }

  .playfield-copy strong {
    font-size: 22px;
  }

  .playfield-hud {
    align-items: flex-start;
    flex-direction: column;
  }

  .score-pills {
    flex-wrap: wrap;
    max-height: 68px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
