/*
 * PamperHive website — the whole stylesheet.
 *
 * Self-contained on purpose. PRIVACY.md says there is no analytics SDK and no
 * third-party tracking; a webfont from a CDN or a hosted stylesheet would send
 * every visitor's IP address to somebody else and make that document false. So:
 * system fonts, one file, no imports.
 *
 * Colours are the app's provisional design tokens
 * (shared/.../designsystem/Tokens.kt) so the site and the app do not look like
 * two products. They are provisional there and provisional here — 07-DESIGN-PASS-2.
 */

:root {
  --primary: #0f5d56;
  --on-primary: #ffffff;
  --primary-container: #a8f2e4;
  --on-primary-container: #00201c;
  --surface: #fbfdfb;
  --on-surface: #191c1b;
  --surface-variant: #dae5e1;
  --on-surface-variant: #3f4947;
  --outline: #6f7977;
  --outline-variant: #bec9c6;
  --error: #b3261e;
  --error-container: #f9dedc;
  --on-error-container: #410e0b;
  --warn: #7a4e00;
  --warn-container: #ffddae;
  --on-warn-container: #2b1700;

  --measure: 38rem;
  --radius: 12px;
  --gap: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #58dbcb;
    --on-primary: #00382f;
    --primary-container: #005046;
    --on-primary-container: #a8f2e4;
    --surface: #191c1b;
    --on-surface: #e1e3e1;
    --surface-variant: #3f4947;
    --on-surface-variant: #bec9c6;
    --outline: #899391;
    --outline-variant: #3f4947;
    --error: #ffb4ab;
    --error-container: #93000a;
    --on-error-container: #ffdad6;
    --warn: #ffb95c;
    --warn-container: #5c3a00;
    --on-warn-container: #ffddae;
  }
}

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

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  /* 17px, not 16: this is read on a phone, often by somebody who is annoyed. */
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius);
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.1rem;
}

.wide { max-width: 52rem; }

/* ---------------------------------------------------------------- header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  max-width: 52rem;
  margin: 0 auto;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--outline-variant);
}

.wordmark {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--primary);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-left: auto;
  font-size: 0.95rem;
}

.site-footer {
  max-width: 52rem;
  margin: 3rem auto 0;
  padding: 1.5rem 1.1rem 3rem;
  border-top: 1px solid var(--outline-variant);
  color: var(--on-surface-variant);
  font-size: 0.9rem;
}

.site-footer p { margin: 0.4rem 0; }
.fine { font-size: 0.82rem; }

a { color: var(--primary); }
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* ------------------------------------------------------------- documents */

.prose { padding-top: 1.5rem; padding-bottom: 2rem; }

.prose h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 0.5rem 0 1rem;
  letter-spacing: -0.02em;
}
.prose h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 2.2rem 0 0.6rem;
  padding-top: 0.4rem;
}
.prose h3 {
  font-size: 1.08rem;
  margin: 1.6rem 0 0.4rem;
}
.prose h4, .prose h5, .prose h6 {
  font-size: 1rem;
  margin: 1.2rem 0 0.3rem;
}

.prose p { margin: 0.85rem 0; }
.prose ul, .prose ol { margin: 0.85rem 0; padding-left: 1.4rem; }
.prose li { margin: 0.4rem 0; }

.prose hr {
  border: 0;
  border-top: 1px solid var(--outline-variant);
  margin: 2rem 0;
}

.prose blockquote {
  margin: 1.2rem 0;
  padding: 0.1rem 1rem;
  border-left: 4px solid var(--primary-container);
  /* The plain declaration first, for Chrome below 111 — a real share of Android
   * phones in this market. Browsers that do not know `color-mix` keep it. */
  background: transparent;
  background: color-mix(in srgb, var(--primary-container) 22%, transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.88em;
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

/*
 * A three-column table does not fit a 360px phone. The scroller is on the table
 * alone so the page body never scrolls sideways — a horizontally scrolling page
 * on a phone reads as a broken page.
 */
.table-scroll {
  overflow-x: auto;
  margin: 1.2rem 0;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
  font-size: 0.94rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--outline-variant);
}

thead th {
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  font-weight: 600;
}

tbody tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------- placeholders */

/*
 * The point is that a human proof-reading the published page cannot skim past
 * one. Colour alone would not survive a monochrome print or a colour-blind
 * reader, so the marker also carries the words "TO FILL IN" and a warning sign.
 */
.placeholder,
.placeholder-example {
  display: inline-block;
  background: var(--warn-container);
  color: var(--on-warn-container);
  border: 2px dashed var(--warn);
  border-radius: 6px;
  padding: 0 0.35em;
  font-weight: 700;
  font-size: 0.86em;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* -------------------------------------------------------------- banners */

.banner {
  margin: 1.2rem 0 1.6rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 2px solid;
  font-size: 0.95rem;
}

.banner p { margin: 0.4rem 0; }
.banner p:first-child { margin-top: 0; }
.banner p:last-child { margin-bottom: 0; }

.banner-stop {
  background: var(--error-container);
  color: var(--on-error-container);
  border-color: var(--error);
}

.banner-note {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-color: var(--primary);
}

.banner-warn {
  background: var(--warn-container);
  color: var(--on-warn-container);
  border-color: var(--warn);
}

/* ---------------------------------------------------------------- landing */

.hero { padding: 2.5rem 0 1rem; }

.hero h1 {
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.lede {
  font-size: 1.1rem;
  color: var(--on-surface-variant);
  margin: 0 0 1.5rem;
}

.cards {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

.card {
  display: block;
  padding: 1rem;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  background: transparent;
  background: color-mix(in srgb, var(--surface-variant) 30%, transparent);
}

.card:hover, .card:focus-visible {
  border-color: var(--primary);
}

.card strong { display: block; color: var(--primary); margin-bottom: 0.2rem; }
.card span { font-size: 0.92rem; color: var(--on-surface-variant); }

/* ----------------------------------------------------------------- forms */

.step { margin: 1.5rem 0; }
.step[hidden] { display: none; }

.field { margin: 1.2rem 0; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.hint {
  display: block;
  font-weight: 400;
  font-size: 0.88rem;
  color: var(--on-surface-variant);
  margin-bottom: 0.4rem;
}

input[type="tel"],
input[type="text"] {
  width: 100%;
  /* 1rem minimum, or iOS Safari zooms the viewport on focus. */
  font-size: 1.05rem;
  font-family: inherit;
  padding: 0.7rem 0.8rem;
  color: var(--on-surface);
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
}

input.code {
  letter-spacing: 0.4em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

button {
  font: inherit;
  font-weight: 600;
  /* 48px tall at the default font size — a thumb target, not a mouse target. */
  padding: 0.75rem 1.2rem;
  min-height: 48px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--primary);
  color: var(--on-primary);
  cursor: pointer;
}

button[disabled] { opacity: 0.55; cursor: default; }

button.secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--outline);
}

button.danger {
  background: var(--error);
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  button.danger { color: #410e0b; }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 400;
  margin: 1.2rem 0;
}

.checkbox input {
  /* Big enough to hit on a phone; this is the last stop before deletion. */
  width: 1.4rem;
  height: 1.4rem;
  margin: 0.15rem 0 0;
  flex: none;
  accent-color: var(--error);
}

.status {
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  border: 2px solid var(--error);
  background: var(--error-container);
  color: var(--on-error-container);
  font-size: 0.95rem;
}

.status[hidden] { display: none; }

.busy { color: var(--on-surface-variant); font-size: 0.95rem; margin-top: 0.8rem; }
.busy[hidden] { display: none; }

.progress {
  display: flex;
  gap: 0.5rem;
  padding: 0;
  margin: 1.5rem 0 0;
  list-style: none;
  font-size: 0.85rem;
  color: var(--on-surface-variant);
}

.progress li {
  flex: 1;
  padding-top: 0.4rem;
  border-top: 4px solid var(--outline-variant);
}

.progress li[aria-current="step"] {
  color: var(--primary);
  font-weight: 700;
  border-top-color: var(--primary);
}

.noscript {
  border: 2px solid var(--warn);
  background: var(--warn-container);
  color: var(--on-warn-container);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin: 1.2rem 0;
}

/*
 * The wordmark is an image now, not styled text.
 *
 * `brand/README.txt` forbids letterspacing, outlining, splitting the word, or
 * flipping the two weights — all of which a CSS re-creation invites the first
 * time somebody adjusts the header. A PNG cannot be got wrong that way, and it
 * needs no webfont: the letterforms are Archivo, and shipping a variable font
 * to render eleven characters would cost more than the image does.
 *
 * Two files rather than one, chosen by the browser: the horizontal lockup is
 * ink-on-light and there is a reverse lockup for dark, per the same document.
 * `<picture>` does the switch, so it also works with CSS disabled.
 */
.wordmark img {
  display: block;
  height: 20px;
  width: auto;
}
