/* TubeGrab Pro — colors and type match the app (lib/theme.dart, Poppins). */
:root {
  --bg: #07060f;
  --surface: #13111f;
  --surface-2: #1b1830;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --cyan: #22d3ee;
  --indigo: #6366f1;
  --deep: #4f46e5;
  --text: #f5f3ff;
  --muted: #9a96b5;
  --ok: #34d399;
  --line: rgba(245, 243, 255, 0.08);
  --line-strong: rgba(245, 243, 255, 0.14);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --header-h: 76px;
  --max: 1120px;
  --grad: linear-gradient(135deg, var(--purple), var(--pink));
  --grad-cool: linear-gradient(135deg, var(--indigo), var(--cyan));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100%; overflow-x: hidden; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

@font-face {
  font-family: "Poppins";
  src: url("../assets/fonts/Poppins-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../assets/fonts/Poppins-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../assets/fonts/Poppins-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../assets/fonts/Poppins-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--surface-2);
  color: var(--text);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  z-index: 1000;
}
.skip:focus { top: 1rem; }

/* Ambient animated backdrop, like the app's moving color blobs */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: drift 22s var(--ease) infinite alternate;
}
.blob-a { width: 52vw; height: 52vw; max-width: 720px; max-height: 720px; background: #4f46e5; top: -18%; right: -12%; animation-duration: 26s; }
.blob-b { width: 42vw; height: 42vw; max-width: 560px; max-height: 560px; background: var(--pink); bottom: 10%; left: -16%; opacity: 0.35; animation-duration: 20s; animation-delay: -6s; }
.blob-c { width: 36vw; height: 36vw; max-width: 480px; max-height: 480px; background: var(--cyan); top: 42%; left: 36%; opacity: 0.16; animation-duration: 28s; animation-delay: -12s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-6%, 8%, 0) scale(1.12); }
}

.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(7, 6, 15, 0.62);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), height 0.3s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(7, 6, 15, 0.86);
  border-bottom-color: var(--line);
  height: 64px;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line-strong), 0 8px 24px rgba(236, 72, 153, 0.28);
}
.brand-mark {
  background: linear-gradient(180deg, #fff, #f9a8d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.site-nav { display: flex; align-items: center; gap: 0.2rem 1.35rem; }
.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.35rem 0;
  transition: color 0.2s;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--text); }
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 10px;
}
.nav-toggle svg { width: 24px; height: 24px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-download {
  min-height: 64px;
  padding: 0.85rem 1.35rem 0.85rem 1.15rem;
  color: #fff;
  width: 100%;
  text-align: left;
  box-shadow: 0 12px 32px rgba(236, 72, 153, 0.28);
}
.btn-android {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 52%, #4f46e5 100%);
  background-size: 160% 160%;
  animation: sheen 8s ease-in-out infinite;
}
.btn-windows {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 48%, #22d3ee 140%);
  background-size: 160% 160%;
  animation: sheen 9s ease-in-out infinite;
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.32);
}
.btn-download:hover { filter: brightness(1.08); box-shadow: 0 16px 40px rgba(139, 92, 246, 0.4); }
.btn-logo {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
}
.btn-logo svg { width: 26px; height: 26px; fill: currentColor; display: block; }
.btn-copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.btn-title { font-size: 1rem; }
.btn-meta { font-size: 0.78rem; font-weight: 600; opacity: 0.86; margin-top: 0.15rem; }

@keyframes sheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.dl-block { display: flex; flex-direction: column; gap: 0.45rem; }
.dl-caption {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  padding-inline: 0.4rem;
}
.dl-sha-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
  padding-inline: 0.4rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.dl-sha-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  color: #cfcbe8;
  word-break: break-all;
}
.copy-btn {
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  cursor: pointer;
}
.copy-btn:hover, .copy-btn.is-copied { background: rgba(52, 211, 153, 0.16); color: var(--ok); }

/* Hero */
.hero {
  position: relative;
  padding: 4.2rem 0 5rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 3.2rem;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 1rem;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}
.hero h1 {
  font-size: clamp(2.4rem, 4.6vw, 4.15rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin: 0 0 1.1rem;
}
.hero h1 .grad {
  background: linear-gradient(90deg, #fff 0%, #fff 36%, #f472b6 72%, var(--purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 36rem;
  margin: 0 0 1.8rem;
}
.dl-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.35rem;
  align-items: start;
}
.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.trust span { display: inline-flex; align-items: center; gap: 0.4rem; }
.trust i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--cyan);
  display: inline-block;
}

/* Device mockups */
.stage {
  position: relative;
  min-height: 540px;
  display: grid;
  place-items: center;
}
.laptop {
  width: min(100%, 520px);
  margin-left: auto;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.5));
  transform: perspective(1600px) rotateY(-8deg) rotateX(4deg);
  animation: floaty 7s ease-in-out infinite;
}
.laptop-chrome {
  background: #0c0a16;
  border: 1px solid var(--line-strong);
  border-radius: 14px 14px 10px 10px;
  overflow: hidden;
}
.laptop-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  background: #161326;
  border-bottom: 1px solid var(--line);
}
.laptop-bar i { width: 8px; height: 8px; border-radius: 50%; background: #3a3654; }
.laptop-bar i:nth-child(1) { background: #fb7185; }
.laptop-bar i:nth-child(2) { background: #fbbf24; }
.laptop-bar i:nth-child(3) { background: #34d399; }
.laptop-screen img {
  width: 100%;
  height: auto;
  aspect-ratio: 1120 / 776;
  object-fit: cover;
  object-position: top left;
}
.laptop-base {
  height: 12px;
  margin: 0 8%;
  background: linear-gradient(#1a1730, #0b0a14);
  border-radius: 0 0 10px 10px;
}

.phone {
  position: absolute;
  left: 4%;
  bottom: -8%;
  width: 230px;
  z-index: 2;
  animation: floaty 8s ease-in-out infinite reverse;
  filter: drop-shadow(0 24px 40px rgba(0,0,0,0.55));
}
.phone-frame {
  background: #090814;
  border: 3px solid #2a2642;
  border-radius: 32px;
  padding: 10px 9px 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 0 0 1px rgba(139,92,246,0.25);
}
.phone-screen {
  border-radius: 24px;
  overflow: hidden;
  background: #07060f;
  aspect-ratio: 1080 / 2240;
}
.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.phone-island {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 10px;
  background: #05040c;
  border-radius: 99px;
  z-index: 3;
}

@keyframes floaty {
  0%, 100% { transform: perspective(1600px) rotateY(-8deg) rotateX(4deg) translateY(0); }
  50% { transform: perspective(1600px) rotateY(-8deg) rotateX(4deg) translateY(-10px); }
}
.phone { transform: rotate(-8deg); }
.phone, .phone.float { animation: phonefloat 8s ease-in-out infinite; }
@keyframes phonefloat {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(-8deg) translateY(-12px); }
}

/* Sections */
section { padding: 4.5rem 0; }
.section-head { text-align: center; max-width: 38rem; margin: 0 auto 2.6rem; }
.section-head h2, .section-head p { text-wrap: balance; }
.section-head h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  letter-spacing: -0.04em;
  font-weight: 800;
  margin: 0 0 0.7rem;
}
.section-head p { margin: 0; color: var(--muted); }

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
.feature {
  background: linear-gradient(180deg, rgba(27,24,48,0.9), rgba(19,17,31,0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.3rem 1.5rem;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.feature:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 16px 40px rgba(0,0,0,0.28), 0 0 0 1px rgba(236,72,153,0.12);
}
.feature-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  margin-bottom: 0.95rem;
  background: var(--grad);
  color: #fff;
}
.feature-icon.cool { background: var(--grad-cool); }
.feature-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin: 0 0 0.4rem; font-size: 1.05rem; letter-spacing: -0.02em; }
.feature p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Install */
.install-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.install-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.7rem;
}
.install-card h3 {
  display: flex; align-items: center; gap: 0.7rem;
  margin: 0 0 1rem;
  font-size: 1.15rem;
}
.install-card h3 .btn-logo { width: 32px; height: 32px; color: var(--text); }
.install-card h3 .btn-logo svg { width: 28px; height: 28px; }
.install-card ol { margin: 0; padding-left: 1.2rem; color: var(--muted); }
.install-card li { margin: 0.45rem 0; padding-left: 0.25rem; }
.install-card strong { color: var(--text); font-weight: 600; }
.kbd {
  display: inline-block;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.05rem 0.4rem;
  color: var(--text);
  white-space: nowrap;
  vertical-align: baseline;
}
.nowrap { white-space: nowrap; }

/* FAQ */
.faq-list { max-width: 42rem; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--line);
}
.faq-q {
  width: 100%;
  background: none;
  border: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  text-align: left;
  padding: 1.15rem 2rem 1.15rem 0;
  cursor: pointer;
  position: relative;
  letter-spacing: -0.01em;
}
.faq-q::after {
  content: "";
  position: absolute;
  right: 0; top: 50%;
  width: 10px; height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.25s var(--ease);
}
.faq-item.is-open .faq-q::after { transform: translateY(-20%) rotate(225deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
  color: var(--muted);
}
.faq-a p { margin: 0 0 1.15rem; padding-right: 1.5rem; }

/* Privacy block */
.privacy-panel {
  background: linear-gradient(180deg, rgba(27,24,48,0.92), rgba(19,17,31,0.92));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(1.6rem, 3vw, 2.4rem);
  max-width: 48rem;
  margin: 0 auto;
}
.privacy-panel h3 { margin: 1.2rem 0 0.4rem; font-size: 1.08rem; }
.privacy-panel p, .privacy-panel li { color: var(--muted); }
.privacy-panel ul { padding-left: 1.15rem; }
.privacy-panel a { color: #e9d5ff; text-decoration: underline; text-underline-offset: 3px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.4rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem 1.5rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0.9rem 1.2rem; }
.footer-links a { text-decoration: none; color: var(--muted); font-weight: 600; }
.footer-links a:hover { color: var(--text); }
.footer-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--text); text-decoration: none; }
.footer-brand img { width: 26px; height: 26px; border-radius: 7px; }

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

/* Focus */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
.btn:focus-visible { outline-offset: 4px; }

/* Legal / privacy page */
.page-hero { padding: 3.5rem 0 1.5rem; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.04em; margin: 0 0 0.6rem; font-weight: 800; }
.prose { max-width: 46rem; margin: 0 auto 4rem; }
.prose h2 { margin-top: 2rem; letter-spacing: -0.03em; }
.prose p, .prose li { color: var(--muted); }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.6rem; }
  .stage { min-height: 420px; }
  .laptop { margin: 0 auto; transform: none; }
  .phone { left: 6%; bottom: -4%; width: 190px; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: grid; place-items: center; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem 1.25rem 1.1rem;
    background: rgba(13, 11, 24, 0.96);
    border-bottom: 1px solid var(--line);
  }
  .site-header.is-open .site-nav { display: flex; }
  .site-nav a { padding: 0.7rem 0; }
  .dl-row, .install-grid, .features { grid-template-columns: 1fr; }
  .hero { padding-top: 2.4rem; }
  .phone { width: 160px; }
  .wrap { width: min(var(--max), calc(100% - 1.5rem)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blob, .btn-android, .btn-windows, .laptop, .phone { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}
