:root {
  --ink: #191816;
  --paper: #f2efe7;
  --paper-deep: #e5dfd2;
  --red: #a4372d;
  --green: #244d43;
  --line: #bcb3a3;
  --muted: #6f6a61;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(0deg, transparent 0, transparent 27px, rgba(25, 24, 22, .035) 28px);
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.masthead {
  min-height: 132px;
  padding: 30px clamp(24px, 6vw, 88px);
  border-bottom: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.masthead > div:first-child { position: relative; padding-left: 72px; }
.masthead h1 { margin: 0; font-size: 46px; line-height: 1; font-weight: 500; }
.seal {
  position: absolute;
  left: 0;
  top: 0;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--red);
  font-size: 27px;
  border: 2px solid var(--red);
  outline: 1px solid var(--paper);
  outline-offset: -5px;
}
.eyebrow, .folio, .meta {
  margin: 0 0 8px;
  font-family: "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0;
  color: var(--muted);
}
.auth-view { min-height: calc(100vh - 133px); display: grid; grid-template-columns: 1.2fr .8fr; }
.auth-copy { padding: clamp(60px, 10vw, 140px) clamp(32px, 10vw, 150px); border-right: 1px solid var(--ink); }
.auth-copy h2 { max-width: 700px; margin: 24px 0; font-size: 48px; line-height: 1.16; font-weight: 400; }
.auth-copy > p:last-child { color: var(--muted); }
.auth-form { align-self: center; padding: 48px clamp(28px, 7vw, 100px); }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 34px; }
.tab { flex: 1; padding: 12px; border: 0; color: var(--muted); background: transparent; }
.tab.active { color: var(--ink); border-bottom: 3px solid var(--red); }
label { display: block; margin: 20px 0; font-size: 14px; }
input, textarea {
  width: 100%;
  display: block;
  margin-top: 8px;
  padding: 12px 2px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  outline: none;
}
textarea { border: 1px solid var(--line); padding: 12px; resize: vertical; line-height: 1.8; }
input:focus, textarea:focus { border-color: var(--red); box-shadow: 0 2px 0 var(--red); }
.primary {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--ink);
  color: var(--paper);
  background: var(--ink);
}
.primary:hover { background: var(--green); }
.error { min-height: 22px; color: var(--red); font-size: 13px; }
.user-bar { display: flex; gap: 16px; align-items: center; font-family: "Courier New", monospace; font-size: 13px; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--ink); background: transparent; font-size: 22px; }
.archive-view { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; min-height: calc(100vh - 133px); }
.composer { padding: 48px clamp(24px, 4vw, 60px); border-right: 1px solid var(--ink); background: rgba(229, 223, 210, .5); }
.composer h2, .collection h2 { margin: 6px 0 24px; font-size: 32px; font-weight: 400; }
.collection { padding: 48px clamp(24px, 6vw, 88px); }
.collection-heading { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.count { display: grid; place-items: center; min-width: 46px; height: 46px; color: var(--paper); background: var(--green); font-family: "Courier New", monospace; }
.poem { position: relative; padding: 34px 20px 34px 70px; border-bottom: 1px solid var(--line); }
.poem-number { position: absolute; left: 4px; top: 38px; color: var(--red); font-family: "Courier New", monospace; font-size: 12px; }
.poem h3 { margin: 0 0 18px; font-size: 25px; font-weight: 500; }
.verse { margin: 0 0 24px; white-space: pre-wrap; line-height: 2; }

button:disabled { opacity: .55; cursor: wait; }
h2, h3, p, dd, #username { overflow-wrap: anywhere; }
.collection, .composer { min-width: 0; }
.consent-view { max-width: 680px; margin: 0 auto; padding: 48px 24px; }
.consent-view h2 { font-size: 32px; }
.consent-view h3 { font-size: 24px; }
.consent-view p, .consent-view li { line-height: 1.8; }
.consent-view dt { color: var(--muted); margin-top: 20px; }
.consent-view dd { margin: 6px 0; }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.consent-actions button, .grant button { min-height: 44px; border: 1px solid var(--ink); padding: 8px 16px; }
.grant-section { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 24px; }
.grant-section h2 { font-size: 24px; }
.grant { padding: 16px 0; border-bottom: 1px solid var(--line); }
.grant p { line-height: 1.6; }

@media (max-width: 760px) {
  .masthead { min-height: 104px; padding: 20px; }
  .masthead > div:first-child { padding-left: 58px; }
  .masthead h1 { font-size: 34px; }
  .seal { width: 44px; height: 44px; font-size: 22px; }
  .eyebrow { display: none; }
  .auth-view, .archive-view { display: block; }
  .auth-copy, .composer { border-right: 0; border-bottom: 1px solid var(--ink); }
  .auth-copy { padding: 48px 24px; }
  .auth-copy h2 { font-size: 42px; }
  .auth-form, .collection { padding: 40px 24px; }
  .user-bar #username { display: none; }
}