:root {
  color-scheme: dark;
  --bg: #07140f;
  --bg-2: #0b1c14;
  --bg-overlay: rgba(3, 8, 6, 0.7);
  --surface: rgba(255, 255, 255, 0.055);
  --surface-2: rgba(255, 255, 255, 0.03);
  --surface-3: rgba(255, 255, 255, 0.06);
  --surface-4: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.94);
  --text-strong: rgba(255, 255, 255, 0.88);
  --text-muted: rgba(255, 255, 255, 0.72);
  --text-soft: rgba(255, 255, 255, 0.58);
  --text-dim: rgba(255, 255, 255, 0.45);
  --mist: rgba(238, 250, 242, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.18);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --shadow: 0 14px 44px rgba(0, 0, 0, 0.32);
  --panel-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  --brand-blue: #60a5fa;
  --brand-green: #22c55e;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f4fbf7;
    --bg-2: #e7f6ee;
    --bg-overlay: rgba(244, 251, 247, 0.78);
    --surface: rgba(255, 255, 255, 0.84);
    --surface-2: rgba(255, 255, 255, 0.66);
    --surface-3: rgba(11, 89, 57, 0.06);
    --surface-4: rgba(11, 89, 57, 0.08);
    --text: #11231b;
    --text-strong: rgba(17, 35, 27, 0.88);
    --text-muted: rgba(17, 35, 27, 0.72);
    --text-soft: rgba(17, 35, 27, 0.58);
    --text-dim: rgba(17, 35, 27, 0.42);
    --mist: rgba(17, 35, 27, 0.05);
    --border: rgba(17, 35, 27, 0.1);
    --border-strong: rgba(17, 35, 27, 0.15);
    --border-subtle: rgba(17, 35, 27, 0.08);
    --shadow: 0 18px 48px rgba(28, 52, 41, 0.08);
    --panel-shadow: 0 28px 70px rgba(28, 52, 41, 0.1);
    --brand-blue: #0f7fd6;
    --brand-green: #1b8f55;
  }
}

html,
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
}

body.site-shell {
  background: var(--bg);
  color: var(--text);
}

.page {
  position: relative;
  z-index: 10;
}

.leafy-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
}

.leafy-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.9;
  background-image:
    linear-gradient(180deg, var(--bg-overlay), rgba(0, 0, 0, 0.14) 50%, rgba(0, 0, 0, 0.32)),
    url("/static/img/plant-bg.png");
  background-size: cover;
  background-position: center;
  filter: saturate(1.03) contrast(1.02);
  transform: scale(1.06);
  animation: bg-breathe 18s ease-in-out infinite;
}

@media (prefers-color-scheme: light) {
  .leafy-bg::before {
    filter: saturate(0.86) brightness(1.24) contrast(0.92);
  }
}

.leafy-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image: radial-gradient(var(--mist) 1px, transparent 0);
  background-size: 34px 34px;
}

@keyframes bg-breathe {
  0% {
    transform: scale(1.06) translate3d(0, 0, 0);
  }
  50% {
    transform: scale(1.09) translate3d(-10px, 8px, 0);
  }
  100% {
    transform: scale(1.06) translate3d(0, 0, 0);
  }
}

.leafy-bg,
.leafy-bg::before {
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .leafy-bg::before {
    animation: none !important;
  }
}

.transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(1200px 800px at 40% 20%, rgba(238, 250, 242, 0.08), transparent 58%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.65));
  backdrop-filter: blur(10px);
}

.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg) 68%, transparent);
}

.footer-shell {
  border-top: 1px solid var(--border-subtle);
  color: var(--text-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-strong);
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-green));
  box-shadow: 0 0 0 5px var(--surface-3);
}

.brand-text {
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.navlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
  text-decoration: none;
  font-size: 0.9rem;
}

.navlink:hover {
  background: var(--surface-3);
  border-color: var(--border);
  color: var(--text);
}

.navlink-active {
  background: var(--surface-4);
  border-color: var(--border-strong);
  color: var(--text);
}

.nav-cta {
  margin-left: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-blue) 28%, transparent), color-mix(in srgb, var(--brand-green) 22%, transparent));
  border: 1px solid var(--border-strong);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-cta:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--brand-blue) 26%, var(--border-strong));
}

.menu-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text-strong);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.menu-btn:hover {
  background: var(--surface-4);
  border-color: var(--border-strong);
}

.mobile-menu {
  border-top: 1px solid var(--border-subtle);
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--border-strong);
  text-decoration: none;
  font-weight: 550;
  letter-spacing: -0.01em;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn-primary {
  background: linear-gradient(135deg, color-mix(in srgb, #8fd698 28%, transparent), color-mix(in srgb, var(--brand-blue) 18%, transparent));
  color: var(--text);
}

.btn-secondary {
  background: var(--surface-3);
  color: var(--text-strong);
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--brand-blue) 24%, var(--border-strong));
}

.card {
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.card-hover {
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 108%, white 0%), color-mix(in srgb, var(--surface-2) 104%, white 0%));
}

.card-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.card-title {
  margin-top: 0.4rem;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.card-body {
  margin-top: 0.5rem;
  color: var(--text-muted);
}

.panel {
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: var(--panel-shadow);
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .panel {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    padding: 1.5rem;
  }
}

.panel-left {
  padding-right: 0.25rem;
}

.panel-right {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

@media (min-width: 768px) {
  .panel-right {
    border-top: none;
    border-left: 1px solid var(--border-subtle);
    padding-top: 0;
    padding-left: 1.25rem;
  }
}

.badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-3);
  white-space: nowrap;
}

.link {
  color: var(--text-strong);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: border-color 160ms ease, color 160ms ease;
  font-size: 0.95rem;
}

.link:hover {
  color: var(--text);
  border-bottom-color: color-mix(in srgb, var(--brand-blue) 36%, var(--border-strong));
}

.label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.input {
  width: 100%;
  border-radius: 0.95rem;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 28%, white 2%);
  padding: 0.75rem 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, background 160ms ease;
}

@media (prefers-color-scheme: light) {
  .input {
    background: rgba(255, 255, 255, 0.9);
  }
}

.input:focus {
  border-color: color-mix(in srgb, var(--brand-green) 54%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, white 10%);
}

.li-dot {
  position: relative;
  padding-left: 1.15rem;
}

.li-dot::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.6rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-soft) 70%, transparent);
}

.li-num {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.li-num-n {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.toast {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 56%, white 4%);
  padding: 0.75rem 0.9rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.toast-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-soft) 74%, transparent);
  margin-top: 0.35rem;
  flex: 0 0 auto;
}

.toast-success .toast-dot {
  background: rgba(34, 197, 94, 0.75);
}

.toast-error .toast-dot {
  background: rgba(248, 113, 113, 0.85);
}

.toast-text {
  color: var(--text-muted);
}

.game-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 62%, white 3%);
}

.game-shell-wide {
  aspect-ratio: 3 / 2;
}

.game-shell-embed {
  aspect-ratio: 16 / 9;
  min-height: 34rem;
}

.game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.game-embed {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: var(--surface-2);
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: radial-gradient(800px 420px at 40% 25%, rgba(238, 250, 242, 0.08), transparent 60%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0.58));
  backdrop-filter: blur(6px);
}

.game-overlay-inner {
  text-align: center;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 52%, white 4%);
  padding: 1rem 1.25rem;
  max-width: 22rem;
  width: 100%;
}

.hero-pill {
  border: 1px solid var(--border-subtle);
  background: var(--surface-3);
  color: var(--text-muted);
}

.text-muted {
  color: var(--text-muted);
}

.text-soft {
  color: var(--text-soft);
}

.text-dim {
  color: var(--text-dim);
}

.text-strong {
  color: var(--text-strong);
}

.section-icon {
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, white 4%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 0.55rem;
}
