:root {
  /* Obsidian palette */
  --bg: #08090c;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf4;
  --text-dim: #8b9bb4;

  /* Mode accents */
  --accent-endless: #6ea8fe;
  --accent-blitz: #ff6b6b;
  --accent-zen: #5ceead;
  --accent-hunt: #ffb347;
  --accent-coop: #ffd866;
  --accent-duel: #c084fc;

  /* Active accent (driven by scroll via JS) */
  --accent: var(--accent-endless);

  /* Typography */
  --font: 'DM Sans', system-ui, sans-serif;

  /* Easing */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  padding: 2.5rem;
}

#glyph-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.lang-pill {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: color 0.2s, border-color 0.2s;
}

.lang-pill:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
}

.section-title {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
  text-align: center;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === Hero === */
.section--hero {
  min-height: 100vh;
  text-align: center;
}

.hero-content {
  background: transparent;
  backdrop-filter: none;
  border: none;
  max-width: 700px;
}

.hero-title {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(135deg, #e8ecf4 0%, #6ea8fe 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.hero-tagline {
  font-size: clamp(18px, 3vw, 24px);
  color: var(--text-dim);
  margin-bottom: 2.5rem;
}

/* === CTA Button === */
.cta-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-endless), var(--accent-duel));
  color: #fff;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.3s var(--spring), box-shadow 0.3s;
  box-shadow: 0 4px 24px rgba(110, 168, 254, 0.3);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(110, 168, 254, 0.45);
}

.cta-button:active {
  transform: translateY(0) scale(0.97);
}

.cta-button--pulse {
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 24px rgba(110, 168, 254, 0.3); }
  50% { box-shadow: 0 4px 32px rgba(110, 168, 254, 0.55); }
}

.cta-button--large {
  padding: 1.2rem 3rem;
  font-size: 1.25rem;
}

/* === About === */
.section--about { min-height: 80vh; }

.about-content {
  max-width: 600px;
  text-align: center;
}

.about-content h2 {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text), var(--accent-duel));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-detail {
  color: var(--text-dim);
  margin-bottom: 2rem;
}

/* Tile demo animation */
.tile-demo {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
  height: 56px;
}

.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  background: rgba(110, 168, 254, 0.15);
  border: 1px solid rgba(110, 168, 254, 0.3);
  color: var(--accent-endless);
  animation: tile-cycle 3s ease-in-out infinite;
}

.tile--2 { animation-delay: 0.15s; }
.tile--3 { animation-delay: 0.3s; }
.tile--4 { animation-delay: 0.45s; }

@keyframes tile-cycle {
  0% { opacity: 0; transform: translateY(-20px); }
  25% { opacity: 1; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(0); background: rgba(110, 168, 254, 0.35); box-shadow: 0 0 16px rgba(110, 168, 254, 0.4); }
  75% { opacity: 1; transform: translateY(0) scale(1.05); background: rgba(110, 168, 254, 0.5); }
  100% { opacity: 0; transform: translateY(-12px) scale(0.9); }
}

/* === Mode Cards === */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 960px;
  width: 100%;
}

.mode-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s var(--spring), border-color 0.3s, box-shadow 0.3s;
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-accent, var(--surface-border));
  box-shadow: 0 8px 32px var(--card-glow, transparent);
}

.mode-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 1rem 0 0.5rem;
}

.mode-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.mode-icon {
  width: 40px;
  height: 40px;
  opacity: 0.9;
}

/* === Features === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 960px;
  width: 100%;
}

.feature-card {
  text-align: center;
  padding: 2rem 1.5rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}

.feature-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.feature-icon {
  width: 36px;
  height: 36px;
  opacity: 0.8;
}

/* === Feature Link === */
.feature-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--accent-zen);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}

.feature-link:hover {
  color: var(--text);
}

/* === Section Subtitle === */
.section-subtitle {
  color: var(--text-dim);
  text-align: center;
  max-width: 600px;
  margin-bottom: 3rem;
  font-size: 1.05rem;
}

/* === Compatibility === */
.section--compat { min-height: 80vh; }

.compat-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 960px;
  width: 100%;
}

.compat-table-panel {
  overflow: hidden;
}

.compat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.compat-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--surface-border);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.compat-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.status-optimal {
  color: var(--accent-zen);
  font-weight: 600;
}

.pwa-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pwa-icon {
  color: var(--accent-coop);
  margin-bottom: 1rem;
  opacity: 0.9;
}

.pwa-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.pwa-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* === Closing CTA === */
.section--cta { min-height: 60vh; }

.cta-content {
  text-align: center;
  max-width: 500px;
}

.cta-content h2 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text), var(--accent-endless));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cta-content p {
  color: var(--text-dim);
  margin-bottom: 2rem;
}

/* === Footer === */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* === Responsive === */
@media (max-width: 768px) {
  .section { padding: 3rem 1rem; }
  .glass-panel { padding: 1.5rem; }
  .modes-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .compat-layout { grid-template-columns: 1fr; }
  .hero-content { padding: 0 0.5rem; }
}

@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
  .lang-pill { top: 1rem; right: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* === Ambient Glow Orbs === */
.glow-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
}

.glow-orb--1 {
  width: 600px;
  height: 600px;
  background: var(--accent-endless);
  top: -200px;
  right: -100px;
  animation: orb-drift-1 20s ease-in-out infinite alternate;
}

.glow-orb--2 {
  width: 500px;
  height: 500px;
  background: var(--accent-duel);
  bottom: -150px;
  left: -100px;
  animation: orb-drift-2 25s ease-in-out infinite alternate;
}

.glow-orb--3 {
  width: 400px;
  height: 400px;
  background: var(--accent-zen);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: orb-drift-3 30s ease-in-out infinite alternate;
}

@keyframes orb-drift-1 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-80px, 60px); }
}

@keyframes orb-drift-2 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, -40px); }
}

@keyframes orb-drift-3 {
  0% { transform: translate(-50%, -50%); }
  100% { transform: translate(calc(-50% + 40px), calc(-50% - 50px)); }
}
