/* EA7KLX home page. Shares its drawing language with the technical report:
   blue dimension lines, red markers, drafting-paper greys. */

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/source-serif-4-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/barlow-semi-condensed-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/barlow-semi-condensed-latin-600-normal.woff2') format('woff2');
}

:root {
  color-scheme: light dark;

  --paper: #eef1f5;
  --sheet: #ffffff;
  --ink: #16202e;
  --muted: #566273;
  --rule: #c5cdd8;
  --cota: #0a3fa8;
  --mark: #c4281c;
  --area: #fbe9d8;
  --terminal: #101a28;
  --terminal-ink: #dbe4f0;

  --serif: 'Source Serif 4', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: 'Barlow Semi Condensed', 'DIN Alternate', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'DejaVu Sans Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0c1829;
    --sheet: #12233a;
    --ink: #e7edf5;
    --muted: #9fb0c6;
    --rule: #34496a;
    --cota: #9dbdff;
    --mark: #ff8f7f;
    --area: #2b3443;
    --terminal: #08111e;
    --terminal-ink: #dbe4f0;
  }
}

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

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
}

a {
  color: var(--cota);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
}

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--sheet);
  font-family: var(--sans);
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* ---------- Masthead ---------- */

.masthead {
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
  padding: 3.5rem 0 2.5rem;
}

.masthead-kind {
  margin: 0;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--muted);
}

.callsign {
  margin: 0.4rem 0 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(5rem, 19vw, 14rem);
  line-height: 0.86;
  letter-spacing: 0.01em;
  color: var(--cota);
}

.masthead-lead {
  margin: 1.75rem 0 0;
  max-width: 40rem;
  font-size: 1.25rem;
  line-height: 1.5;
}

.masthead-nav {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.125rem;
}

.dial {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 2.75rem;
  font-family: var(--sans);
}

.dial-minor {
  stroke: var(--ink);
  stroke-width: 12;
}

.dial-major {
  stroke: var(--ink);
  stroke-width: 24;
}

.dial-band {
  fill: var(--cota);
}

.dial-break {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
}

.dial-text {
  fill: var(--muted);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.dial-name {
  fill: var(--cota);
  font-weight: 600;
  font-size: 22px;
}

/* ---------- Sections ---------- */

.band {
  padding: 4rem 0;
  border-bottom: 1px solid var(--rule);
}

.band h2 {
  margin: 0 0 1rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  text-wrap: balance;
}

.band p {
  margin: 0 0 1rem;
  max-width: 38rem;
}

.section-lead {
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 21rem);
  gap: 3rem;
  align-items: center;
}

.drawing {
  margin: 0;
  padding: 1.25rem;
  background: var(--sheet);
  border: 1px solid var(--ink);
}

.drawing svg {
  display: block;
  width: 100%;
  height: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.band .actions {
  max-width: none;
}

.button {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  border: 1.5px solid var(--cota);
  border-radius: 4px;
  background: var(--cota);
  color: var(--sheet);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
}

.button:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.button.is-quiet {
  background: transparent;
  color: var(--cota);
}

.button.is-quiet:hover {
  background: var(--cota);
  border-color: var(--cota);
  color: var(--sheet);
}

/* ---------- Applications ---------- */

.app {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}

.app h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.1;
}

.app h3 img {
  border-radius: 8px;
}

.band .app-kind {
  margin: 0.3rem 0 1rem;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.1875rem;
  color: var(--muted);
}

.band .app-facts {
  font-family: var(--sans);
  color: var(--muted);
}

.terminal {
  margin: 2rem 0 0;
}

.terminal pre {
  margin: 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  background: var(--terminal);
  color: var(--terminal-ink);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.terminal figcaption {
  margin-top: 0.6rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.band h3.about-title {
  margin: 2rem 0 0.6rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.5rem;
}

.screenshot {
  margin: 2rem 0 0;
}

.screenshot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--rule);
}

.screenshot figcaption {
  margin-top: 0.6rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Smaller projects: a two-column list under the two radio applications. */
.projects {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  gap: 2.5rem 3.5rem;
}

.project h3,
.resource h3 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.625rem;
  line-height: 1.15;
}

.band .project .app-kind {
  margin-bottom: 0.75rem;
}

.band .project p {
  max-width: none;
}

.band .project-link {
  font-family: var(--sans);
  font-weight: 500;
  color: var(--muted);
}

.resource + .resource {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}

.resource h3 {
  margin-bottom: 0.75rem;
}

/* ---------- Manual chapters ---------- */

.chapters {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: chapter;
  columns: 3 15rem;
  column-gap: 2.5rem;
  font-family: var(--sans);
  font-size: 1.1875rem;
}

.chapters + .actions {
  margin-top: 2.25rem;
}

.chapters li {
  counter-increment: chapter;
  break-inside: avoid;
  display: grid;
  grid-template-columns: 2rem 1fr;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
}

.chapters li::before {
  content: counter(chapter);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.chapters a {
  color: var(--ink);
  text-decoration: none;
}

.chapters a:hover {
  color: var(--cota);
  text-decoration: underline;
}

.page-footer {
  background: var(--sheet);
}

.page-footer p {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  font-family: var(--sans);
  color: var(--muted);
}

/* ---------- Drawing (same classes as the technical report) ---------- */

.dw-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.dw {
  font-family: var(--sans);
  font-size: 19px;
  fill: var(--ink);
}

.dw-line {
  stroke: var(--ink);
  stroke-width: 1.6;
}

line.dw-line.dw-heavy {
  stroke-width: 3;
}

.dw-line.dw-thin {
  stroke-width: 0.9;
}

path.dw-line {
  fill: none;
}

.dw-area {
  fill: var(--area);
}

.dw-hatch {
  fill: url(#dw-hatch);
}

.dw-hatch-line {
  stroke: var(--muted);
  stroke-width: 0.8;
}

.dw-mast {
  fill: var(--muted);
}

.dw-antenna {
  fill: var(--sheet);
}

.dw-mark {
  fill: var(--mark);
}

.dw-ext {
  fill: none;
  stroke: var(--cota);
  stroke-width: 0.6;
  stroke-dasharray: 2 3;
  opacity: 0.75;
}

.dw-cota line,
.dw-tick-mark {
  fill: none;
  stroke: var(--cota);
  stroke-width: 1.2;
}

.dw-cota-text {
  fill: var(--cota);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: var(--sheet);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.dw-cota-total {
  font-size: 27px;
}

.dw-note {
  font-size: 0.87em;
  fill: var(--muted);
}

/* ---------- Narrow screens ---------- */

@media (max-width: 48rem) {
  body {
    font-size: 1.0625rem;
  }

  .wrap {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .masthead {
    padding: 2.25rem 0 1.75rem;
  }

  .masthead-lead {
    font-size: 1.125rem;
  }

  .band {
    padding: 2.75rem 0;
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .drawing {
    max-width: 19rem;
  }

  /* The MHz figures get too small at this width: keep only the band names. */
  .dial-text {
    display: none;
  }

  .dial-name {
    font-size: 44px;
  }
}
