:root {
  --paper: #f2eddf;
  --ink: #171713;
  --muted: #6d695e;
  --line: #b9b2a2;
  --signal: #ff4b22;
  --signal-dark: #d72d0c;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(23, 23, 19, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 19, .025) 1px, transparent 1px);
  background-size: 28px 28px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

button, input { font: inherit; }
button { color: inherit; }

.page-shell {
  width: min(1120px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.masthead {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.wordmark {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: .2em;
}

.wordmark-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  background: var(--signal);
  border-radius: 50%;
}

.privacy-note { margin: 0; color: var(--muted); }
.privacy-note span { margin-right: 7px; color: #439b65; font-size: 8px; }

main { flex: 1; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 340px);
  column-gap: 72px;
  align-items: end;
  padding: 74px 0 58px;
  border-bottom: 1px solid var(--ink);
}

.eyebrow {
  grid-column: 1 / -1;
  margin: 0 0 24px;
  color: var(--signal-dark);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: clamp(68px, 8.6vw, 126px);
  font-weight: 400;
  line-height: .75;
  letter-spacing: -.055em;
}

h1 em { color: var(--signal); font-weight: 400; }

.intro {
  margin: 0 0 2px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.workbench { padding: 44px 0 58px; }

.fields {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 32px;
}

.field {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 4px 0;
}

.field-number {
  grid-row: 1 / 3;
  padding-top: 4px;
  color: var(--signal-dark);
  font-size: 9px;
}

.field-label {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.input-wrap {
  grid-column: 2;
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--ink);
}

.input-wrap:focus-within { border-color: var(--signal); }

input {
  width: 100%;
  height: 66px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 36px;
}

input::placeholder { color: #9b9587; opacity: 1; }
.username-wrap input { padding-left: 30px; }
.at { position: absolute; left: 0; color: var(--signal); font-family: "Iowan Old Style", "Baskerville", serif; font-size: 34px; }

.token-wrap input {
  padding-right: 66px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 18px;
  letter-spacing: .04em;
}

.reveal-button, .reset-button {
  border: 0;
  padding: 8px 0;
  background: transparent;
  font-size: 9px;
  letter-spacing: .1em;
  cursor: pointer;
}

.reveal-button { position: absolute; right: 0; }
.reveal-button:hover, .reset-button:hover { color: var(--signal-dark); }

.form-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 32px;
  margin-top: 36px;
  padding-left: 38px;
}

.token-help {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.token-help strong { color: var(--ink); font-weight: 500; }

.submit-button {
  display: flex;
  align-items: center;
  gap: 48px;
  min-width: 248px;
  height: 62px;
  padding: 0 10px 0 22px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}

.submit-button:hover { transform: translateY(-3px); background: var(--signal-dark); }
.submit-button:disabled { cursor: wait; opacity: .65; transform: none; }
.button-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.button-arrow { display: grid; place-items: center; width: 42px; height: 42px; margin-left: auto; background: var(--signal); font-size: 20px; }

.form-error {
  min-height: 18px;
  margin: 22px 0 0 38px;
  color: #b3261e;
  font-size: 11px;
}

.results {
  padding: 54px 0 50px;
  border-top: 1px solid var(--ink);
  animation: reveal .5s ease both;
}

.results[hidden] { display: none; }

.results-heading-row { display: flex; justify-content: space-between; align-items: end; }
.results h2 { margin: 0; font-family: "Iowan Old Style", "Baskerville", serif; font-size: 58px; font-weight: 400; letter-spacing: -.03em; }
.results .eyebrow { margin-bottom: 8px; }
.reset-button { border-bottom: 1px solid var(--ink); }

.scoreboard {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  margin-top: 34px;
  border: 1px solid var(--ink);
}

.score { min-height: 190px; padding: 22px; border-left: 1px solid var(--ink); }
.score:first-child { border-left: 0; }
.score p { margin: 0; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.score strong { display: block; margin-top: 22px; font-family: "Iowan Old Style", "Baskerville", serif; font-size: 92px; font-weight: 400; line-height: 1; }
.total-score { background: var(--signal); }
.result-footnote { margin: 16px 0 0; color: var(--muted); font-size: 9px; text-align: right; text-transform: uppercase; }

footer {
  display: flex;
  justify-content: space-between;
  padding: 20px 0;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .page-shell { width: min(100% - 28px, 1120px); }
  .masthead { min-height: 72px; }
  .privacy-note { font-size: 8px; }
  .hero { grid-template-columns: 1fr; gap: 34px; padding: 52px 0 42px; }
  h1 { font-size: clamp(62px, 20vw, 94px); line-height: .79; }
  .intro { max-width: 420px; }
  .fields { grid-template-columns: 1fr; gap: 34px; }
  .form-footer { grid-template-columns: 1fr; padding-left: 38px; }
  .submit-button { width: 100%; }
  .scoreboard { grid-template-columns: 1fr 1fr; }
  .score { min-height: 150px; }
  .total-score { grid-column: 1 / -1; border-bottom: 1px solid var(--ink); }
  .score:nth-child(2) { border-left: 0; }
  .score strong { font-size: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
