/* ============================================================
   CleanWatch Website — Design System
   Mirrors the extension's own design language:
   dark-first, red-orange accent, frosted cards, rounded geometry
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

/* ---- Design Tokens — Dark (default) ---- */
:root {
  --bg:              #000000;
  --bg-card:         rgba(28, 28, 30, 0.82);
  --bg-card-solid:   #1c1c1e;
  --bg-elevated:     #2c2c2e;
  --border:          rgba(255, 255, 255, 0.08);
  --border-hover:    rgba(255, 255, 255, 0.14);
  --text:            #f5f5f7;
  --text-secondary:  #98989d;
  --text-muted:      #636366;
  --accent:          #ff453a;
  --accent-2:        #ff6b3d;
  --accent-gradient: linear-gradient(135deg, #ff453a 0%, #ff6b3d 100%);
  --accent-soft:     rgba(255, 69, 58, 0.12);
  --accent-soft-2:   rgba(255, 69, 58, 0.20);
  --success:         #30d158;
  --success-soft:    rgba(48, 209, 88, 0.12);
  --radius:          20px;
  --radius-md:       14px;
  --radius-sm:       10px;
  --shadow-sm:       0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md:       0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg:       0 8px 48px rgba(0, 0, 0, 0.55);
  --ease:            cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:     cubic-bezier(0.34, 1.56, 0.64, 1);
  --font:            -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --header-h:        64px;
}

/* ---- Design Tokens — Light ---- */
[data-theme="light"] {
  --bg:              #f2f2f7;
  --bg-card:         rgba(255, 255, 255, 0.82);
  --bg-card-solid:   #ffffff;
  --bg-elevated:     #ffffff;
  --border:          rgba(0, 0, 0, 0.08);
  --border-hover:    rgba(0, 0, 0, 0.12);
  --text:            #1a1a1a;
  --text-secondary:  #636366;
  --text-muted:      #8e8e93;
  --accent:          #ff3b30;
  --accent-soft:     rgba(255, 59, 48, 0.08);
  --accent-soft-2:   rgba(255, 59, 48, 0.15);
  --success:         #2fb15b;
  --success-soft:    rgba(47, 177, 91, 0.10);
  --shadow-sm:       0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md:       0 4px 24px rgba(0, 0, 0, 0.12);
  --shadow-lg:       0 8px 48px rgba(0, 0, 0, 0.16);
}

/* ---- Body ---- */
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

/* ---- Asset visibility by theme ---- */
.dark-asset  { display: block; }
.light-asset { display: none; }
[data-theme="light"] .dark-asset  { display: none; }
[data-theme="light"] .light-asset { display: block; }

/* ============================================================
   HEADER
   ============================================================ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg-card);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.logo-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Nav */
.header-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-link:hover {
  color: var(--text);
  background: var(--accent-soft);
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.lang-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
  font-family: var(--font);
}

.lang-btn:hover { color: var(--text); }

.lang-btn.active {
  background: var(--accent-gradient);
  color: #fff;
}

/* Theme toggle */
.theme-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.theme-toggle:hover { color: var(--text); border-color: var(--border-hover); }
.theme-toggle svg { width: 16px; height: 16px; }

/* Sun shown in dark, moon in light */
.icon-sun  { display: block; }
.icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ============================================================
   SHARED LAYOUT
   ============================================================ */
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px;
}

.section-title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 760;
  letter-spacing: -0.03em;
  color: var(--text);
  text-align: center;
  margin-bottom: 48px;
}

/* ============================================================
   HERO
   ============================================================ */
#hero {
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(255, 69, 58, 0.12) 0%, transparent 70%),
              var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 700px;
  margin: 0 auto;
  padding: 96px 24px 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hero-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 28px;
}

.hero-icon-wrap {
  margin-bottom: 28px;
}

.hero-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}

.hero-headline {
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 780;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 20px;
}

.hero-tagline {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 540px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}

.hero-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  box-shadow: var(--shadow-sm);
  font-family: var(--font);
}

.btn-primary:hover  { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }

.btn-primary.btn-full { width: 100%; justify-content: center; }

.btn-icon { width: 18px; height: 18px; flex-shrink: 0; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--border-hover);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
  font-family: var(--font);
}

.btn-outline:hover  { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.btn-outline:active { transform: scale(0.97); }

/* ============================================================
   FEATURES
   ============================================================ */
#features { background: var(--bg); }

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

.feature-card {
  background: var(--bg-card);
  backdrop-filter: saturate(150%) blur(20px);
  -webkit-backdrop-filter: saturate(150%) blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.feature-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Sync card gets accent treatment */
.feature-card--accent {
  background: linear-gradient(145deg, var(--accent-soft) 0%, var(--bg-card) 60%);
  border-color: rgba(255, 69, 58, 0.20);
}

.feature-card--accent:hover {
  border-color: rgba(255, 69, 58, 0.35);
}

.feature-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: var(--accent);
  margin-bottom: 10px;
}

.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--accent);
}

.feature-icon svg { width: 18px; height: 18px; }

.feature-card h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}

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

/* ============================================================
   SCREENSHOTS
   ============================================================ */
#screenshots {
  background: var(--bg);
  overflow: hidden;
}

#screenshots .section-inner {
  padding-bottom: 0;
}

.screenshots-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 0 24px 64px;
  max-width: 1148px;
  margin: 0 auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
}

.screenshots-track::-webkit-scrollbar { height: 4px; }
.screenshots-track::-webkit-scrollbar-track { background: transparent; }
.screenshots-track::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 999px; }

.screenshot-item {
  flex: 0 0 auto;
  width: 400px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.screenshot-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-solid);
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.screenshot-frame:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

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

.screenshot-caption {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  padding: 0 8px;
}

/* ============================================================
   SYNC
   ============================================================ */
#sync { background: var(--bg); }

.sync-card {
  background: var(--bg-card);
  backdrop-filter: saturate(150%) blur(20px);
  -webkit-backdrop-filter: saturate(150%) blur(20px);
  border: 1px solid rgba(255, 69, 58, 0.18);
  border-radius: var(--radius);
  padding: 40px 48px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.sync-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 0% 0%, var(--accent-soft) 0%, transparent 60%);
  pointer-events: none;
}

.sync-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.sync-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--accent-soft-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.sync-icon-wrap svg { width: 24px; height: 24px; }

.sync-header-text { flex: 1; }
.sync-header-text h2 {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 760;
  letter-spacing: -0.03em;
  color: var(--text);
}

.sync-desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  max-width: 600px;
}

.sync-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.sync-note svg { flex-shrink: 0; margin-top: 1px; }

/* ============================================================
   CHECK LIST (shared by sync + privacy)
   ============================================================ */
.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.check-list li::before {
  content: '';
  display: flex;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--success-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2330d158' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 8 6.5 11.5 13 5'/%3E%3C/svg%3E");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
  margin-top: 2px;
}

[data-theme="light"] .check-list li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%232fb15b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 8 6.5 11.5 13 5'/%3E%3C/svg%3E");
}

/* ============================================================
   PRIVACY
   ============================================================ */
#privacy { background: var(--bg); }

.privacy-card {
  background: var(--bg-card);
  backdrop-filter: saturate(150%) blur(20px);
  -webkit-backdrop-filter: saturate(150%) blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 48px;
  box-shadow: var(--shadow-sm);
}

.privacy-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.privacy-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(0, 122, 255, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a84ff;
  flex-shrink: 0;
}

[data-theme="light"] .privacy-icon-wrap {
  background: rgba(0, 122, 255, 0.08);
  color: #007aff;
}

.privacy-icon-wrap svg { width: 22px; height: 22px; }

.privacy-header h2 {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 760;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* ============================================================
   INSTALL
   ============================================================ */
#install { background: var(--bg); }

.install-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.install-card {
  background: var(--bg-card);
  backdrop-filter: saturate(150%) blur(20px);
  -webkit-backdrop-filter: saturate(150%) blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.install-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.install-card-icon--neutral {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.install-card-icon svg { width: 22px; height: 22px; }

.install-card h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  width: fit-content;
}

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 0;
  counter-reset: steps;
  list-style: none;
  margin-top: 4px;
}

.install-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  counter-increment: steps;
}

.install-steps li::before {
  content: counter(steps);
  display: flex;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: saturate(150%) blur(20px);
  -webkit-backdrop-filter: saturate(150%) blur(20px);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.footer-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

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

.footer-links {
  display: flex;
  gap: 20px;
}

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

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

.footer-copy {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .sync-card,
  .privacy-card {
    padding: 28px 24px;
  }

  .sync-header {
    flex-direction: column;
    gap: 14px;
  }
}

@media (max-width: 640px) {
  :root { --header-h: 56px; }

  .header-nav {
    display: none;
  }

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

  .hero-inner {
    padding: 64px 20px 56px;
  }

  .hero-icon { width: 72px; height: 72px; }

  .section-inner { padding: 56px 20px; }

  .screenshot-item { width: 300px; }

  .screenshots-track { padding: 0 20px 48px; }

  .logo-name { display: none; }

  .lang-btn { padding: 4px 8px; }
}

@media (max-width: 420px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn-primary, .btn-outline { justify-content: center; }
}

/* ============================================================
   TRANSITIONS for theme / language changes
   ============================================================ */
.feature-card,
.sync-card,
.privacy-card,
.install-card,
#site-header,
#site-footer {
  transition:
    background 0.25s var(--ease),
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    color 0.25s var(--ease);
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
