/* --- Design Tokens --- */
:root {
  /* brand */
  --brand: #6a64cc; /* primary */
  --brand-2: #3e2fa3; /* secondary */
  --brand-3: #9f98ff; /* accent for rings */

  /* neutrals (dark theme) */
  --bg-0: #0b0b12; /* app background */
  --bg-1: #10101a; /* surface */
  --bg-2: #151522; /* raised surface */
  --bg-3: #1b1b2b; /* hover surface */
  --text-1: #e7e9f3; /* primary text */
  --text-2: #b7bbcf; /* secondary text */
  --muted: #8e92a6; /* dim text */
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);

  /* sizing */
  --radius: 14px;
  --radius-lg: 22px;
  --container: 2160px;
  --gap: 24px;
  --space: 16px;
  --nav-h: 64px;
}

@media (min-width: 880px) {
  :root {
    --nav-h: 72px;
  }
}

/* --- Modern Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
}
img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
}
:focus-visible {
  outline: 2px solid var(--brand-3);
  outline-offset: 2px;
  border-radius: calc(var(--radius) - 2px);
}

/* Safe-area padding for notched devices */
body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* --- Global Layout --- */
.container {
  width: min(100% - 80px, var(--container));
  margin-inline: auto;
}
.stack > * + * {
  margin-top: clamp(10px, 1.8vw, 16px);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--gap);
}

section {
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

.section-title {
  font-size: clamp(1.35rem, 1.2vw + 1rem, 2rem);
  line-height: 1.1;
  margin-bottom: 4px;
}
.kicker {
  color: var(--muted);
  font-size: clamp(0.92rem, 0.2vw + 0.88rem, 0.98rem);
}

/* App Backdrop & Subtle Gradient */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 60vh;
  pointer-events: none;
  background: radial-gradient(
      60% 60% at 20% 20%,
      color-mix(in oklab, var(--brand) 35%, transparent) 0%,
      transparent 60%
    ),
    radial-gradient(
      80% 80% at 90% 10%,
      color-mix(in oklab, var(--brand-2) 35%, transparent) 0%,
      transparent 70%
    );
  filter: blur(60px) saturate(120%);
  opacity: 0.7;
  z-index: -1;
}

/* --- Header / Nav --- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(1.1) blur(10px);
  background: color-mix(in hsl, var(--panel) 85%, transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
}
.brand .logo {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.links {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.links a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.9;
}
.links a:hover,
.links a:focus-visible {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  border: none;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.menu-btn {
  display: none;
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0.5rem;
  border-radius: 10px;
}
.menu-btn:focus-visible {
  outline: var(--outline);
}
@media (max-width: 840px) {
  .menu-btn {
    display: inline-flex;
  }

  .links {
    display: none;
  }

  body.nav-open .links {
    display: flex;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 1rem;
    background-color: var(--bg-1); /* Use a defined dark background */
    z-index: 99;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
  }

  body.nav-open .links a {
    padding: 0.75rem;
  }

  body.nav-open .links a:hover {
    background-color: var(--bg-3);
  }
}


/* --- Hero / Download --- */
.hero {
  padding: clamp(28px, 6vw, 72px) 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 4vw, 44px);
  align-items: center;
}
@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.hero h1 {
  font-size: clamp(1.6rem, 2.2vw + 1rem, 3rem);
  line-height: 1.05;
  margin: 0 0 8px;
}
.tagline {
  color: var(--text-2);
  font-size: clamp(0.98rem, 1vw + 0.6rem, 1.1rem);
  margin: 0 0 24px;
}

.download-card {
  background: linear-gradient(
    180deg,
    rgba(106, 100, 204, 0.08),
    rgba(62, 47, 163, 0.08)
  );
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(14px, 2vw, 18px);
  box-shadow: var(--shadow);
}

.dl-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 520px) {
  .dl-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1100px) {
  .dl-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  color: var(--text-1);
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: transform 120ms ease, box-shadow 120ms ease, background 200ms ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 10px 25px rgba(0, 0, 0, 0.35);
}
.btn:hover {
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--bg-2) 80%, var(--brand) 20%),
    var(--bg-1)
  );
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 16px 30px rgba(0, 0, 0, 0.45);
}
.btn:active {
  transform: translateY(0);
}

.btn.recommended {
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--brand) 60%, #ffffff 0%),
    color-mix(in oklab, var(--brand-2) 70%, #000 0%)
  );
  border-color: color-mix(in oklab, var(--brand-2) 40%, transparent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--brand) 50%, transparent),
    0 10px 30px color-mix(in oklab, var(--brand) 25%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .btn.recommended::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 16px;
    border: 2px solid color-mix(in oklab, var(--brand) 60%, transparent);
    filter: blur(4px);
    opacity: 0.55;
    animation: pulse 1.8s ease-in-out infinite;
  }
  @keyframes pulse {
    0%,
    100% {
      opacity: 0.35;
    }
    50% {
      opacity: 0.9;
    }
  }
}

.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.os-ico {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  opacity: 0.95;
}

/* Mock UI preview on the right */
.mock {
  border-radius: 18px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 100px;
}
.mock .bar {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--bg-2) 80%, var(--brand) 20%),
    var(--bg-2)
  );
  border-bottom: 1px solid var(--border);
}
.mock .bar .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--brand) 65%, transparent);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 0 6px color-mix(in oklab, var(--brand) 40%, transparent);
}
.mock .body {
  padding: clamp(14px, 2vw, 18px);
  display: grid;
  gap: 10px;
}
@media (max-width: 960px) {
  aside[aria-hidden="true"] {
    display: none;
  }
}

.row-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-2);
}

/* --- Features grid --- */
#features {
  padding: clamp(32px, 6vw, 80px) 0;
}
.features {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 600px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.feature-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
  padding: clamp(12px, 1.2vw, 16px);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: 160ms ease;
}
.feature-card:hover {
  transform: translateY(-1px);
  background: color-mix(in oklab, var(--bg-2) 80%, var(--brand) 20%);
}
.feature-ico {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--brand) 25%, transparent),
    var(--bg-2)
  );
  border: 1px solid var(--border);
}
.feature-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.feature-desc {
  color: var(--text-2);
  margin: 0;
}

/* --- Why choose (pills) --- */
#why {
  padding: clamp(28px, 6vw, 72px) 0;
}
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
}
.pill svg {
  width: 18px;
  height: 18px;
}

/* --- Support cards --- */
#support {
  padding: clamp(28px, 6vw, 72px) 0;
}
.support-cards {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
@media (min-width: 760px) {
  .support-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.support-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: 160ms ease;
}
.support-card:hover {
  background: color-mix(in oklab, var(--bg-2) 75%, var(--brand) 25%);
  transform: translateY(-1px);
}
.support-card a {
  font-weight: 700;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Footer --- */
footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  background: linear-gradient(
    180deg,
    rgba(16, 16, 26, 0.65),
    rgba(16, 16, 26, 0.85)
  );
}
footer a {
  color: var(--text-2);
}
footer a:hover {
  color: var(--text-1);
}

/* --- Utilities --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Responsive tweaks --- */
@media (max-width: 920px) {
  aside[aria-hidden="true"] {
    order: -1;
  }
}

/* Accessibility in forced-colors mode */
@media (forced-colors: active) {
  .btn,
  .nav-toggle {
    border: 1px solid CanvasText;
  }
}