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

:root {
  --blue-500: #2196f3;
  --blue-600: #1e88e5;
  --blue-700: #1565c0;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #eeeeee;
  --gray-400: #bdbdbd;
  --gray-600: #757575;
  --gray-800: #424242;
  --gray-900: #212121;
  --bg: #fff;
  --bg-elevated: var(--gray-50);
  --border: var(--gray-200);
  --text: var(--gray-900);
  --text-secondary: var(--gray-600);
  --code-selector: var(--blue-600);
  --code-value: #7c3aed;
  --nav-bg: rgba(255, 255, 255, 0.82);
  --cta-gradient: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  --icon-gradient: linear-gradient(135deg, #e3f2fd, #bbdefb);
  --badge-border: #fff;
  --key-bg: #fff;
  --key-shadow: var(--gray-200);
  --radius: 16px;
  --radius-sm: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --gray-50: #1c1c1e;
    --gray-100: #2c2c2e;
    --gray-200: #3a3a3c;
    --gray-400: #636366;
    --gray-600: #aeaeb2;
    --gray-800: #d1d1d6;
    --gray-900: #f2f2f7;
    --bg: #0d0d0f;
    --bg-elevated: #1c1c1e;
    --border: #2c2c2e;
    --text: #f2f2f7;
    --text-secondary: #aeaeb2;
    --code-selector: #64b5f6;
    --code-value: #b39ddb;
    --nav-bg: rgba(13, 13, 15, 0.82);
    --cta-gradient: linear-gradient(135deg, #1a237e 0%, #311b92 100%);
    --icon-gradient: linear-gradient(135deg, #1a237e, #0d47a1);
    --badge-border: #1c1c1e;
    --key-bg: #2c2c2e;
    --key-shadow: #1c1c1e;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Scroll Reveal --- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-hero {
  transition-delay: calc(var(--delay, 0) * 0.12s);
}

/* Stagger feature cards within the grid */
.feature-grid .reveal:nth-child(1) { transition-delay: 0s; }
.feature-grid .reveal:nth-child(2) { transition-delay: 0.06s; }
.feature-grid .reveal:nth-child(3) { transition-delay: 0.12s; }
.feature-grid .reveal:nth-child(4) { transition-delay: 0.18s; }
.feature-grid .reveal:nth-child(5) { transition-delay: 0.24s; }
.feature-grid .reveal:nth-child(6) { transition-delay: 0.30s; }
.feature-grid .reveal:nth-child(7) { transition-delay: 0.36s; }
.feature-grid .reveal:nth-child(8) { transition-delay: 0.42s; }
.feature-grid .reveal:nth-child(9) { transition-delay: 0.48s; }

/* --- Layout --- */

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

/* --- Nav --- */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 17px;
}

.nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

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

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

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

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

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Hero --- */

.hero {
  padding: 140px 0 80px;
  text-align: center;
}

.hero h1 {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero h1 span {
  background: linear-gradient(135deg, #42a5f5, #1565c0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero > .container > p {
  font-size: 19px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 64px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--text);
  color: var(--bg);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
}

.btn-primary:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.btn-secondary:hover {
  border-color: var(--gray-400);
  transform: translateY(-1px);
}

.hero-screenshot {
  max-width: 900px;
  margin: 0 auto;
}

.hero-screenshot img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 24px 64px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
  .hero-screenshot img {
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.2),
      0 4px 16px rgba(0, 0, 0, 0.3),
      0 24px 64px rgba(0, 0, 0, 0.4);
  }
}

/* --- Features --- */

.features {
  padding: 80px 0;
}

.section-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue-600);
  margin-bottom: 12px;
}

@media (prefers-color-scheme: dark) {
  .section-label {
    color: #64b5f6;
  }
}

.features h2 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.features > .container > p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 48px;
}

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

.feature-card {
  padding: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--gray-400);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

@media (prefers-color-scheme: dark) {
  .feature-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  }
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--icon-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Highlights (alternating) --- */

.highlights {
  padding: 40px 0 80px;
}

.highlight-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 48px 0;
}

.highlight-row:nth-child(even) .highlight-text {
  order: 2;
}

.highlight-text h3 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}

.highlight-text p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.highlight-visual {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}

.shortcut-demo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 600;
  font-family: "SF Mono", SFMono-Regular, Menlo, monospace;
  color: var(--gray-800);
}

.key-plus {
  color: var(--gray-400);
  font-family: "SF Mono", SFMono-Regular, Menlo, monospace;
  font-size: 22px;
  font-weight: 600;
}

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  background: var(--key-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 0 var(--key-shadow);
  font-size: 18px;
  font-weight: 600;
  font-family: "SF Mono", SFMono-Regular, Menlo, monospace;
}

.code-snippet {
  font-family: "SF Mono", SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  color: var(--gray-800);
  line-height: 1.8;
  text-align: left;
}

.code-selector {
  color: var(--code-selector);
}

.code-value {
  color: var(--code-value);
}

.badge-demo {
  position: relative;
  display: inline-block;
}

.badge-demo img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
}

.badge-demo .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  background: #ef4444;
  color: #fff;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid var(--badge-border);
}

/* --- CTA --- */

.cta {
  padding: 80px 0;
  text-align: center;
}

.cta-box {
  background: var(--cta-gradient);
  border-radius: var(--radius);
  padding: 64px 40px;
}

.cta-box h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.cta-box p {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.version-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  font-family: "SF Mono", SFMono-Regular, Menlo, monospace;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  margin-bottom: 16px;
}

.install-note {
  font-size: 13px;
  color: var(--text-secondary);
}

.install-note a {
  color: var(--blue-600);
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  .install-note a {
    color: #64b5f6;
  }
}

.install-note a:hover {
  text-decoration: underline;
}

/* --- Footer --- */

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

footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

footer p {
  font-size: 13px;
  color: var(--text-secondary);
}

footer nav {
  position: static;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
}

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

.footer-links a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

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

.footer-link-inline {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-link-inline:hover {
  color: var(--text);
}

/* --- Legal page --- */

.legal {
  padding: 120px 0 80px;
  max-width: 680px;
  margin: 0 auto;
}

.legal h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 32px;
}

.legal-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 12px;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content h3 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-content p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal-content ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 12px;
}

.legal-content li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}

.legal-content a {
  color: var(--blue-600);
  text-decoration: none;
}

.legal-content a:hover {
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  .legal-content a {
    color: #64b5f6;
  }
}

/* --- Responsive --- */

@media (max-width: 960px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 36px;
  }

  .hero > .container > p {
    font-size: 17px;
  }

  .hero-actions {
    flex-direction: column;
  }

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

  .highlight-row {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .highlight-row:nth-child(even) .highlight-text {
    order: 0;
  }

  /* Mobile nav */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
  }

  .nav-links.nav-open {
    display: flex;
  }

  footer .container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 110px 0 48px;
  }

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

  .cta-box {
    padding: 40px 24px;
  }
}
