/* Clarity Commerce, shared styles. Mobile first; desktop rules in min-width queries. */

:root {
  --navy: #0E3D4A;
  --mint: #2DD4A7;
  --green: #19694F;
  --brick: #9C3D2A;
  --white: #FFFFFF;
  --panel: #F3F6F8;
  --line: #D9E1E6;
  --ink: #16262D;          /* body text */
  --ink-soft: #4A5C64;     /* secondary text, 7:1 on white */
  --seg-fees: #A9B7BF;     /* chart: fees and other */

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --wrap: 1120px;
  --gutter: 16px;
  --radius: 8px;
}

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--navy);
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: 1.25rem; font-weight: 600; }
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: .35em; }

a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green); }

:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--mint);
  border-radius: 2px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }

.skip-link {
  position: absolute; left: 8px; top: -60px;
  background: var(--navy); color: var(--white);
  padding: 8px 14px; border-radius: var(--radius); z-index: 100;
}
.skip-link:focus { top: 8px; color: var(--white); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 22px;
  border-radius: var(--radius); border: 2px solid transparent;
  font: 600 1rem/1.2 var(--sans); text-decoration: none; text-align: center;
  cursor: pointer;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: #0A2E38; color: var(--white); }
.btn-secondary { background: var(--white); color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: var(--panel); color: var(--navy); }
.btn-mint { background: var(--mint); color: var(--navy); }
.btn-mint:hover { background: #5BE0BC; color: var(--navy); }
.btn-ghost { color: var(--white); border-color: rgba(255,255,255,.7); }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: var(--white); }
.btn-small { min-height: 40px; padding: 8px 16px; font-size: .9375rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.5em 0 1em; }
.btn-row .btn { flex: 1 1 100%; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--white); position: relative; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }

.wordmark {
  font-family: var(--serif); font-weight: 700; font-size: 1.375rem;
  color: var(--navy); text-decoration: none; letter-spacing: -.01em; white-space: nowrap;
}
.wordmark:hover { color: var(--navy); }
.wordmark .dot { color: var(--mint); }

.nav-toggle {
  display: none;
  min-height: 44px; padding: 8px 16px;
  background: var(--white); color: var(--navy);
  border: 2px solid var(--navy); border-radius: var(--radius);
  font: 600 1rem var(--sans); cursor: pointer;
}
.js .nav-toggle { display: inline-flex; align-items: center; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li + li { margin-top: 0; }
.site-nav a:not(.btn) {
  display: block; padding: 12px 0;
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.site-nav a:not(.btn):hover { color: var(--green); }
.site-nav a[aria-current="page"] { color: var(--navy); text-decoration: underline; text-decoration-color: var(--mint); text-decoration-thickness: 3px; text-underline-offset: 6px; }

/* Mobile: without JS the nav is a plain list under the logo; with JS it is a toggled panel. */
.site-header .header-inner { flex-wrap: wrap; }
.site-nav { width: 100%; padding: 0 0 16px; }
.js .site-nav { display: none; }
.js .site-nav.open { display: block; }
.site-nav .btn { width: 100%; margin-top: 8px; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-tight { padding: 32px 0; }
.panel { background: var(--panel); }
.page-head { padding: 48px 0 16px; }
.page-head .lede { max-width: 680px; }
.lede { font-size: 1.1875rem; color: var(--ink-soft); }
.eyebrow { font: 600 .8125rem/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--green); margin-bottom: .75em; }
.note { color: var(--ink-soft); font-size: .9375rem; }
.caption { color: var(--ink-soft); font-size: .875rem; }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 56px; }
.hero-grid { display: grid; gap: 32px; }
.hero h1 { font-size: clamp(2rem, 7vw, 3.25rem); }
.hero-note { font-weight: 500; color: var(--green); margin-top: .5em; }

.report-figure { margin: 0; }
.report-figure img { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(14,61,74,.12); }
.report-figure figcaption { margin-top: 10px; font-size: .875rem; color: var(--brick); font-weight: 600; }
.hero .report-figure { max-width: 420px; }

/* ---------- Stacked bar: where $100 goes ---------- */
.stackbar {
  display: flex; gap: 2px; height: 56px; margin: 24px 0 16px;
  border-radius: 4px; overflow: hidden;
}
.seg { display: flex; align-items: center; justify-content: center; color: var(--white); font-weight: 600; font-size: .9375rem; min-width: 0; }
.seg-product { flex: 42 1 0; background: var(--navy); }
.seg-ads     { flex: 30 1 0; background: var(--brick); }
.seg-fees    { flex: 15 1 0; background: var(--seg-fees); color: var(--ink); }
.seg-kept    { flex: 13 1 0; background: var(--green); }

.stack-legend { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.stack-legend li { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 12px; margin: 0; padding: 6px 0; border-bottom: 1px solid var(--line); }
.stack-legend .swatch { width: 14px; height: 14px; border-radius: 3px; }
.stack-legend .val { font-variant-numeric: tabular-nums; font-weight: 600; }
.stack-legend .kept .val, .stack-legend .kept .name { color: var(--green); font-weight: 700; }

/* ---------- Cards ---------- */
.cards { display: grid; gap: 16px; list-style: none; padding: 0; margin: 24px 0 0; }
.cards li { margin: 0; }
.card {
  display: block; height: 100%; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  text-decoration: none; color: var(--ink);
}
a.card:hover { border-color: var(--navy); color: var(--ink); }
a.card:hover h3 { color: var(--green); }
.card h3, .card .h3-like { margin-bottom: .35em; font-size: 1.25rem; font-weight: 600; }
a.card:hover .h3-like { color: var(--green); }
.card p { margin: 0; color: var(--ink-soft); }
.card .more { display: inline-block; margin-top: 12px; color: var(--navy); font-weight: 600; }

/* ---------- Lists, steps, notes ---------- */
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 30px; }
.checklist li::before {
  content: ""; position: absolute; left: 4px; top: .45em;
  width: 12px; height: 7px; border-left: 2.5px solid var(--green); border-bottom: 2.5px solid var(--green);
  transform: rotate(-45deg);
}
.nolist { list-style: none; padding: 0; }
.nolist li { position: relative; padding-left: 30px; }
.nolist li::before { content: ""; position: absolute; left: 4px; top: .75em; width: 12px; height: 2.5px; background: var(--brick); }

.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 16px; }
.steps > li { counter-increment: step; position: relative; padding: 20px 20px 20px 72px; background: var(--panel); border-radius: var(--radius); margin: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: 20px; top: 20px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: grid; place-items: center; font: 700 1.0625rem var(--serif);
}
.steps h3, .steps h2 { margin-bottom: .25em; font-size: 1.1875rem; }
.steps p { margin: 0; }

.timeline { list-style: none; padding: 0; border-left: 3px solid var(--mint); margin-left: 6px; }
.timeline li { position: relative; padding: 0 0 20px 24px; margin: 0; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: .4em; width: 15px; height: 15px; border-radius: 50%; background: var(--white); border: 3px solid var(--navy); }
.timeline strong { display: block; color: var(--navy); }

.callout { border-left: 4px solid var(--navy); background: var(--panel); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin: 24px 0; }
.callout-warn { border-left-color: var(--brick); }
.callout p:last-child { margin-bottom: 0; }

.two-col { display: grid; gap: 32px; }
.report-layout { display: grid; gap: 40px; }

/* Tiers */
.tiers { display: grid; gap: 16px; list-style: none; padding: 0; margin: 24px 0; }
.tiers li { margin: 0; padding: 24px; border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: var(--radius); }
.tiers h3 { margin-bottom: .25em; }
.tiers .fits { color: var(--ink-soft); margin: 0; }

/* Annotated report */
.annotations { list-style: none; padding: 0; counter-reset: note; }
.annotations li { counter-increment: note; position: relative; padding: 0 0 20px 48px; margin: 0; }
.annotations li::before {
  content: counter(note); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%; background: var(--mint); color: var(--navy);
  display: grid; place-items: center; font-weight: 700;
}
.annotations h3 { font-size: 1.125rem; margin-bottom: .2em; }
.annotations p { margin: 0; }
.num { font-variant-numeric: tabular-nums; color: var(--green); font-weight: 600; }
.num-ads { color: var(--brick); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 40px 18px 0; position: relative;
  font: 600 1.125rem/1.4 var(--sans); color: var(--navy);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 8px; top: 14px; font-size: 1.5rem; font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 18px; }

/* Posts */
.post { padding: 48px 0 32px; }
.post h2 { font-size: 1.5rem; margin-top: 1.6em; }
.post-meta { color: var(--ink-soft); font-size: .9375rem; }
.post-list { list-style: none; padding: 0; display: grid; gap: 16px; }
.post-list li { margin: 0; }

/* ---------- Form ---------- */
.form { display: grid; gap: 20px; max-width: 560px; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; color: var(--navy); }
.field .hint { display: block; font-weight: 400; font-size: .875rem; color: var(--ink-soft); }
.field input[type="text"], .field input[type="email"], .field input[type="url"], .field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  font: 400 1rem var(--sans); color: var(--ink);
  border: 1.5px solid #7A8C94; border-radius: var(--radius); background: var(--white);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--navy); }
fieldset.field { border: 0; padding: 0; margin: 0; }
.field label.check { display: flex; margin: 0; align-items: center; gap: 10px; min-height: 40px; font-weight: 400; color: var(--ink); }
.check input { width: 20px; height: 20px; accent-color: var(--navy); }
.contact-email { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 1.0625rem; }
.contact-address { font-weight: 600; color: var(--navy); user-select: all; overflow-wrap: anywhere; }
.form-status { min-height: 1.5em; font-weight: 500; color: var(--ink-soft); }
.form-status.is-ok { color: var(--green); }
.form-status.is-error { color: var(--brick); }
/* Honeypot: off-screen, not display:none, so simple bots still see and fill it. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.btn:disabled { opacity: .6; cursor: wait; }

/* ---------- Home audience line ---------- */
.audience { font-weight: 600; color: var(--green); margin: -.25em 0 .75em; }

/* ---------- GST/HST checker ---------- */
.gst-form { max-width: none; }
.gst-grid { display: grid; gap: 16px; margin-top: 16px; }
.gst-grid .field label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.gst-grid .q-months { font-weight: 400; }
.field input[aria-invalid="true"] { border-color: var(--brick); border-width: 2px; }
.gst-result:empty { display: none; }
.gst-result { border-left: 4px solid var(--navy); background: var(--panel); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; }
.gst-result p { margin: 0 0 .6em; }
.gst-result p:last-child { margin-bottom: 0; }
.gst-status { font: 700 1.25rem/1.3 var(--serif); color: var(--navy); }
.gst-result.is-over-quarter, .gst-result.is-over-rolling, .gst-result.is-error { border-left-color: var(--brick); }
.gst-result.is-over-quarter .gst-status, .gst-result.is-over-rolling .gst-status, .gst-result.is-error .gst-status { color: var(--brick); }
.gst-result.is-below { border-left-color: var(--green); }
.gst-result.is-below .gst-status { color: var(--green); }
.gst-next { color: var(--ink-soft); font-size: .9375rem; }
.source { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 16px; font-size: .9375rem; color: var(--ink-soft); }
.source p { margin: .25em 0; }
.source a { overflow-wrap: anywhere; }

/* ---------- Templates page ---------- */
.price { font: 700 1.5rem var(--serif); color: var(--navy); }
.badge-soon { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 22px; border-radius: var(--radius); background: var(--panel); color: var(--ink-soft); font-weight: 600; border: 2px dashed var(--line); }
.tabs-list { display: grid; grid-template-columns: 1fr; gap: 4px 24px; margin: 0 0 24px; }
.tabs-list dt { font-weight: 600; color: var(--navy); margin-top: 12px; }
.tabs-list dd { margin: 0; color: var(--ink-soft); }
.shot { margin: 24px 0; }
.shot img { border: 1px solid var(--line); border-radius: var(--radius); }
.shot figcaption { margin-top: 8px; font-size: .875rem; color: var(--ink-soft); }
@media (min-width: 600px) {
  .gst-grid { grid-template-columns: 1fr 1fr; }
  .tabs-list { grid-template-columns: max-content 1fr; }
  .tabs-list dt { margin-top: 0; }
}

/* ---------- CTA band & footer ---------- */
.cta-band { background: var(--navy); color: var(--white); padding: 56px 0; }
.cta-band h2 { color: var(--white); }
.cta-band p { color: #D5E3E8; max-width: 620px; }

.site-footer { background: var(--panel); padding: 48px 0 24px; font-size: .9375rem; }
.footer-grid { display: grid; gap: 24px; }
.footer-brand p { color: var(--ink-soft); margin: .5em 0 0; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
.footer-links li { margin: 0; }
.footer-links a { display: inline-block; padding: 6px 0; color: var(--ink); }
.footer-base { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-soft); }
.footer-base p { margin: .25em 0; }

/* ---------- Larger screens ---------- */
@media (min-width: 600px) {
  .btn-row .btn { flex: 0 0 auto; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .footer-links { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .section { padding: 80px 0; }
  .hero { padding: 72px 0 80px; }
  .hero-grid { grid-template-columns: 1.25fr 1fr; align-items: center; gap: 56px; }
  .hero .report-figure { justify-self: end; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .tiers { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: 1fr 1fr; gap: 48px; }
  .footer-grid { grid-template-columns: 1fr 1.4fr; gap: 48px; }
  .report-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
  .report-layout .report-figure { position: sticky; top: 24px; }
}

/* Desktop header: logo, then the links right next to it, then the button pushed to the far right. */
@media (min-width: 960px) {
  .js .nav-toggle { display: none; }
  .site-header .header-inner { flex-wrap: nowrap; justify-content: flex-start; gap: 40px; }
  .site-nav, .js .site-nav { display: flex; align-items: center; gap: 24px; flex: 1; width: auto; padding: 0; }
  .site-nav ul { display: flex; gap: 22px; }
  .site-nav a:not(.btn) { padding: 8px 0; font-size: .9688rem; white-space: nowrap; }
  .site-nav .nav-cta { width: auto; margin: 0 0 0 auto; white-space: nowrap; }
}

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