/* Greenline Digital. Ink on paper with one green line; each product brings its own colour.
   Contrast for every text and control pair below is checked by test/contrast.test.js. */

:root {
  color-scheme: light dark;

  --paper: #fbfaf6;
  --surface: #ffffff;
  --ink: #1c1b18;
  --muted: #57554d;
  --line: #dedad0;
  --control: #77746a;
  --green: #1d6b43;
  --error: #a3261b;

  /* Battery Fit Check: its own navy and gold */
  --bfc-panel: #0e1a2b;
  --bfc-text: #0f4c9a;

  /* Meat Sweats: its own charcoal and ember (ember darkened for text on white) */
  --ms-panel: #312f35;
  --ms-text: #b0441a;

  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;

  --radius: 4px;
  --tap: 3rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141412;
    --surface: #1c1c19;
    --ink: #ecebe5;
    --muted: #b0ada3;
    --line: #34332e;
    --control: #8d8a80;
    --green: #74c69d;
    --error: #ff8a80;

    --bfc-text: #8fb8ee;
    --ms-text: #fe6e35;
  }
}

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

html {
  font-size: 112.5%; /* 18px body text */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

p + p {
  margin-top: 0.75rem;
}

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

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

.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  min-height: 4.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--tap);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-decoration: none;
}

.wordmark::before {
  content: "";
  width: 1.4rem;
  height: 3px;
  background: var(--green);
}

.nav {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding-inline: 0.75rem;
  color: var(--ink);
}

/* Keep the name and the links on one line on a phone; narrower screens still wrap cleanly. */
@media (max-width: 26rem) {
  .site-header__inner {
    column-gap: 0.75rem;
  }

  .wordmark::before {
    width: 1rem;
  }

  .nav {
    margin-right: -0.4rem;
  }

  .nav a {
    padding-inline: 0.4rem;
  }
}

/* Intro */

.intro {
  padding-block: clamp(3rem, 10vw, 6.5rem) clamp(2.5rem, 6vw, 4rem);
}

.intro h1 {
  font-size: clamp(2.75rem, 9vw, 5.25rem);
  letter-spacing: -0.01em;
}

.intro h1::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 4px;
  margin-top: 1.5rem;
  background: var(--green);
}

.lede {
  max-width: 30em;
  margin-top: 1.5rem;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  line-height: 1.4;
}

/* Sections */

.section {
  padding-block: 2.5rem 3.5rem;
}

.section > h2 {
  padding-top: 1.25rem;
  margin-bottom: 1.75rem;
  border-top: 1px solid var(--line);
  font-size: 2rem;
}

/* Product cards */

.cards {
  display: grid;
  align-items: start;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }

  .card--next {
    grid-column: 1 / -1;
  }
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card__panel {
  display: grid;
  place-items: center;
  aspect-ratio: 616 / 353;
  margin: -1.5rem -1.5rem 1.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

.card--bfc .card__panel {
  background: var(--bfc-panel);
}

.card--bfc .card__panel img {
  width: 72%;
}

.card--ms .card__panel {
  background: var(--ms-panel);
}

.card__panel--logo img {
  width: 84%;
}

.card__panel--capsule img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__kicker {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.card--bfc .card__kicker {
  color: var(--bfc-text);
}

.card--ms .card__kicker {
  color: var(--ms-text);
}

.card__title {
  margin-bottom: 0.75rem;
  font-size: 1.6rem;
}

.card__tagline {
  font-weight: 700;
  font-size: 1.1rem;
}

.card__action,
.card__note {
  margin-top: auto;
  padding-top: 1.25rem;
}

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

.card__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 600;
}

.card--next {
  background: transparent;
  border-style: dashed;
  border-color: var(--control);
}

/* Contact */

.contact {
  display: grid;
  gap: 2rem;
}

@media (min-width: 56rem) {
  .contact {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 3rem;
  }
}

.contact__intro {
  max-width: 34ch;
  font-size: 1.1rem;
}

.contact__aside {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 1rem;
}

.form {
  display: grid;
  gap: 1.25rem;
  max-width: 36rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

label {
  font-weight: 600;
}

.field__optional {
  font-weight: 400;
  color: var(--muted);
}

input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--control);
  border-radius: var(--radius);
}

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

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-offset: 1px;
}

[aria-invalid="true"] {
  border-color: var(--error);
  border-width: 2px;
}

.field__error,
.form__summary {
  color: var(--error);
  font-weight: 600;
}

.field__error[hidden],
.form__summary[hidden] {
  display: none;
}

.field--trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.turnstile {
  min-height: 65px;
}

.form__privacy,
.form__noscript {
  color: var(--muted);
  font-size: 1rem;
}

.button {
  justify-self: start;
  min-height: 3.25rem;
  padding: 0.75rem 1.5rem;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}

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

.button[aria-disabled="true"] {
  cursor: progress;
  opacity: 0.75;
}

.form__status:empty {
  display: none;
}

.sent {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  background: var(--surface);
}

.sent h3 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

/* Footer */

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 2rem;
  padding-block: 1.25rem 2rem;
}

.site-footer p + p {
  margin-top: 0;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

/* Privacy and other text pages */

.prose {
  max-width: 40rem;
  padding-block: 3rem 4rem;
}

.prose h1 {
  font-size: clamp(2.25rem, 7vw, 3.25rem);
  margin-bottom: 0.75rem;
}

.prose h2 {
  margin-top: 2.25rem;
  margin-bottom: 0.6rem;
  font-size: 1.5rem;
}

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

.prose li + li {
  margin-top: 0.4rem;
}

.prose ul + p {
  margin-top: 0.75rem;
}

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

/* Motion: only gentle colour changes, and none when reduced motion is asked for */

@media (prefers-reduced-motion: no-preference) {
  a,
  .button {
    transition: color 150ms ease-out, background-color 150ms ease-out, text-decoration-thickness 150ms ease-out;
  }
}

@media (forced-colors: active) {
  .card__panel {
    border-bottom: 1px solid CanvasText;
  }

  .wordmark::before,
  .intro h1::after {
    background: CanvasText;
  }
}
