/* betterle.win. Same palette as the extension (DESIGN.md): tinted green neutrals, one accent. */
:root {
  --bg: #f3f7f1;
  --surface: #fbfdfa;
  --surface2: #e6eee3;
  --line: rgba(23, 61, 39, .13);
  --ink: #14231a;
  --muted: #4d5f53;
  --accent: #1c6b3f;
  --fill: #173d27;
  --on-fill: #eef7ef;
  --glass: rgba(243, 247, 241, .72);
  --shadow: 0 1px 2px rgba(23, 61, 39, .06), 0 12px 32px -12px rgba(23, 61, 39, .22);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --r-lg: 18px;
  --r-md: 10px;
  --max: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f0b;
    --surface: #111813;
    --surface2: #18211a;
    --line: rgba(190, 235, 200, .11);
    --ink: #e4efe5;
    --muted: #9db0a1;
    --accent: #8fdca4;
    --fill: #c9f0cf;
    --on-fill: #0b140e;
    --glass: rgba(10, 15, 11, .7);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 "General Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
img { display: block; max-width: 100%; height: auto; }
code { padding: .1em .4em; border-radius: 6px; background: var(--surface2); font: 500 .9em/1 ui-monospace, "Cascadia Code", Consolas, monospace; }
.ph { font-size: 1.15em; line-height: 1; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 12px; border-radius: var(--r-md); background: var(--fill); color: var(--on-fill); }
.skip:focus { top: 12px; }

/* ---- navigation: a translucent layer, content scrolls under it ---- */
.nav { position: sticky; top: 0; z-index: 40; padding: 12px 16px 0; }
.nav-inner {
  display: flex; align-items: center; gap: 24px;
  max-width: var(--max); margin: 0 auto; padding: 8px 8px 8px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.nav nav { display: flex; gap: 4px; margin-left: auto; }
.nav nav a { padding: 6px 12px; border-radius: 999px; color: var(--muted); font-size: .9375rem; font-weight: 500; text-decoration: none; transition: color .2s var(--ease), background-color .2s var(--ease); }
.nav nav a:hover { background: var(--surface2); color: var(--ink); }

/* ---- buttons: feedback on press, not on release ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 20px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font: 500 1rem/1 inherit; text-decoration: none; white-space: nowrap;
  transition: transform .1s ease-out, background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { background: var(--surface2); }
.btn:active { transform: scale(.97); }
.btn-small { height: 36px; padding: 0 14px; font-size: .9375rem; }
.btn-primary { border-color: transparent; background: var(--fill); color: var(--on-fill); box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--fill); filter: brightness(1.08); }
.btn .ver { opacity: .75; font-weight: 400; }

/* ---- layout ---- */
main > section { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
section + section { margin-top: clamp(80px, 11vw, 140px); }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 4.4vw, 3.6rem); line-height: 1.04; letter-spacing: -.032em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); line-height: 1.08; letter-spacing: -.028em; }
h3 { font-size: 1.1875rem; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0; }
.fine { color: var(--muted); font-size: .875rem; letter-spacing: .005em; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; margin-bottom: 40px; }
.section-head p { max-width: 46ch; color: var(--muted); }

/* ---- hero: copy left, product right ---- */
.hero { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 12fr); gap: 56px; align-items: center; padding-top: clamp(48px, 8vw, 96px) !important; }
.lede { max-width: 40ch; margin-top: 24px; color: var(--muted); font-size: 1.1875rem; line-height: 1.55; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero .fine { max-width: 44ch; margin-top: 20px; }
.hero-shot { margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: calc(var(--r-lg) + 8px); background: var(--surface2); box-shadow: var(--shadow); }
.hero-shot img { border-radius: var(--r-lg); }

/* ---- works on ---- */
.sites { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
section.sites { margin-top: 72px; }
.sites-label { margin-right: 8px; color: var(--muted); font-size: .875rem; font-weight: 500; }
.site {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px 12px 20px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); text-decoration: none;
  transition: background-color .2s var(--ease), transform .1s ease-out;
}
.site span { color: var(--muted); font-size: .9375rem; }
.site .ph { color: var(--muted); transition: transform .3s var(--ease); }
.site:hover { background: var(--surface2); }
.site:hover .ph { transform: translate(2px, -2px); }
.site:active { transform: scale(.98); }

/* ---- designs: a segmented control, the thumb glides to the pick ---- */
.designs-body { display: grid; justify-items: start; gap: 16px; }
.segmented { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface2); }
.segmented button { position: relative; z-index: 1; min-width: 72px; height: 36px; padding: 0 18px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 .9375rem/1 inherit; cursor: pointer; transition: color .25s var(--ease); }
.segmented button[aria-selected="true"] { color: var(--ink); }
.segmented-thumb { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 4px 12px -4px rgba(0, 0, 0, .18); transition: transform .4s var(--ease), width .4s var(--ease); }
.design-note { min-height: 1.6em; color: var(--muted); }
.design-shot { width: 100%; margin: 8px 0 0; padding: 8px; border: 1px solid var(--line); border-radius: calc(var(--r-lg) + 8px); background: var(--surface2); box-shadow: var(--shadow); }
.design-shot img { border-radius: var(--r-lg); transition: opacity .22s ease-out; }
.design-shot.is-swapping img { opacity: 0; }

/* ---- features: grouped lists, not a wall of cards ---- */
.feature-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 64px; border-top: 1px solid var(--line); }
.group { padding: 32px 0; border-bottom: 1px solid var(--line); }
.group h3 { display: flex; align-items: center; gap: 10px; }
.group h3 .ph { color: var(--accent); font-size: 1.35rem; }
.group ul { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.group li { position: relative; padding-left: 20px; color: var(--muted); }
.group li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .55; }
.group li b { color: var(--ink); font-weight: 600; }

/* ---- who ---- */
.who-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; margin: 0; }
.who-list dt { display: flex; align-items: center; gap: 10px; font-size: 1.1875rem; font-weight: 600; letter-spacing: -.01em; }
.who-list dt .ph { color: var(--accent); }
.who-list dd { margin: 10px 0 0; color: var(--muted); }

/* ---- install ---- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; color: var(--muted); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font-weight: 600; }
.steps b { color: var(--ink); font-weight: 600; }

/* ---- release log ---- */
.log { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.log > li { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.log .tag { display: flex; flex-direction: column; gap: 4px; }
.log .tag b { font-size: 1.1875rem; letter-spacing: -.01em; }
.log .tag time { color: var(--muted); font-size: .875rem; }
.log .latest { align-self: start; padding: 2px 10px; border-radius: 999px; background: var(--fill); color: var(--on-fill); font-size: .75rem; font-weight: 600; letter-spacing: .02em; }
.log ul { display: grid; gap: 6px; margin: 0; padding-left: 18px; }
.log li li { color: var(--ink); }
.log li li::marker { color: var(--accent); }
.log-empty { padding: 24px 0; color: var(--muted); }

/* ---- footer ---- */
.footer { margin-top: clamp(96px, 12vw, 160px); border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: grid; grid-template-columns: auto 1fr; gap: 16px 32px; align-items: center; max-width: var(--max); margin: 0 auto; padding: 32px 24px 40px; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 20px; }
.footer nav a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 500; text-decoration: none; }
.footer nav a:hover { color: var(--accent); }
.footer .fine { grid-column: 1 / -1; }

/* ---- entrance: one gentle rise as each part scrolls in, from an already-visible default ---- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .8s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---- smaller screens ---- */
@media (max-width: 900px) {
  .hero, .section-head { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 40px; }
  .feature-groups { grid-template-columns: minmax(0, 1fr); }
  .who-list { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav nav { display: none; }
  .nav-inner { justify-content: space-between; }
}
@media (max-width: 560px) {
  main > section { padding: 0 16px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .log > li { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer nav { justify-content: flex-start; }
  .btn { height: 44px; }
}

/* ---- accessibility ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .segmented-thumb, .design-shot img, .site .ph { transition: none; }
  .btn:active, .site:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav-inner { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav-inner { background: var(--surface); }
}
@media (prefers-contrast: more) {
  :root { --line: var(--muted); --glass: var(--surface); }
}
