/* Funeral Suite - shared foundations.
   Linen ground, ink type, one rose for numerals, hairline rules. Objects that
   are paper look like paper (white, a soft shadow); everything else is flat.
   System fonts only: nothing is fetched from a third party, which is part of
   the privacy promise on the landing page. */

:root {
  --paper: #e8e1d5;
  --paper-2: #fbf8f1;
  --paper-3: #f1eee8;
  --ink: #2b2926;
  --ink-2: #5c5955;
  --ink-3: #8f8a82;
  --rule: #cbc4b7;
  --rule-strong: #a59d90;
  --accent: #2b2926;
  --accent-ink: #111110;
  --accent-soft: #f1eee8;
  --rose: #b78c85;
  --warn: #8a5a2b;
  --warn-soft: #f3e9d8;
  --focus: #2f6f8f;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --w-page: 68rem;
  --w-text: 38rem;
  --r: 0px;
  --step: clamp(1.5rem, 4vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1c1a17;
    --paper-2: #26231f;
    --paper-3: #2e2a25;
    --ink: #efe9de;
    --ink-2: #cdc4b4;
    --ink-3: #9c9284;
    --rule: #3f3a33;
    --rule-strong: #5c554b;
    --accent: #efe9de;
    --accent-ink: #ffffff;
    --accent-soft: #2e2a25;
    --rose: #c9a09a;
    --warn: #d6a76a;
    --warn-soft: #2a2317;
    --focus: #7fb8d6;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.2rem; }

/* The two small voices used everywhere: a spaced capital label, and the rose
   numeral that counts the five things. */
.k { font-family: var(--sans); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); }
.num { font-family: var(--serif); color: var(--rose); font-weight: 400; }
p { margin: 0 0 1em; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--step) 0; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r);
}

/* Nothing may make the document wider than the screen. One unconstrained
   table was enough to push every section sideways, header included, and on a
   phone that reads as a broken site rather than as one wide element. `clip`
   rather than `hidden` so position: sticky keeps working. */
html { overflow-x: clip; }
img, svg, video, table, pre { max-width: 100%; }

.wrap { width: min(100% - 2.5rem, var(--w-page)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, var(--w-text)); margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.serif { font-family: var(--serif); }
.stack > * + * { margin-top: 1rem; }
.hidden { display: none !important; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--sans); font-size: .78rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  padding: 1rem 1.6rem;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--accent);
  color: var(--paper);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-lg { padding: 1.15rem 2rem; font-size: .84rem; }
.btn-sm { padding: .75rem 1.1rem; font-size: .7rem; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--paper-3); color: var(--ink); border-color: var(--ink); }
.btn-quiet { background: none; border: 0; color: var(--ink-2); padding: .5rem .25rem; font-family: var(--sans); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; }
.btn-quiet:hover { color: var(--ink); background: none; text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn { color: #1c1a17; }
}

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

label, .label { display: block; font-family: var(--sans); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .45rem; }
input[type="text"], input[type="date"], input[type="time"], input[type="number"], input[type="email"], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  padding: .8rem .9rem;
  font-family: var(--serif);
  font-size: 1.05rem;
}
textarea { min-height: 7rem; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: .7; }
/* Vertical rhythm between blocks of a form. A .grid-2 pair row is one such
   block, so it has to appear on both sides of the combinator: with only
   .field + .field, the field following a pair row sat flush against it. */
.field + .field,
.grid-2 + .field,
.field + .grid-2,
.grid-2 + .grid-2 { margin-top: 1.1rem; }
.hint { font-size: .85rem; color: var(--ink-3); margin: .35rem 0 0; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; align-items: start; }
/* The rhythm above is for blocks stacked in a column. Inside the grid the gap
   already spaces the two cells, and the margin would land on the second cell
   only - dropping the right-hand column 1.1rem below the left on every row. */
.grid-2 > .field + .field { margin-top: 0; }
@media (max-width: 34rem) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- cards, notices ---------- */

.card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: clamp(1.1rem, 3vw, 1.75rem);
}
.notice {
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--warn);
  background: var(--warn-soft);
  border-radius: var(--r);
  padding: .9rem 1.1rem;
  font-size: .92rem;
}
.notice h3 { font-family: var(--sans); font-size: .95rem; font-weight: 600; margin-bottom: .3rem; }
.notice ul { margin: .3rem 0 0; padding-left: 1.1rem; }

.tag {
  display: inline-block; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--rose); border: 1px solid var(--rose); padding: .25rem .6rem;
}

/* ---------- site chrome ---------- */

.site-head {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.site-head .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: 1.4rem 0; }
.site-head .brand { grid-column: 2; }
.site-head .brand + * { grid-column: 3; justify-self: end; }
.brand { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); text-decoration: none; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.brand span { color: var(--ink); }

.site-foot {
  border-top: 1px solid var(--ink);
  margin-top: calc(var(--step) * 2);
  padding: 1.4rem 0 3rem;
  font-family: var(--sans); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-3);
}
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-bottom: .75rem; }
.site-foot p { text-transform: none; letter-spacing: 0; font-size: .85rem; }

/* ---------- legal pages ---------- */

.legal { padding: clamp(2rem, 5vw, 3.5rem) 0 var(--step); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 2rem clamp(2rem, 6vw, 6rem); align-items: start; }
.legal-side { position: sticky; top: 1.5rem; }
.legal-side h1 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.06; margin: .5rem 0 1rem; }
.legal-side .note { font-size: .9rem; line-height: 1.6; color: var(--ink-2); margin: 0; }
.toc { list-style: none; margin: 1.5rem 0 0; padding: 0; border-top: 1px solid var(--ink); }
.toc li { padding: .6rem 0; border-bottom: 1px solid var(--rule); font-family: var(--sans); font-size: .8rem; letter-spacing: .06em; }
.toc li a { color: var(--ink-2); text-decoration: none; }
.toc li.on a { color: var(--ink); }
.toc li a:hover { text-decoration: underline; text-underline-offset: 3px; }
.legal-body { font-family: var(--serif); font-size: 1.1rem; line-height: 1.7; max-width: 42rem; }
.legal-body > .k { display: block; margin-bottom: 1rem; }
.legal-body h2 { font-size: 1.6rem; margin: 2.25rem 0 .6rem; }
.legal-body p { margin: 0 0 1em; }
.legal-body li { margin-bottom: .4rem; }
@media (max-width: 46rem) {
  .legal { grid-template-columns: 1fr; gap: 1.5rem; }
  .legal-side { position: static; }
  .legal-body { font-size: 1.05rem; }
}

/* ---------- misc ---------- */

.spinner {
  width: 1em; height: 1em; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  display: inline-block; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
  * { scroll-behavior: auto !important; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- phones ----------
   Half the people organising a service are over fifty-five and doing this on
   a phone at the kitchen table. Type a size up, and every target tall enough
   to hit with a thumb. */
@media (max-width: 34rem) {
  body { font-size: 18px; }
  .site-head .wrap { display: flex; justify-content: space-between; }
  .brand { font-size: .95rem; letter-spacing: .1em; }
  .btn { min-height: 3rem; padding: .95rem 1.4rem; white-space: normal; text-align: center; line-height: 1.3; }
  .btn-lg { min-height: 3.4rem; font-size: 1.1rem; }
  .btn-quiet { min-height: 2.75rem; padding: .6rem .5rem; }
  input[type="text"], input[type="date"], input[type="time"], input[type="number"], input[type="email"], textarea, select {
    font-size: 1.05rem; padding: .85rem .9rem;
  }
  label, .label { font-size: .95rem; }
  .hint { font-size: .9rem; }
  .small { font-size: .92rem; }
}
