/* ============================================================
   SHARED DESIGN SYSTEM — Leap Launcher
   hazanwar.github.io/leap-launcher/
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;600;700&display=swap");

/* === Tokens (dark — default) === */
:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1e1e1e;
  --border: rgba(255, 255, 255, 0.07);
  --nav-bg: rgba(10, 10, 10, 0.88);
  --accent: #00ffe1;
  --accent-rgb: 0, 255, 225;
  --blue: #3b82f6;
  --text: #f0f0f0;
  --text-muted: #888;
  --text-hover: #ffffff;
  --radius: 12px;
  --radius-lg: 20px;
  --nav-h: 64px;
  --max-w: 1100px;
  --t: 0.2s ease;
}

/* === Tokens (light) === */
[data-theme="light"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --border: rgba(0, 0, 0, 0.09);
  --nav-bg: rgba(245, 246, 248, 0.92);
  --accent: #0891b2;
  --accent-rgb: 8, 145, 178;
  --blue: #2563eb;
  --text: #111827;
  --text-muted: #6b7280;
  --text-hover: #000000;
}

/* === Reset === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t);
}
a:hover {
  color: var(--text-hover);
}

/* === Nav === */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  gap: 1rem;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
}
.nav-links a {
  color: var(--text-muted);
  transition: color var(--t);
}
.nav-links a:hover {
  color: var(--text);
}
.nav-cta {
  color: var(--accent) !important;
  font-weight: 600;
}
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: var(--t);
}

/* === Nav Social Icons === */
.nav-social {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition:
    border-color var(--t),
    color var(--t);
}
.nav-social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.nav-social-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* === Theme Toggle === */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    border-color var(--t),
    color var(--t),
    background var(--t);
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Dark mode: show sun (click to go light). Light mode: show moon (click to go dark). */
.icon-moon {
  display: block;
}
.icon-sun {
  display: none;
}
[data-theme="light"] .icon-moon {
  display: none;
}
[data-theme="light"] .icon-sun {
  display: block;
}

/* === Hero === */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 55% at 50% 0%,
    rgba(var(--accent-rgb), 0.11),
    transparent
  );
  pointer-events: none;
}
.hero-content {
  max-width: 620px;
  position: relative;
  z-index: 1;
}
.hero-icon {
  width: 110px;
  height: 110px;
  border-radius: 24px;
  margin: 0 auto 2rem;
  box-shadow:
    0 0 50px rgba(var(--accent-rgb), 0.28),
    0 20px 60px rgba(0, 0, 0, 0.5);
}
.hero h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(2.8rem, 9vw, 5rem);
  color: var(--accent);
  line-height: 1.05;
  text-shadow: 0 0 40px rgba(var(--accent-rgb), 0.4);
  margin-bottom: 1rem;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-weight: 300;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* === CTA Button === */
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--blue) 100%);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.875rem 2rem;
  border-radius: 50px;
  transition:
    transform var(--t),
    box-shadow var(--t);
  box-shadow: 0 4px 24px rgba(var(--accent-rgb), 0.22);
}
.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(var(--accent-rgb), 0.42);
  color: #000;
}
.cta-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

/* === Sections === */
section {
  padding: 5rem 2rem;
}
.container {
  max-width: var(--max-w);
  margin: 0 auto;
}
.section-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--accent);
  text-align: center;
  margin-bottom: 3rem;
  text-shadow: 0 0 24px rgba(var(--accent-rgb), 0.22);
}

/* === Features === */
.features {
  background: var(--surface);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.feature-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition:
    border-color var(--t),
    transform var(--t);
}
.feature-card:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateY(-3px);
}
.feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.feature-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  color: var(--accent);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* === Screenshots === */
.screenshot-gallery {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--accent) transparent;
  scrollbar-width: thin;
}
.screenshot-gallery::-webkit-scrollbar {
  height: 6px;
}
.screenshot-gallery::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}
.screenshot {
  height: 320px;
  width: auto;
  border-radius: var(--radius);
  flex-shrink: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  scroll-snap-align: start;
  cursor: pointer;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}
.screenshot:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 36px rgba(var(--accent-rgb), 0.18);
}

/* === TV Mockup === */
.tv-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.tv-frame {
  width: 100%;
  max-width: 820px;
}
.tv-bezel {
  background: #181818;
  border-radius: 16px 16px 10px 10px;
  padding: 14px 14px 24px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 40px 100px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(var(--accent-rgb), 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
}
.tv-screen {
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background-color: #000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  transition: opacity 0.18s ease;
}
.tv-screen.fading {
  opacity: 0;
}

/* === TV nav buttons (prev / next) === */
.tv-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(
    calc(-50% - 5px)
  ); /* offset for unequal bottom padding */
  z-index: 3;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 0.2s,
    background 0.2s;
}
.tv-frame:hover .tv-nav-btn,
.tv-nav-btn:focus-visible {
  opacity: 1;
}
.tv-nav-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}
.tv-nav-btn svg {
  width: 18px;
  height: 18px;
}
.tv-prev {
  left: 16px;
}
.tv-next {
  right: 16px;
}
/* Always show on touch devices */
@media (hover: none) {
  .tv-nav-btn {
    opacity: 0.7;
  }
}
.tv-stand-neck {
  width: 80px;
  height: 22px;
  background: linear-gradient(to bottom, #202020, #181818);
  margin: 0 auto;
  clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
}
.tv-stand-base {
  width: 220px;
  height: 10px;
  background: #181818;
  border-radius: 0 0 8px 8px;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.tv-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}
.tv-thumbnails {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 820px;
}
.tv-thumb {
  width: 112px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
/* Image container — this is where the border/overflow lives */
.thumb-img {
  width: 100%;
  aspect-ratio: 87 / 52;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid var(--border);
  display: block;
  transition:
    border-color var(--t),
    transform var(--t),
    box-shadow var(--t);
}
.thumb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.tv-thumb:hover .thumb-img {
  border-color: rgba(var(--accent-rgb), 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.15);
}
.tv-thumb.active .thumb-img {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px var(--accent),
    0 6px 20px rgba(var(--accent-rgb), 0.2);
}
/* Thumbnail label */
.thumb-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color var(--t);
}
.tv-thumb.active .thumb-label {
  color: var(--accent);
}

/* === Bug Report === */
.bug-report {
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.section-lead {
  text-align: center;
  color: var(--text-muted);
  margin-top: -0.5rem;
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}
.bug-form {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
.form-group label span {
  color: var(--accent);
}
.form-group input,
.form-group textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) / 2);
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  padding: 0.65rem 0.9rem;
  transition:
    border-color var(--t),
    box-shadow var(--t);
  resize: vertical;
  outline: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
.form-error {
  color: #f87171;
  font-size: 0.875rem;
  margin-top: -0.5rem;
}
.bug-form .cta-button {
  align-self: center;
  margin-top: 0.5rem;
}

/* === Privacy page === */
.prose {
  max-width: 700px;
  margin: 0 auto;
}
.prose p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}
.prose h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: var(--accent);
  font-size: clamp(2rem, 6vw, 3rem);
  text-shadow: 0 0 30px rgba(var(--accent-rgb), 0.35);
  margin-bottom: 0.5rem;
}
.prose .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.prose .back-link:hover {
  color: var(--accent);
}

/* === Footer === */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
footer nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
footer a {
  color: var(--text-muted);
  transition: color var(--t);
}
footer a:hover {
  color: var(--accent);
}

/* === Responsive === */
@media (max-width: 768px) {
  .nav {
    padding: 0 1.25rem;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    gap: 1rem;
    font-size: 1rem;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-hamburger {
    display: flex;
  }
  section {
    padding: 3.5rem 1.25rem;
  }
  .hero {
    padding: 3.5rem 1.25rem;
    min-height: auto;
  }
  .hero-icon {
    width: 88px;
    height: 88px;
    border-radius: 20px;
  }
  .screenshot {
    height: 240px;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .tv-bezel {
    padding: 8px 8px 16px;
  }
  .tv-stand-neck {
    width: 50px;
    height: 16px;
  }
  .tv-stand-base {
    width: 140px;
  }
  .tv-thumb {
    width: 80px;
  }
  .tv-nav-btn {
    opacity: 0.8;
  }
}
