/* Platenpost marketing site (PLAN.md P0.4). Tokens, type, markers and components.
   No third-party requests and no inline styles anywhere (the P0.7 CSP forbids both). */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --desk: #f3f4f2;
  --sheet: #ffffff;
  --graphite: #1e2124;
  --muted: #5a626a;
  --rule: #d6dadc;
  --rule-strong: #b9bfc3;
  --ink: #00739e;
  --ink-hover: #005c80;
  --cyan: #00aeef;
  --magenta: #e6007e;
  --yellow: #ffe600;
  --error: #b3261e;
  --gutter: 16px;
  --measure: 70ch;
  --page: 68rem;
}

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

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

body {
  margin: 0;
  background: var(--desk);
  color: var(--graphite);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  font-weight: 400;
  font-stretch: 100%;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

main {
  flex: 1 0 auto;
}

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

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 48rem) {
  :root {
    --gutter: 24px;
  }
}

/* Type */
h1,
h2,
h3 {
  font-stretch: 112%;
  font-weight: 740;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem);
  line-height: 1.04;
  font-weight: 780;
  text-wrap: balance;
}

h2 {
  font-size: 1.6rem;
  line-height: 1.15;
}

h3 {
  font-size: 1.15rem;
  line-height: 1.25;
}

p {
  margin: 0 0 1em;
  max-width: var(--measure);
}

.lede {
  font-size: 1.15rem;
  color: var(--graphite);
}

.muted {
  color: var(--muted);
}

.num,
td.n,
th.n {
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--ink);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--ink-hover);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--sheet);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}

.skip:focus {
  top: 0.5rem;
}

/* Markers (hero sheet and calculator preview use these in P0.5 and P0.6) */
.marker {
  display: inline-block;
  width: 10px;
  height: 10px;
  vertical-align: baseline;
  margin-right: 0.4em;
  flex: none;
}

.marker-mono {
  background: #000;
}

.marker-colour {
  background: linear-gradient(90deg, var(--cyan) 0 33.3%, var(--magenta) 33.3% 66.6%, var(--yellow) 66.6% 100%);
}

/* Masthead and wordmark */
.masthead {
  border-bottom: 1px solid var(--rule);
}

.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-block: 0.9rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--graphite);
  font-stretch: 112%;
  font-weight: 760;
  font-size: 1.15rem;
  text-decoration: none;
  margin-right: auto;
}

.wordmark:hover {
  color: var(--graphite);
}

.swatches {
  display: inline-flex;
  gap: 2px;
}

.swatches span {
  width: 9px;
  height: 9px;
  display: block;
}

.sw-c {
  background: var(--cyan);
}
.sw-m {
  background: var(--magenta);
}
.sw-y {
  background: var(--yellow);
}
.sw-k {
  background: #000;
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
}

.masthead nav a {
  padding-block: 0.35rem;
}

/* Buttons */
.button {
  display: inline-block;
  appearance: none;
  border: 0;
  border-radius: 3px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 620;
  line-height: 1.2;
  padding: 0.8rem 1.2rem;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
}

.button:hover {
  background: var(--ink-hover);
  color: #fff;
}

.button:disabled {
  background: var(--muted);
  cursor: progress;
}

.button-quiet {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
  padding-block: 0.5rem;
  min-height: 0;
}

.button-quiet:hover {
  background: transparent;
  color: var(--ink-hover);
  box-shadow: inset 0 0 0 1.5px var(--ink-hover);
}

/* Forms */
.field {
  margin: 0 0 1rem;
}

label,
legend {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  padding: 0;
}

input[type="text"],
input[type="email"],
select,
textarea {
  display: block;
  width: 100%;
  font: inherit;
  color: var(--graphite);
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: 0.6rem 0.7rem;
  min-height: 44px;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 1px var(--error);
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.25rem;
  min-width: 0;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 400;
  margin: 0;
  padding: 0.3rem 0;
}

.choice input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.2rem 0 0;
  accent-color: var(--ink);
}

.field-error,
.form-error {
  color: var(--error);
  font-weight: 500;
  margin: 0.35rem 0 0;
}

.form-error {
  margin: 0 0 1rem;
}

.form-note {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.9rem 0 0;
}

/* Spam trap: off screen, not display:none, so simple bots still fill it. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Hero (P0.5 adds the example sheet beside it) */
.hero {
  padding-block: 2rem 3rem;
}

.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: start;
}

.signup-card {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.25rem var(--gutter);
  max-width: 32rem;
  margin-top: 1.5rem;
}

.signup-card h2 {
  font-size: 1.25rem;
}

@media (min-width: 60rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
    gap: 1rem 3rem;
  }
  .hero {
    padding-block: 1.75rem 2.5rem;
  }
  .hero-head {
    grid-column: 1 / -1;
  }
  .hero-head h1 {
    max-width: 22ch;
    margin-bottom: 0.35em;
  }
  .hero .signup-card {
    margin-top: 0;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Hero example invoice */
.example {
  margin: 0;
}

.sheet-label {
  font-weight: 700;
  font-stretch: 112%;
  margin: 0 0 0.75rem;
}

.sheet-who {
  margin: 0 0 1rem;
}

.sheet table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.sheet th,
.sheet td {
  padding: 0.4rem 0.3rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  font-weight: 400;
}

.sheet thead th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.8rem;
}

.sheet tbody th {
  font-weight: 600;
  white-space: nowrap;
}

.sheet .n {
  text-align: right;
}

.sheet .meters {
  margin-bottom: 1.25rem;
}

.sheet .lines th {
  padding-left: 0;
}

.sheet .lines .n {
  padding-right: 0;
}

.sheet .lines .total th,
.sheet .lines .total td {
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 0;
  border-top: 2px solid var(--graphite);
}

.sheet-status {
  margin: 1rem 0 0;
  font-weight: 600;
  color: var(--muted);
}

/* Sections under the hero */
.band {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem;
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

.steps li {
  counter-increment: step;
  padding-left: 3rem;
  position: relative;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  font-size: 2rem;
  font-weight: 780;
  font-stretch: 112%;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.steps h3 {
  margin-bottom: 0.3em;
}

.steps p {
  margin: 0;
}

.plans {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
  max-width: 40rem;
}

.plan {
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 1rem 1.25rem;
}

.plan h3 {
  margin-bottom: 0.2em;
}

.plan p {
  margin: 0;
}

.price {
  font-size: 1.15rem;
}

.price .num {
  font-size: 2rem;
  font-weight: 780;
  font-stretch: 112%;
}

.terms {
  margin: 1.25rem 0 0;
}

.cross p {
  margin: 0;
  font-size: 1.15rem;
}

@media (min-width: 48rem) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Calculator page head and join band (P0.6 adds the tool) */
.page-head {
  padding-block: 2.25rem 1.5rem;
}

.join-band {
  border-block: 1px solid var(--rule);
  padding-block: 1.75rem;
  margin-block: 2rem;
}

.join-band h2 {
  margin-bottom: 0.25rem;
}

.join-band .band-fields {
  display: grid;
  gap: 0 1rem;
}

@media (min-width: 48rem) {
  .join-band .band-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.followup h2 {
  font-size: 1.4rem;
}

.followup textarea {
  max-width: 40rem;
}

.thanks:focus {
  outline: none;
}

/* Paper sheet: only for things that are documents (P0.5 hero example, P0.6 invoice preview) */
.sheet {
  background: var(--sheet);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgb(30 33 36 / 0.12), 0 6px 18px rgb(30 33 36 / 0.08);
  padding: 1.25rem var(--gutter);
}

/* Highlighter swipe: the one moment of motion (P0.5 puts it on the hero sheet overage cells and total). Add .hl, plus .hl-2 or .hl-3 to stagger. Off under reduced motion. */
.hl {
  background-image: linear-gradient(var(--yellow), var(--yellow));
  background-repeat: no-repeat;
  background-position: 0 85%;
  background-size: 100% 0.6em;
  padding-inline: 0.15em;
  margin-inline: -0.15em;
  font-weight: 700;
  animation: swipe 550ms ease-out both;
}

.hl-2 {
  animation-delay: 350ms;
}

.hl-3 {
  animation-delay: 700ms;
}

@keyframes swipe {
  from {
    background-size: 0 0.6em;
  }
  to {
    background-size: 100% 0.6em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hl {
    animation: none;
  }
}

/* Footer */
.footer {
  border-top: 1px solid var(--rule);
  padding-block: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.footer p {
  margin: 0;
}

/* Free overage calculator (P0.6) */
.calc {
  padding-bottom: 1rem;
}

.calc-noscript {
  padding: 0.75rem 1rem;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  font-weight: 600;
}

.calc-layout {
  display: grid;
  gap: 2rem;
}

.calc-group {
  margin: 0 0 1.5rem;
}

.calc-group > legend {
  font-size: 1.15rem;
  font-weight: 740;
  font-stretch: 112%;
  margin-bottom: 0.6rem;
}

.calc-hint {
  color: var(--muted);
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.calc-meter {
  margin: 0 0 0.5rem;
}

.calc-meter > legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.calc-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 0.75rem;
}

.calc-toggle {
  margin: 0.5rem 0;
  align-items: center;
  font-weight: 600;
}

.calc-toggle input {
  width: 1.2rem;
  height: 1.2rem;
}

.calc-meter.is-off,
.field.is-off {
  opacity: 0.5;
}

input:disabled {
  background: var(--desk);
  cursor: not-allowed;
}

.field-warning {
  color: var(--graphite);
  font-size: 0.9rem;
  margin: 0.3rem 0 0;
  font-weight: 600;
}

.calc-status {
  font-weight: 600;
  color: var(--error);
}

.calc-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
}

.calc-stat dt {
  color: var(--muted);
  font-size: 0.9rem;
}

.calc-stat dd {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.calc-stat-total {
  grid-column: 1 / -1;
}

.calc-stat-total dd {
  font-size: 2.1rem;
  line-height: 1.1;
  font-stretch: 112%;
}

.calc-actions {
  margin-bottom: 1.25rem;
}

.calc-sheet-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin-bottom: 0.75rem;
}

.calc-company {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.calc-sheet-head .sheet-label {
  margin: 0;
}

.calc-sheet .sheet-who {
  overflow-wrap: anywhere;
}

.calc-footnote {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 1rem 0 0;
}

.calc-empty {
  font-weight: 600;
  margin: 0;
}

@media (max-width: 30rem) {
  .calc-sheet {
    padding-inline: 0.75rem;
  }
  .calc-sheet .meters {
    font-size: 0.8rem;
  }
  .calc-sheet .meters th,
  .calc-sheet .meters td {
    padding-inline: 0.15rem;
  }
  .calc-sheet .meters thead th {
    font-size: 0.7rem;
  }
}

@media (min-width: 56rem) {
  .calc-layout {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
    gap: 2.5rem;
  }
}

@media (min-width: 56rem) and (min-height: 50rem) {
  .calc-result {
    position: sticky;
    top: 1rem;
  }
}

.calc-steps {
  max-width: var(--measure);
  padding-left: 1.25rem;
}

.calc-steps li {
  margin-bottom: 0.75rem;
}

.calc-seo h2:not(:first-child) {
  margin-top: 2rem;
}

@media print {
  @page {
    margin: 16mm;
  }
  .skip,
  .masthead,
  .footer,
  .page-head,
  .join-band,
  .calc-seo,
  .calc-inputs,
  .calc-summary,
  .calc-actions,
  .calc-noscript,
  #calc-heading,
  template {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .calc {
    padding: 0;
  }
  .calc-layout {
    display: block;
  }
  .calc-result {
    position: static;
  }
  .calc-sheet {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }
  .hl {
    animation: none;
    background-size: 0;
  }
}

/* Supporting pages (P0.7) and the no-JavaScript calculator */
html:not(.js) .js-only {
  display: none;
}

.calc-prefill {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.prose .wrap > * {
  max-width: var(--measure);
}

.prose h2:not(:first-child) {
  margin-top: 2rem;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.75rem;
}

.prose code {
  font-size: 0.95em;
}

/* Fleet calculator (P1.2) */
.fleet-privacy {
  max-width: var(--measure);
}

.fleet {
  padding-bottom: 1rem;
}

.fleet-step {
  max-width: 52rem;
  margin: 0 0 2.5rem;
}

.fleet-step[hidden],
.fleet-slot[hidden] {
  display: none;
}

.fleet-step > h2 {
  margin-bottom: 0.4rem;
}

.fleet-slots {
  display: grid;
  gap: 0 1.5rem;
}

.fleet-slot > legend {
  font-weight: 700;
  font-stretch: 112%;
}

.fleet-slot textarea {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.fleet-status {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
}

.fleet-status[hidden],
.fleet-notice[hidden] {
  display: none;
}

.fleet-notice {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  font-weight: 600;
}

.field-hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.3rem 0 0;
}

.fleet-grid {
  display: grid;
  gap: 0 1rem;
}

.fleet-ask {
  padding: 0.75rem 1rem;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  margin-bottom: 1.25rem;
}

.fleet-ask[hidden] {
  display: none;
}

.fleet-meters > legend {
  font-size: 1.05rem;
  font-weight: 740;
  font-stretch: 112%;
  margin-bottom: 0.4rem;
}

.fleet-row {
  display: grid;
  gap: 0 0.75rem;
  align-items: end;
  padding: 0.5rem 0 0.25rem;
  border-top: 1px solid var(--rule);
}

.fleet-row .button {
  margin-bottom: 1rem;
  justify-self: start;
}

.fleet-meters > .button {
  margin-top: 0.5rem;
}

.fleet-preview {
  margin: 0 0 1.5rem;
}

.fleet-save {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.75rem;
  align-items: end;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.fleet-save .field {
  flex: 1 1 14rem;
}

.fleet-save .button {
  margin-bottom: 1rem;
}

.fleet-save .fleet-status {
  flex: 1 0 100%;
  margin-top: 0;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 3px;
  max-width: 100%;
}

.fleet-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.fleet-table th,
.fleet-table td {
  padding: 0.4rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  font-weight: 400;
  vertical-align: top;
}

.fleet-table thead th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.fleet-table tbody th {
  font-weight: 600;
}

.fleet-table .n {
  text-align: right;
  white-space: nowrap;
}

.fleet-notes {
  list-style: none;
  margin: 0.2rem 0 0;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 400;
}

.fleet-note-error {
  color: var(--error);
  font-weight: 600;
}

.fleet-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  max-width: var(--measure);
}

.fleet-list[hidden] {
  display: none;
}

.fleet-list-error {
  color: var(--error);
  font-weight: 600;
}

.fleet-totals {
  max-width: 24rem;
}

#res-table-wrap .button {
  margin-top: 0.75rem;
}

.fleet-unmatched {
  max-width: 52rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}

@media (min-width: 40rem) {
  .fleet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .fleet-slots.is-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fleet-row {
    grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) auto;
  }
  .fleet-row-terms {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .fleet-row-derived {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  }
}

@media print {
  .fleet-step:not(#step-results),
  .fleet-unmatched,
  #download-csv {
    display: none !important;
  }
  .table-scroll {
    overflow: visible;
    border: 0;
  }
}

.fleet-summary {
  max-width: 28rem;
  margin-bottom: 1rem;
}

#res-summary-wrap h3 {
  margin: 1.25rem 0 0.4rem;
}
