/* Home page: product-first. Tokens first, then sections top to bottom. */

:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --fg: #141a23;
  --dim: #535e6c;
  --line: #e2e6ee;
  --accent: #4338ca;
  --accent-fg: #ffffff;
  --accent-soft: #eceefe;
  --ok: #0b6b52;
  --ok-soft: #e3f4ee;
  --warn: #8a4b00;
  --warn-soft: #fbefdc;
  --tint: #6d28d9;
  --tint-soft: #f1eafd;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 8px 24px rgb(16 24 40 / 8%);
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f15;
    --surface: #121822;
    --surface-2: #18202c;
    --fg: #e8edf3;
    --dim: #a0abb8;
    --line: #232d3b;
    --accent: #a5b4fc;
    --accent-fg: #0b0f15;
    --accent-soft: #1c2140;
    --ok: #6ee0b4;
    --ok-soft: #10291f;
    --warn: #f3bd6b;
    --warn-soft: #2c210f;
    --tint: #c4b5fd;
    --tint-soft: #241c3d;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 28px rgb(0 0 0 / 35%);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

code, kbd { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; padding: 0 5px; border-radius: 5px; background: var(--surface); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: -9999px; top: 8px; }
.skip:focus { left: 16px; z-index: 10; background: var(--surface); padding: 6px 10px; }

/* ------------------------------------------------------------ top bar */

.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 650; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.top nav { display: flex; gap: 4px; }
.top nav a { color: var(--dim); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.top nav a:hover { color: var(--fg); background: var(--surface-2); }
@media (max-width: 640px) {
  .top-row { height: 100px; flex-direction: column; justify-content: center; gap: 6px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 26px; height: 26px; }
  .top nav a { padding: 6px 8px; font-size: 14px; }
}

/* --------------------------------------------------------------- hero */

.hero { padding: 88px 0 72px; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-weight: 650; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
.hero h1 { margin: 0; max-width: 21ch; font-size: clamp(34px, 5.4vw, 58px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 750; }
.lede { max-width: 62ch; margin: 22px 0 0; font-size: clamp(17px, 2vw, 19px); color: var(--dim); }
.pills { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; }
.pills li { font-size: 14px; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0 0; }
@media (max-width: 600px) { .hero { padding: 48px 0 40px; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--fg); text-decoration: none; font-weight: 600; font-size: 15px;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn small { font-weight: 400; color: var(--dim); font-size: 13px; }

/* -------------------------------------------------------------- tools */

.section-title { margin: 0 0 8px; font-size: clamp(24px, 3vw, 30px); letter-spacing: -0.015em; }
.section-lede { margin: 0 0 28px; color: var(--dim); max-width: 60ch; }

.tools { padding: 24px 0 40px; }
.tools .section-title { margin-bottom: 28px; }

.tool {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start;
  padding: 36px; margin: 0 0 28px; background: var(--surface);
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow);
}
.tool.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.tool.flip .tool-text { order: 2; }
.tool.small { display: block; padding: 28px 36px; box-shadow: none; }
.tool.small > p:not(.badges):not(.links) { max-width: 70ch; }
@media (max-width: 860px) {
  .tool, .tool.flip { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
  .tool.flip .tool-text { order: 0; }
  .tool.small { padding: 24px; }
}

.tool-head { display: flex; gap: 14px; align-items: center; }
.tool-icon { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.tool-icon.glyph { display: grid; place-items: center; background: var(--surface-2); color: var(--dim); font-size: 18px; }
.tool h3 { margin: 0; font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; }
.tool h3 a { color: var(--fg); text-decoration: none; }
.tool h3 a:hover { color: var(--accent); }
.kind { margin: 2px 0 0; font-size: 14px; color: var(--dim); }
.tool p { margin: 14px 0 0; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--dim); }
.badge.live { background: var(--ok-soft); color: var(--ok); }
.badge.tint { background: var(--tint-soft); color: var(--tint); }
.badge.exp { background: var(--warn-soft); color: var(--warn); }

.ticks { list-style: none; margin: 16px 0 0; padding: 0; }
.ticks li { position: relative; padding: 0 0 0 26px; margin: 8px 0; }
.ticks li::before { content: "✓"; position: absolute; left: 2px; color: var(--ok); font-weight: 700; }

.note { font-size: 15px; color: var(--dim); padding: 10px 14px; border-radius: 10px; background: var(--tint-soft); }

.links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 22px !important; font-weight: 600; font-size: 15px; }
.links a:not(.btn) { text-decoration: none; }
.links a:not(.btn):hover { text-decoration: underline; }

.shot { margin: 0; }
.shot.narrow { max-width: 520px; justify-self: center; width: 100%; }
.shot img {
  display: block; width: 100%; height: auto; border-radius: 10px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}

/* --------------------------------------------------------- principles */

.principles, .privacy, .about, .support { padding: 48px 0; }
.grid4, .grid3 { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 16px; }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid3 { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .grid4 { grid-template-columns: 1fr; } }
.grid4 li, .grid3 li {
  display: flex; flex-direction: column; gap: 6px; padding: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.grid4 b, .grid3 b { font-size: 16px; }
.grid4 span, .grid3 span { color: var(--dim); font-size: 15px; }
.grid3 a { text-decoration: none; }
.grid3 a:hover b { text-decoration: underline; }

/* ------------------------------------------------------- about, support */

.about-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 40px; align-items: start; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 20px; } }
.about p { max-width: 62ch; color: var(--dim); }
.about p.actions { margin-top: 18px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 52px 0 0; padding: 0; }
@media (max-width: 860px) { .chips { margin-top: 0; } }
.chips li { font-size: 14px; padding: 4px 11px; border-radius: 8px; background: var(--surface-2); }

.support-box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  padding: 32px 36px; background: var(--surface);
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px);
}
@media (max-width: 600px) { .support-box { padding: 24px; } }
.support-box p { margin: 0; color: var(--dim); max-width: 56ch; }
.support-box .actions { margin: 0; }

.foot { padding: 32px 0 48px; color: var(--dim); font-size: 14px; }

/* -------------------------------------------------------------- tours */

/* One screenshot at a time with its caption, chosen by the tabs below it
 * (tours.js). Without the script only the first screenshot shows. */
.tour { min-width: 0; }
.tour-stage { position: relative; touch-action: pan-y; }
.tour:not(.ready) .tour-slide ~ .tour-slide,
.tour:not(.ready) .tour-bar { display: none; }
.tour-slide { margin: 0; }
.tour-slide[hidden] { display: none; }
.tour.ready .tour-slide:not([hidden]) { animation: tour-in 220ms ease-out; }
@keyframes tour-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tour.ready .tour-slide:not([hidden]) { animation: none; } }

.tour-frame {
  display: grid; place-items: center; aspect-ratio: var(--ratio, 16 / 10);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; box-shadow: var(--shadow);
}
.tour-frame img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.tour-slide figcaption { margin-top: 14px; color: var(--dim); font-size: 15px; min-height: 3.2em; }
.tour-slide figcaption b { display: block; color: var(--fg); font-size: 16px; margin-bottom: 2px; }

.tour-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.tour-tabs { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; justify-content: center; }
.tour-tabs [role="tab"] {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--dim);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; cursor: pointer;
}
.tour-tabs [role="tab"]:hover { color: var(--fg); background: var(--surface-2); }
.tour-tabs [role="tab"][aria-selected="true"] { color: var(--accent-fg); background: var(--accent); border-color: var(--accent); }
.tour-step {
  flex: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  font-size: 20px; line-height: 1;
}
.tour-step:hover { background: var(--surface-2); }
@media (max-width: 520px) { .tour-step { display: none; } }
.tour.narrow { max-width: 500px; justify-self: center; width: 100%; }

.zoom-open {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  padding: 0; border: 0; background: none; cursor: zoom-in;
}
.zoom-open img { cursor: zoom-in; }
.zoom { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 94vh; overflow: visible; }
.zoom::backdrop { background: rgb(8 10 14 / 82%); }
.zoom img { display: block; max-width: 96vw; max-height: 90vh; width: auto; height: auto; border-radius: 10px; box-shadow: 0 10px 40px rgb(0 0 0 / 50%); cursor: zoom-out; }
.zoom-close {
  position: absolute; top: -40px; right: 0; font: 600 14px system-ui, sans-serif;
  color: #fff; background: rgb(255 255 255 / 14%); border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 8px; padding: 5px 12px; cursor: pointer;
}

/* ------------------------------------------------------------ coffee */

.support-box .bugs { margin-top: 10px; font-size: 15px; }
.btn.coffee { gap: 10px; }
.coffee-icon { width: 20px; height: 20px; flex: none; }
/* buycoffee.to's mark is one colour, drawn in the text colour so it suits both themes. */
.coffee-icon.buycoffee {
  display: inline-block; background: currentColor;
  -webkit-mask: url(assets/icons/buycoffee.png) center / contain no-repeat;
  mask: url(assets/icons/buycoffee.png) center / contain no-repeat;
}

.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.foot nav a { color: var(--dim); }
.foot nav a:hover { color: var(--fg); }


/* -------------------------------------------- tours, second look */

/* A wide screenshot gets the card's whole width: the text sits above it. */
.tool.wide, .tool.wide.flip { grid-template-columns: 1fr; gap: 28px; }
.tool.wide .tool-text { order: 0; max-width: 760px; }

.tour-bar .tour-step {
  position: static; flex: none;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  box-shadow: var(--shadow); cursor: pointer; opacity: .92;
}
.tour-bar .tour-step:hover { opacity: 1; background: var(--surface-2); }
.tour-bar .tour-step svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tour-bar { gap: 10px; }
.tour-bar .tour-step { width: 38px; height: 38px; box-shadow: none; opacity: 1; background: var(--surface-2); }
@media (max-width: 520px) { .tour-bar .tour-step { display: none; } }

/* The switcher: one segmented bar instead of loose pills. */
.tour-bar { justify-content: center; margin-top: 14px; }
.tour-tabs {
  flex: 0 1 auto; gap: 2px; padding: 3px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.tour-tabs [role="tab"] {
  border: 0; border-radius: 9px; padding: 6px 14px; font-size: 14px;
  background: transparent; color: var(--dim);
}
.tour-tabs [role="tab"]:hover { background: transparent; color: var(--fg); }
.tour-tabs [role="tab"][aria-selected="true"] {
  background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgb(16 24 40 / 12%), 0 1px 3px rgb(16 24 40 / 10%);
}
.tour-slide figcaption { text-align: center; min-height: 0; }
.tour-frame { background: transparent; border: 0; box-shadow: none; }
.tour-frame img { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.grid2 { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
.grid2 li { display: flex; flex-direction: column; gap: 6px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.grid2 b { font-size: 16px; }
.grid2 span { color: var(--dim); font-size: 15px; }
.grid2 a { text-decoration: none; }
.grid2 a:hover b { text-decoration: underline; }
/* Wrapping keeps every screenshot choice visible on narrow screens. */
.tour-tabs { flex-wrap: wrap; max-width: 100%; }
.tour-tabs [role="tab"] { flex: none; padding: 6px 11px; }
.tour-bar { min-width: 0; }


/* Homepage previews retain each extension's natural screenshot proportions. */
.product-preview { width: 100%; max-width: 900px; margin: 0 auto; }
.product-preview.narrow { max-width: 380px; }
.product-preview .tour-frame { aspect-ratio: auto; }
.tool-text { max-width: 760px; }
.support { padding: 28px 0 40px; }
.support p { color: var(--dim); margin: 8px 0 18px; }

.top nav a[aria-current="page"] { color: var(--fg); background: var(--surface-2); }
#tools, #coffee { scroll-margin-top: 112px; }

/* Action icons keep their labels and inherit the link colour in either theme. */
.icon-link { display: inline-flex; align-items: center; gap: 8px; }
.action-icon { display: inline-block; width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: var(--action-icon) center / contain no-repeat; mask: var(--action-icon) center / contain no-repeat; }
.icon-extensions { --action-icon: url("assets/icons/action-extensions.svg"); }
.icon-person { --action-icon: url("assets/icons/action-person.svg"); }
.icon-email { --action-icon: url("assets/icons/action-email.svg"); }
.icon-chrome { --action-icon: url("assets/icons/action-chrome.svg"); }
.icon-github { --action-icon: url("assets/icons/action-github.svg"); }
