:root {
  --ink: #1b3136;
  --navy: #123c43;
  --accent: #9e4237;
  --rule: #bcc8c4;
  --paper: #f6f5ee;
  --white: #fffefa;
  color: var(--ink);
  background: var(--paper);
  font:
    1rem/1.48 "Source Sans 3",
    system-ui,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.wrap {
  width: min(calc(100% - 2rem), 65rem);
  margin-inline: auto;
}
a {
  color: #075666;
  text-underline-offset: 0.17em;
}
a:focus-visible,
input:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #cc783a;
  outline-offset: 2px;
}
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.mast {
  background: var(--navy);
  color: white;
  border-bottom: 5px solid #ca8d6c;
}
.mast a {
  color: #e3f8f1;
}
nav.wrap {
  display: flex;
  justify-content: space-between;
  padding: 0.8rem 0;
  border-bottom: 1px solid #689196;
  font-size: 0.88rem;
}
.heading {
  padding: 1.6rem 0 1.4rem;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e8c6a5;
  font-size: 0.78rem;
  margin: 0;
}
h1,
h2,
h3 {
  font-family: "Source Serif 4", Georgia, serif;
  line-height: 1.12;
}
h1 {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  max-width: 25ch;
  letter-spacing: -0.04em;
  margin: 0.25rem 0 0.55rem;
}
h2 {
  font-size: 1.65rem;
  margin: 0 0 0.45rem;
}
h3 {
  font-size: 1.35rem;
  margin: 1.3rem 0 0.4rem;
}
p {
  max-width: 75ch;
  margin: 0.5rem 0 0.75rem;
}
.heading p:last-child {
  margin-bottom: 0;
}
.controls,
#results,
.guide {
  margin: 1.25rem 0;
  padding: 1.2rem clamp(0.9rem, 2vw, 1.55rem);
  border: 1px solid var(--rule);
  background: var(--white);
}
.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.35fr 2.1fr auto;
  align-items: end;
  gap: 0.75rem;
}
.input-grid label {
  font-size: 0.84rem;
  font-weight: 650;
}
.input-grid :is(input, select, button) {
  font: inherit;
  font-size: 1rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid #688184;
  border-radius: 0.2rem;
  width: 100%;
  background: white;
  color: var(--ink);
  height: 2.8rem;
}
.input-grid input {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.input-grid button {
  background: var(--navy);
  color: white;
  font-weight: 700;
  cursor: pointer;
}
.input-grid button:disabled {
  opacity: 0.5;
}
#status {
  font-size: 0.86rem;
  margin-bottom: 0;
}
#period {
  font-weight: 620;
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.cards article {
  border-top: 3px solid #9e6550;
  background: #f3f3e9;
  padding: 1rem;
}
.cards article:nth-child(2) {
  border-color: #3e7476;
}
.cards h3 {
  font:
    700 1.8rem/1.25 "IBM Plex Mono",
    monospace;
  margin: 0;
}
.cards h4 {
  font-weight: 500;
  margin: 0;
  color: #435c5c;
}
.cards dl {
  margin: 0.9rem 0 0;
}
.cards dt {
  font-size: 0.8rem;
}
.cards dd {
  margin: 0 0 0.45rem;
  font-size: 1.25rem;
  font-weight: 670;
  font-variant-numeric: tabular-nums;
}
#difference {
  font-weight: 600;
}
footer {
  padding: 1rem 0 2.5rem;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
th,
td {
  text-align: left;
  padding: 0.55rem;
  border-bottom: 1px solid var(--rule);
}
th {
  font-size: 0.85rem;
}
caption {
  text-align: left;
  margin-bottom: 0.45rem;
}
.scroll {
  overflow-x: auto;
}
code {
  font-size: 0.95em;
}
.guide a {
  font-weight: 600;
}
@media (max-width: 730px) {
  .input-grid {
    grid-template-columns: 1fr 1fr;
  }
  .input-grid button {
    grid-column: 1/-1;
  }
  .wrap {
    width: calc(100% - 1.25rem);
  }
  .cards {
    gap: 0.45rem;
  }
  .cards article {
    padding: 0.65rem;
  }
  .cards dd {
    font-size: 1.05rem;
    overflow-wrap: anywhere;
  }
  .controls,
  #results,
  .guide {
    padding: 0.85rem;
  }
  .heading {
    padding-top: 1rem;
  }
}
@media (max-width: 360px) {
  .input-grid {
    gap: 0.45rem;
  }
  .input-grid label {
    min-width: 0;
  }
  .cards {
    grid-template-columns: 1fr;
  }
}
