/* Trackforms – carbonless-copy palette, brand-blue ink */

@font-face { font-family: "Public Sans"; src: url("/assets/fonts/public-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/assets/fonts/public-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/assets/fonts/public-sans-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("/assets/fonts/caveat-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;
  --paper: #F6F7F9;        /* form white */
  --surface: #FFFFFF;
  --tint: #ECEFF5;         /* section tint, cool grey-blue */
  --graphite: #23262E;     /* text */
  --muted: #5A6070;
  --rule: #C9D0DE;         /* form-line blue-grey */
  --ink-blue: #015694;     /* brand blue, from the logo */
  --ink-blue-hover: #013F6E;
  --canary: #F3E59A;       /* carbonless yellow copy */
  --pink: #F2C9D2;         /* carbonless pink copy */
  --ok: #2E7D4F;
  --on-blue: #FFFFFF;
  --phone: #1C1E24;

  --font: "Public Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14161B;
    --surface: #1C1F26;
    --tint: #1A1D24;
    --graphite: #E7E9EE;
    --muted: #A3A9B7;
    --rule: #363C4A;
    --ink-blue: #7DB6E8;
    --ink-blue-hover: #A6CDF0;
    --on-blue: #0B1C2B;
    --ok: #6FCF97;
  }
}

*, *::before, *::after { box-sizing: inherit; }
html { scroll-behavior: smooth; scroll-padding-top: calc(4.5rem + env(safe-area-inset-top, 0px)); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img, svg { max-width: 100%; }
a { color: var(--ink-blue); text-underline-offset: 0.18em; }
a:hover { color: var(--ink-blue-hover); }
:focus-visible { outline: 3px solid var(--ink-blue); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.6em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 800; max-width: 26ch; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow > * { max-width: 48rem; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink-blue); color: var(--on-blue); padding: 0.6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: calc(1rem + env(safe-area-inset-top, 0px)); }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--ink-blue);
  color: var(--on-blue);
  font-weight: 600;
  text-decoration: none;
  padding: 0.8rem 1.35rem;
  border-radius: 6px;
  border: 2px solid var(--ink-blue);
}
.btn:hover { background: var(--ink-blue-hover); border-color: var(--ink-blue-hover); color: var(--on-blue); }
.btn-quiet { background: transparent; color: var(--ink-blue); }
.btn-quiet:hover { background: transparent; color: var(--ink-blue-hover); }
.btn-small { padding: 0.45rem 0.9rem; font-size: 0.95rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--rule);
  top: env(safe-area-inset-top, 0px);
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--graphite); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand:hover { color: var(--graphite); }
.brand-mark { width: 2.25rem; height: 2.25rem; display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-mark { filter: brightness(0) invert(1); } }
.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a:not(.btn) { color: var(--graphite); text-decoration: none; font-size: 0.95rem; }
.site-nav a:not(.btn):hover { color: var(--ink-blue); text-decoration: underline; }
.nav-toggle { display: none; font: inherit; font-weight: 600; background: none; border: 1px solid var(--rule); color: var(--graphite); border-radius: 6px; padding: 0.4rem 0.8rem; cursor: pointer; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 1.25rem;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) { padding: 0.7rem 0; width: 100%; border-bottom: 1px solid var(--rule); }
  .site-nav .btn { margin-top: 1rem; }
}

/* Hero */
.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(3.5rem, 8vw, 7rem); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero-copy h1 { max-width: 19ch; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 1.25rem; }
.hero-note { font-size: 0.95rem; color: var(--muted); }

.hero-visual { position: relative; margin: 0; min-height: 30rem; }

/* Carbonless sheets */
.sheets { position: relative; width: min(100%, 25rem); margin-left: auto; margin-right: 6rem; }
.sheet { border-radius: 3px; }
.sheet-pink, .sheet-canary { position: absolute; inset: 0; }
.sheet-pink { background: var(--pink); transform: translate(18px, 18px) rotate(2.2deg); }
.sheet-canary { background: var(--canary); transform: translate(9px, 9px) rotate(1.1deg); }
.sheet-white {
  position: relative;
  background: #FFFFFF; color: #23262E;
  padding: 1.4rem 1.5rem 1.6rem;
  box-shadow: 0 1px 0 #C9D0DE, 0 18px 40px -24px rgba(1, 86, 148, 0.45);
  transform: rotate(-1.2deg);
}
.sheet-head { display: flex; flex-direction: column; border-bottom: 2px solid #23262E; padding-bottom: 0.6rem; margin-bottom: 1rem; }
.sheet-head strong { font-size: 0.98rem; }
.sheet-head span { font-size: 0.75rem; color: #5A6070; }
.field { display: flex; flex-direction: column; border-bottom: 1px solid #B9C3D6; padding: 0.35rem 0 0.15rem; margin-bottom: 0.7rem; min-height: 3.3rem; }
.field label { font-size: 0.68rem; color: #5A6070; }
.field-row { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.field.sig { border-bottom-width: 1.5px; border-bottom-color: #23262E; }

.hand {
  font-family: var(--hand); font-weight: 600; font-size: 1.55rem; line-height: 1.1;
  color: #015694;
  display: inline-block; white-space: nowrap; overflow: hidden;
  clip-path: inset(0 100% 0 0);
  animation: write 0.9s steps(18, end) forwards;
}
.signature { font-size: 1.95rem; transform: rotate(-3deg); transform-origin: left; }
.h1 { animation-delay: 0.4s; }
.h2 { animation-delay: 1.2s; }
.h3 { animation-delay: 1.9s; animation-duration: 0.3s; }
.h4 { animation-delay: 2.3s; }
.h5 { animation-delay: 3.1s; }
.h6 { animation-delay: 3.9s; animation-duration: 1.1s; }
@keyframes write { to { clip-path: inset(0 0 0 0); } }

/* Phone */
.phone {
  position: absolute; right: 0; bottom: -1rem;
  width: 13.5rem;
  background: var(--phone);
  border-radius: 2rem;
  padding: 0.65rem;
  box-shadow: 0 30px 50px -25px rgba(0, 0, 0, 0.55);
}
.phone-screen {
  background: #FFFFFF; color: #23262E;
  border-radius: 1.45rem;
  padding: 1.25rem 1rem 1rem;
  font-size: 0.8rem; line-height: 1.4;
}
.phone-progress { height: 4px; background: #E2E6EF; border-radius: 2px; overflow: hidden; }
.phone-progress span { display: block; height: 100%; background: #015694; }
.phone-step { color: #5A6070; font-size: 0.7rem; margin: 0.5rem 0 0.6rem; }
.phone-q { font-weight: 600; font-size: 0.92rem; margin-bottom: 0.7rem; }
.choice { border: 1.5px solid #C9D0DE; border-radius: 8px; padding: 0.45rem 0.65rem; margin-bottom: 0.4rem; }
.choice.is-on { border-color: #015694; background: #E6F0F8; font-weight: 600; }
.phone-follow { font-size: 0.74rem; color: #5A6070; margin: 0.7rem 0 0.35rem; }
.input { border: 1.5px solid #2E7D4F; border-radius: 8px; padding: 0.45rem 0.65rem; }
.phone-check { color: #2E7D4F; font-size: 0.7rem; margin: 0.3rem 0 0.8rem; padding-left: 1rem; position: relative; }
.phone-check::before { content: ""; position: absolute; left: 0.1rem; top: 0.25rem; width: 0.35rem; height: 0.6rem; border: solid #2E7D4F; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.phone-btn { background: #015694; color: #FFFFFF; text-align: center; font-weight: 600; border-radius: 8px; padding: 0.55rem; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 0; padding-bottom: 2rem; }
  .sheets { margin: 0 auto 0 0; }
  .phone { right: 0; bottom: 0; }
}
@media (max-width: 520px) {
  .sheets { width: 88%; }
  .phone { width: 11rem; bottom: -1.5rem; right: -0.25rem; }
  .phone-screen { font-size: 0.7rem; padding: 1rem 0.75rem 0.8rem; }
  .phone-q { font-size: 0.8rem; }
  .phone-follow, .phone-check { display: none; }
  .hand { font-size: 1.3rem; }
  .signature { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hand { animation: none; clip-path: none; }
}

/* Sections */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-tint { background: var(--tint); }
.section-intro { font-size: 1.15rem; color: var(--muted); max-width: 42rem; margin-bottom: 2.5rem; }

/* Comparison: drawn like a form table */
.compare { border: 1.5px solid var(--graphite); background: var(--surface); }
.compare-row { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr; }
.compare-row > span { padding: 1rem 1.15rem; border-top: 1px solid var(--rule); }
.compare-row > span + span { border-left: 1px solid var(--rule); }
.compare-row > [role="rowheader"] { font-weight: 600; }
.compare-row > span:last-child { color: var(--ink-blue); font-weight: 600; }
.compare-head > span { border-top: 0; font-weight: 800; font-size: 0.95rem; border-bottom: 1.5px solid var(--graphite); }
.compare-head > span:last-child { color: var(--ink-blue); }
@media (max-width: 720px) {
  .compare-head { display: none; }
  .compare-row { grid-template-columns: 1fr; border-top: 1.5px solid var(--graphite); }
  .compare-row:nth-child(2) { border-top: 0; }
  .compare-row > span { border-top: 0; padding: 0.4rem 1rem; }
  .compare-row > span + span { border-left: 0; }
  .compare-row > [role="rowheader"] { padding-top: 1rem; }
  .compare-row > span:last-child { padding-bottom: 1rem; }
  .compare-row > [role="cell"]:nth-child(2)::before { content: "Web form: "; font-weight: 600; color: var(--muted); }
  .compare-row > [role="cell"]:nth-child(3)::before { content: "Trackforms: "; }
}

/* Steps: a real sequence */
.steps { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 3.5rem; }
.steps li::before {
  content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 2px solid var(--ink-blue); color: var(--ink-blue);
  font-weight: 800; display: grid; place-items: center;
  background: var(--tint);
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 1.2rem; left: 3rem; right: -1.5rem;
  border-top: 2px dashed var(--rule);
}
.steps p { color: var(--muted); }
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; gap: 1.75rem; }
  .steps li { padding: 0 0 0 3.5rem; }
  .steps li:not(:last-child)::after { top: 2.8rem; left: 1.2rem; right: auto; bottom: -1.5rem; border-top: 0; border-left: 2px dashed var(--rule); }
}

/* Features */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1.5px solid var(--graphite); }
.features > div { padding: 1.4rem 1.5rem 1.5rem 0; border-bottom: 1px solid var(--rule); }
.features > div:not(:nth-child(3n+1)) { padding-left: 1.5rem; border-left: 1px solid var(--rule); }
.features dt { font-weight: 600; font-size: 1.1rem; margin-bottom: 0.35rem; }
.features dd { margin: 0; color: var(--muted); }
@media (max-width: 860px) {
  .features { grid-template-columns: 1fr 1fr; }
  .features > div:not(:nth-child(3n+1)) { padding-left: 0; border-left: 0; }
  .features > div:nth-child(even) { padding-left: 1.5rem; border-left: 1px solid var(--rule); }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .features > div:nth-child(even) { padding-left: 0; border-left: 0; }
}

/* Audiences */
.audiences { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.audiences article { background: var(--surface); padding: 1.6rem 1.75rem; border-left: 4px solid var(--ink-blue); }
.audiences article:nth-child(2) { border-left-color: var(--canary); }
.audiences article:nth-child(3) { border-left-color: var(--pink); }
.audiences article:nth-child(4) { border-left-color: var(--rule); }
.audiences p { margin: 0; color: var(--muted); }
@media (max-width: 720px) { .audiences { grid-template-columns: 1fr; } }

/* Control */
.control-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.control-grid p { max-width: 38rem; }
.control-list { list-style: none; margin: 0; padding: 1.5rem 1.75rem; background: var(--surface); border: 1.5px solid var(--graphite); }
.control-list li { position: relative; padding: 0.7rem 0 0.7rem 2.1rem; border-bottom: 1px solid var(--rule); font-weight: 600; }
.control-list li:last-child { border-bottom: 0; }
.control-list li::before {
  content: ""; position: absolute; left: 0; top: 0.85rem;
  width: 1.15rem; height: 1.15rem; border: 1.5px solid var(--graphite); border-radius: 2px;
}
.control-list li::after {
  content: ""; position: absolute; left: 0.38rem; top: 0.95rem;
  width: 0.4rem; height: 0.75rem; border: solid var(--ink-blue); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
@media (max-width: 860px) { .control-grid { grid-template-columns: 1fr; } }

/* FAQ */
details { border-bottom: 1px solid var(--rule); }
details:first-of-type { border-top: 1.5px solid var(--graphite); }
summary { cursor: pointer; font-weight: 600; font-size: 1.1rem; padding: 1.15rem 2rem 1.15rem 0; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0.25rem; top: 0.95rem; font-size: 1.5rem; font-weight: 400; color: var(--ink-blue); line-height: 1; }
details[open] summary::after { content: "–"; }
details p { color: var(--muted); max-width: 40rem; padding-bottom: 0.5rem; }

/* Access */
.access { background: var(--ink-blue); color: var(--on-blue); }
.access h2 { color: var(--on-blue); max-width: 22ch; }
.access-inner > p { max-width: 38rem; font-size: 1.15rem; }
.btn-light { background: var(--on-blue); color: var(--ink-blue); border-color: var(--on-blue); margin-top: 0.75rem; }
.btn-light:hover { background: transparent; color: var(--on-blue); border-color: var(--on-blue); }
.access :focus-visible { outline-color: var(--on-blue); }
.access-note { font-size: 0.95rem !important; opacity: 0.85; margin-top: 1.5rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 2rem 0; font-size: 0.95rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-inner p { margin: 0; }
.footer-inner nav { display: flex; gap: 1.5rem; }

/* Simple content pages (privacy, 404) */
.page { padding: clamp(3rem, 7vw, 5rem) 0; }
.page h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
.page h2 { font-size: 1.35rem; margin-top: 2.25rem; max-width: none; }
.page p, .page li { max-width: 42rem; }
.page .updated { color: var(--muted); }

/* Inline-style-free helpers (keeps a strict Content-Security-Policy working) */
.phone-progress .p62 { width: 62%; }
.site-nav.site-nav-simple { display: flex; position: static; padding: 0; border: 0; background: none; flex-direction: row; }
.site-nav-simple .btn { margin-top: 0; }
.site-nav-simple a:not(.btn) { padding: 0; width: auto; border-bottom: 0; }
.footer-inner p a { color: inherit; }
