/* worththehour.com: light porcelain, ink and one iris accent, phone first. The question from a
   course is the one large thing on the page; everything around it stays quiet. */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --porcelain: #f6f7f9;
  --paper: #ffffff;
  --ink: #16181d;
  --ink-soft: #4a4f5a;
  --rule: #dfe2e8;
  --iris: #5b5bd6;
  --iris-deep: #3e3eb0;
  --iris-soft: #ececfb;
  --right: #1f7a4d;
  --right-soft: #e6f4ec;
  --wrong: #b4233c;
  --wrong-soft: #fbe9ec;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--porcelain);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}

.masthead, main, footer {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 20px;
}

.masthead { padding-top: 20px; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font: 600 19px/1 var(--serif);
}
.wordmark svg { color: var(--iris); flex: none; }

.decision { padding: 40px 0 8px; }

.context {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 34rem;
}
.context h1, .context p { display: inline; margin: 0; font: inherit; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }

legend {
  padding: 0;
  margin: 0 0 28px;
  font: 600 clamp(27px, 7.4vw, 40px)/1.18 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

fieldset button {
  display: block;
  width: 100%;
  min-height: 56px;
  margin: 0 0 10px;
  padding: 14px 16px 14px 18px;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease;
}
fieldset button:hover { border-color: var(--iris); }
fieldset button[data-chosen="right"] { border-color: var(--right); background: var(--right-soft); }
fieldset button[data-chosen="wrong"] { border-color: var(--wrong); background: var(--wrong-soft); }

.feedback {
  margin: 6px 0 0;
  font: 18px/1.6 var(--serif);
  max-width: 34rem;
}
.feedback:empty { display: none; }
.feedback[data-state="right"] { color: var(--right); }
.feedback[data-state="wrong"] { color: var(--ink); }

.about {
  margin-top: 44px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}
.about p {
  margin: 0 0 18px;
  font: 19px/1.65 var(--serif);
  max-width: 34rem;
}

.notify { padding: 20px 0 8px; }
.notify h2 {
  margin: 0 0 16px;
  font: 600 22px/1.3 var(--serif);
}
.notify form { display: grid; gap: 10px; max-width: 26rem; }
.notify label { font-weight: 500; font-size: 16px; }
.notify input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #c9ced8;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: 17px var(--sans);
}
.notify form button {
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--iris);
  color: #ffffff;
  font: 600 17px var(--sans);
  cursor: pointer;
}
.notify form button:hover { background: var(--iris-deep); }
.notify form button:disabled { opacity: 0.7; cursor: progress; }
.promise { margin: 12px 0 0; color: var(--ink-soft); font-size: 16px; max-width: 26rem; }
.answer { margin: 12px 0 0; font-size: 17px; max-width: 26rem; }
.answer:empty { display: none; }
.answer[data-state="right"] { font: 19px/1.6 var(--serif); }
.answer[data-state="wrong"] { color: var(--wrong); }

footer { padding-top: 48px; padding-bottom: 40px; }
footer p { margin: 0; color: var(--ink-soft); font-size: 15px; }

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

@media (min-width: 900px) {
  .decision { padding-top: 48px; }
  .masthead { padding-top: 32px; }
}

/* On a wide screen the decision keeps the left, and what Worth the Hour is and its one action
   sit beside it, so the whole page is read without scrolling. */
@media (min-width: 1100px) {
  .masthead, main, footer { max-width: 76rem; padding-left: 48px; padding-right: 48px; }
  main {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-rows: auto 1fr;
    column-gap: 80px;
  }
  .decision { grid-row: 1 / span 2; }
  .about { grid-column: 2; margin-top: 0; padding-top: 48px; border-top: 0; }
  .about p { font-size: 17px; line-height: 1.6; margin-bottom: 14px; }
  .notify { grid-column: 2; padding-top: 4px; }
  .notify h2 { margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
