/* Simple pages (About, Contact, 404): a short footage frame for the title,
   then readable text on the page. */

.page-head {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) var(--gutter) 0;
}

.page-head__frame {
  --corner: 1.5rem;
  --corner-weight: 3px;
  --corner-inset: clamp(0.75rem, 2vw, 1.125rem);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 2rem;
  min-height: min(22rem, 50svh);
  /* Side padding follows the screen width, not the text size, so large text keeps its room. */
  padding: max(clamp(1.75rem, 5vw, 3.25rem), var(--corner-clearance)) min(clamp(1.75rem, 5vw, 3.25rem), 7.5vw);
}

.page-head__frame > * {
  min-width: 0;
}

.page-head__osd {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  font-size: 1.125rem;
}

.page-head__body {
  align-self: end;
}

.page-head__title {
  margin: 0;
  text-wrap: balance;
  font-family: var(--font-display);
  font-size: min(clamp(2.75rem, 1.5rem + 5vw, 5.75rem), 11.5vw);
  font-stretch: 80%;
  font-weight: 800;
  font-variation-settings: "opsz" 96;
  line-height: 0.92;
  letter-spacing: -0.015em;
}

.page-head__dek {
  max-width: var(--measure);
  margin: 1rem 0 0;
  font-size: clamp(1.25rem, 1.05rem + 0.6vw, 1.5rem);
  line-height: 1.45;
}

.page-body {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
}

.page-body > * {
  max-width: var(--measure);
}

.page-body h2 {
  margin: 2.5rem 0 1rem;
  font-family: var(--font-display);
  /* On phones with large text, headings stay above body text but below the page title. */
  font-size: min(clamp(1.75rem, 1.3rem + 1.5vw, 2.5rem), max(9vw, 1.25rem));
  font-stretch: 85%;
  font-weight: 750;
  line-height: 1.05;
}

.page-body h2:first-child {
  margin-top: 0;
}

.page-body p {
  margin: 0 0 1em;
}

/* The history: a tape counter down the side, one year per line. */

.history {
  display: grid;
  gap: 1.25rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

/* Year beside the text when there's room, above it when there isn't. Wrapping
   follows the space itself, so large text stacks too. */
.history li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem 1rem;
  align-items: baseline;
}

.history__text {
  flex: 1 1 16.5rem;
  min-width: 0;
}

.history__text p {
  margin: 0;
}

.history__text p + p {
  margin-top: 0.75em;
}

.history time {
  flex: 0 0 4.5rem;
  font-family: var(--font-osd);
  font-size: 1.25rem;
  color: var(--ink-muted);
}

/* Contact form: one field per line, at reading width. Field edges stay at
   3:1 contrast or more against the page, so each field is easy to find. */

:root {
  --field-edge: #85838b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --field-edge: #74727a;
  }
}

.contact-form {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
}

.contact-form__field {
  display: grid;
  gap: 0.4rem;
  width: 100%;
}

.contact-form label {
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--field-edge);
  border-radius: 0.4rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  border-color: var(--pen);
  outline: 3px solid var(--pen);
  outline-offset: 1px;
}

/* Only after someone has tried, so the empty form doesn't start out red. */
.contact-form :user-invalid {
  border-color: var(--rec);
}

.contact-form__trap {
  position: absolute;
  left: -100vw;
}

.contact-form__send:disabled {
  opacity: 0.7;
  cursor: progress;
}

.contact-form__status p {
  margin: 0;
}
