:root {
  color-scheme: dark;
  --bg: #0b1020;
  --surface: #111a2c;
  --surface-hover: #172238;
  --text: #edf2ff;
  --muted: #9ba9c2;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --border: #26344b;
  --success: #4ade80;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

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

button {
  font: inherit;
}

.topbar {
  width: 100%;
  min-height: 72px;
  padding: 14px max(5%, calc((100% - 1160px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 1.12rem;
  letter-spacing: -0.4px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 10px;
  background: #1d3556;
  color: #bfdbfe;
  font-weight: 800;
}

nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

nav a {
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 0.2s;
}

nav a:hover,
.text-link:hover {
  color: var(--accent-hover);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}

main {
  max-width: 1160px;
  width: 90%;
  margin: 0 auto;
}

.hero {
  padding: 104px 0 88px;
  max-width: 780px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 1.5px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex: 0 0 auto;
}

.hero h1 {
  margin: 22px 0 14px;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.08;
  letter-spacing: -3px;
  font-weight: 800;
}

.hero h1 span {
  color: var(--accent);
}

.hero > p {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

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

.primary {
  background: #2563a9;
  border-color: #3478bf;
  color: #fff;
}

.primary:hover {
  background: #2f74bd;
}

.secondary,
.copy-button {
  background: var(--surface);
  color: var(--text);
}

.secondary:hover,
.copy-button:hover {
  background: var(--surface-hover);
  border-color: #46648a;
}

.section {
  padding: 36px 0 50px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 7px 0 0;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  line-height: 1.25;
  letter-spacing: -0.8px;
}

.section-note {
  color: var(--muted);
  font-size: 0.85rem;
}

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

.card {
  min-width: 0;
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.card:hover {
  background: var(--surface-hover);
  border-color: #3b506e;
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.game-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 11px;
  background: #233c5e;
  color: #dbeafe;
  font-size: 1.25rem;
  font-weight: 800;
}

.bedrock {
  background: #20443b;
  color: #bbf7d0;
}

.voice {
  background: #3b315a;
  color: #ddd6fe;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-size: 0.72rem;
}

.card h3 {
  margin: 19px 0 7px;
  font-size: 1.15rem;
}

.card > p {
  min-height: 48px;
  margin: 0 0 19px;
  color: var(--muted);
  font-size: 0.9rem;
}

.connection {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 13px 0;
  min-width: 0;
}

.connection-label,
.project-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 1px;
}

.connection code {
  display: block;
  max-width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: #bfdbfe;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.copy-button {
  width: 100%;
  margin-top: 10px;
}

.project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card h3 {
  margin-top: 14px;
}

.project-card > p {
  min-height: auto;
}

.text-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 650;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding: 27px 5%;
  border-top: 1px solid var(--border);
}

footer p {
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-brand {
  font-size: 1rem;
}

#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 20;
  transform: translate(-50%, 15px);
  padding: 11px 17px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

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

body.light {
  color-scheme: light;
  --bg: #f4f7fc;
  --surface: #ffffff;
  --surface-hover: #edf3fb;
  --text: #18243a;
  --muted: #617089;
  --accent: #245fa7;
  --accent-hover: #174a88;
  --border: #d8e1ee;
  --success: #16a34a;
  --shadow: 0 8px 24px rgba(24, 36, 58, 0.05);
}

body.light .brand-mark {
  background: #dceaff;
  color: #174a88;
}

body.light .game-icon {
  background: #dceaff;
  color: #174a88;
}

body.light .bedrock {
  background: #d8f5e7;
  color: #166534;
}

body.light .voice {
  background: #e9e1ff;
  color: #5b21b6;
}

body.light .primary {
  background: #245fa7;
  color: #fff;
}

body.light .connection code {
  color: #245fa7;
}

@media (max-width: 850px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    padding: 78px 0 65px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 12px 5%;
    gap: 12px;
  }

  nav {
    gap: 13px;
  }

  nav a {
    font-size: 0.8rem;
  }

  .brand {
    font-size: 0.98rem;
    gap: 7px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  main {
    width: 90%;
  }

  .hero {
    padding: 65px 0 52px;
  }

  .hero h1 {
    letter-spacing: -1.8px;
  }

  .hero > p {
    font-size: 1rem;
  }

  .section {
    padding: 28px 0 34px;
  }

  .section-note {
    display: none;
  }

  .card-grid,
  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .card {
    padding: 20px;
  }

  .card > p {
    min-height: auto;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  footer p {
    margin: 4px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
