/* Marketing site styles. Deliberately plain CSS with no build step and no
   external fonts, so the site stays fast and cannot break the app Worker.
   Playbook 03: keep the marketing site static and separate. */

:root {
  --bg: #0f1420;
  --card: #1a2233;
  --line: #2a3550;
  --text: #e8ecf4;
  --dim: #8b96ad;
  --accent: #4f8cff;
  --ok: #3ecf8e;
  --warn: #f5a524;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: Consolas, Monaco, monospace; font-size: .9em; color: var(--text); }

/* ---- nav ---- */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  max-width: 1040px; margin: 0 auto; padding: 20px;
  border-bottom: 1px solid var(--line);
}
.nav .brand { font-weight: 700; font-size: 18px; color: var(--text); }
.nav nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.nav nav a { color: var(--dim); font-size: 14px; }
.nav nav a[aria-current] { color: var(--text); }
.nav .cta {
  background: var(--accent); color: #fff; padding: 8px 14px;
  border-radius: 8px; font-weight: 600;
}
.nav .cta:hover { text-decoration: none; opacity: .92; }

/* ---- layout ---- */
main { max-width: 1040px; margin: 0 auto; padding: 20px 20px 80px; }
main.prose { max-width: 860px; }
section { padding: 56px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }

h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.15; margin: 0 0 16px; letter-spacing: -.02em; }
h2 { font-size: clamp(22px, 3.4vw, 30px); margin: 0 0 18px; letter-spacing: -.01em; }
h3 { font-size: 17px; margin: 0 0 8px; }
.lede { font-size: 18px; color: var(--dim); max-width: 62ch; }
.count { font-size: 13px; color: var(--dim); font-weight: 400; }

/* ---- hero ---- */
.hero { padding: 72px 0 56px; }
.hero .buttons { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 14px; }
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 10px;
  font-weight: 600; font-size: 15px; border: 1px solid var(--line);
}
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); }
.trust { font-size: 13px; color: var(--dim); }

/* ---- cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.card p { color: var(--dim); font-size: 14px; margin: 0; }
.card.highlight { border-color: var(--accent); }

/* ---- steps ---- */
.steps { counter-reset: step; display: grid; gap: 18px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step .num {
  flex: 0 0 32px; height: 32px; border-radius: 50%;
  background: rgba(79, 140, 255, .15); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.step p { margin: 4px 0 0; color: var(--dim); font-size: 14px; }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 32px; }
th {
  text-align: left; color: var(--dim); font-weight: 500; font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 10px; border-bottom: 1px solid var(--line);
}
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.mono { font-family: Consolas, Monaco, monospace; font-size: 12.5px; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

/* ---- pricing ---- */
.price { font-size: 38px; font-weight: 700; margin: 6px 0 2px; }
.price span { font-size: 15px; color: var(--dim); font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 16px 0; }
.plan li { padding: 5px 0; color: var(--dim); font-size: 14px; }
.plan li::before { content: "✓"; color: var(--ok); margin-right: 8px; }

/* ---- misc ---- */
details {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px; background: var(--card);
}
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--dim); margin: 10px 0 0; font-size: 14px; }
.note {
  border: 1px solid rgba(245, 165, 36, .4); background: rgba(245, 165, 36, .08);
  border-radius: 10px; padding: 14px 16px; font-size: 14px; margin: 20px 0;
}
pre {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; overflow-x: auto; font-size: 13px;
}
input[type="search"] {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--text); font-size: 15px;
}
input[type="search"]:focus { outline: none; border-color: var(--accent); }
.foot { color: var(--dim); font-size: 14px; }
footer {
  max-width: 1040px; margin: 0 auto; padding: 28px 20px 60px;
  border-top: 1px solid var(--line); color: var(--dim); font-size: 13px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.centre { text-align: center; }

/* ---- screenshots ----
   width/height are set on every <img> in the markup so the browser reserves the
   right space before the file arrives - without that the page jumps as each
   screenshot loads, which is worst on the phone where the docs get read. */
figure { margin: 24px 0; }
figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: var(--radius);
}
figcaption { font-size: 13px; color: var(--dim); margin-top: 10px; }

/* ---- video ----
   preload="none" on every <video> plus an explicit poster: a docs page should
   not spend a visitor's bandwidth on a screencast they may never play. */
figure video {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #000;
}

/* =====================================================================
   Responsive
   =====================================================================
   The site was written desktop-first with flex-wrap as its only
   concession, which left three measurable faults on a phone - all found
   by scripts/check-responsive.mjs, none of them visible on a laptop:

     - tools.html scrolled sideways to 532px inside a 375px screen
     - the privacy table pushed the page 5px wide
     - nav links were 22px tall, well under a comfortable thumb

   Breakpoint at 700px: below it the layout is one column, and the only
   things that may exceed the viewport are deliberately scrollable. */

/* Never let a long unbroken string - a tool name, a URL, a token hint -
   push the whole page sideways. This is the single most common cause of
   a mobile page that slides. */
body { overflow-wrap: break-word; }

/* Any table wide enough to overflow scrolls inside its own box rather
   than taking the page with it. Belt and braces with .table-scroll:
   that class has to be remembered by whoever writes the markup, and on
   tools.html it was not. */
main table { max-width: 100%; }

@media (max-width: 700px) {
  /* ---- nav: real tap targets ---- */
  .nav { padding: 14px 16px; gap: 10px; }
  .nav nav { gap: 4px; width: 100%; }
  .nav nav a {
    /* 40px is a comfortable thumb. Padding rather than height so the
       text stays vertically centred. */
    display: inline-flex; align-items: center; min-height: 40px;
    padding: 0 10px; font-size: 15px;
  }
  .nav .cta { padding: 10px 16px; }
  .nav .brand { font-size: 17px; }

  /* ---- type and spacing ---- */
  main { padding: 16px 16px 56px; }
  .hero { padding: 40px 0 32px; }
  .lede { font-size: 16px; }
  .hero .buttons { gap: 10px; }
  .btn { width: 100%; text-align: center; }

  /* ---- tables ----
     Tool names are monospace and up to ~34 characters, and were
     white-space: nowrap. That is what made tools.html - the page with
     the most search traffic - scroll sideways on every phone. */
  table { font-size: 13px; }
  th, td { padding: 8px 6px; }
  td.mono {
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 12px;
  }

  /* Anything still too wide scrolls in place. */
  .table-scroll { -webkit-overflow-scrolling: touch; }

  /* The tools table is a two-column list of (name, description) repeated 222
     times. Squeezed into 375px the name column gets ~90px, which forces
     monospace identifiers to break mid-word - "ghl_add / _contac / t_tags".
     Stacking each row gives the name the full width, so it breaks at most
     once and stays readable. */
  table.tools, table.tools tbody, table.tools tr, table.tools td { display: block; }
  table.tools thead { display: none; }
  table.tools tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.tools td { border: 0; padding: 0; }
  table.tools td.mono {
    overflow-wrap: normal;
    font-size: 13px; color: var(--text); margin-bottom: 3px;
  }

  /* ---- footer ---- */
  footer { flex-direction: column; gap: 12px; padding: 22px 16px 48px; }
  footer nav { gap: 2px; }
  footer nav a {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px;
  }

  /* The brand is the "go home" target and needs the same treatment. */
  .nav .brand { display: inline-flex; align-items: center; min-height: 40px; }
}

/* Very narrow phones. Nothing should be assumed below this. */
@media (max-width: 380px) {
  .price { font-size: 32px; }
  th, td { padding: 7px 4px; }
}
