/* Barrys Electronics
   Palette comes from mid-century receivers: hammertone cabinet paint,
   a backlit amber dial glass, a red tuning needle. */
:root {
  --paint: #d3dacd;
  --paint-deep: #bcc6b7;
  --panel: #1c2925;
  --paper: #f6f8f1;
  --glass: #eda81f;
  --glass-hi: #f7c653;
  --needle: #c2261a;
  --ink: #1c2925;
  --ink-soft: #43514b;
  --radius: 3px;
  --wrap: 68rem;
  --gutter: 1.25rem;
  --display: 'Archivo', 'Arial Narrow', Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paint);
  color: var(--ink);
  font-family: var(--display);
  font-stretch: 100%;
  font-size: 1.0625rem;
  line-height: 1.55;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  text-decoration-thickness: 0.16em;
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 0.9rem;
  background: var(--paper);
  border-radius: var(--radius);
}

.skip:focus {
  top: 0.5rem;
}

/* Masthead */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 0.9rem var(--gutter);
  background: var(--panel);
  color: var(--paper);
}

.masthead :focus-visible {
  outline-color: var(--glass);
}

.wordmark {
  font-stretch: 62%;
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.95rem;
}

.masthead nav a {
  padding-block: 0.35rem;
}

/* Hero */
.hero {
  padding-block: clamp(2.25rem, 7vw, 5rem) clamp(1.5rem, 4vw, 2.5rem);
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-stretch: 62%;
  font-weight: 800;
  font-size: clamp(3rem, 11vw, 7.25rem);
  line-height: 0.9;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.lede {
  margin: 1.25rem 0 0;
  max-width: 34ch;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.4;
}

h2 {
  margin: 0 0 1rem;
  font-stretch: 68%;
  font-weight: 800;
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  line-height: 1;
}

h3 {
  margin: 0 0 0.35rem;
  font-stretch: 80%;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.2;
}

p {
  margin: 0 0 1rem;
  max-width: 62ch;
}

/* Dial: the band selector is a row of radio inputs behind amber glass. */
.dial {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.dial legend {
  padding-block: 0 0.6rem;
  font-stretch: 80%;
  font-weight: 700;
  font-size: 1.2rem;
}

.dial-glass {
  background: var(--panel);
  padding-block: 0.7rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--glass) var(--panel);
}

.dial-scale {
  position: relative;
  display: flex;
  width: max-content;
  min-width: 100%;
  padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  background:
    repeating-linear-gradient(90deg, rgb(28 41 37 / 0.55) 0 1px, transparent 1px 0.75rem) top / 100% 0.55rem no-repeat,
    linear-gradient(180deg, var(--glass-hi), var(--glass) 55%, #d9940f);
  box-shadow: inset 0 0.5rem 0.9rem -0.5rem rgb(0 0 0 / 0.45), inset 0 -0.4rem 0.7rem -0.5rem rgb(0 0 0 / 0.35);
}

.stop {
  position: relative;
  flex: 1 0 5.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.1rem 0.4rem 1rem;
  cursor: pointer;
  scroll-snap-align: center;
  text-align: center;
}

/* Long tick above every band */
.stop::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 1.05rem;
  margin-left: -1px;
  background: var(--panel);
}

.stop input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.stop-band {
  font-stretch: 68%;
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1.1;
}

.stop-freq {
  font-size: 0.82rem;
  line-height: 1.2;
}

.stop:has(input:checked) .stop-band {
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.16em;
}

.stop:has(input:focus-visible) {
  outline: 3px solid var(--panel);
  outline-offset: -5px;
}

/* Needle: per-stop without JavaScript, one sliding needle with it. */
.stop:has(input:checked)::before,
.needle {
  content: '';
  position: absolute;
  top: 0;
  height: 1.75rem;
  width: 4px;
  border-radius: 0 0 2px 2px;
  background: var(--needle);
  box-shadow: 1px 0 0 rgb(0 0 0 / 0.25);
  pointer-events: none;
}

.stop:has(input:checked)::before {
  left: calc(50% - 2px);
  z-index: 1;
}

.needle {
  left: 0;
  z-index: 1;
  transition: transform 0.35s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.has-needle .stop:has(input:checked)::before {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .needle {
    transition: none;
  }
}

/* Request form */
.form-body {
  display: grid;
  gap: 1.25rem 1.5rem;
  padding-block: 1.75rem clamp(2.5rem, 6vw, 4rem);
}

@media (min-width: 46rem) {
  .form-body {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .field-wide {
    grid-column: 1 / -1;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

label {
  font-weight: 700;
}

.hint,
.note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1.5px solid var(--panel);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
}

textarea {
  resize: vertical;
  max-width: 46rem;
}

.field-wide select,
.field:first-child select {
  max-width: 24rem;
}

[aria-invalid='true'] {
  border-color: var(--needle);
  box-shadow: inset 0 0 0 1px var(--needle);
}

.trap {
  position: absolute;
  left: -200vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.actions {
  align-items: flex-start;
  gap: 0.75rem;
}

.button {
  appearance: none;
  padding: 0.85rem 1.6rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--paper);
  font: inherit;
  font-stretch: 80%;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.2;
  cursor: pointer;
}

.button:hover {
  background: #0f1815;
}

.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.status {
  margin: 0;
  font-weight: 700;
}

.status:empty {
  display: none;
}

.status.is-error {
  color: #8f1a11;
}

/* Content sections */
.section {
  padding-block: clamp(2.25rem, 6vw, 4rem);
  border-top: 2px solid var(--panel);
}

.steps {
  display: grid;
  gap: 1.5rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: block;
  font-stretch: 62%;
  font-weight: 800;
  font-size: 3.25rem;
  line-height: 1;
  color: var(--needle);
}

.steps p {
  margin: 0;
}

@media (min-width: 46rem) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.plain {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  max-width: 46rem;
}

.plain li {
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--paint-deep);
  font-stretch: 85%;
  font-weight: 600;
  font-size: 1.15rem;
}

/* Footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.5rem 2.5rem;
  border-top: 2px solid var(--panel);
  font-size: 0.95rem;
}

.footer p {
  margin: 0;
}

/* Text pages, pay pages and admin */
main.wrap {
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

main.wrap h1 {
  max-width: 20ch;
  margin-bottom: 1.5rem;
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 0.95;
}

main.wrap h2 {
  margin-top: 2.5rem;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
}

.notice {
  max-width: 46rem;
  padding: 0.9rem 1rem;
  border-left: 5px solid var(--glass);
  background: var(--paper);
  overflow-wrap: anywhere;
}

.notice-error {
  border-left-color: var(--needle);
}

.summary {
  width: 100%;
  max-width: 34rem;
  margin: 0 0 1.25rem;
  border-collapse: collapse;
}

.summary th,
.summary td {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--paint-deep);
  text-align: left;
  font-weight: 400;
  vertical-align: top;
}

.summary td {
  padding-left: 1rem;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.summary tfoot th,
.summary tfoot td {
  border-bottom: 0;
  font-weight: 800;
}

.stack {
  display: grid;
  gap: 1rem;
  max-width: 46rem;
}

.stack label {
  display: grid;
  gap: 0.35rem;
}

.stack .button {
  justify-self: start;
}

.row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 40rem) {
  .row {
    grid-template-columns: 1fr 1fr;
  }
}

.table-scroll {
  overflow-x: auto;
}

.grid {
  width: 100%;
  min-width: 46rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.grid th,
.grid td {
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--paint-deep);
  text-align: left;
  vertical-align: top;
}

.grid thead th {
  border-bottom: 2px solid var(--panel);
}

.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.link-button {
  appearance: none;
  display: block;
  margin-top: 0.35rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
