:root {
  --parchment: #f5f4ed;
  --ivory: #faf9f5;
  --warm-sand: #e8e6dc;
  --border: #e8e6dc;
  --border-soft: #e5e3d8;
  --brand: #1B365D;
  --brand-light: #2D5A8A;
  --brand-tint: #EEF2F7;
  --brand-tint-strong: #E4ECF5;
  --signal: #2F6F5E;
  --signal-tint: #E7F0EC;
  --copper: #8E513A;
  --copper-tint: #F0E8E2;
  --near-black: #141413;
  --dark-warm: #3d3d3a;
  --olive: #504e49;
  --stone: #6b6a64;
  --serif: Charter, Georgia, Palatino, "Times New Roman", "Source Han Serif SC", "Noto Serif CJK SC", serif;
  --utility: "Avenir Next", "Segoe UI", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Fira Code", Consolas, Monaco, "Source Han Serif SC", monospace;
  --hand: Z003, "Comic Neue", "Bradley Hand", "Segoe Print", "Comic Sans MS", "Chalkboard SE", cursive;
  --page-pad: 32px;
  --content-max: 1180px;
}

html[data-theme="night"] {
  --parchment: #151716;
  --ivory: #1d211f;
  --warm-sand: #333832;
  --border: #343a35;
  --border-soft: #2b312d;
  --brand: #B8D0F1;
  --brand-light: #D7A45B;
  --brand-tint: #23312f;
  --brand-tint-strong: #30433f;
  --signal: #A6D7C4;
  --signal-tint: #22352f;
  --copper: #D7A45B;
  --copper-tint: #352820;
  --near-black: #F4EFE5;
  --dark-warm: #DED6C6;
  --olive: #C5BBAA;
  --stone: #A89F91;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--parchment);
  color: var(--near-black);
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--parchment);
  color: var(--near-black);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

body::selection {
  background: var(--brand-tint-strong);
  color: var(--near-black);
}

a {
  color: inherit;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--brand);
}

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

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("/assets/paper-grain.png");
  background-size: 192px 192px;
  opacity: 0.58;
}

html[data-theme="night"] .paper-grain {
  opacity: 0.2;
}

.skip-link {
  position: fixed;
  left: 24px;
  top: 16px;
  z-index: 20;
  transform: translateY(-220%);
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--ivory);
  padding: 8px 12px;
  font-family: var(--utility);
  font-size: 13px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.site-footer,
main {
  width: min(calc(100% - var(--page-pad) * 2), var(--content-max));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 22px;
  border-bottom: 1px solid var(--border);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--brand);
  border-radius: 8px;
  color: var(--brand);
  background: var(--ivory);
}

.brand-mark-icon {
  width: 31px;
  height: 31px;
}

.brand-mark-sky {
  fill: currentColor;
}

.brand-mark-moon {
  fill: var(--ivory);
}

.brand-mark-cutout {
  fill: currentColor;
}

.brand-mark-star {
  fill: var(--copper);
}

.brand-mark-horizon {
  fill: none;
  stroke: var(--ivory);
  stroke-linecap: round;
  stroke-width: 2.2px;
  opacity: 0.76;
}

.brand-name,
.brand-domain {
  display: block;
}

.brand-name {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
}

.brand-domain {
  color: var(--stone);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.site-nav a {
  border-bottom: 1px solid transparent;
  color: var(--olive);
  text-decoration: none;
}

.site-nav a:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.site-nav a[aria-current="page"] {
  border-color: var(--brand);
  color: var(--brand);
}

.theme-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  flex: 0 0 auto;
  width: 58px;
  height: 34px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--ivory);
  color: var(--brand);
  cursor: pointer;
  padding: 3px;
}

.theme-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  padding: 3px;
}

.theme-icon-sun {
  background: var(--brand);
  color: var(--ivory);
}

.theme-icon-moon {
  color: var(--stone);
}

html[data-theme="night"] .theme-icon-sun {
  background: transparent;
  color: var(--stone);
}

html[data-theme="night"] .theme-icon-moon {
  background: var(--brand);
  color: var(--ivory);
}

main {
  padding: 54px 0 72px;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.65fr);
  gap: 56px;
  align-items: center;
  min-height: 470px;
  padding: 36px 0 48px;
}

.hero-copy {
  max-width: 780px;
}

.overline,
.eyebrow,
.footer-label {
  margin: 0;
  color: var(--brand);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong {
  font-weight: 500;
}

h1 {
  margin: 14px 0 22px;
  font-size: 64px;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: 0;
}

.motto {
  width: fit-content;
  margin: -10px 0 20px;
  color: var(--copper);
  font-family: var(--hand);
  font-size: 56px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.9;
  transform: rotate(-3deg);
}

.lede {
  max-width: 780px;
  margin-bottom: 24px;
  color: var(--dark-warm);
  font-size: 21px;
  line-height: 1.52;
}

.signal-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.signal-strip li,
.route-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border-radius: 4px;
  background: var(--brand-tint);
  color: var(--brand);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.35;
  overflow-wrap: anywhere;
  padding: 4px 8px;
}

.search-band {
  display: grid;
  gap: 18px;
  padding: 38px 0 54px;
  border-top: 1px solid var(--border);
}

.site-search {
  display: grid;
  gap: 12px;
}

.search-label {
  color: var(--brand);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--ivory);
  color: var(--brand);
  padding: 12px 14px;
}

.search-box svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--near-black);
  font: inherit;
  outline: 0;
}

.search-box input::placeholder {
  color: var(--stone);
}

.search-results {
  display: grid;
  gap: 8px;
}

.search-results:empty {
  display: none;
}

.search-result,
.search-empty {
  display: grid;
  gap: 3px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ivory) 78%, transparent);
  padding: 12px 14px;
  text-decoration: none;
}

.search-result span,
.search-empty span {
  color: var(--brand);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search-result strong {
  color: var(--near-black);
  line-height: 1.25;
}

.search-result small {
  color: var(--olive);
  font-family: var(--mono);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.profile-band {
  display: grid;
  gap: 18px;
}

.profile-summary {
  display: grid;
  gap: 26px;
  max-width: 980px;
  margin-left: auto;
}

.profile-summary > p {
  margin: 0;
  color: var(--dark-warm);
  font-size: 20px;
  line-height: 1.55;
}

.focus-preview,
.focus-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.focus-preview article,
.focus-list article {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 176px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--ivory) 76%, transparent);
  padding: 20px;
}

.focus-preview p,
.focus-list p {
  margin: 0;
  color: var(--olive);
  font-size: 15px;
  line-height: 1.5;
}

.route-ledger {
  border-top: 2px solid var(--brand);
  background: var(--ivory);
  padding: 18px 20px;
}

.ledger-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}

.ledger-row:last-child {
  border-bottom: 0;
}

.ledger-row span {
  color: var(--stone);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ledger-row strong {
  color: var(--dark-warm);
  line-height: 1.35;
}

.content-band {
  padding: 62px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  margin-bottom: 30px;
  align-items: start;
}

.section-header.compact {
  margin-bottom: 18px;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.channel-card {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--ivory) 72%, transparent);
  padding: 18px;
  text-decoration: none;
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.channel-card:hover {
  background: var(--ivory);
  box-shadow: 0 12px 34px rgba(20, 20, 19, 0.045);
  transform: translateY(-2px);
}

.module-number,
.module-letter {
  color: var(--brand);
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}

.channel-card-main {
  display: grid;
  gap: 12px;
}

.channel-card strong,
.highlight-item strong {
  display: block;
  color: var(--near-black);
  font-size: 24px;
  line-height: 1.18;
}

.channel-card span:not(.module-number, .channel-card-main, .eyebrow, .route-tag),
.highlight-item span:not(.module-letter, .eyebrow) {
  color: var(--olive);
  font-size: 15px;
  line-height: 1.48;
}

.split-band {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 54px;
  align-items: start;
}

.split-band .section-header {
  display: block;
  margin-bottom: 0;
}

.split-band .section-header .overline {
  margin-bottom: 16px;
}

.highlight-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.highlight-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 20px;
  border-bottom: 1px solid var(--border-soft);
  padding: 22px 0;
  text-decoration: none;
}

.highlight-item:hover strong {
  color: var(--brand);
}

.closing-index {
  border-top: 1px solid var(--border);
  padding-top: 42px;
}

.host-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.site-footer {
  display: grid;
  gap: 20px;
  padding: 34px 0 42px;
  border-top: 1px solid var(--border);
  color: var(--olive);
}

.footer-main {
  display: flex;
  justify-content: space-between;
  gap: 32px;
}

.site-footer p {
  max-width: 560px;
  margin: 8px 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
}

.footer-link,
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ivory) 78%, transparent);
  color: var(--olive);
  min-height: 36px;
  padding: 8px 10px;
  text-decoration: none;
}

.footer-link svg,
.contact-link svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.footer-link:hover,
.contact-link:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.copyright {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--stone);
  font-family: var(--mono);
  font-size: 12px;
}

.copyright-icon {
  width: 17px;
  height: 17px;
  color: var(--copper);
}

.channel-page,
.about-page,
.not-found {
  max-width: 940px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  margin-bottom: 42px;
  color: var(--brand);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.channel-hero {
  padding: 36px 0 54px;
  border-bottom: 1px solid var(--border);
}

.about-hero {
  padding: 36px 0 54px;
  border-bottom: 1px solid var(--border);
}

.channel-detail,
.next-routes,
.about-grid,
.contact-section,
.game-catalog {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

.about-grid {
  display: grid;
  gap: 22px;
}

.principle-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: principles;
  border-top: 1px solid var(--border);
}

.principle-list li {
  position: relative;
  min-height: 72px;
  padding: 20px 0 20px 58px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--dark-warm);
}

.principle-list li::before {
  position: absolute;
  left: 0;
  top: 18px;
  color: var(--copper);
  content: counter(principles, decimal-leading-zero);
  counter-increment: principles;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-link {
  min-height: 42px;
  padding: 10px 12px;
}

.planned-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.planned-list li {
  position: relative;
  padding: 15px 0 15px 26px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--dark-warm);
}

.planned-list li::before {
  position: absolute;
  left: 0;
  top: 27px;
  width: 12px;
  height: 2px;
  background: var(--brand);
  content: "";
}

.small-route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.small-route-grid a {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--ivory);
  padding: 16px;
  text-decoration: none;
}

.small-route-grid span {
  color: var(--brand);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.small-route-grid strong {
  line-height: 1.25;
}

.primary-link {
  display: inline-flex;
  margin-top: 28px;
  border-radius: 8px;
  background: var(--brand);
  color: var(--ivory);
  padding: 10px 16px;
  text-decoration: none;
}

.primary-link:hover {
  color: var(--ivory);
  box-shadow: 0 0 0 2px var(--brand-light);
}

.secondary-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid var(--brand);
  border-radius: 8px;
  color: var(--brand);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.35;
  padding: 10px 14px;
  text-decoration: none;
  text-transform: uppercase;
}

.secondary-link:hover {
  background: var(--brand-tint);
}

.game-grid {
  display: grid;
  gap: 16px;
}

.game-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(180px, 0.55fr);
  gap: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ivory) 76%, transparent);
  padding: 24px;
}

html[data-theme="night"] .channel-card,
html[data-theme="night"] .focus-preview article,
html[data-theme="night"] .focus-list article,
html[data-theme="night"] .search-result,
html[data-theme="night"] .search-empty,
html[data-theme="night"] .footer-link,
html[data-theme="night"] .contact-link,
html[data-theme="night"] .game-card {
  background-color: var(--ivory);
  background-image: none;
}

.game-card-copy {
  min-width: 0;
}

.game-card h3 {
  margin: 10px 0 6px;
  font-size: 30px;
  line-height: 1.12;
}

.game-card p {
  color: var(--dark-warm);
}

.game-subtitle {
  margin-bottom: 18px;
  color: var(--copper);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.game-tags,
.game-detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 8px;
}

.game-tags li {
  border-radius: 4px;
  background: var(--signal-tint);
  color: var(--signal);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  padding: 5px 8px;
}

.game-detail-list {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border-soft);
}

.game-detail-list li {
  position: relative;
  padding: 12px 0 12px 20px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--olive);
  font-size: 15px;
  line-height: 1.48;
}

.game-detail-list li::before {
  position: absolute;
  left: 0;
  top: 21px;
  width: 8px;
  height: 2px;
  background: var(--brand);
  content: "";
}

.game-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.game-actions .primary-link {
  margin-top: 0;
}

@media (min-width: 1180px) {
  .channel-card:nth-child(4) {
    background: var(--ivory);
  }
}

@media (max-width: 1120px) {
  .channel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .channel-card {
    min-height: 260px;
  }

  .split-band,
  .hero-section {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
  }

  .focus-preview,
  .focus-list,
  .game-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --page-pad: 18px;
  }

  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .theme-toggle {
    grid-column: 2;
    grid-row: 1;
  }

  main {
    padding: 34px 0 54px;
  }

  .hero-section {
    gap: 28px;
    padding: 18px 0 44px;
  }

  h1 {
    font-size: 42px;
  }

  .motto {
    font-size: 44px;
  }

  h2 {
    font-size: 28px;
  }

  .lede {
    font-size: 18px;
  }

  .section-header {
    display: block;
  }

  .section-header .overline {
    margin-bottom: 14px;
  }

  .channel-grid,
  .small-route-grid,
  .focus-preview,
  .focus-list {
    grid-template-columns: 1fr;
  }

  .channel-card {
    min-height: 0;
    padding: 20px;
  }

  .route-ledger {
    padding: 14px;
  }

  .ledger-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .footer-main {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .footer-link,
  .contact-link {
    flex: 1 1 150px;
  }
}

@media print {
  .paper-grain,
  .skip-link {
    display: none;
  }

  body {
    background: var(--parchment);
  }

  a {
    text-decoration: none;
  }
}
