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

:root {
  --brand: #3b82f6;
  --brand-dark: #2563eb;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --white: #ffffff;
  --radius: 12px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

/* ── Header ─────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .15s;
}
.header-nav a:hover { color: var(--text); }
.btn-ghost {
  padding: 8px 18px !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  color: var(--brand) !important;
}
.btn-ghost:hover { background: #eff6ff !important; }

/* ── Hero ────────────────────────────────── */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: calc(100vh - 64px);
}
.hero-content h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
}
.highlight { color: var(--brand); }
.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 40px;
  line-height: 1.7;
}

/* ── Action card ─────────────────────────── */
.action-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.full-width { width: 100%; justify-content: center; margin-top: 4px; }

.join-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.input-wrapper {
  position: relative;
  flex: 1;
}
.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.input-wrapper input, #displayNameInput, #joinRoomCodeDisplay {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.input-wrapper input:focus { border-color: var(--brand); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--brand);
  color: var(--brand);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.btn-outline:hover { background: #eff6ff; }
.btn-outline:disabled { opacity: .4; cursor: not-allowed; }
.action-hint {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Demo visual ─────────────────────────── */
.hero-visual { display: flex; justify-content: center; }
.demo-grid {
  background: #111827;
  border-radius: 16px;
  padding: 16px;
  width: 440px;
  aspect-ratio: 4/3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  box-shadow: 0 25px 60px rgba(0,0,0,.2);
  position: relative;
}
.demo-tile {
  background: #1f2937;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  animation: pulse 3s ease-in-out infinite;
}
.demo-tile:nth-child(2) { animation-delay: .5s; }
.demo-tile:nth-child(3) { animation-delay: 1s; }
.demo-tile:nth-child(4) { animation-delay: 1.5s; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .85; }
}
.demo-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: 700;
}
.demo-name {
  font-size: 12px;
  color: rgba(255,255,255,.8);
  font-weight: 500;
}
.demo-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #111827;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 0 0 16px 16px;
}
.demo-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.demo-btn.red { background: #ef4444; }
.demo-btn.gray { background: #374151; }

/* ── Features ────────────────────────────── */
.features {
  background: var(--bg);
  padding: 80px 24px;
}
.features h2 {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 48px;
  letter-spacing: -.5px;
}
.features-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .2s, box-shadow .2s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.feature-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ── Footer ──────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}
.footer-copy { font-size: 13px; color: var(--text-muted); }

/* ── Modal ───────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal-card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,.2);
  animation: slideUp .2s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.modal-close:hover { background: var(--border); }
.modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.modal-card h2 { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.modal-card p { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
#displayNameInput {
  padding: 13px 16px;
  margin-bottom: 12px;
  font-size: 16px;
}
#displayNameInput:focus { border-color: var(--brand); }
#joinRoomCodeRow { margin-bottom: 12px; }
#joinRoomCodeRow label { font-size: 12px; font-weight: 500; color: var(--text-muted); display: block; margin-bottom: 6px; }
#joinRoomCodeDisplay { padding: 10px 16px; background: var(--bg); color: var(--text-muted); letter-spacing: 1px; }

@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; padding: 48px 20px; min-height: auto; gap: 40px; }
  .hero-visual { display: none; }
  .hero-content h1 { font-size: 32px; }
  .action-row { flex-direction: column; }
  .join-form { width: 100%; }
  .features h2 { font-size: 28px; }
}
