/* Shared sheet for every page except index.html.
 *
 * index.html keeps its own inline styles: it is one file that has to render
 * with no second request, and it predates this stylesheet. Everything below is
 * the same palette and type pairing from docs/design.md — paper, ink, hairline
 * rules, Playfair for the wordmark, Inter for the text, no accent colour.
 *
 * Plain CSS on purpose. The landing page has no build step and adding one for
 * three documents would be the most expensive thing in this directory. */

:root {
  --paper: #f7f5f0;
  --sheet: #ffffff;
  --ink: #111111;
  --muted: #6e6a63;
  --rule: #e2ded6;
  color-scheme: light;
}

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

body {
  margin: 0;
  min-height: 100svh;
  padding: clamp(1.25rem, 5vw, 3rem);
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.sheet {
  width: min(46rem, 100%);
  margin: 0 auto;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: clamp(1.75rem, 6vw, 3.5rem);
}

/* Masthead ----------------------------------------------------------------- */

.masthead {
  text-align: center;
}

.action-link {
  display: inline-block;
  padding: 0.75rem 1.125rem;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}

.action-link:focus-visible {
  outline: 3px solid var(--muted);
  outline-offset: 3px;
}

.masthead a {
  display: inline-block;
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 900;
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  letter-spacing: 0.08em;
  color: inherit;
  text-decoration: none;
}

/* The double rule under a masthead is the oldest newspaper cue there is. The
   height has to exceed the two borders, otherwise they collapse into one bar
   and the effect is lost. */
.rule-double {
  margin: 0.75rem 0 0;
  border: 0;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  height: 7px;
}

.dateline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.375rem 1.25rem;
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Draft banner ------------------------------------------------------------- */

.draft {
  margin: clamp(1.5rem, 5vw, 2rem) 0 0;
  padding: clamp(0.875rem, 3vw, 1.125rem);
  background: var(--ink);
  color: var(--paper);
  border-radius: 3px;
  font-size: 0.9375rem;
}

.draft strong {
  display: block;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

/* Text --------------------------------------------------------------------- */

h1 {
  margin: clamp(1.5rem, 5vw, 2rem) 0 0;
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  line-height: 1.15;
}

h2 {
  margin: clamp(1.75rem, 5vw, 2.25rem) 0 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 1.0625rem;
  font-weight: 600;
}

h3 {
  margin: 1.5rem 0 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

p,
ul,
ol,
dl {
  margin: 0.75rem 0 0;
}

li {
  margin-top: 0.375rem;
}

dt {
  margin-top: 0.75rem;
  font-weight: 600;
}

dd {
  margin: 0.125rem 0 0;
}

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0 0.25em;
  overflow-wrap: anywhere;
}

/* A value the owner of the product still has to supply. Deliberately loud: an
   unreplaced placeholder has to be impossible to miss on a published page. */
.todo {
  border-bottom: 2px dotted var(--ink);
  font-weight: 600;
}

.lede {
  margin: 1rem 0 0;
  font-size: 1.0625rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Footer ------------------------------------------------------------------- */

.page-footer {
  margin: clamp(2rem, 6vw, 2.75rem) 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-footer a {
  color: inherit;
}

/* Form (reset-password) ---------------------------------------------------- */

.field {
  margin: 1.25rem 0 0;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  margin-top: 0.375rem;
  padding: 0.75rem;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
}

.field input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.hint {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Reserves no space when empty: a field error must not push the layout about
   on every keystroke, but an empty red line under every input is noise. */
.field-error:not(:empty) {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
}

button {
  margin: 1.5rem 0 0;
  width: 100%;
  padding: 0.875rem;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}

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

.notice {
  margin: 1.5rem 0 0;
  padding: clamp(0.875rem, 3vw, 1.125rem);
  border: 1px solid var(--ink);
  border-radius: 3px;
}

.notice strong {
  display: block;
}

.notice p {
  margin-top: 0.5rem;
}

.notice.ok {
  background: var(--ink);
  color: var(--paper);
}

[hidden] {
  display: none !important;
}
