/*
 * TabStaq website: hand-written CSS, no build step, no third-party requests.
 * Design tokens mirror src/index.css of the extension (accent #15ae5c, surface scale, Inter).
 * Contrast notes: white text on the brand green #15ae5c is only 2.9:1, so primary buttons keep white
 * text on a slightly deeper green (--accent-btn #0f8745, 4.6:1; hover #0c7a3e, 5.6:1);
 * green text on light backgrounds uses --accent-ink (#0f7040, 6.1:1).
 */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f6f8f7;
  --card: #ffffff;
  --fg: #202124;
  --muted: #5f6368;
  --line: #e3e6e8;
  --accent: #15ae5c;
  --accent-btn: #0f8745;
  --accent-btn-hover: #0c7a3e;
  --accent-ink: #0f7040;
  --accent-tint: #e8f8ef;
  --on-accent: #ffffff;
  --ring: #0f7040;
  --dark: #202124;
  --dark-2: #2a2d2f;
  --on-dark: #f1f3f4;
  --on-dark-muted: #bdc1c6;
  --shadow: 0 1px 2px rgb(32 33 36 / 0.06), 0 8px 24px rgb(32 33 36 / 0.08);
  --shadow-lg: 0 2px 4px rgb(32 33 36 / 0.06), 0 24px 60px rgb(32 33 36 / 0.16);
  --radius: 14px;
  --radius-lg: 20px;
  --max: 1120px;
  --font: "Inter Variable", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131516;
    --bg-soft: #181a1c;
    --card: #1f2123;
    --fg: #f1f3f4;
    --muted: #a3a9ae;
    --line: #2a2d2f;
    --accent-ink: #3fc17c;
    --accent-tint: #10261a;
    --ring: #3fc17c;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.3), 0 24px 60px rgb(0 0 0 / 0.55);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:lang(zh-CN) body,
body:lang(zh-CN) {
  line-height: 1.8;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

p a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 6px;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

kbd {
  font-family: var(--font);
  font-size: 0.8em;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--card);
  white-space: nowrap;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.container {
  width: min(100% - 40px, var(--max));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  gap: 2px;
  margin-left: 12px;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.nav-links a:hover {
  color: var(--fg);
  background: var(--bg-soft);
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.lang-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.lang-link:hover {
  color: var(--fg);
  background: var(--bg-soft);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn-sm {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
}

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

.btn-primary:hover {
  background: var(--accent-btn-hover);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent-btn) 35%, transparent);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--fg);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--bg-soft);
}

.btn-light {
  background: #ffffff;
  color: #202124;
}

.btn-light:hover {
  background: #e8eaed;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 96px);
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -10% -10% auto;
  height: 640px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(60% 60% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 72%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-size: 0.8125rem;
  font-weight: 650;
}

.hero h1 {
  max-width: 19ch;
  margin: 22px auto 0;
  font-size: clamp(2.25rem, 5.4vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 760;
  text-wrap: balance;
}

:lang(zh-CN) .hero h1 {
  max-width: 16em;
  letter-spacing: 0;
  line-height: 1.25;
}

.lead {
  max-width: 62ch;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  text-wrap: pretty;
}

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

.hero-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.875rem;
}

/* A drawn browser window around the screenshot */
.browser {
  max-width: 1040px;
  margin: clamp(40px, 6vw, 64px) auto 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: left;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.browser-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--line);
}

.browser-bar span {
  margin: 0 auto;
  padding: 3px 18px;
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.75rem;
  transform: translateX(-24px);
}

.browser img,
.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(64px, 9vw, 112px) 0;
}

.section-soft {
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 720px;
  margin: 0 auto clamp(40px, 6vw, 64px);
  text-align: center;
}

.section-head p.eyebrow {
  margin: 0 0 16px;
  color: var(--accent-ink);
  font-size: 0.8125rem;
}

h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 730;
  text-wrap: balance;
}

:lang(zh-CN) h2 {
  letter-spacing: 0;
  line-height: 1.3;
}

.section-head p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.125rem;
  text-wrap: pretty;
}

/* Trust strip */

.trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: clamp(48px, 7vw, 80px);
  text-align: left;
}

.trust li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}

.trust .icon-wrap {
  width: 40px;
  height: 40px;
}

.trust strong {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.35;
}

.trust div > span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.icon-wrap {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-tint);
  color: var(--accent-ink);
}

/* Feature rows */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.feature + .feature {
  margin-top: clamp(64px, 9vw, 112px);
}

.feature--flip {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.feature--flip .feature-copy {
  order: 2;
}

.feature-copy .icon-wrap {
  margin-bottom: 20px;
}

h3 {
  font-size: clamp(1.4rem, 2.4vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 700;
  text-wrap: balance;
}

:lang(zh-CN) h3 {
  letter-spacing: 0;
  line-height: 1.35;
}

.feature-copy > p {
  margin-top: 14px;
  color: var(--muted);
  text-wrap: pretty;
}

.checks {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.checks li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9688rem;
  line-height: 1.55;
}

.checks .icon {
  margin-top: 0.2em;
  color: var(--accent-ink);
}

.shot {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

/* Card grid */

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

.card {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}

.card .icon-wrap {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 1.0625rem;
  line-height: 1.35;
  letter-spacing: 0;
  font-weight: 680;
}

.card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Privacy band (always dark) */

.band {
  position: relative;
  isolation: isolate;
  overflow: clip;
  background: var(--dark);
  color: var(--on-dark);
  --ring: #3fc17c;
}

.band::before {
  content: "";
  position: absolute;
  inset: auto -10% -40% auto;
  width: 720px;
  height: 720px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgb(21 174 92 / 0.28), transparent);
}

.band-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.band h2 {
  color: #ffffff;
}

.band .band-lead {
  margin-top: 16px;
  color: var(--on-dark-muted);
  font-size: 1.125rem;
  text-wrap: pretty;
}

.band .eyebrow {
  background: rgb(63 193 124 / 0.14);
  color: #6dd29b;
  margin-bottom: 18px;
}

.band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.band .btn-ghost {
  border-color: #3c4043;
  color: var(--on-dark);
}

.band .btn-ghost:hover {
  background: var(--dark-2);
}

.band-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--dark-2);
  border: 1px solid #3c4043;
}

.band-card .checks li {
  color: var(--on-dark);
}

.band-card .checks .icon {
  color: #3fc17c;
}

.band-card .caution {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #3c4043;
  color: var(--on-dark-muted);
  font-size: 0.9062rem;
  line-height: 1.6;
}

/* Permissions */

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

.perms .card h3 {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 650;
  color: var(--accent-ink);
}

.fine-print {
  margin-top: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Install */

.install {
  max-width: 520px;
  margin: 0 auto;
}

.install .card {
  padding: 32px 28px;
  text-align: center;
}

.install .card h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.install .card p {
  margin-top: 12px;
}

.install .card .btn {
  margin-top: 24px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0;
}

/* FAQ */

.faq {
  max-width: 780px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  font-weight: 650;
  font-size: 1.0625rem;
  line-height: 1.45;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
}

.faq details p {
  padding: 0 40px 22px 0;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 56px;
  color: var(--muted);
  font-size: 0.9062rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}

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

.footer-links a {
  padding: 4px 0;
  transition: color 0.18s ease;
}

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

.footer-copy {
  margin-top: 24px;
}

/* ---------- Prose pages (privacy, 404) ---------- */

.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 80px) 0 clamp(56px, 8vw, 96px);
}

.prose h1 {
  margin-top: 18px;
  font-size: clamp(2rem, 4.4vw, 2.875rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 750;
  text-wrap: balance;
}

:lang(zh-CN) .prose h1 {
  letter-spacing: 0;
  line-height: 1.3;
}

.prose .meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.prose h2 {
  margin: 2.4em 0 0.5em;
  font-size: 1.3125rem;
  letter-spacing: -0.01em;
  font-weight: 700;
}

:lang(zh-CN) .prose h2 {
  letter-spacing: 0;
}

.prose p {
  margin-top: 0.9em;
  line-height: 1.8;
}

.prose .back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.prose .back:hover {
  color: var(--fg);
}

.prose .back .icon {
  transform: rotate(180deg);
}

.callout {
  margin: 32px 0 36px;
  padding: 22px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.callout strong {
  display: block;
  margin-bottom: 14px;
  font-size: 1rem;
}

.prose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

/* ---------- Scroll reveal (pure CSS, progressive; content is always visible without support) ---------- */

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: reveal-up linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .trust {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 880px) {
  .nav-links {
    display: none;
  }
  .feature,
  .feature--flip,
  .band-grid {
    grid-template-columns: 1fr;
  }
  .feature--flip .feature-copy {
    order: 0;
  }
  .perms {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 1rem;
  }
  .container {
    width: min(100% - 32px, var(--max));
  }
  .nav {
    gap: 12px;
  }
  .lang-link span {
    display: none;
  }
  .cards,
  .trust {
    grid-template-columns: 1fr;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .browser-bar span {
    transform: none;
  }
  .band-card {
    padding: 22px;
  }
  .faq details p {
    padding-right: 0;
  }
}

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

@media print {
  .site-header {
    position: static;
  }
  .reveal {
    animation: none !important;
  }
}
