/* =========================================================================
   MoniTweak — marketing site design system
   Dark-first, with a fully art-directed light theme (the site's own
   dark/light switch is the hero interaction, so both must be first-class).
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand */
  --brand-500: #6d5ef1;
  --brand-400: #8b7cf6;
  --brand-300: #ab9ffb;
  --brand-600: #5645d6;
  --amber-500: #f5a524;
  --amber-400: #ffb84d;
  --green-500: #2ecc71;

  /* Dark theme tokens (default) */
  --bg: #0a0a0e;
  --bg-elevated: #101116;
  --surface: #15161d;
  --surface-2: #1b1c25;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f3f7;
  --text-dim: #a8a8b6;
  --text-faint: #6f6f80;
  --shadow-color: 240 60% 2%;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --container: 1160px;

  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #f7f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f0f6;
  --border: rgba(20, 20, 40, 0.09);
  --border-strong: rgba(20, 20, 40, 0.16);
  --text: #16161f;
  --text-dim: #57576b;
  --text-faint: #8b8b9c;
  --shadow-color: 240 30% 60%;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color .45s ease, color .45s ease;
  overflow-x: hidden;
}

/* Reduce transition thrash for users who don't want motion, but keep the
   hero theme-swap itself (it's the point of the page). */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.mono { font-family: var(--font-mono); overflow-wrap: anywhere; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, var(--brand-400), var(--brand-500));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 8px 24px -8px rgba(109,94,241,.65);
}
.btn-primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 10px 30px -6px rgba(109,94,241,.8); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--border-strong); }

.btn-lg { padding: 14px 26px; font-size: 15.5px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.brand img { width: 28px; height: 28px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-dim);
}
.nav-links a { transition: color .15s ease; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  color: var(--text);
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-actions { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.badge-brand { background: color-mix(in srgb, var(--brand-500) 16%, transparent); color: var(--brand-300); }
.badge-amber { background: color-mix(in srgb, var(--amber-500) 18%, transparent); color: var(--amber-400); }
.badge-outline { border: 1px solid var(--border-strong); color: var(--text-dim); }

/* ---------- Trust strip ---------- */
.trust-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.trust-strip .container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  justify-content: center;
  padding-top: 18px;
  padding-bottom: 18px;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
}
.trust-item svg { flex: none; color: var(--green-500); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 56px 0 40px;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 620px;
  background:
    radial-gradient(480px 320px at 20% 20%, color-mix(in srgb, var(--brand-500) 32%, transparent), transparent 70%),
    radial-gradient(420px 300px at 82% 8%, color-mix(in srgb, var(--amber-500) 18%, transparent), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; text-align: center; max-width: 780px; margin: 0 auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--green-500); }

.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 3.9rem);
  line-height: 1.06;
  margin-bottom: 14px;
}
.hero h1 .accent {
  background: linear-gradient(100deg, var(--brand-300), var(--brand-500) 60%, var(--amber-400));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto 24px;
}
.hero-ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.hero-meta {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 10px;
}

/* ---------- Interactive demo card ---------- */
.demo-card {
  position: relative;
  z-index: 1;
  margin: 32px auto 0;
  max-width: 980px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, var(--surface), var(--bg-elevated));
  box-shadow: 0 40px 80px -30px hsl(var(--shadow-color) / 0.55), 0 1px 0 rgba(255,255,255,.06) inset;
  padding: 28px 28px 32px;
  overflow: hidden;
}
img.demo-shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  filter: saturate(var(--sat, 1));
  transition: filter .05s linear;
}
.demo-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 26px;
}
@media (max-width: 720px) {
  .demo-controls { grid-template-columns: 1fr; }
}

.slider-block { text-align: left; }
.slider-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.slider-label .value { color: var(--brand-300); font-family: var(--font-mono); font-weight: 600; text-transform: none; letter-spacing: 0; }
.slider-label .value.amber { color: var(--amber-400); }

input[type="range"].fx-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-500) 0%, var(--brand-500) var(--pct, 50%), var(--surface-2) var(--pct, 50%), var(--surface-2) 100%);
  outline: none;
}
input[type="range"].fx-slider.amber {
  background: linear-gradient(90deg, var(--amber-500) 0%, var(--amber-500) var(--pct, 50%), var(--surface-2) var(--pct, 50%), var(--surface-2) 100%);
}
input[type="range"].fx-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 3px solid var(--brand-400);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  cursor: pointer;
  margin-top: -7px;
}
input[type="range"].fx-slider.amber::-webkit-slider-thumb { border-color: var(--amber-500); }
input[type="range"].fx-slider::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 3px solid var(--brand-400);
  cursor: pointer;
}
input[type="range"].fx-slider::-moz-range-track { height: 6px; border-radius: 999px; background: var(--surface-2); }

.slider-caption { margin-top: 8px; font-size: 12.5px; color: var(--text-faint); }

/* ---------- Sections ---------- */
section { padding: 88px 0; }
.section-head { max-width: 640px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 14px; }
.section-head p { color: var(--text-dim); font-size: 16.5px; }
.section-head.left { margin-left: 0; text-align: left; }

.kicker {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-400);
  margin-bottom: 12px;
  display: block;
}

/* ---------- Feature grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card .icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--brand-500) 15%, transparent);
  color: var(--brand-300);
  margin-bottom: 16px;
}
.grid .card:nth-child(4n+2) .icon { background: color-mix(in srgb, var(--amber-500) 16%, transparent); color: var(--amber-400); }
.grid .card:nth-child(4n+3) .icon { background: color-mix(in srgb, #2ecc71 16%, transparent); color: #2ecc71; }
.grid .card:nth-child(4n+4) .icon { background: color-mix(in srgb, #2ea6e0 16%, transparent); color: #4fb8ec; }
.card h3 { font-size: 16px; margin-bottom: 7px; }
.card p { font-size: 14px; color: var(--text-dim); line-height: 1.45; }
.card .tag { margin-top: 12px; }

/* ---------- Alternating feature rows ---------- */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 64px 0;
  border-top: 1px solid var(--border);
}
.feature-copy, .feature-visual { min-width: 0; }
.feature-row:first-of-type { border-top: none; }
.feature-row.reverse .feature-copy { order: 2; }
.feature-row.reverse .feature-visual { order: 1; }
@media (max-width: 900px) {
  .feature-row, .feature-row.reverse { grid-template-columns: 1fr; gap: 32px; }
  .feature-row.reverse .feature-copy, .feature-row.reverse .feature-visual { order: initial; }
}
.feature-copy h3 { font-size: 1.6rem; margin-bottom: 14px; line-height: 1.2; }
.feature-copy p { color: var(--text-dim); font-size: 16px; margin-bottom: 18px; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feature-list li {
  display: flex;
  gap: 10px;
  font-size: 14.5px;
  color: var(--text);
}
.feature-list li svg { flex: none; margin-top: 3px; color: var(--brand-400); }

.feature-visual {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px hsl(var(--shadow-color) / .5);
}
.feature-visual img { width: 100%; }
.feature-visual.pad { padding: 28px; }

/* ---------- Mock UI (illustrative, non-screenshot) ---------- */
.mock-panel {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 20px;
  font-size: 13px;
}
.mock-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.mock-row:last-child { border-bottom: none; }
.mock-row .l { display: flex; align-items: center; gap: 10px; color: var(--text-dim); }
.mock-row .l .dot { width: 8px; height: 8px; border-radius: 999px; }
.mock-key {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 3px 7px;
  color: var(--text-dim);
}

/* ---------- Compare table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
table.compare { width: 100%; border-collapse: collapse; min-width: 720px; }
table.compare th, table.compare td { padding: 14px 18px; text-align: center; border-bottom: 1px solid var(--border); font-size: 14px; }
table.compare th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); font-weight: 700; }
table.compare td:first-child, table.compare th:first-child { text-align: left; color: var(--text); font-weight: 600; }
table.compare th:nth-child(2), table.compare td:nth-child(2) { background: color-mix(in srgb, var(--brand-500) 8%, transparent); }
table.compare tr:last-child td { border-bottom: none; }
table.compare .yes { color: var(--green-500); font-weight: 700; }
table.compare .no { color: var(--text-faint); }
table.compare .partial { color: var(--amber-400); font-weight: 700; }
.compare-note { font-size: 13px; color: var(--text-faint); margin-top: 16px; max-width: 720px; }

/* ---------- Download cards ---------- */
.download-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 780px) { .download-grid { grid-template-columns: 1fr; } }
.download-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 30px;
}
.download-card .icon-lg { width: 48px; height: 48px; margin-bottom: 18px; }
.download-card h3 { font-size: 19px; margin-bottom: 8px; }
.download-card p { color: var(--text-dim); font-size: 14.5px; margin-bottom: 20px; }
.download-card .fine { font-size: 12.5px; color: var(--text-faint); margin-top: 14px; }

/* ---------- CTA band ---------- */
.cta-band {
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500) 55%, #7a3fd6);
  color: #fff;
  text-align: center;
  padding: 64px 32px;
  position: relative;
  overflow: hidden;
}
.cta-band h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 14px; }
.cta-band p { color: rgba(255,255,255,.85); margin-bottom: 28px; font-size: 16px; }
.cta-band .btn-ghost { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.cta-band .btn-ghost:hover { background: rgba(255,255,255,.2); }
.cta-band .btn-primary { background: #fff; color: var(--brand-600); box-shadow: none; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 56px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: 14px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a { color: var(--text-dim); font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--border); padding-top: 24px; font-size: 13px; color: var(--text-faint); }

/* ---------- Page header (non-home pages) ---------- */
.page-header { padding: 64px 0 40px; text-align: center; }
.page-header h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 16px; }
.page-header p { color: var(--text-dim); font-size: 17px; max-width: 620px; margin: 0 auto; }

/* ---------- Utility ---------- */
.stack { display: grid; gap: 16px; }
.mt-lg { margin-top: 64px; }
.center { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Changelog ---------- */
.changelog-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin-bottom: 14px;
  overflow: hidden;
}
.changelog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  cursor: pointer;
  user-select: none;
}
.changelog-head .title { display: flex; align-items: center; gap: 12px; }
.changelog-head .version { font-family: var(--font-mono); font-weight: 700; font-size: 15px; }
.changelog-head .date { font-size: 13px; color: var(--text-faint); }
.changelog-head .chevron { transition: transform .2s ease; color: var(--text-faint); flex: none; }
.changelog-entry.open .chevron { transform: rotate(180deg); }
.changelog-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.changelog-entry.open .changelog-body { max-height: 900px; }
.changelog-body-inner { padding: 0 22px 22px; }
.changelog-body-inner ul { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.changelog-body-inner li { font-size: 14.5px; color: var(--text-dim); }
.changelog-body-inner li strong { color: var(--text); }

/* ---------- Mobile nav drawer ---------- */
.mobile-drawer {
  position: fixed; inset: 68px 0 0 0; z-index: 49;
  background: var(--bg);
  padding: 24px;
  display: none;
  flex-direction: column;
  gap: 4px;
}
.mobile-drawer.open { display: flex; }
.mobile-drawer a {
  padding: 14px 6px;
  font-size: 17px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.mobile-drawer .btn { margin-top: 18px; }
