/* Fenimore Industries: shared stylesheet */

:root {
  --paper: #F5F2EA;
  --ink: #1C1C1A;
  --rule: #6B675E;
  --muted: #6B675E;
  --accent: #AB5227; /* brief copper #B4572A, darkened slightly to pass WCAG AA on paper */
  --on-accent: #FFFFFF;
  --error: #9E2A1C;

  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --column: 720px;
  --gutter: 24px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161614;
    --ink: #E8E4DA;
    --rule: #6B675E;
    --muted: #A39E92;
    --accent: #D9824F;
    --on-accent: #161614;
    --error: #F08C78;
  }
}

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
}

/* Skip link */

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 14px;
  z-index: 10;
}

.skip-link:focus {
  top: 8px;
}

/* Layout */

.wrap {
  width: 100%;
  max-width: calc(var(--column) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main.wrap {
  flex: 1 0 auto;
  padding-top: 56px;
  padding-bottom: 72px;
}

main p,
main ul,
main ol {
  max-width: 65ch;
}

/* Links and focus */

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration: underline;
}

main a,
.site-footer a {
  text-decoration: underline;
  text-decoration-color: transparent;
}

main a:hover,
.site-footer a:hover {
  text-decoration-color: currentColor;
}

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

/* Header */

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

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.18em;
  white-space: nowrap;
}

.wordmark:hover {
  text-decoration: none;
}

.wordmark::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  background: var(--accent);
  flex: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.site-nav a:hover {
  color: var(--accent);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
}

/* Type */

h1,
h2 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-size: 40px;
  margin-bottom: 28px;
}

h2 {
  font-size: 26px;
  margin-bottom: 16px;
}

h3 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  margin: 32px 0 8px;
}

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

p {
  margin: 0 0 18px;
}

.label {
  display: block;
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Sections, separated by thin rules */

.section {
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid var(--rule);
}

.section > :last-child,
main > :last-child {
  margin-bottom: 0;
}

.plain-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 15px;
}

.history {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history li {
  display: grid;
  grid-template-columns: 7ch 1fr;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--rule);
}

.history li:last-child {
  border-bottom: 0;
}

.history .when {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--muted);
  padding-top: 2px;
}

.signature {
  font-family: var(--serif);
  font-style: italic;
}

/* Figure (line drawing) */

.drawing {
  margin: 40px 0 8px;
  color: var(--ink);
}

.drawing svg {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
}

.drawing figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Form */

.form {
  margin-top: 40px;
  max-width: 560px;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field .opt {
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.4;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

.field select option {
  background: var(--paper);
  color: var(--ink);
}

.field textarea {
  min-height: 180px;
  resize: vertical;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

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

.turnstile {
  margin: 8px 0 20px;
  min-height: 65px;
}

.button {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-error {
  margin: 0 0 24px;
  padding: 12px 16px;
  border: 1px solid var(--error);
  color: var(--error);
}

.form-error:empty {
  display: none;
}

.note {
  margin-top: 24px;
  color: var(--muted);
  font-size: 16px;
}

.contact-line {
  margin-top: 32px;
  font-family: var(--mono);
  font-size: 15px;
}

/* Footer */

.site-footer {
  padding-bottom: 40px;
}

.footer-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

@media (max-width: 600px) {
  body {
    font-size: 17px;
  }

  :root {
    --gutter: 16px;
  }

  main.wrap {
    padding-top: 40px;
    padding-bottom: 56px;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 23px;
  }

  .wordmark {
    font-size: 13px;
  }

}

