/* ============================================
   Bytowl Website — Dark theme, teal accent
   ============================================ */

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

:root {
  --accent: #0ea5e9;
  --accent-light: #38bdf8;
  --accent-glow: rgba(14, 165, 233, 0.15);
  --bg: #0a0e17;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --surface: #151d2e;
  --border: #1e293b;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --ws-green: #22c55e;
  --stomp-orange: #f59e0b;
  --socketio-pink: #ec4899;
  --radius: 12px;
  --radius-lg: 20px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.accent {
  color: var(--accent-light);
}

/* ─── Nav ─── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.3s, backdrop-filter 0.3s, padding 0.3s;
}

.nav.scrolled {
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 600 !important;
  transition: background 0.2s, transform 0.15s !important;
}

.nav-cta:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ─── Buttons ─── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 24px rgba(14, 165, 233, 0.25);
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(14, 165, 233, 0.35);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 17px;
  border-radius: 12px;
}

/* ─── Hero ─── */

.hero {
  position: relative;
  padding: 160px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.hero-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse at center, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 99px;
  background: var(--accent-glow);
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 24px;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
}

.hero-sub {
  max-width: 640px;
  margin: 0 auto 40px;
  font-size: 18px;
  color: var(--text-dim);
  line-height: 1.7;
}

.hero-sub strong {
  color: var(--text);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-screenshot {
  margin-top: 64px;
  perspective: 1200px;
}

/* ─── Screenshot Frame ─── */

.screenshot-frame {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.3),
    0 0 80px rgba(14, 165, 233, 0.06);
}

.screenshot-dots {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.screenshot-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.screenshot-dots span:nth-child(1) { background: #ef4444; }
.screenshot-dots span:nth-child(2) { background: #f59e0b; }
.screenshot-dots span:nth-child(3) { background: #22c55e; }

.screenshot-frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* ─── Protocols ─── */

.protocols {
  padding: 120px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-header h2 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-dim);
  font-size: 18px;
  max-width: 520px;
  margin: 0 auto;
}

.protocol-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.protocol-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  opacity: 0;
  transform: translateY(20px);
}

.protocol-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.3s, box-shadow 0.3s;
}

.protocol-card:hover {
  transform: translateY(-4px);
  border-color: var(--text-muted);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.protocol-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

.protocol-icon.ws {
  background: rgba(34, 197, 94, 0.12);
  color: var(--ws-green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.protocol-icon.stomp {
  background: rgba(245, 158, 11, 0.12);
  color: var(--stomp-orange);
  border: 1px solid rgba(245, 158, 11, 0.2);
  font-size: 11px;
}

.protocol-icon.socketio {
  background: rgba(236, 72, 153, 0.12);
  color: var(--socketio-pink);
  border: 1px solid rgba(236, 72, 153, 0.2);
}

.protocol-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.protocol-card p {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
}

/* ─── Features (alternating rows) ─── */

.features {
  padding: 80px 0 120px;
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 120px;
  opacity: 0;
  transform: translateY(30px);
}

.feature-row.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.feature-row:last-child {
  margin-bottom: 0;
}

.feature-row.reverse {
  direction: rtl;
}

.feature-row.reverse > * {
  direction: ltr;
}

.feature-label {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--accent-glow);
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.feature-text h3 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.2;
}

.feature-text p {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 24px;
}

.feature-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.feature-list li {
  font-size: 14px;
  color: var(--text-dim);
  padding-left: 22px;
  position: relative;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.feature-img .screenshot-frame {
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.25);
}

/* ─── More Features Grid ─── */

.more-features {
  padding: 80px 0 120px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.mini-feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform 0.3s, border-color 0.3s;
  opacity: 0;
  transform: translateY(20px);
}

.mini-feature.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.3s;
}

.mini-feature:hover {
  transform: translateY(-4px);
  border-color: var(--text-muted);
}

.mini-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-glow);
  color: var(--accent-light);
  margin-bottom: 18px;
  border: 1px solid rgba(14, 165, 233, 0.15);
}

.mini-feature h4 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.mini-feature p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

.mini-feature code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--accent-light);
}

/* ─── Download ─── */

.download {
  padding: 120px 0;
  position: relative;
}

.download .container {
  position: relative;
}

.download-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.download-content {
  text-align: center;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
}

.download-content.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.download-content h2 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.download-content > p {
  color: var(--text-dim);
  font-size: 18px;
  max-width: 520px;
  margin: 0 auto 40px;
}

.download-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.download-meta {
  display: flex;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.download-note {
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ─── Footer ─── */

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 13px;
}

/* ─── Responsive ─── */

@media (max-width: 900px) {
  .protocol-grid {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin: 0 auto;
  }

  .feature-row,
  .feature-row.reverse {
    grid-template-columns: 1fr;
    gap: 40px;
    direction: ltr;
  }

  .feature-row.reverse > * {
    direction: ltr;
  }

  .feature-img {
    order: -1;
  }

  .features-grid {
    grid-template-columns: 1fr 1fr;
  }

  .feature-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 24px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 120px 20px 60px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero-sub {
    font-size: 16px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .download-meta {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ─── Scroll animations ─── */

.feature-row,
.protocol-card,
.mini-feature,
.download-content {
  transition: opacity 0.5s ease, transform 0.5s ease;
}
