/* ============================================================
   Prysm — Open Source IPTV Player
   Design system: dark, terminal-inspired, developer-first
   ============================================================ */

:root {
  /* palette */
  --bg: #0c0d10;
  --bg-2: #14161b;
  --surface: #181b21;
  --surface-2: #1f232b;
  --border: #2a2e38;
  --border-soft: #1e2129;
  --text: #ecedf1;
  --text-2: #a8aebd;
  --text-3: #6b7180;
  --accent: #7c9cff;
  --accent-2: #b893ff;
  --green: #5cc98a;
  --red: #ff6b6b;
  --yellow: #f5c557;

  /* type */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  /* layout */
  --maxw: 1120px;
  --radius: 12px;
  --radius-lg: 18px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

::selection { background: var(--accent); color: var(--bg); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 13, 16, 0.8);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.logo-mark { width: 26px; height: 26px; border-radius: 6px; }
.nav-menu {
  display: flex;
  gap: 2rem;
  margin-left: 2rem;
  font-size: 0.9rem;
  color: var(--text-2);
}
.nav-menu a { transition: color 0.15s; }
.nav-menu a:hover { color: var(--text); }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}
.ghost-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  transition: border-color 0.15s, color 0.15s;
}
.ghost-link:hover { border-color: var(--text-3); color: var(--text); }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 0.5rem;
}
.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.62rem 1.15rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.12s ease, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 0.85rem 1.6rem; font-size: 0.95rem; }

.btn-primary {
  background: var(--accent);
  color: #0c0d10;
}
.btn-primary:hover { background: #94afff; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--text-3); background: var(--surface); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid transparent;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border); }

.inline-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.15s;
}
.inline-link:hover { color: var(--accent-2); }

/* ============================================================
   LAYOUT
   ============================================================ */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }

.section-head { margin-bottom: 2.5rem; max-width: 640px; }
.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.section-sub { color: var(--text-2); margin-top: 0.75rem; font-size: 1.05rem; }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  display: inline-block;
  margin-bottom: 0.85rem;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-block: clamp(3rem, 8vw, 5.5rem) clamp(2rem, 5vw, 4rem);
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
}
.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 1.25rem;
}
.hero-accent {
  color: var(--text);
}

.hero-desc {
  color: var(--text-2);
  font-size: 1.12rem;
  max-width: 460px;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-tech {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 2.5rem;
  font-size: 0.82rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  flex-wrap: wrap;
}
.hero-tech strong {
  color: var(--text-2);
  font-weight: 500;
}

/* ============================================================
   PHONE MOCKUP (hero)
   ============================================================ */
.phone-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}
.phone-glow {
  position: absolute;
  inset: -10% -5%;
  background: radial-gradient(closest-side, rgba(124,156,255,0.22), rgba(184,147,255,0.10) 60%, transparent 80%);
  filter: blur(40px);
  z-index: 0;
}
.phone {
  position: relative;
  z-index: 1;
  width: 280px;
  max-width: 100%;
  aspect-ratio: 9 / 18;
  background: #050608;
  border: 2px solid #2a2e38;
  border-radius: 38px;
  padding: 8px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.7);
  transition: transform 0.4s ease;
}
.phone:hover { transform: translateY(-6px) rotate(-1.2deg); }
.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
  background: var(--bg);
}
.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-floats {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.float-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text);
  background: rgba(20,22,27,0.92);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.6);
  white-space: nowrap;
}
.float-chip-1 {
  top: 8%;
  left: -4%;
  animation: floaty 5s ease-in-out infinite;
}
.float-chip-2 {
  bottom: 14%;
  left: -8%;
  animation: floaty 6s ease-in-out infinite 0.6s;
}
.float-chip-3 {
  top: 24%;
  right: -6%;
  color: var(--green);
  border-color: rgba(92,201,138,0.4);
  animation: floaty 5.5s ease-in-out infinite 1.2s;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ============================================================
   FEATURES
   ============================================================ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.feature-card {
  background: var(--bg);
  padding: 2rem 1.85rem;
  transition: background 0.18s ease;
  position: relative;
}
.feature-card:hover { background: var(--bg-2); }
.feature-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 1rem;
}
.feature-card:hover .feature-num { color: var(--accent); }
.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.55rem;
}
.feature-card p {
  color: var(--text-2);
  font-size: 0.92rem;
}

/* ============================================================
   PREVIEW / SCREENS
   ============================================================ */
.screens-label {
  margin: 0 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}
.screens-label span {
  display: inline-block;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.screens-label + .screens { margin-top: 0; }

.screens {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.screen {
  margin: 0;
  transition: transform 0.3s ease;
}
.screen:hover { transform: translateY(-6px); }
.screen img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.3s;
}
.screen:hover img { border-color: var(--text-3); }
.screen figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-2);
  font-family: var(--font-mono);
}

.screens-landscape {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.screen-land {
  margin: 0;
  transition: transform 0.3s ease;
}
.screen-land:hover { transform: translateY(-6px); }
.screen-land img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.3s;
}
.screen-land:hover img { border-color: var(--text-3); }
.screen-land figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-2);
  font-family: var(--font-mono);
}

/* ============================================================
   QUICK START
   ============================================================ */
.start-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.start-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
}
.start-step h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.start-step p {
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
}

.stack-block {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 2rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  margin-top: 1.25rem;
}
.stack-block + .stack-block { margin-top: 1.25rem; }
.stack-col h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.stack-sub { color: var(--text-2); font-size: 0.92rem; }

.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stack-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--surface-2);
  padding: 1.1rem 1.25rem;
  transition: background 0.18s ease;
}
.stack-item:hover { background: #262b35; }
.stack-tag {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.stack-grid-tech .stack-tag { color: var(--accent-2); }
.stack-grid-engine .stack-tag { color: var(--green); }
.stack-desc {
  font-size: 0.82rem;
  color: var(--text-3);
}

/* ============================================================
   COMMUNITY
   ============================================================ */
.community-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3.5rem);
}
.community-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}
.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.big-stat {
  background: var(--surface-2);
  padding: 1.75rem 1.25rem;
  text-align: center;
}
.big-num {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.big-label {
  display: block;
  color: var(--text-3);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  margin-top: 0.3rem;
}

/* ============================================================
   CTA
   ============================================================ */
.cta {
  text-align: center;
  padding-block: clamp(3.5rem, 8vw, 5.5rem);
  border-top: 1px solid var(--border-soft);
}
.cta h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}
.cta p { color: var(--text-2); margin-bottom: 2rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 2.5rem 1.5rem;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 1.75rem;
  margin-left: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-2);
}
.footer-links a:hover { color: var(--text); }
.footer-copy {
  margin-left: auto;
  color: var(--text-3);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}
.footer-copy .love { color: var(--red); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .phone-wrap { margin-top: 1.5rem; }
  .community-card { grid-template-columns: 1fr; gap: 2rem; }
  .stack-block { grid-template-columns: 1fr; gap: 1.5rem; }
  .screens { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem 1.25rem;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-soft);
  }
  .nav-toggle { display: flex; }
  .ghost-link span { display: none; }
  .screens { grid-template-columns: repeat(2, 1fr); max-width: 480px; margin: 0 auto 2.5rem; }
  .screens-landscape { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
  .start-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: 1fr; }
  .float-chip-1, .float-chip-2 { left: 2%; }
  .float-chip-3 { right: 2%; }
  .footer-links { margin-left: 0; }
  .footer-copy { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
