/*
 * site.css — Hemly satellite site (COLD_START §4).
 *
 * Tokens are the same values as `src/styles/tokens.css` (DESIGN_SPEC §1); only the
 * subset a marketing page needs is copied here, because this site is a standalone
 * static bundle with no build step for CSS. If the palette changes, change it there
 * first — tokens.css stays the authority.
 *
 * Rules this file obeys:
 *   - no Vinted teal (#007782 family) anywhere (docs/CLAUDE.md §红线 5)
 *   - system font stack only, no @import, no Google Fonts, no external request at all
 *   - money is tabular and the largest thing on the card
 *   - light theme only, matching the extension
 */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-muted: #efeae1;

  --ink: #1f1d1a;
  --ink-secondary: #4a463f;
  --ink-muted: #6f6a61;
  --ink-faint: #8b857b;

  --border: #e3ddd3;
  --border-strong: #c9c2b6;

  --primary: #3e6b4f;
  --primary-hover: #2f5540;
  --primary-ink: #faf7f2;
  --primary-soft: rgba(62, 107, 79, 0.08);
  --primary-soft-strong: rgba(62, 107, 79, 0.22);

  --amber: #d9a441;
  --amber-ink: #8a6413;
  --amber-soft: rgba(217, 164, 65, 0.16);
  --amber-border: rgba(217, 164, 65, 0.4);

  --success: #2f7d46;
  --success-soft: rgba(47, 125, 70, 0.1);
  --success-border: rgba(47, 125, 70, 0.25);

  --alert: #c4533a;
  --alert-soft: rgba(196, 83, 58, 0.1);
  --alert-border: rgba(196, 83, 58, 0.25);

  --radius: 8px;
  --radius-sm: 4px;
  --radius-pill: 999px;

  --font-sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
    Arial, 'Noto Sans', sans-serif;
  /*
   * Site-only, with no twin in tokens.css: the extension has no monospace surface, and
   * this exists for one thing — the licence key on /activate/, where a seller has to
   * read 29 characters back to themselves without confusing 0 and O. Still system
   * fonts only, so it stays a zero-request page.
   */
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas,
    'Liberation Mono', monospace;
  --numeric-features: 'tnum' 1, 'lnum' 1;

  --shadow-card: 0 1px 2px rgba(31, 29, 26, 0.06);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary-soft-strong);

  --measure: 68ch;
  --page-max: 960px;
}

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

/*
 * The install CTA ships as `<a class="btn" hidden>` and is revealed only once
 * `site-config.js` has a store URL. Any author `display` rule (`.btn` sets
 * `inline-block`) outranks the UA stylesheet's `[hidden] { display: none }`, so the
 * hidden state has to be restated here or the placeholder button shows up next to
 * its own "coming soon" note.
 */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: var(--primary-ink);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  z-index: 10;
}

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

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- numerals & labels (mirrors tokens.css helpers) --------------------- */

.num {
  font-feature-settings: var(--numeric-features);
  font-variant-numeric: tabular-nums lining-nums;
}

.label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0;
}

/* ---- header ------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand svg {
  display: block;
}

.brand small {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-faint);
}

nav.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

nav.langs a {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 13px;
  text-decoration: none;
  color: var(--ink-secondary);
}

nav.langs a:hover {
  border-color: var(--border-strong);
}

nav.langs a[aria-current='true'] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
}

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

main {
  display: block;
  padding: 36px 0 8px;
}

h1 {
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-weight: 700;
}

.lead {
  font-size: 17px;
  color: var(--ink-secondary);
  max-width: var(--measure);
  margin: 0 0 28px;
}

h2 {
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 36px 0 10px;
  font-weight: 600;
}

h3 {
  font-size: 16px;
  margin: 24px 0 6px;
  font-weight: 600;
}

p,
li {
  max-width: var(--measure);
  color: var(--ink-secondary);
}

article p {
  margin: 0 0 14px;
}

article ul {
  padding-left: 20px;
  margin: 0 0 14px;
}

article li {
  margin-bottom: 6px;
}

strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---- calculator card ---------------------------------------------------- */

.calc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px;
  max-width: 560px;
}

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

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
  margin-bottom: 4px;
}

.field .hint {
  display: block;
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 400;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 10px;
}

.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.input-wrap .cur {
  font-size: 14px;
  color: var(--ink-muted);
  min-width: 1.4em;
  text-align: center;
}

.calc input[type='text'],
.calc input[type='number'],
.activate-card input[type='text'] {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 0;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  font-feature-settings: var(--numeric-features);
  font-variant-numeric: tabular-nums lining-nums;
}

.calc input:focus,
.activate-card input:focus {
  outline: none;
  box-shadow: none;
}

.calc select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}

.calc select:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

@media (max-width: 480px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

hr.rule {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0 14px;
}

.breakdown {
  margin: 0 0 16px;
  font-size: 14px;
}

.breakdown .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  color: var(--ink-secondary);
}

.breakdown .row .v {
  font-feature-settings: var(--numeric-features);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
}

.result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
}

.result .hero {
  font-size: clamp(30px, 7vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-feature-settings: var(--numeric-features);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--success);
}

.result[data-sign='negative'] .hero {
  color: var(--alert);
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  background: var(--success-soft);
  border: 1px solid var(--success-border);
  color: var(--success);
  font-feature-settings: var(--numeric-features);
  font-variant-numeric: tabular-nums lining-nums;
}

.result[data-sign='negative'] .pill {
  background: var(--alert-soft);
  border-color: var(--alert-border);
  color: var(--alert);
}

.calc-note {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-faint);
  max-width: none;
}

.calc-note code {
  font-size: 11px;
  color: var(--ink-muted);
}

/* ---- CTA ---------------------------------------------------------------- */

.cta-band {
  margin: 28px 0 8px;
  padding: 20px;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 560px;
}

.cta-band p {
  margin: 0 0 14px;
  color: var(--ink-secondary);
  font-size: 15px;
}

.btn {
  display: inline-block;
  padding: 11px 18px;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid var(--primary);
}

.btn:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--primary-ink);
}

.cta-pending {
  display: inline-block;
  padding: 11px 16px;
  border-radius: var(--radius);
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  color: var(--amber-ink);
  font-weight: 600;
  font-size: 14px;
}

.cta-sub {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-faint);
}

/* ---- FAQ / policy blocks ------------------------------------------------ */

.qa {
  border-top: 1px solid var(--border);
  padding: 20px 0 4px;
  max-width: var(--measure);
}

.qa:first-of-type {
  border-top: 0;
}

.qa h2 {
  margin-top: 0;
}

.callout {
  margin: 24px 0;
  padding: 14px 16px;
  border: 1px solid var(--amber-border);
  background: var(--amber-soft);
  border-radius: var(--radius);
  max-width: var(--measure);
}

.callout p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.meta {
  font-size: 13px;
  color: var(--ink-faint);
  margin: 0 0 24px;
}

/* ---- activation page (/activate/) --------------------------------------- */

/*
 * The post-checkout receipt. Same card as the calculator, but the licence key is what
 * the money bought, so it gets the same treatment the net-profit figure gets on the
 * calculator: the largest thing on the card, monospaced, and selectable in one click.
 */

.activate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px;
  max-width: 560px;
  margin: 0 0 20px;
}

.activate-card .activate-title {
  margin: 0 0 10px;
  font-size: 19px;
}

.activate-card p {
  margin: 0 0 12px;
}

.activate-card p:last-child {
  margin-bottom: 0;
}

.activate-card ul,
.activate-card ol {
  padding-left: 22px;
  margin: 0 0 12px;
}

.activate-card li {
  margin-bottom: 8px;
}

.activate-card code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  padding: 1px 4px;
}

.key-box {
  margin: 6px 0 14px;
  padding: 14px 16px;
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.license-key {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(18px, 5.2vw, 27px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  /* 29 characters must not push a 320px screen sideways. */
  overflow-wrap: anywhere;
  /* One click selects the whole key, for anyone who distrusts copy buttons. */
  -webkit-user-select: all;
  user-select: all;
}

.activate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0 0 12px;
}

button.btn {
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
}

.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: default;
}

.btn[disabled]:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-secondary[disabled]:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}

.copy-status,
.retry-note {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.retry-note:empty {
  display: none;
}

.activate-plan {
  font-size: 14px;
  color: var(--ink-muted);
}

.steps li {
  margin-bottom: 8px;
}

.activate-note {
  font-size: 13px;
  color: var(--ink-faint);
}

.lookup-error {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--alert);
}

.activate-help {
  max-width: var(--measure);
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.activate-help h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.activate-help p {
  font-size: 14px;
  margin: 0;
}

/*
 * A 29-character key on a 320px phone: the card gives its padding back so the key
 * wraps at one of its own hyphens instead of splitting a group in half.
 */
@media (max-width: 420px) {
  .activate-card {
    padding: 16px;
  }

  .key-box {
    padding: 12px;
  }
}

/* ---- checkout page (/buy/) ---------------------------------------------- */

/*
 * Three plans, and the same card as everywhere else on this site. The price is the
 * largest thing on it — the calculator's rule for the net figure and /activate/'s rule
 * for the licence key, applied to the one number a buyer is deciding about.
 *
 * The yearly card is the recommended one and says so in words ("Best value") as well as
 * in colour, because a border alone is not a message anyone can read out.
 */

.plan-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  max-width: 760px;
}

@media (max-width: 640px) {
  .plan-list {
    grid-template-columns: 1fr;
    max-width: 560px;
  }
}

.plan {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px;
}

.plan-featured {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.plan .label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.plan .pill {
  letter-spacing: 0;
  text-transform: none;
  font-size: 11px;
}

.plan-price {
  margin: 0;
  font-size: clamp(26px, 5vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

/*
 * Spacing lives in the markup (a plain space, or none before a slash), not here: the
 * period is read aloud straight after the amount, and a margin is not a space to a
 * screen reader.
 */
.plan-period {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-muted);
}

.plan-line {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

/* The button sits on the floor of the card, so three cards of unequal copy still line up. */
.plan .btn {
  margin-top: auto;
  align-self: stretch;
  text-align: center;
}

.plans-note {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--amber-border);
  background: var(--amber-soft);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink);
  max-width: 560px;
}

.plans-note:empty {
  display: none;
}

/* ---- footer ------------------------------------------------------------- */

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
}

.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 14px;
}

.site-footer .disclaimer {
  font-size: 13px;
  color: var(--ink-faint);
  margin: 0;
  max-width: none;
}

.site-footer .disclaimer strong {
  color: var(--ink-muted);
}
