/* The About pages (info.html, guide.html, pro.html): the site's VHS look (styles.css), kept to what
   they need. */
@font-face {
  font-family: "VCR OSD Mono";
  src: url("fonts/VCR_OSD_MONO.ttf") format("truetype");
  /* Held back until the font arrives (preloaded by each page), not drawn in a fallback font first:
     the headings would flash from one font to the other. */
  font-display: block;
}

:root {
  --vhs-font: "VCR OSD Mono", ui-monospace, monospace;
  --body-font: ui-sans-serif, "Segoe UI", system-ui, sans-serif;
  --vhs-blue: #1a1aa6;
  --vhs-blue-light: #3a3aff;
  --vhs-text: #f4f4f4;
  --vhs-muted: #a9a9c8;
  --vhs-green: #39ff7a;
  --vhs-link: #8cc4ff;
  --vhs-fringe: 1px 0 rgba(255, 0, 60, 0.75), -1px 0 rgba(0, 220, 255, 0.75);
  --page-bg: #05050c;
  --row-line: rgba(255, 255, 255, 0.12);
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--vhs-text);
  font: 16px/1.55 var(--body-font);
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding-block: 24px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid;
  gap: 28px;
}

a {
  color: var(--vhs-link);
}

header {
  display: grid;
  gap: 10px;
}

.back {
  font-family: var(--vhs-font);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  justify-self: start;
  background: var(--vhs-blue);
  border: 2px solid var(--vhs-blue-light);
  color: var(--vhs-text);
  padding: 6px 12px;
}

h1,
h2 {
  font-family: var(--vhs-font);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-shadow: var(--vhs-fringe);
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  color: var(--vhs-green);
}

h2 {
  font-size: 1.25rem;
  background: var(--vhs-blue);
  border: 2px solid var(--vhs-blue-light);
  padding: 6px 12px;
}

p {
  margin: 0;
  max-width: 68ch;
}

section {
  display: grid;
  gap: 12px;
}

dl {
  margin: 0;
  display: grid;
}

.row {
  display: grid;
  grid-template-columns: minmax(150px, 13rem) 1fr;
  gap: 4px 20px;
  padding-block: 10px;
  border-bottom: 1px solid var(--row-line);
}

dt {
  font-family: var(--vhs-font);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--vhs-green);
}

dd {
  margin: 0;
  min-width: 0;
}

.when {
  display: block;
  color: var(--vhs-muted);
  font-size: 0.9em;
}

.notice {
  border: 2px solid var(--vhs-blue-light);
  padding: 12px 16px;
  display: grid;
  gap: 8px;
}

@media (max-width: 560px) {
  .row {
    grid-template-columns: 1fr;
  }
}

/* The VHS Radar logo at the top: the tornado mark (logo-mark.svg) beside the name, as the wordmark
   (design/logo) draws it: green, glowing, with the red and cyan fringe. */
.brand {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  justify-self: start;
  text-decoration: none;
}

.brand img {
  height: 84px;
}

.brand span {
  font-family: var(--vhs-font);
  font-size: clamp(2rem, 9vw, 3.2rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--vhs-green);
  text-shadow: var(--vhs-fringe), 0 0 10px rgba(57, 255, 122, 0.55);
  padding-bottom: 6px;
}

@media (max-width: 560px) {
  .brand img {
    height: 60px;
  }
}

/* The tabs between the About pages, under the Back button; the open one is lit. */
.pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pages a {
  font-family: var(--vhs-font);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--vhs-text);
  border: 2px solid var(--vhs-blue-light);
  padding: 4px 10px;
}

.pages a[aria-current="page"] {
  background: var(--vhs-text);
  color: var(--vhs-blue);
}

h3 {
  font-family: var(--vhs-font);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--vhs-green);
  font-size: 1rem;
  margin: 8px 0 0;
}

kbd {
  font-family: var(--vhs-font);
  border: 1px solid var(--vhs-muted);
  padding: 0 4px;
}

/* Back to the map and Upgrade to Pro, side by side under the logo (they wrap on a narrow screen). */
.header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Upgrade to Pro (every About page) and the Pro page's sign-in link: the site's PRO yellow. */
.upgrade {
  font-family: var(--vhs-font);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  justify-self: start;
  background: #ffd84a;
  border: 2px solid #ffd84a;
  color: #05050c;
  padding: 6px 12px;
}

/* The Pro page (pro.html): its two plans, their buttons, and the tiers table. */
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.plan {
  border: 2px solid var(--vhs-blue-light);
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.plan-price {
  font-family: var(--vhs-font);
  font-size: 2.2rem;
  color: var(--vhs-green);
  text-shadow: var(--vhs-fringe);
}

.plan-price span {
  font-size: 1rem;
  margin-left: 6px;
  color: var(--vhs-text);
}

.plan-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.plan-actions .when {
  flex-basis: 100%;
  max-width: none; /* a line of its own, not beside the buttons */
}

.plan-button {
  font: inherit;
  font-family: var(--vhs-font);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #ffd84a;
  color: #05050c;
  border: 2px solid #ffd84a;
  padding: 8px 14px;
  cursor: pointer;
}

.plan-button:disabled {
  opacity: 0.6;
  cursor: default;
}

/* The plan picked before the account box below it (pro-page.js): outlined, so the other stands back. */
.plan-button.picked {
  outline: 2px solid var(--vhs-green);
  outline-offset: 2px;
}

/* Signed out: the box to create an account (or sign in), then pay, on a line of its own. */
.pro-account-form {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: minmax(0, 360px);
  gap: 8px;
}

.pro-account-form input {
  font: inherit;
  padding: 8px 10px;
  background: #05050c;
  color: var(--vhs-text);
  border: 2px solid var(--vhs-blue-light);
}

.pro-account-form input[hidden] {
  display: none;
}

.pro-account-form .switch-mode {
  font: inherit;
  justify-self: start;
  background: none;
  border: none;
  padding: 0;
  color: var(--vhs-muted);
  text-decoration: underline;
  cursor: pointer;
}

/* The renewal and Terms line under the plan buttons: small, so it stays out of the way. */
.fine-print {
  color: var(--vhs-muted);
  font-size: 0.75em;
  margin-top: 4px;
  max-width: none; /* p's 68ch, at this size, would wrap it to two short lines */
}

/* The tiers table scrolls sideways on its own on a narrow screen, never the page. */
.tiers-scroll {
  overflow-x: auto;
}

.tiers {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.tiers th,
.tiers td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--row-line);
  text-align: left;
  vertical-align: top;
}

.tiers td {
  text-align: center;
  white-space: nowrap;
  color: var(--vhs-green);
}

.tiers thead th {
  font-family: var(--vhs-font);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--vhs-muted);
}

.tiers thead th:not(:first-child) {
  text-align: center;
}

.tiers thead th:last-child,
.tiers td:last-child {
  color: #ffd84a;
}

.tiers tbody th {
  font-weight: normal;
}

.tiers-group th {
  font-family: var(--vhs-font);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--vhs-green);
  padding-top: 18px;
}

/* On a phone the four columns don't fit (the Pro column was off the screen): each feature takes a line
   of its own, with its Free, Free account and Pro marks in three columns under it, and the three
   headings stay at the top of the screen while the table scrolls by. */
@media (max-width: 560px) {
  .tiers-scroll {
    overflow-x: visible; /* a scroll box would keep the headings from sticking to the screen */
  }

  .tiers {
    min-width: 0;
  }

  .tiers,
  .tiers thead,
  .tiers tbody {
    display: block;
  }

  .tiers thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--page-bg);
  }

  .tiers tr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--row-line);
  }

  .tiers th,
  .tiers td {
    border-bottom: none;
  }

  .tiers thead th:first-child {
    display: none;
  }

  .tiers tbody th {
    grid-column: 1 / -1;
    padding-bottom: 2px;
  }

  .tiers td {
    padding-top: 2px;
    white-space: normal;
  }
}

/* The Terms page (terms.html): its lists, and details still to fill in, marked yellow. */
section ul {
  margin: 0;
  padding-left: 1.3em;
  display: grid;
  gap: 6px;
  max-width: 68ch;
}

mark.fill-in {
  background: #ffd84a;
  color: #05050c;
  padding: 0 4px;
}
