:root {
  --canvas: #c7e8f8;
  --text: #17191b;
  --muted: #526774;
  --rule: #9fc4d7;
  --accent: #416f87;
  --accent-strong: #2e596f;
  --success: #245e4f;
  --error: #8a3f39;
  color-scheme: light;
  font-family: "HanziPen SC", "HanziPen TC", "Bradley Hand", "PingFang SC",
    sans-serif;
  background: var(--canvas);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 31px,
      rgb(65 111 135 / 8%) 32px
    ),
    var(--canvas);
}

button,
input {
  font: inherit;
}

.page {
  width: min(100% - 40px, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 56px 0 32px;
  display: flex;
  flex-direction: column;
}

.masthead {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 20px;
}

.eyebrow,
.date,
.help,
footer,
.status-label,
dt {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 10px;
  font-size: clamp(2.35rem, 7vw, 4.6rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.date {
  margin-bottom: 0;
}

.probe {
  flex: 1;
  padding: 42px 0 48px;
}

.drawing {
  width: min(72%, 340px);
  margin: 0 auto 38px;
  color: var(--accent);
}

.drawing svg {
  width: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.copy {
  max-width: 34rem;
  margin-bottom: 42px;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.copy p,
#status-message {
  line-height: 1.7;
}

form {
  margin-bottom: 36px;
}

label {
  display: block;
  margin-bottom: 10px;
  color: var(--accent-strong);
  font-size: 0.92rem;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
}

input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--accent);
  border-radius: 0;
  outline: 0;
  padding: 10px 2px 9px;
  background: transparent;
  color: var(--text);
}

input:focus {
  border-bottom-width: 2px;
  padding-bottom: 8px;
}

input::placeholder {
  color: rgb(82 103 116 / 65%);
}

button {
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 9px 18px;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
}

button:hover,
button:focus-visible {
  background: rgb(234 247 253 / 72%);
}

button:active {
  opacity: 0.72;
  transform: scale(0.97);
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.help {
  margin: 9px 0 0;
  line-height: 1.55;
}

code {
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 0.86em;
}

.status {
  min-height: 112px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 20px 0;
}

.status[data-state="loading"] {
  color: var(--accent-strong);
}

.status[data-state="success"] {
  border-color: var(--success);
}

.status[data-state="error"] {
  border-color: var(--error);
}

.status[data-state="error"] #status-message {
  color: var(--error);
}

.status-label {
  margin-bottom: 7px;
  text-transform: uppercase;
}

#status-message {
  margin-bottom: 0;
}

dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
  margin: 24px 0 0;
}

dl div {
  border-top: 1px solid var(--rule);
  padding-top: 8px;
}

dt,
dd {
  margin: 0;
}

dd {
  margin-top: 4px;
}

footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  padding-top: 16px;
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 28px, 760px);
    padding-top: 32px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  button {
    justify-self: start;
  }

  dl {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .probe {
    animation: arrive 220ms ease-out both;
  }

  button {
    transition:
      background-color 160ms ease,
      opacity 120ms ease,
      transform 120ms ease;
  }

  @keyframes arrive {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
  }
}
