/* ScrollReset — style.css (landing page)
 * Styled after Instagram's dark-mode web UI: pure black background, flat
 * #121212 surfaces with hairline #262626 borders, the system font, 14px
 * body text, and blue #0095F6 primary buttons with 8px corners.
 * (Instagram's logo, gradient and wordmark are deliberately not used.)
 * All colours are tokens below. */

:root {
  --bg: #000000;              /* Instagram dark background */
  --card: #121212;            /* elevated surface */
  --card-hover: #1A1A1A;
  --elevated: #262626;        /* inputs, chips, secondary buttons */
  --line: #262626;            /* hairline borders */
  --line-strong: #363636;
  --text: #F5F5F5;            /* primary text */
  --text-muted: #A8A8A8;      /* secondary text */
  --accent: #0095F6;          /* Instagram primary blue */
  --accent-hover: #1877F2;
  --accent-soft: rgba(0, 149, 246, 0.12);
  /* Yellow -> orange -> pink -> purple, used on headings. */
  --heading-gradient: linear-gradient(90deg,
    #FEDA75 0%, #FA7E1E 28%, #D62976 58%, #962FBF 100%);
  /* Dashboard comparison bars */
  --track: #2A2A2A;           /* muted charcoal bar track */
  --danger: #FF4D4D;          /* "average teenager" bar */
  --good: #3DD68C;            /* streak bar: start (green) */
  --warn: #FFC93C;            /* streak bar: middle (yellow) */
  --focus: #FFFFFF;           /* accent: white (glass theme); your tracked time */
  --focus-glow: rgba(255, 255, 255, 0.35);
  --radius: 12px;             /* cards */
  --radius-btn: 8px;          /* buttons */
  /* Native system UI font (San Francisco on Apple, Segoe UI on Windows,
   * Roboto on Android): the same stack Instagram's web UI uses. */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, sans-serif;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

a { color: inherit; }

.container {
  width: 100%;
  max-width: 975px;           /* Instagram's content width */
  margin: 0 auto;
  padding: 0 20px;
}

.accent { color: var(--accent); }

/* Small label above headings: plain sentence case, like Instagram's
 * secondary text, rather than an uppercase kicker. */
.eyebrow {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  color: var(--text-muted);
}

h1, h2, h3 { margin: 0; line-height: 1.2; }

/* ---------- Gradient headings ----------
 * The gradient is painted as the text's background and clipped to the
 * letters. Each heading is shrunk to the width of its text (fit-content)
 * so short headings still show the full yellow -> purple sweep instead
 * of only the middle of a page-wide gradient. Browsers without
 * background-clip: text keep the normal solid colour. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero__title,
  .command__title,
  .section-head h2,
  .install h2,
  .card h3,
  .eyebrow {
    width: fit-content;
    background: var(--heading-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }

  /* Centred headings stay centred once shrunk. */
  .hero__title,
  .command__title,
  .hero .eyebrow,
  .section-head h2,
  .section-head .eyebrow { margin-left: auto; margin-right: auto; }

  /* The blue .accent span inside the hero title takes the gradient too. */
  .hero__title .accent { color: inherit; }

  /* Keep the "Coming soon" badge solid inside a gradient card title. */
  .card h3 .badge { -webkit-text-fill-color: var(--accent); }
}

h2 {
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--elevated);
  font-size: 12px;
}

/* ---------- Buttons (Instagram primary button) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-btn);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
}

.btn--primary {
  background: var(--accent);
  color: #FFFFFF;
}

.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:active { opacity: 0.7; }

.btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.btn--sm { padding: 7px 16px; font-size: 14px; line-height: 18px; }
.btn--lg { padding: 12px 28px; font-size: 16px; line-height: 20px; }

.btn--xl {
  flex-wrap: wrap;
  padding: 16px 32px;
  border-radius: var(--radius);
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 24px;
  text-align: center;
}

.btn__sub {
  flex-basis: 100%;
  font-size: 13px;
  font-weight: 400;
  line-height: 16px;
  opacity: 0.85;
}

/* ---------- Navbar (Instagram top bar) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  /* "ScrollReset" wordmark: heavy weight, tight tracking. */
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.05em;
  text-decoration: none;
}

.nav__logo svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  stroke-linecap: round;
}

.nav__links {
  display: flex;
  gap: 24px;
  margin-left: auto;
}

.nav__links a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.15s;
}

.nav__links a:hover { opacity: 0.6; }

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 72px;
  text-align: center;
}

.hero__glow { display: none; }

.hero__title {
  font-size: clamp(36px, 6.2vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.hero__lead {
  max-width: 600px;
  margin: 20px auto 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-muted);
}

.hero__cta { margin-top: 36px; }

.hero__note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
}

/* Before / after preview, drawn like two feed columns */
.preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 56px;
}

.preview__card {
  position: relative;
  width: 220px;
  padding: 40px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.preview__card--after { border-color: var(--line-strong); }

.preview__tag {
  position: absolute;
  top: 12px;
  left: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.preview__tag--accent { color: var(--accent); }

.preview__row {
  height: 44px;
  border-radius: 8px;
  background: var(--elevated);
}

.preview__row--video {
  height: 64px;
  background: repeating-linear-gradient(135deg,
    rgba(237, 73, 86, 0.22) 0 10px, rgba(237, 73, 86, 0.1) 10px 20px);
}

.preview__row--chat {
  height: 32px;
  width: 70%;
  align-self: flex-end;
  border-radius: 18px;        /* DM bubble */
  background: var(--accent);
  opacity: 0.85;
}

.preview__arrow {
  font-size: 24px;
  color: var(--text-muted);
}

/* ---------- Features ---------- */
.features {
  padding: 80px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 600px;
  margin: 0 auto 40px;
  text-align: center;
}

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

.card {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background 0.15s, border-color 0.15s;
}

.card:hover {
  background: var(--card-hover);
  border-color: var(--line-strong);
}

.card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--elevated);
}

.card__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
}

.card p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  vertical-align: middle;
  white-space: nowrap;
}

/* ---------- Personal Analytics Dashboard ---------- */
.dashboard { padding: 0 0 80px; }

.compare {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  align-items: stretch;
  gap: 32px;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.compare__bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

.metric__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.metric__label {
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
}

.metric__value {
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.metric--avg .metric__value { color: var(--danger); }
.metric--you .metric__value { color: var(--focus); }

.metric__track {
  height: 14px;
  border-radius: 999px;
  background: var(--track);
}

.metric__fill {
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.metric--avg .metric__fill { background: var(--danger); }

.metric--you .metric__fill {
  background: var(--focus);
  box-shadow: 0 0 14px var(--focus-glow), 0 0 3px var(--focus);
}

.metric__note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
}

/* "Attention Reclaimed" panel */
.reclaimed {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px 20px;
  text-align: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 0.3s, border-color 0.3s;
}

.reclaimed__label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  color: var(--text-muted);
}

.reclaimed__value {
  margin: 6px 0 4px;
  font-size: 44px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--focus);
  text-shadow: 0 0 24px var(--focus-glow);
  transition: color 0.3s;
}

.reclaimed__caption {
  margin: 0;
  max-width: 240px;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-muted);
}

/* Over the benchmark: switch the panel to the warning colour. */
.compare[data-state="over"] .reclaimed {
  background: rgba(255, 77, 77, 0.08);
  border-color: rgba(255, 77, 77, 0.3);
}

.compare[data-state="over"] .reclaimed__value {
  color: var(--danger);
  text-shadow: 0 0 24px rgba(255, 77, 77, 0.45);
}

/* No extension data yet: neutral panel. */
.compare[data-state="empty"] .reclaimed {
  background: var(--card-hover);
  border-color: var(--line);
}

.compare[data-state="empty"] .reclaimed__value {
  color: var(--text-muted);
  text-shadow: none;
}

/* ---------- Command Center (extension detected) ----------
 * app.js adds `is-installed` to <html>. The landing sections, nav links and
 * download button are hidden; the dashboard fills the page with its title
 * and the Pro card. Without the class, those extras stay hidden. */
.command__head,
.controls,
.pro,
.streak,
.nav__status { display: none; }

html.is-installed .hero,
html.is-installed .features,
html.is-installed .install,
html.is-installed .nav__links,
html.is-installed .nav__download { display: none; }

html.is-installed body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

html.is-installed main { flex: 1; }

html.is-installed .dashboard { padding: 56px 0 80px; }

html.is-installed .command__head {
  display: block;
  margin-bottom: 48px;
  text-align: center;
}

html.is-installed .pro,
html.is-installed .controls { display: block; }

/* Under-1-hour streak: Command Center + Pro only. */
html.is-installed.is-pro .streak { display: flex; }

.streak {
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 56px;
  padding: 24px 28px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.21);
  border-radius: var(--radius);
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.05);
}

.streak__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(250, 126, 30, 0.12);
  font-size: 28px;
  line-height: 1;
}

.streak__body { flex: 1; min-width: 0; }

.streak__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  color: var(--text-muted);
}

.streak__value {
  margin: 4px 0 2px;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--focus);
  font-variant-numeric: tabular-nums;
}

.streak__sub {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-muted);
}

.streak__best {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.streak__best-label {
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
}

.streak__best-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 22px;
  font-variant-numeric: tabular-nums;
}

.streak[data-state="empty"] .streak__value { color: var(--text-muted); }

/* Today's progress toward the 1-hour limit. */
.streak__today { margin-top: 16px; max-width: 440px; }

.streak__today-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.streak__today-time { color: var(--focus); font-variant-numeric: tabular-nums; }

.streak__track {
  height: 8px;
  margin: 8px 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track);
}

/* Green at the left, yellow in the middle, red at the right (= the limit).
 * The gradient always spans the whole track and the fill is trimmed with
 * clip-path, so each colour stays at its place: 15 min shows only green,
 * 50 min reaches into red. app.js sets --fill (e.g. "61%"). */
.streak__fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--good) 0%, var(--warn) 50%, var(--danger) 100%);
  clip-path: inset(0 calc(100% - var(--fill, 0%)) 0 0 round 999px);
  transition: clip-path 0.6s ease;
}

.streak__note {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
}

/* Over the limit today: red, and the streak will restart at midnight. */
.streak.is-over .streak__today-time { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  .streak__fill { transition: none; }
}

@media (max-width: 560px) {
  .streak { flex-wrap: wrap; gap: 16px; padding: 20px; }
  .streak__icon { width: 48px; height: 48px; font-size: 24px; }
  .streak__body { flex-basis: calc(100% - 64px); }
  .streak__best {
    flex-basis: 100%;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    padding: 12px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

html.is-installed .nav__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--focus);
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
}

.nav__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--focus);
  box-shadow: 0 0 8px var(--focus);
}

.command__title {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.command__sub {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 22px;
  color: var(--text-muted);
}

/* ---------- Time spent on social media this week (Command Center) ----------
 * A bar graph of this week, Monday to Sunday. Each white bar (#FFFFFF)
 * grows up from a shared baseline to its day's share of the chart scale;
 * app.js sets --h on the bar and draws the hour gridlines. The dashed
 * line marks the benchmark on the same scale. */
.trends {
  display: none;
  margin-top: 40px;
  padding: 28px 32px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

html.is-installed .trends { display: block; }

.trends__head { margin-bottom: 24px; }

.trends__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
}

.trends__sub {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 18px;
  color: var(--text-muted);
}

.trends__chart {
  --plot-h: 220px;           /* bar area height */
  --top: 24px;               /* room above the tallest bar for its number */
  --axis-w: 40px;            /* hour labels on the left */
  position: relative;
  padding: var(--top) 0 0 var(--axis-w);
}

/* Hour gridlines: one per tick, positioned by app.js with --at (0-1). */
.trends__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.trends__gridline {
  position: absolute;
  left: var(--axis-w);
  right: 0;
  top: calc(var(--top) + var(--plot-h) * (1 - var(--at)));
  border-top: 1px solid var(--line);
}

.trends__gridline span {
  position: absolute;
  left: calc(var(--axis-w) * -1);
  width: calc(var(--axis-w) - 8px);
  top: -8px;
  font-size: 11px;
  font-weight: 400;
  line-height: 16px;
  text-align: right;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* The baseline (0) is a little stronger. */
.trends__gridline--zero { border-top-color: var(--line-strong); }

.trends__days {
  position: relative;        /* bars sit above the gridlines */
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.day__track {
  position: relative;
  display: flex;
  align-items: flex-end;     /* bar grows up from the baseline */
  justify-content: center;
  width: 100%;
  height: var(--plot-h);
}

.day__fill {
  display: block;
  width: 100%;
  max-width: 48px;
  height: var(--h, 0%);
  border-radius: 6px 6px 0 0;
  background: var(--focus);
  box-shadow: 0 0 14px var(--focus-glow), 0 0 3px var(--focus);
  transition: height 0.6s ease;
}

/* The day's time, just above the top of its bar. */
.day__value {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--h, 0%) + 6px);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: bottom 0.6s ease;
}

.day__label {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  color: var(--text-muted);
  text-align: center;
}

.day__short { display: none; }

/* Today: brighter label and value. */
.day--today .day__label,
.day--today .day__value { color: var(--text); }

/* Over the benchmark: warning colour. */
.day--over .day__fill {
  background: var(--danger);
  box-shadow: 0 0 14px rgba(255, 77, 77, 0.45), 0 0 3px var(--danger);
}

/* Days still to come, or before ScrollReset was installed: no bar. */
.day--untracked .day__fill { box-shadow: none; }
.day--untracked .day__label { opacity: 0.5; }

/* The best full day gets a small dot under its label. */
.day--best .day__label { color: var(--focus); }
.day--best .day__label::after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  margin: 4px auto 0;
  border-radius: 50%;
  background: var(--focus);
}

.trends__benchmark {
  position: absolute;
  left: var(--axis-w);
  right: 0;
  /* app.js sets --benchmark: the line's height as a fraction of the plot */
  top: calc(var(--top) + var(--plot-h) * (1 - var(--benchmark, 1)));
  border-top: 1px dashed rgba(255, 77, 77, 0.6);
  pointer-events: none;
  transition: top 0.6s ease;
}

.trends__benchmark span {
  position: absolute;
  right: 0;
  bottom: 2px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--card);
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  color: var(--danger);
}

.trends[data-state="empty"] .trends__benchmark { display: none; }

.trends__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0 0;
}

.trends__stat {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--card-hover);
  border: 1px solid var(--line);
}

.trends__stat dt {
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  color: var(--text-muted);
}

.trends__stat dd {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--focus);
}

.trends[data-state="empty"] .trends__stat dd { color: var(--text-muted); }

.trends__note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
}

/* ---------- Blocking controls (Command Center) ---------- */
.controls { margin-top: 40px; }

.controls__head {
  margin-bottom: 16px;
  text-align: center;
}

.controls__title {
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
}

.controls__sub {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 18px;
  color: var(--text-muted);
}

.controls__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.toggle:hover {
  background: var(--card-hover);
  border-color: var(--line-strong);
}

.toggle__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--elevated);
  color: var(--text-muted);
  transition: color 0.15s;
}

.toggle__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toggle__icon svg.fill { fill: currentColor; stroke: none; }
.toggle__icon .dot { fill: currentColor; }

.toggle:has(.switch:checked) .toggle__icon { color: var(--text); }

.toggle__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}

.toggle__desc {
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
}

.toggle:not(:has(.switch:checked)) .toggle__title { opacity: 0.45; }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .toggle__title {
    width: fit-content;
    background: var(--heading-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

/* Switch: same as the extension popup (Instagram blue when on). */
.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 44px;
  height: 26px;
  margin: 0;
  border-radius: 999px;
  background: var(--elevated);
  cursor: pointer;
  transition: background 0.2s;
}

.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}

.switch:checked { background: var(--accent); }
.switch:checked::before { transform: translateX(18px); }
.switch:disabled { cursor: default; opacity: 0.4; }

.switch:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* ---------- Pro upgrade card ----------
 * Glass panel: translucent fill + backdrop blur over a soft neon glow
 * placed behind it, with a glowing neon border. */
.pro {
  position: relative;
  margin-top: 40px;
}

.pro::before {
  content: "";
  position: absolute;
  inset: 8% 22%;
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, 0.33), transparent 70%),
    radial-gradient(closest-side at 80% 60%, rgba(150, 47, 191, 0.35), transparent 70%);
  filter: blur(36px);
  pointer-events: none;
}

.pro__card {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: 28px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.09),
    0 0 28px rgba(255, 255, 255, 0.21),
    0 24px 60px -24px rgba(255, 255, 255, 0.36);
}

.pro__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.01em;
}

.pro__list {
  margin: 18px 0 24px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.pro__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text);
}

/* Neon check mark */
.pro__list li::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--focus) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23041210' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
  box-shadow: 0 0 10px var(--focus-glow);
}

.btn--pro {
  width: 100%;
  padding: 13px 20px;
  font-size: 16px;
  line-height: 20px;
  background: var(--focus);
  color: #041210;
  box-shadow: 0 0 20px var(--focus-glow);
}

.btn--pro:hover { background: #E6E6E6; }

.pro__fine {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  color: var(--text-muted);
}

.pro__error {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.35);
  font-size: 13px;
  line-height: 18px;
  color: #FFB3B3;
}

.pro__error[hidden] { display: none; }

/* Pro unlocked (html.is-pro): swap the button for a confirmation. */
.pro__active {
  display: none;
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 14px;
  line-height: 20px;
  color: var(--text);
}

.pro__active strong { color: var(--focus); font-weight: 700; }

html.is-pro .btn--pro,
html.is-pro .pro__fine { display: none; }
html.is-pro .pro__active { display: block; }

/* Pro-only toggles: "PRO" tag, locked look until Pro is unlocked. */
.toggle--pro .toggle__title::after {
  content: "PRO";
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: 2px;
}

html:not(.is-pro) .toggle--pro { cursor: not-allowed; }
html:not(.is-pro) .toggle--pro:hover { background: var(--card); border-color: var(--line); }
.btn--pro:active { opacity: 0.8; }

/* ---------- Install ---------- */
.install { padding: 0 0 96px; }

.install__panel {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 40px;
  padding: 40px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.steps {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 24px;
  color: var(--text-muted);
}

.steps strong { color: var(--text); font-weight: 600; }

.steps__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--elevated);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.install__cta { text-align: center; }

.install__fine {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
}

/* ---------- Footer (Instagram-style small grey links) ---------- */
.footer {
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ---------- Scroll reveal ----------
 * Any element with .reveal-element fades and slides up when app.js adds
 * .active as it scrolls into view. Used on the hero, the features grid,
 * the analytics dashboard, the blocking controls and the Pro card.
 *
 * Only hidden once JS has added `.js` to <html>, so the page is never
 * blank without JavaScript. Reduced-motion users skip it (see app.js).
 *
 * Only opacity and transform animate (not `all`): with `all`, every hover
 * colour change on these elements would also take 0.8 s. --reveal-delay
 * staggers siblings without delaying their hover effects. */
.js .reveal-element {
  --reveal-ease: cubic-bezier(0.25, 1, 0.5, 1);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--reveal-ease) var(--reveal-delay, 0s),
              transform 0.8s var(--reveal-ease) var(--reveal-delay, 0s);
  will-change: opacity, transform;
}

.js .reveal-element.active {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* Feature cards keep their quick hover colours. */
.js .card.reveal-element {
  transition: opacity 0.8s var(--reveal-ease) var(--reveal-delay, 0s),
              transform 0.8s var(--reveal-ease) var(--reveal-delay, 0s),
              background 0.15s, border-color 0.15s;
}

/* Stagger the three feature cards. */
.js .grid .reveal-element:nth-child(2) { --reveal-delay: 0.1s; }
.js .grid .reveal-element:nth-child(3) { --reveal-delay: 0.2s; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .day__long { display: none; }      /* "Wed" instead of "Wednesday" */
  .day__short { display: inline; }
  .grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; padding: 24px 20px; gap: 24px; }
  .pro__card { padding: 24px 20px; }
  .install__panel { grid-template-columns: 1fr; padding: 28px 20px; }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .trends { padding: 22px 16px 18px; }
  .trends__chart { --plot-h: 180px; --axis-w: 32px; }
  .trends__days { gap: 4px; }
  .day__value { font-size: 10px; }
  .day__fill { width: 72%; }
  .trends__stats { grid-template-columns: 1fr; }
  .nav__inner { gap: 16px; }
  .hero { padding: 56px 0 48px; }
  .btn--xl { padding: 14px 20px; }
  .preview { gap: 12px; }
  .preview__card { width: 140px; padding: 36px 10px 10px; }
  .preview__arrow { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card, .metric__fill, .reclaimed, .reclaimed__value,
  .toggle, .switch, .switch::before,
  .day__fill, .day__value, .trends__benchmark { transition: none; }
}
