:root {
  color-scheme: light dark;
  --paper: #f5efe1;
  --paper-well: #fbf8f0;
  --ink: #201c14;
  --ink-soft: #4d4636;
  --muted: #8c826d;
  --hairline: #ded2b4;
  --accent: #b8451f;
  --accent-ink: #fff8ef;
  --accent-soft: rgba(184, 69, 31, 0.1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a1712;
    --paper-well: #211d16;
    --ink: #efe7d4;
    --ink-soft: #cabfa4;
    --muted: #8c8268;
    --hairline: #37311f;
    --accent: #e37a48;
    --accent-ink: #211004;
    --accent-soft: rgba(227, 122, 72, 0.14);
  }
}
* { box-sizing: border-box; }
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
}

.kicker {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 4.5rem;
}

.quote {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 0 3rem;
}

.kind {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

blockquote {
  margin: 0;
  font-size: clamp(1.5rem, 5.2vw, 2.4rem);
  line-height: 1.35;
  letter-spacing: 0;
  font-weight: 500;
  text-wrap: balance;
}

.attribution {
  margin: 1.75rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
#author {
  font-size: 1rem;
  font-weight: 600;
}
.source {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  color: var(--muted);
}

.controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}
button {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid var(--accent);
  border-radius: 0.25rem;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
button:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
button.ghost {
  background: transparent;
  color: var(--accent);
}
button.ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
button.link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
button.link:hover { background: none; color: var(--accent); }
button:disabled { opacity: 0.55; cursor: default; }

.error {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: var(--paper-well);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  padding: 0.9rem 1.1rem;
  margin: 0 0 2.5rem;
}

.hidden { display: none; }

.quote.fade-in { animation: fade-in 0.5s ease both; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(0.35rem); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  .quote.fade-in { animation: none; }
}

footer {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
  margin-top: auto;
}
footer a { color: inherit; }
footer a:hover { color: var(--accent); }
footer .sep { opacity: 0.5; }

@media (max-width: 480px) {
  .kicker { margin-bottom: 3rem; }
  blockquote { font-size: 1.45rem; }
  footer { flex-direction: column; gap: 0.2rem; }
  footer .sep { display: none; }
}
