/* ============ Design tokens ============ */
:root {
  --background: 60 30% 97%;
  --foreground: 150 25% 12%;
  --card: 60 30% 99%;
  --card-foreground: 150 25% 12%;
  --primary: 142 55% 38%;
  --primary-foreground: 60 40% 98%;
  --primary-glow: 95 65% 55%;
  --secondary: 95 35% 92%;
  --secondary-foreground: 150 30% 18%;
  --muted: 60 20% 94%;
  --muted-foreground: 150 10% 40%;
  --accent: 38 90% 55%;
  --accent-foreground: 30 50% 12%;
  --border: 150 15% 88%;
  --ring: 142 55% 38%;
  --radius: 1rem;
  --gradient-hero: linear-gradient(135deg, hsl(142 55% 38%), hsl(95 65% 55%));
  --gradient-card: linear-gradient(180deg, hsl(60 30% 99%), hsl(95 35% 95%));
  --shadow-glow: 0 20px 60px -20px hsl(142 55% 38% / 0.45);
  --shadow-soft: 0 8px 30px -10px hsl(150 30% 20% / 0.15);
}

.dark {
  --background: 150 30% 6%;
  --foreground: 60 30% 96%;
  --card: 150 25% 9%;
  --card-foreground: 60 30% 96%;
  --primary: 95 65% 55%;
  --primary-foreground: 150 40% 8%;
  --primary-glow: 142 70% 50%;
  --secondary: 150 20% 14%;
  --secondary-foreground: 60 30% 96%;
  --muted: 150 18% 13%;
  --muted-foreground: 95 15% 65%;
  --accent: 38 90% 60%;
  --accent-foreground: 30 50% 10%;
  --border: 150 20% 16%;
  --ring: 95 65% 55%;
  --gradient-hero: linear-gradient(135deg, hsl(142 60% 30%), hsl(95 65% 45%));
  --gradient-card: linear-gradient(180deg, hsl(150 25% 10%), hsl(150 25% 7%));
  --shadow-glow: 0 20px 60px -15px hsl(95 65% 50% / 0.5);
  --shadow-soft: 0 8px 30px -10px hsl(0 0% 0% / 0.5);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  min-height: 100vh;
}

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

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.container {
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ============ Icons ============ */
.icon-xs { width: 0.75rem; height: 0.75rem; }
.icon-sm { width: 1.25rem; height: 1.25rem; }
.icon-star { width: 1rem; height: 1rem; color: hsl(var(--accent)); fill: hsl(var(--accent)); }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid hsl(var(--border) / 0.4);
  background-color: hsl(var(--background) / 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-soft);
}
.brand-text { line-height: 1.1; }
.brand-name {
  margin: 0;
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.brand-sub {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(95 65% 55%);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid hsl(var(--border) / 0.6);
  background-color: transparent;
  transition: background-color 0.2s;
}
.theme-toggle:hover { background-color: hsl(var(--secondary)); }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
.dark .theme-toggle .icon-sun { display: block; }
.dark .theme-toggle .icon-moon { display: none; }

/* ============ Main ============ */
.main {
  max-width: 768px;
  padding-top: 1.5rem;
  padding-bottom: 6rem;
}

/* ============ Hero ============ */
.hero-card {
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid hsl(var(--border) / 0.6);
  background-color: hsl(var(--card));
  box-shadow: var(--shadow-soft);
}
.hero-banner {
  position: relative;
  height: 11rem;
}
@media (min-width: 640px) {
  .hero-banner { height: 14rem; }
}
.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-banner-fade {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to top, hsl(var(--card)), hsl(var(--card) / 0.4), transparent);
}
.hero-body {
  position: relative;
  margin-top: -5rem;
  padding: 0 1.25rem 1.5rem;
}
@media (min-width: 640px) {
  .hero-body { margin-top: -6rem; padding: 0 1.75rem 1.5rem; }
}
.hero-logo {
  width: 7rem;
  height: 7rem;
  border-radius: 1rem;
  border: 4px solid hsl(var(--card));
  background-color: hsl(var(--card));
  box-shadow: var(--shadow-glow);
}
@media (min-width: 640px) {
  .hero-logo { width: 8rem; height: 8rem; }
}
.hero-title-block { margin-top: 1rem; }
.hero-title {
  margin: 0;
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
}
@media (min-width: 640px) {
  .hero-title { font-size: 3rem; }
}
.hero-author {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.hero-author span {
  font-weight: 600;
  color: hsl(var(--foreground));
}
.badges {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}
.badge-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}
.badge-primary {
  background-color: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
}
.badge-accent {
  background-color: hsl(var(--accent) / 0.2);
  color: hsl(var(--accent-foreground));
}

/* ============ Stats ============ */
.stats {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-radius: 1rem;
  border: 1px solid hsl(var(--border) / 0.6);
  background-color: hsl(var(--card));
  padding: 1rem 0;
  text-align: center;
}
.stat { padding: 0 0.5rem; position: relative; }
.stat + .stat { border-left: 1px solid hsl(var(--border) / 0.6); }
.stat-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: 1.25rem;
  font-weight: 800;
}
@media (min-width: 640px) {
  .stat-value { font-size: 1.5rem; }
}
.stat-label {
  margin: 0.125rem 0 0;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--muted-foreground));
}

/* ============ Download buttons ============ */
.downloads {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
  height: 3.5rem;
  padding: 0 1.25rem;
  border-radius: 1rem;
  font-size: 1rem;
  font-weight: 600;
  transition: transform 0.15s ease;
}
.btn:hover { transform: scale(1.01); }
.btn:active { transform: scale(0.99); }
.btn .icon-trail { margin-left: auto; }
.btn-primary {
  background-image: var(--gradient-hero);
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-glow);
}
.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border) / 0.6);
  box-shadow: var(--shadow-soft);
}
.btn-secondary .icon-trail { opacity: 0.7; }
.downloads-note {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* ============ Sections ============ */
.section { margin-top: 2.5rem; }
.section-eyebrow {
  margin: 0;
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: hsl(var(--muted-foreground));
}

/* ============ Features ============ */
.features-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.feature-card {
  border-radius: 1rem;
  border: 1px solid hsl(var(--border) / 0.6);
  background-image: var(--gradient-card);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}
.feature-icon {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background-color: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
}
.feature-icon svg { width: 1.25rem; height: 1.25rem; }
.feature-title {
  margin: 0;
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
}
.feature-desc {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* ============ Overview ============ */
.overview {
  margin-top: 2rem;
  border-radius: 1.5rem;
  border: 1px solid hsl(var(--border) / 0.6);
  background-color: hsl(var(--card));
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}
@media (min-width: 640px) {
  .overview { padding: 2rem; }
}
.overview-title {
  margin: 0;
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.overview-text {
  margin-top: 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
}
.overview-text p { margin: 0 0 1rem; }
.overview-text p:last-child { margin-bottom: 0; }
.overview-text strong { color: hsl(var(--foreground)); font-weight: 600; }

.divider {
  margin: 1.5rem 0;
  height: 1px;
  background-color: hsl(var(--border) / 0.6);
}

.overview-subtitle {
  margin: 0;
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: 1.125rem;
  font-weight: 700;
}

.info-list { margin: 0.75rem 0 0; padding: 0; font-size: 0.875rem; }
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px dashed hsl(var(--border) / 0.5);
}
.info-row:last-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.info-row dt { color: hsl(var(--muted-foreground)); margin: 0; }
.info-row dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.reviews { margin-top: 0.75rem; display: grid; gap: 0.625rem; }
.review {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background-color: hsl(var(--secondary) / 0.6);
}
.review-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background-color: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
}
.review-icon svg { width: 1rem; height: 1rem; }
.review-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}
.review-desc {
  margin: 0;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* ============ Trust row ============ */
.trust {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.trust-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border) / 0.6);
  background-color: hsl(var(--card));
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}
.trust-item svg { width: 1rem; height: 1rem; color: hsl(var(--primary)); }

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid hsl(var(--border) / 0.4);
  background-color: hsl(var(--card) / 0.4);
  padding: 2rem 0;
}
.footer-inner { max-width: 768px; text-align: center; }
.footer-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}
.footer-row svg { width: 0.875rem; height: 0.875rem; color: hsl(var(--primary)); }
.footer-copy {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* ============ Notifications ============ */
#notifContainer { position: fixed; bottom: 1rem; left: 1rem; right: 1rem; z-index: 50; pointer-events: none; }
@media (min-width: 640px) {
  #notifContainer { bottom: 1.5rem; left: 1.5rem; right: auto; max-width: 24rem; }
}
.notif {
  max-width: 24rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 1rem;
  border: 1px solid hsl(var(--border) / 0.6);
  background-color: hsl(var(--card) / 0.95);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: slide-up-fade 5s ease-in-out forwards;
}
.notif-icon {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background-color: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
}
.notif-icon svg { width: 1.25rem; height: 1.25rem; }
.notif-icon-check {
  position: absolute;
  top: -2px;
  right: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.notif-icon-check svg { width: 0.6rem; height: 0.6rem; }
.notif-body { min-width: 0; flex: 1; }
.notif-name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-action {
  margin: 0;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes slide-up-fade {
  0% { opacity: 0; transform: translateY(40px); }
  10%, 90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}
