/* ===== Design tokens ===== */
:root {
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --amber-glow: rgba(245, 158, 11, 0.25);
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1c1917;
  --text-muted: #6b7280;
  --primary: #1a1a2e;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-lg: rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 56rem;
  --header-height: 3.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a09;
    --surface: #1c1917;
    --text: #fafaf9;
    --text-muted: #a8a29e;
    --primary: #0c0a09;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
  }
}

@media (prefers-color-scheme: light) {
  :root:has(#darkmode-switch:checked) {
    --bg: #0c0a09;
    --surface: #1c1917;
    --text: #fafaf9;
    --text-muted: #a8a29e;
    --primary: #0c0a09;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
  }
}

@media (prefers-color-scheme: dark) {
  :root:has(#darkmode-switch:checked) {
    --bg: #fafafa;
    --surface: #ffffff;
    --text: #1c1917;
    --text-muted: #6b7280;
    --primary: #1a1a2e;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-lg: rgba(0, 0, 0, 0.12);
  }
}

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

/* ===== Base ===== */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--amber);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--amber-light);
}

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

ul {
  list-style: none;
}

strong {
  font-weight: 600;
}

.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;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: color-mix(in srgb, var(--primary) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: color 0.2s;
  white-space: nowrap;
}

.logo:hover {
  color: var(--amber);
}

.logo img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #fff;
}

/* Dark mode toggle */
.darkmode-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s;
  color: rgba(255, 255, 255, 0.6);
}

.darkmode-toggle:hover {
  color: var(--amber);
}

.icon-sun,
.icon-moon {
  display: flex;
  transition: opacity 0.3s, transform 0.3s;
}

.icon-moon {
  position: absolute;
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
}

.icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

@media (prefers-color-scheme: dark) {
  .icon-sun {
    position: absolute;
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
  }

  .icon-moon {
    position: relative;
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@media (prefers-color-scheme: light) {
  :root:has(#darkmode-switch:checked) .icon-sun {
    position: absolute;
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
  }

  :root:has(#darkmode-switch:checked) .icon-moon {
    position: relative;
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@media (prefers-color-scheme: dark) {
  :root:has(#darkmode-switch:checked) .icon-sun {
    position: relative;
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }

  :root:has(#darkmode-switch:checked) .icon-moon {
    position: absolute;
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
  }
}

/* ===== Hero ===== */
.hero {
  width: 100%;
  min-height: 80svh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 80%, var(--amber-glow) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, color-mix(in srgb, var(--amber-light) 8%, transparent) 0%, transparent 50%),
    var(--primary);
  color: #fff;
  padding: 4rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 48rem;
  animation: fadeInUp 0.8s ease;
}

.hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero-name {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--amber);
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-accent {
  width: min(16rem, 60%);
  height: 3px;
  margin: 0 auto 2rem;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--amber) 30%, var(--amber-light) 50%, var(--amber) 70%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 4s ease-in-out infinite;
}

.hero-description {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  text-wrap: balance;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--amber);
  color: #1c1917;
}

.btn-primary:hover {
  background: var(--amber-light);
  color: #1c1917;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--amber-glow);
}

.btn-disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
  cursor: default;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  font-family: inherit;
}

/* ===== Sections ===== */
.section {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 4rem 1.5rem;
}

.section:nth-child(even) {
  background: var(--surface);
  --card-bg: var(--bg);
}

.section:nth-child(odd) {
  background: var(--bg);
  --card-bg: var(--surface);
}

.section-inner {
  width: 100%;
  max-width: var(--max-width);
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--amber);
  margin-bottom: 2rem;
  text-wrap: balance;
  position: relative;
  padding-bottom: 0.75rem;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 3rem;
  height: 3px;
  background: var(--amber);
  border-radius: 2px;
}

/* ===== Features grid ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.feature-card {
  background: var(--card-bg, var(--surface));
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 1px 3px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow-lg);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.feature-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.feature-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.feature-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--amber) 15%, transparent);
  color: var(--amber);
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* ===== Screenshots ===== */
.screenshots-scroll {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 1rem 0 2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--amber) transparent;
}

.screenshots-scroll::-webkit-scrollbar {
  height: 6px;
}

.screenshots-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.screenshots-scroll::-webkit-scrollbar-thumb {
  background: var(--amber);
  border-radius: 3px;
}

.screenshot-item {
  flex: 0 0 auto;
  width: 220px;
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px var(--shadow-lg);
  transition: transform 0.3s ease;
}

.screenshot-item:hover {
  transform: scale(1.03);
}

.screenshot-item img {
  width: 100%;
  height: auto;
}

/* ===== Privacy section ===== */
.privacy-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.privacy-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--card-bg, var(--surface));
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px var(--shadow);
}

.privacy-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.privacy-item p {
  font-size: 0.9rem;
  line-height: 1.5;
}

.privacy-item strong {
  display: block;
  margin-bottom: 0.1rem;
  color: var(--text);
}

.privacy-item span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.privacy-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.85rem;
  background: var(--primary);
  color: rgba(255, 255, 255, 0.4);
}

.footer a {
  color: rgba(255, 255, 255, 0.6);
}

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@supports (animation-timeline: view()) {

  .section,
  .feature-card,
  .screenshot-item,
  .privacy-item {
    opacity: 0;
    transform: translateY(1.5rem);
    animation: fadeInUp linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 25%;
  }

  .feature-card {
    animation-range: entry 0% entry 30%;
    transform: translateY(1rem);
  }

  .screenshot-item {
    animation-range: entry 0% entry 35%;
    transform: translateY(1rem);
  }

  .privacy-item {
    animation-range: entry 0% entry 30%;
    transform: translateY(0.5rem);
  }
}

@supports not (animation-timeline: view()) {

  .section,
  .feature-card,
  .screenshot-item,
  .privacy-item {
    animation: fadeInUp 0.6s ease both;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .nav-links a:not(:last-child) {
    display: none;
  }

  .section {
    padding: 3rem 1.25rem;
  }

  .hero {
    min-height: 70svh;
    padding: 3rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
  }

  .screenshot-item {
    width: 180px;
  }
}
