/* Paperlogy 1.001 from https://freesentation.blog/paperlogyfont (SIL OFL 1.1). */
@font-face {
  font-family: Paperlogy;
  src: url("./fonts/paperlogy-v1.001-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Paperlogy;
  src: url("./fonts/paperlogy-v1.001-500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: Paperlogy;
  src: url("./fonts/paperlogy-v1.001-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: Paperlogy;
  src: url("./fonts/paperlogy-v1.001-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fafaf8;
  --ink: #1d1d1b;
  --muted: #70706b;
  --line: #ddddd7;
  --soft: #f1f1ed;
  font-family: Paperlogy, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

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

body {
  min-height: 100vh;
  margin: 0;
  line-height: 1.6;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.site-header,
.content {
  width: min(calc(100% - 46px), 31rem);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  min-height: 5.125rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand-mark {
  font-size: 1.1875rem;
  font-weight: 500;
  letter-spacing: -0.08em;
}

.content {
  padding-block: clamp(3rem, 9vh, 6rem) 3rem;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.6875rem, 5vw, 2.25rem);
  line-height: 1.23;
  letter-spacing: -0.04em;
  font-weight: 650;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.subject {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

.subject h1 {
  min-width: 0;
  margin-bottom: 0;
}

.subject-logo {
  flex: none;
  display: block;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  object-fit: contain;
}

.destination {
  padding: clamp(1rem, 4vw, 1.5rem);
  border: 1px solid var(--line);
}

.destination-info {
  margin: 0 0 1.25rem;
}

.destination-guide-link {
  margin: 0.875rem 0 0;
  font-size: 0.9375rem;
  text-underline-offset: 0.2em;
}

.destination-info dt {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.destination-info dd {
  margin: 0;
  font-weight: 600;
}

.destination-info small {
  display: block;
  margin-top: 0.125rem;
  color: var(--muted);
  font-weight: 400;
}

.hostname {
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.primary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 6px;
  color: var(--paper);
  background: var(--ink);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.primary-action[hidden] {
  display: none;
}

.primary-action:hover {
  background: #363632;
}

.countdown:disabled {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: wait;
  font-variant-numeric: tabular-nums;
}

.open-note {
  min-height: 1.4rem;
  margin: 0.625rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

noscript .open-note {
  margin-top: 0;
}

.link-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.link-list li {
  border-bottom: 1px solid var(--line);
}

.link-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.125rem 1rem;
  padding: 1rem 0.75rem;
  text-decoration: none;
}

.link-list a:hover {
  background: var(--soft);
}

.link-list a:focus-visible {
  outline-offset: -2px;
}

.link-list strong {
  font-weight: 600;
}

.link-list span {
  color: var(--muted);
  font-size: 0.875rem;
}

.home-content {
  width: min(calc(100% - 3rem), 35rem);
  padding-block-start: clamp(5rem, calc(38vh - 4.5rem), 20rem);
}

.home-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-block-size: 1lh;
  margin-block-end: clamp(1.375rem, 3.5vh, 2rem);
  font-size: clamp(2.375rem, 8vw, 4.125rem);
  line-height: 1.06;
  letter-spacing: -0.055em;
}

.home-brand .brand-mark {
  font-size: 0.58em;
  color: var(--muted);
}

.chooser-content {
  padding-block-start: clamp(2rem, 6vh, 3.5rem);
}

.chooser-content .subject {
  margin-block-end: 0.625rem;
}

.chooser-content .subject-logo {
  width: clamp(2.625rem, 9vw, 3.5rem);
  height: auto;
  aspect-ratio: 1;
  border-radius: 11px;
}

.product-overview {
  margin: 0 0 1.125rem;
  color: var(--muted);
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.program-info {
  margin-block-start: 1.25rem;
  border: 1px solid var(--line);
  font-size: 0.9375rem;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.program-info h2 {
  margin: 0;
  padding: 0.625rem 0.875rem;
  border-block-end: 1px solid var(--line);
  background: var(--soft);
  font-size: 1rem;
  font-weight: 650;
}

.program-info .guide-facts {
  border: 0;
}

.program-info .guide-facts > div {
  grid-template-columns: minmax(5.25rem, 25%) minmax(0, 1fr);
  align-items: baseline;
  padding: 0.625rem 0.875rem;
}

.program-info a {
  text-underline-offset: 0.2em;
}

.download-guide {
  margin-block-start: 1.25rem;
  border-block-start: 1px solid var(--line);
  padding-block-start: 1rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.download-guide h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 650;
}

.download-guide p {
  margin: 0;
  color: var(--muted);
}

.download-guide a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-weight: 600;
  text-underline-offset: 0.2em;
}

.guide-section {
  margin-block-start: 1.5rem;
}

.guide-section h3 {
  margin: 0 0 0.45rem;
  font-size: 0.9375rem;
  font-weight: 650;
}

.guide-facts {
  margin: 0;
  border-block: 1px solid var(--line);
}

.guide-facts > div {
  display: grid;
  grid-template-columns: minmax(6.5rem, 26%) minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.625rem 0;
}

.guide-facts > div + div {
  border-block-start: 1px solid var(--line);
}

.guide-facts dt {
  font-weight: 600;
}

.guide-facts dd {
  margin: 0;
}

.guide-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  list-style: none;
}

.guide-sources a {
  font-weight: 500;
}

.guide-section + .guide-more {
  margin-block-start: 0.5rem;
}

.chooser {
  min-width: 0;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.chooser legend {
  padding: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.chooser-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.chooser-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.625rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.chooser-option:has(input:checked) {
  border-color: var(--ink);
  background: var(--soft);
}

.chooser-option:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.chooser-option input {
  flex: none;
  margin: 0.2rem 0 0;
  accent-color: var(--ink);
}

.chooser-option strong { font-weight: 600; }
.chooser-option small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.chooser-host {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.chooser-host .hostname { margin-inline-start: 0.25rem; }

.primary-action[aria-disabled="true"] {
  color: var(--muted);
  background: var(--soft);
  cursor: default;
}

.home-search {
  position: relative;
}

.home-search-icon {
  position: absolute;
  inset-inline-start: 1.125rem;
  inset-block-start: calc(50% - 0.5rem);
  width: 0.8125rem;
  height: 0.8125rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  color: var(--muted);
  pointer-events: none;
}

.home-search-icon::after {
  content: "";
  position: absolute;
  inset-inline-start: 0.56rem;
  inset-block-start: 0.55rem;
  width: 0.375rem;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

#catalog-keyword {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 0.625rem 1rem;
  padding-inline-start: 2.875rem;
  border: 1px solid #bcbcb4;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

#catalog-keyword:hover {
  border-color: var(--muted);
}

#catalog-keyword::placeholder {
  color: var(--muted);
}

#catalog-keyword:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.home-suggestions:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.375rem 0.5rem;
  margin-block-start: 0.875rem;
  font-size: 0.8125rem;
}

.home-suggestions span {
  color: var(--muted);
}

.home-suggestions a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding-inline: 0.65rem;
  border-radius: 999px;
  background: var(--soft);
  text-decoration: none;
}

.home-suggestions a:hover {
  text-decoration: underline;
  text-underline-offset: 0.175em;
}

#catalog-count {
  margin: 0.5rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.search-pagination:not([hidden]) {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.search-pagination button {
  min-width: 4.5rem;
  min-height: 44px;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.search-pagination button:not(:disabled):hover {
  background: var(--soft);
}

.search-pagination button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.search-pagination button:disabled {
  color: var(--muted);
  opacity: 0.55;
  cursor: default;
}

@media (max-width: 600px) {
  .site-header {
    min-height: 4.375rem;
  }

  .brand {
    font-size: 1.25rem;
  }

  .brand-mark {
    font-size: 1.125rem;
  }

  .subject-logo {
    width: 2.625rem;
    height: 2.625rem;
  }
}

@media (max-width: 420px) {
  .guide-facts > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.125rem;
  }
}
