/* Agentcy Grow — single stylesheet for the whole resource hub.
   Light premium, matches agentcy.co.za live:
   --bg #ffffff, --panel #f2f2f2, --ink #1a1a1a, --accent #1a1a1a (buttons),
   periwinkle #839AFF (links/eyebrows), holo gradient for hero moments.
   Readability over decoration: line height, measure and contrast do the work. */

:root {
  --bg: #ffffff;
  --panel: #f2f2f2;
  --panel-2: #eeeeec;
  --line: rgba(26, 26, 26, 0.12);
  --line-2: rgba(26, 26, 26, 0.22);
  --text: #1a1a1a;
  --muted: #525252;
  --faint: #8e8e93;
  --accent: #1a1a1a;
  --accent-ink: #ffffff;
  --peri: #839AFF;
  --warn: #e8b84b;
  --radius: 16px;
  --measure: 68ch;
  --shadow: 0 18px 50px rgba(26, 26, 26, 0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--peri); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Focus must be obvious. This site is used by people on phones in shops and
   on site visits, often one-handed. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 22px; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 22px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: var(--accent-ink);
  padding: 12px 18px; border-radius: 0 0 10px 0; font-weight: 700; z-index: 100;
}
.skip:focus { left: 0; top: 0; }

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

.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.head-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 14px 22px; max-width: 1100px; margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 800; letter-spacing: -0.03em; font-size: 1.15rem;
}
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.brand small {
  display: block; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--faint); margin-top: 1px;
}
.head-nav { display: flex; align-items: center; gap: 20px; font-size: 0.86rem; color: var(--muted); }
.head-nav a { color: var(--muted); }
.head-nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block; border-radius: 11px; padding: 11px 18px;
  font-weight: 800; font-size: 0.88rem; border: 1px solid transparent;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
  cursor: pointer; font-family: inherit;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--peri); }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; }

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

.hero { padding: 76px 0 52px; border-bottom: 1px solid var(--line); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 6px 14px; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--peri);
  margin-bottom: 20px;
}
h1 {
  font-size: clamp(2rem, 5.2vw, 3.15rem); line-height: 1.08;
  letter-spacing: -0.035em; max-width: 18ch;
}
.lead { color: var(--muted); font-size: 1.08rem; max-width: 62ch; margin: 18px 0 26px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- the answer block (AEO) ----------
   This sits at the top of every article and is the paragraph an AI answer
   engine lifts. It is visually distinct so a human also reads it first. */

.answer {
  background: #f2f2f2;
  border: 1px solid rgba(26, 26, 26, 0.12);
  border-radius: var(--radius);
  padding: 22px 24px; margin: 0 0 30px;
}
.answer-label {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--peri); margin-bottom: 8px;
}
.answer p { font-size: 1.06rem; line-height: 1.6; max-width: 66ch; }

/* ---------- article layout ---------- */

.article-head { padding: 56px 0 30px; }
.article-head h1 { max-width: 24ch; }
.crumbs { font-size: 0.8rem; color: var(--faint); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }

.meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  margin-top: 20px; font-size: 0.8rem; color: var(--faint);
}
.tag {
  display: inline-block; border: 1px solid var(--line-2); border-radius: 999px;
  padding: 4px 12px; font-size: 0.72rem; color: var(--muted);
}

.prose { padding-bottom: 40px; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.65rem); letter-spacing: -0.025em;
  margin-top: 2.2em; line-height: 1.25; scroll-margin-top: 80px;
}
.prose h3 { font-size: 1.1rem; letter-spacing: -0.015em; margin-top: 1.9em; line-height: 1.3; }
.prose h4 { font-size: 0.98rem; margin-top: 1.7em; color: var(--muted); }
.prose p, .prose li { max-width: var(--measure); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.45em; }
.prose strong { color: #1a1a1a; }
.prose code {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.prose pre {
  background: #f2f2f2; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; overflow-x: auto; margin: 1.4em 0;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: 0.84rem; line-height: 1.6; }
.prose blockquote {
  border-left: 3px solid var(--peri); padding: 4px 0 4px 20px;
  color: var(--muted); font-style: italic;
}
.prose table {
  width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.9rem;
  display: block; overflow-x: auto; white-space: nowrap;
}
@media (min-width: 720px) { .prose table { display: table; white-space: normal; } }
.prose th, .prose td {
  border: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top;
}
.prose th { background: var(--panel-2); font-weight: 700; }

/* ---------- the download gate ---------- */

.gate {
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 20px; padding: 28px; margin: 40px 0 20px;
}
.gate.signed-in { border-color: rgba(131, 154, 255, 0.55); }
.gate h2 { font-size: 1.3rem; letter-spacing: -0.02em; margin-bottom: 8px; }
.gate p { color: var(--muted); font-size: 0.94rem; max-width: 58ch; }
.gate-includes { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }
.gate-includes span {
  font-size: 0.76rem; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; color: var(--muted);
}

.form-grid { display: grid; gap: 12px; max-width: 420px; margin-top: 18px; }
label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; background: #ffffff; color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px;
  padding: 12px 14px; font: inherit; font-size: 0.94rem;
}
input::placeholder { color: rgba(26, 26, 26, 0.38); }
input:focus { border-color: var(--peri); outline: none; box-shadow: 0 0 0 3px rgba(131, 154, 255, 0.22); }
.field-note { font-size: 0.76rem; color: var(--faint); margin-top: 5px; }
.form-msg { font-size: 0.86rem; margin-top: 12px; min-height: 1.2em; }
.form-msg[data-tone="error"] { color: #c0392b; }
.form-msg[data-tone="ok"] { color: #1a1a1a; }
.form-msg[data-tone="info"] { color: var(--warn); }

.tabs { display: flex; gap: 8px; margin-bottom: 6px; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--faint); font: inherit; font-weight: 700; font-size: 0.86rem;
  padding: 8px 4px; cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--peri); }

/* ---------- listing ---------- */

.section { padding: 54px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
h2.section-h { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -0.03em; }
.section-sub { color: var(--muted); max-width: 62ch; margin: 10px 0 26px; }

.cat { margin-bottom: 38px; }
.cat-name {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--peri); margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.cat-name::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(288px, 1fr)); gap: 14px; }
.card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; color: var(--text);
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}
a.card:hover { border-color: rgba(131, 154, 255, 0.55); background: var(--panel-2); transform: translateY(-2px); text-decoration: none; }
.card h3 { font-size: 1.04rem; letter-spacing: -0.015em; margin-bottom: 8px; line-height: 1.35; }
.card p { color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.card .more {
  display: inline-block; margin-top: 14px; font-size: 0.74rem; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--peri);
}

/* ---------- toc + sidebar ---------- */

.article-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; align-items: start; }
.toc {
  position: sticky; top: 84px; font-size: 0.85rem;
  border-left: 1px solid var(--line); padding-left: 18px;
}
.toc-label { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.toc a { display: block; color: var(--muted); padding: 5px 0; line-height: 1.4; }
.toc a:hover { color: var(--peri); text-decoration: none; }

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

.site-foot { border-top: 1px solid var(--line); background: #f2f2f2; padding: 48px 0 28px; margin-top: 20px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.foot-grid p.statement { color: var(--muted); font-size: 0.88rem; max-width: 34ch; margin-top: 10px; }
.foot-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.foot-nav { display: flex; flex-direction: column; gap: 8px; font-size: 0.86rem; }
.foot-nav a { color: var(--muted); }
.foot-nav a:hover { color: var(--text); }
.foot-bottom {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border-top: 1px solid var(--line); margin-top: 36px; padding-top: 20px;
  font-size: 0.74rem; color: var(--faint);
}

/* ---------- notices ---------- */

.notice {
  border-radius: 12px; padding: 14px 18px; font-size: 0.88rem;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--muted);
}
.notice strong { color: var(--text); }
.notice-warn { border-color: rgba(232, 184, 75, 0.42); }

.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;
}

/* ---------- responsive ---------- */

@media (max-width: 940px) {
  .article-body { grid-template-columns: 1fr; gap: 28px; }
  .toc { position: static; border-left: 0; border-top: 1px solid var(--line); padding: 22px 0 0; }
}
@media (max-width: 720px) {
  .head-nav { display: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  h1 { max-width: none; }
  .gate { padding: 22px; }
}
@media (max-width: 480px) {
  .foot-grid { grid-template-columns: 1fr; }
  body { font-size: 16px; }
}

/* ---------------------------------------------------------------------------
   Cost calculator
   ---------------------------------------------------------------------------
   Sits under .wrap-narrow so it stays a single readable column: this is a form
   people fill in on a phone while standing in a warehouse, so the labels are
   large, the inputs are full-width, and the running total is the one thing
   given real visual weight. */
.hero-fine {
  margin: 1.25rem auto 0;
  max-width: 52ch;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--muted, #525252);
}
.hero-fine a { color: var(--peri, #839AFF); }

.calc { margin: 0; }

.calc-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 22px 22px 8px;
  margin: 0 0 18px;
}
.calc-block legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text, #1a1a1a);
}
.calc-n {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent, #1a1a1a);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.calc-why {
  margin: 0 0 18px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--muted, #525252);
}

.calc-row { margin-bottom: 16px; }
.calc-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9375rem;
  color: var(--text, #1a1a1a);
}
/* 16px minimum. Anything smaller makes iOS Safari zoom the viewport on
   focus, which scrolls the form out from under the person typing. */
.calc-row input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--text, #1a1a1a);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.calc-row input:focus-visible {
  outline: 3px solid var(--peri, #839AFF);
  outline-offset: 1px;
}
.calc-row input::placeholder { color: #64707b; }

.calc-out {
  margin: 4px 0 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 0.9375rem;
  color: var(--muted, #525252);
}
.calc-out b { color: var(--text, #1a1a1a); font-weight: 600; }

.calc-total {
  margin: 26px 0 0;
  padding: 24px 22px;
  border: 1px solid rgba(26, 26, 26, 0.16);
  border-radius: 14px;
  background: #f2f2f2;
  text-align: center;
}
.calc-total-label {
  margin: 0 0 6px;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted, #525252);
}
.calc-total-figure {
  margin: 0;
  font-size: clamp(2.25rem, 8vw, 3.25rem);
  font-weight: 700;
  line-height: 1.05;
  color: #1a1a1a;
  /* Rand amounts can run to six figures and the whole point is that the
     number is readable without a horizontal scroll on a phone. */
  font-variant-numeric: tabular-nums;
}
.calc-total-note {
  margin: 12px 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted, #525252);
}

.calc-noscript {
  margin-top: 22px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.calc-noscript h2 { margin: 0 0 10px; font-size: 1.125rem; }
.calc-noscript ul { margin: 0; padding-left: 20px; }
.calc-noscript li { margin-bottom: 10px; line-height: 1.55; }

.calc-close { margin-top: 44px; }
.calc-close h2 { margin: 0 0 12px; font-size: 1.5rem; }
.calc-close p { line-height: 1.65; }
.calc-fine { font-size: 0.875rem; color: var(--muted, #525252); }

@media (max-width: 480px) {
  .calc-block { padding: 18px 16px 6px; }
  .calc-block legend { font-size: 1rem; }
}

@media print {
  .site-head, .toc, .gate, .site-foot, .head-nav { display: none; }
  body { background: #fff; color: #000; }
  .answer { border-color: #999; background: none; }
  /* Printing a half-filled calculator is only useful if the inputs show
     their values, which is what this block preserves. */
  .calc-total { background: none; }
  .calc-total-figure { color: #000; }
}
