:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #2d3748;
  --ink-soft: #4a5568;
  --muted: #718096;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --accent: #6247c0;            /* sparq primary purple, matches POS app primary */
  --accent-soft: #f3f0fb;        /* very pale purple */
  --accent-ink: #41297f;         /* deep purple, for high-contrast text on pale bg */
  --accent-2: #5b21b6;           /* violet-800, purple accent */
  --accent-2-soft: #f5f3ff;      /* violet-50 */
  --good: #2f855a;
  --good-soft: #e6f4ec;
  --warn: #b7791f;
  --warn-soft: #fefcbf;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4rem; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 800px; margin: 0 auto; padding: 0 1.25rem; }
.wrap.wide { max-width: 1080px; }

/* ---- Top nav ---- */
.top-nav {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 0.9rem 0;
  font-size: 0.95rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-nav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.top-nav-brand { font-weight: 700; color: var(--ink); }
.top-nav-brand .accent { color: var(--accent); }
.top-nav a { color: var(--ink-soft); }
.top-nav a.current { color: var(--accent); font-weight: 600; }

/* Inline brand mention in body copy. Picks up the primary blue and a
   slight weight bump so "fiveanddime" doesn't disappear into the prose. */
.brand { color: var(--accent); font-weight: 600; }

/* ---- Hero ---- */
.hero-band {
  background:
    radial-gradient(circle at 85% 15%, rgba(91, 33, 182, 0.08), transparent 55%),
    linear-gradient(180deg, #f5faff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 3rem 0 2.5rem;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: var(--accent-2-soft);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero-tagline {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 0 1.5rem;
}
.hero-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.hero-meta strong { color: var(--ink); }

/* ---- Topic grid (used on tutorials/index.html) ---- */
.section { padding: 3rem 0; }
.section h2 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.topic-group { margin-bottom: 3rem; }
.topic-group:last-child { margin-bottom: 0; }
.topic-group-title {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 1.25rem;
  padding: 0 0.25rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (max-width: 720px) {
  .topic-grid { grid-template-columns: 1fr; }
}
.topic-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  color: var(--ink);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.topic-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.10);
  text-decoration: none;
}
.topic-card.coming-soon { opacity: 0.5; cursor: not-allowed; }
.topic-card.coming-soon:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}
.topic-card-step {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.topic-card-step.coming-soon-pill { color: var(--muted); }
.topic-card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.35rem; }
.topic-card-detail { font-size: 0.92rem; color: var(--ink-soft); margin: 0; }

/* ---- Step strip (progress) ---- */
.step-strip {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0 2rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.step-strip a,
.step-strip-current {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem 0.45rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  white-space: nowrap;
}
.step-strip a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.step-strip-current {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 600;
}
.step-strip .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.step-strip-current .step-num {
  background: white;
  color: var(--accent);
}

/* ---- Step page body ---- */
main { padding: 2rem 0 4rem; }
.step-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
h1.step-title {
  font-size: clamp(1.8rem, 4vw, 2.25rem);
  margin: 0 0 0.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.step-lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}
main h2 {
  font-size: 1.3rem;
  margin: 2rem 0 0.5rem;
  font-weight: 700;
}
main h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
  font-weight: 700;
}
main p { margin: 0 0 1rem; }
main ol, main ul { margin: 0 0 1rem 1.4rem; padding: 0; }
main li { margin-bottom: 0.4rem; }
main code {
  font-size: 0.92em;
  background: var(--line-soft);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* ---- Callouts ---- */
.callout {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
}
.callout > strong { display: block; margin-bottom: 0.3rem; color: var(--accent-ink); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.warn > strong { color: var(--warn); }
.callout.good { border-left-color: var(--good); background: var(--good-soft); }
.callout.good > strong { color: var(--good); }

.checkpoint {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--good-soft);
  border-left: 4px solid var(--good);
  border-radius: 0 8px 8px 0;
}
.checkpoint > strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--good);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---- Substep card ---- */
.substep {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.substep-num {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.substep h3 {
  margin: 0 0 0.5rem !important;
  font-size: 1.1rem;
}
.substep p:last-child { margin-bottom: 0; }

/* ---- Screenshot placeholder ---- */
.screenshot { margin: 1.5rem 0; }
.screenshot-placeholder {
  background: var(--accent-soft);
  border: 2px dashed var(--accent);
  border-radius: 10px;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--accent-ink);
}
.screenshot-placeholder .ph-tag {
  display: inline-block;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}
.screenshot-placeholder .ph-desc {
  display: block;
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 520px;
  margin: 0 auto;
}
.screenshot img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
}
.screenshot figcaption {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ---- Annotation overlays ----
   Highlight a button or field in a screenshot. Position percentages are
   relative to the .screenshot-frame wrapper, which sits directly around
   the <img>. Ring/box left+top are the top-left corner of the highlighted
   region. Badge left+top point at the CENTER of the badge (we translate
   by -50% on both axes). */
.screenshot-frame {
  position: relative;
  line-height: 0;
}
.annotation {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}
.annotation.ring,
.annotation.box {
  border: 3px solid #dc2626;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85), 0 0 14px rgba(220, 38, 38, 0.45);
}
.annotation.ring { border-radius: 999px; }
.annotation.box  { border-radius: 6px; }
.annotation.badge {
  width: 28px;
  height: 28px;
  background: #dc2626;
  color: white;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
  border: 2px solid white;
}
.annotation.badge::before { content: attr(data-num); }
@media (max-width: 600px) {
  .annotation.badge { width: 22px; height: 22px; font-size: 0.72rem; border-width: 1.5px; }
  .annotation.ring, .annotation.box { border-width: 2px; }
}

/* ---- Example tables (bundle tutorial worked examples) ---- */
.example-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.example-table th,
.example-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
}
.example-table tr:last-child td { border-bottom: 0; }
.example-table th {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.85rem;
}
.example-table tr.deal-fires td { color: var(--good); font-weight: 600; }

/* ---- Big primary CTA (overview page "Start" button) ---- */
.cta-row {
  margin: 2rem 0 1rem;
}
a.cta-primary {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.85rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.05rem;
}
a.cta-primary:hover {
  background: var(--accent-ink);
  text-decoration: none;
}

/* ---- Step nav (prev/next at bottom of each step) ---- */
.step-nav {
  display: flex;
  gap: 1rem;
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.step-nav-link {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  flex: 1 1 0;
  min-width: 0;
}
.step-nav-link:hover {
  border-color: var(--accent);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}
.step-nav-link.next { text-align: right; }
.step-nav-direction {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  font-weight: 600;
}
.step-nav-title {
  font-weight: 600;
  color: var(--ink);
  font-size: 1rem;
}
@media (max-width: 540px) {
  .step-nav { flex-direction: column; }
  .step-nav-link.next { text-align: left; }
}

/* ---- "What's next" footer card ---- */
.next-steps {
  margin-top: 3rem;
  padding: 1.75rem 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.next-steps h2 { font-size: 1.2rem; margin: 0 0 0.5rem; }
.next-steps ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
.next-steps li {
  padding: 0.6rem 0;
  border-top: 1px solid var(--line-soft);
}
.next-steps li:first-child { border-top: none; }

footer {
  padding: 2rem 0 3rem;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 4rem;
}
