@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&display=swap");

:root {
  --ink: #201e1b;
  --paper: #f3efe5;
  --sheet: #fbf8f0;
  --line: #c9c2b4;
  --muted: #716b61;
  --accent: #c65f3f;
  --accent-light: #f1ddd4;
  --error: #9f3f35;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: inherit;
  text-underline-offset: 4px;
}

button,
input,
select {
  font: inherit;
}

button,
input,
select,
a {
  -webkit-tap-highlight-color: transparent;
}

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

header {
  min-height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 8px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

header p {
  margin: 0;
  color: var(--muted);
}

header > a:last-child {
  justify-self: end;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.logo {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
}

.logo span {
  color: var(--accent);
  font-family: "Source Serif 4", serif;
  font-size: 24px;
}

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.masthead {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  padding: 88px 0 64px;
}

.masthead h1 {
  grid-column: 1 / -1;
  margin: 12px 0 0;
  font:
    400 clamp(56px, 10vw, 120px)/0.86 "Source Serif 4",
    serif;
  letter-spacing: -0.055em;
}

.intro {
  grid-column: 2;
  max-width: 560px;
  margin: 16px 0 0;
  color: var(--muted);
  font:
    400 20px/1.5 "Source Serif 4",
    serif;
}

.issue {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.builder {
  border: 1px solid var(--ink);
  background: var(--sheet);
  box-shadow: 8px 8px 0 var(--line);
}

.builder-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#draft-status {
  color: var(--accent);
}

form {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

label {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 20px 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

label:nth-of-type(odd):not(.wide) {
  border-right: 0;
}

label > span {
  font-size: 13px;
  font-weight: 600;
}

label i {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
}

label small {
  color: var(--muted);
  font-size: 11px;
}

.wide {
  grid-column: 1 / -1;
  border-right: 0;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
  background: var(--sheet);
  color: var(--ink);
}

input:invalid:not(:focus):not(:placeholder-shown) {
  border-color: var(--error);
}

.output {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: var(--accent-light);
}

.output > div {
  min-width: 0;
}

.output span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.output p {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  font: 13px/1.5 monospace;
}

button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--sheet);
  cursor: pointer;
}

button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.copy {
  flex: 0 0 auto;
}

.form-actions {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
}

.form-actions p {
  margin: 0;
  color: var(--error);
  font-size: 12px;
}

.registry {
  padding: 104px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-head h2 {
  margin: 6px 0 0;
  font:
    400 56px/1 "Source Serif 4",
    serif;
}

.registry-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quiet {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.quiet:hover {
  color: white;
}

.danger:hover {
  background: var(--error);
  border-color: var(--error);
}

.empty {
  padding: 64px 24px;
  border: 1px dashed var(--line);
  text-align: center;
  color: var(--muted);
}

.empty p {
  margin: 0 0 4px;
  color: var(--ink);
  font-family: "Source Serif 4", serif;
  font-size: 24px;
}

.registry-table {
  overflow-x: auto;
  border-top: 1px solid var(--ink);
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

th,
td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  font-size: 13px;
}

td:first-child {
  font-weight: 600;
}

td button {
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
}

.research {
  display: grid;
  grid-template-columns: 0.6fr 1.1fr 1fr;
  gap: 48px;
  padding: 64px 0 104px;
  border-top: 1px solid var(--line);
}

blockquote {
  margin: 0;
}

blockquote p {
  margin: 0;
  font:
    400 clamp(28px, 4vw, 44px)/1.12 "Source Serif 4",
    serif;
}

.research > div {
  color: var(--muted);
}

.research a {
  color: var(--accent);
}

footer {
  min-height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(20px, 4vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  header {
    grid-template-columns: 1fr auto;
  }
  header p {
    display: none;
  }
  .masthead {
    grid-template-columns: 1fr;
  }
  .masthead h1,
  .intro {
    grid-column: 1;
  }
  .intro {
    font-size: 18px;
  }
  .research {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 24px, 1120px);
  }
  .masthead {
    padding: 56px 0 40px;
  }
  .masthead h1 {
    font-size: 56px;
  }
  form {
    grid-template-columns: 1fr;
  }
  label,
  label:nth-of-type(odd):not(.wide) {
    grid-column: 1;
    border-right: 0;
    padding: 18px 16px;
  }
  .builder {
    box-shadow: 4px 4px 0 var(--line);
  }
  .output,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .form-actions button,
  .copy {
    width: 100%;
  }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .registry-actions {
    width: 100%;
  }
  .registry-actions button {
    flex: 1;
  }
  .registry {
    padding: 80px 0;
  }
}

.research a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}
