/* Three inks, like the 1967 plates: paper white, black, vermilion. */
:root {
  --paper: #f7f5f0;
  --ink: #161616;
  --red: #e2412b;
  --tint: #f7cfc4;
  --muted: #5c5a55;
  --card: #ffffff;
  --display: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --display-sc: "IM Fell English SC", "IM Fell English", Georgia, serif;
  --text: "EB Garamond", Garamond, "Iowan Old Style", Georgia, serif;
  --write: "Literata", "Iowan Old Style", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131313;
    --ink: #eeeae2;
    --red: #ff5a3c;
    --tint: #4a221b;
    --muted: #a8a49b;
    --card: #1c1c1c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 18px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 2px solid var(--ink);
  font-family: var(--display-sc);
  font-size: 19px;
  letter-spacing: 0.06em;
}
.top nav { display: flex; gap: 10px; align-items: center; }
.top form { margin: 0; }
.mark { color: var(--ink); text-decoration: none; }
.mark::before {
  content: "";
  display: inline-block;
  width: 10px; height: 10px;
  margin-right: 10px;
  background: var(--red);
  border-radius: 50%;
  vertical-align: 1px;
}

.btn {
  font: 400 16px var(--display-sc);
  letter-spacing: 0.08em;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  padding: 8px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn.ghost { background: transparent; color: var(--ink); }
.btn:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn:focus-visible, input:focus-visible, .dots button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(24px, 5vw, 80px);
  padding: 32px clamp(16px, 5vw, 80px) 48px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(56px, 8.8vw, 124px);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.015em;
  margin: 0 0 28px;
}
.intro .lede {
  font-size: clamp(21px, 2.2vw, 27px);
  font-style: italic;
  line-height: 1.35;
  margin: 0;
  max-width: 24ch;
  padding-top: 18px;
  border-top: 6px solid var(--red);
}

.intro .about {
  margin: 28px 0 0;
  max-width: 44ch;
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
}
.about cite { font-style: italic; }
.about a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; }
.about a:hover { color: var(--red); }

/* Plates */
.plates { margin: 0; position: relative; }
.plates .plate {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.plates .plate + .plate { position: absolute; top: 0; left: 0; }
.plates .plate.on { opacity: 1; }
.dots { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.dots button {
  width: 28px; height: 6px;
  padding: 0;
  border: 0;
  background: var(--ink);
  opacity: 0.2;
  cursor: pointer;
}
.dots button[aria-selected="true"] { background: var(--red); opacity: 1; }

.s-ink { stroke: var(--ink); fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.s-red { stroke: var(--red); fill: none; stroke-width: 1.8; stroke-linecap: round; }
.s-paper { stroke: var(--paper); stroke-width: 1.4; }
.heavy { stroke-width: 3; }
.thin { stroke-width: 1; }
.wire { stroke-width: 2.2; }
.ring { stroke-width: 5; }
.grid { opacity: 0.25; }
.f-paper { fill: var(--paper); }
.f-ink { fill: var(--ink); }
.f-red { fill: var(--red); }
.f-tint { fill: var(--tint); }
.s-ink { stroke: var(--ink); }
.f-hatch { fill: url(#hatch); }
.f-stipple { fill: url(#stipple); }
.f-streak { fill: url(#streak); }
.f-sand { fill: url(#sand); }
.lead path, .plate path.lead { fill: none; stroke: var(--ink); stroke-width: 0.9; }
.lbl { font: italic 500 14px var(--text); fill: var(--ink); }
.lbl.sm { font-size: 11px; fill: var(--muted); }
.lbl.b { font-weight: 700; }
.cap { font: 400 15px var(--display-sc); letter-spacing: 0.08em; fill: var(--ink); white-space: pre; }
.src { font: italic 400 12.5px var(--text); fill: var(--muted); }
a:hover .src { fill: var(--red); text-decoration: underline; }
.cap .fig { fill: var(--red); letter-spacing: 0.04em; }

/* Motion: the runner turns, the shutter leaves open and close. */
.spin { transform-origin: 190px 190px; animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.leaf { transform-origin: 210px 60px; animation: leaf 4s ease-in-out infinite; }
@keyframes leaf {
  0%, 15% { transform: rotate(0deg); }
  45%, 65% { transform: rotate(-34deg); }
  95%, 100% { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .spin, .leaf { animation: none; }
  .plates .plate { transition: none; }
}

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; padding-top: 24px; }
  .plates { max-width: 460px; width: 100%; margin: 0 auto; }
}

/* Login and app pages */
.narrow { width: 100%; max-width: 420px; margin: 8vh auto 0; padding: 0 16px; }
.card {
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--red);
  padding: 28px;
  display: grid;
  gap: 16px;
}
.card h1, .narrow h1 { margin: 0; font: 400 38px var(--display); }
label {
  display: grid;
  gap: 6px;
  font-family: var(--display-sc);
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
input {
  font: 18px var(--text);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 10px 12px;
}
.error { color: var(--red); margin: 0; font-weight: 500; }
