/* ==========================================================================
   ninebysixteen
   Colors, fonts and spacing are defined once in :root below.
   ========================================================================== */

/* Fonts — self-hosted, SIL Open Font License (see fonts/) */
@font-face {
  font-family: "Mona Sans";
  src: url("fonts/mona-sans.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6f3ee;                 /* warm white */
  --ink: #111;                      /* type */
  --muted: #5c574f;                 /* secondary text, 6:1 on paper */
  --rule: rgb(17 17 17 / 0.16);     /* hairlines */
  --frame: #1d1915;                 /* behind stills while they load */

  --sans: "Mona Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max-width: 90rem;
  --space: clamp(4.5rem, 10vw, 9rem);
  --col-gap: clamp(1.5rem, 3vw, 3rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

/* Base ------------------------------------------------------------------ */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
}

h1, h2, h3, p, ul {
  margin: 0;
}

h1, h2, h3 {
  font-weight: inherit;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

ul {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

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

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max-width));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: var(--gutter);
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(calc(-100% - 1rem));
}

.skip-link:focus {
  transform: none;
}

/* Type ------------------------------------------------------------------ */

.display {
  font-weight: 800;
  font-stretch: 87.5%;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.label {
  font-size: 0.8125rem;
  font-weight: 600;
  font-stretch: 112.5%;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-label {
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--rule);
}

.icon {
  flex: none;
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  transition: transform 0.4s var(--ease);
}

/* Header ---------------------------------------------------------------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1rem;
  padding-block: clamp(1rem, 2.5vw, 1.75rem);
}

.wordmark {
  font-size: clamp(1.125rem, 0.9vw + 0.8rem, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.nav a {
  position: relative;
  display: block;
  padding-block: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 22.5em) {
  .nav a {
    font-size: 0.875rem;
  }
}

.nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 0.3rem;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}

/* Introduction ---------------------------------------------------------- */

.intro {
  container-type: inline-size;
  padding-block: clamp(3rem, 8vw, 7.5rem) clamp(4rem, 8vw, 7.5rem);
}

/* Sized so the longest headline line ("for the small screen", ~7.6em wide)
   always fits the column. If you change the headline, adjust the divisor. */
.intro-title {
  font-size: 11vw;
  font-size: calc(100cqi / 7.9);
}

.intro-title .line {
  display: block;
}

.intro-lede {
  max-width: 25ch;
  text-wrap: balance;
  margin-top: clamp(2rem, 5vw, 4rem);
  font-family: var(--serif);
  font-size: clamp(1.3125rem, 1.6vw + 0.75rem, 2rem);
  line-height: 1.25;
}

@media (min-width: 60em) {
  .intro-lede {
    margin-left: calc(50% + var(--col-gap) / 2);
  }
}

/* Combined stats -------------------------------------------------------- */

.stats-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--col-gap);
}

.stat {
  padding-top: clamp(1.75rem, 4vw, 3rem);
}

.stat + .stat {
  position: relative;
}

.stat + .stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 calc(var(--col-gap) / -2);
  border-left: 1px solid var(--rule);
}

.stat-value {
  display: block;
  font-size: clamp(3.25rem, 9vw + 1.5rem, 11rem);
  line-height: 0.85;
}

.stat-label {
  display: block;
  margin-top: clamp(0.625rem, 1.4vw, 1.25rem);
  font-size: clamp(1.0625rem, 0.8vw + 0.8rem, 1.5rem);
  font-weight: 500;
}

.stats-note {
  margin-top: clamp(2rem, 4vw, 3rem);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1rem;
}

/* Our shows ------------------------------------------------------------- */

.shows {
  padding-top: var(--space);
}

.show-grid {
  display: grid;
  gap: clamp(3.5rem, 8vw, 4.5rem) var(--col-gap);
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

@media (min-width: 45em) {
  .show-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.show {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Line up titles, descriptions, stats and links across both cards. */
@supports (grid-template-rows: subgrid) {
  .show {
    display: grid;
    grid-row: span 5;
    grid-template-rows: subgrid;
    row-gap: 0;
    justify-items: start;
    align-content: start;
  }
}

.show-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--frame);
}

.show-still {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

/* A show's logo centered over its still (white artwork with a transparent background) */
.show-media .show-logo {
  position: absolute;
  inset: 0;
  width: var(--logo-width, 60%);
  height: auto;
  margin: auto;
  z-index: 1;
  filter: drop-shadow(0 1px 10px rgb(0 0 0 / 0.35));
  pointer-events: none;
}

/* Logo-only card: plain black, the logo eases in a touch on hover */
.show-media--black {
  background: #000;
}

.show-media--black .show-logo {
  transition: transform 1.2s var(--ease);
}

/* Soft shade behind a centered logo so white type reads over bright areas */
.show-media:has(.show-logo)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 58% 20% at 50% 50%, rgb(0 0 0 / 0.32), rgb(0 0 0 / 0));
  pointer-events: none;
}

.show-title {
  margin-top: clamp(1.25rem, 2.5vw, 2rem);
  font-size: clamp(2.5rem, 4.4vw, 4.5rem);
  line-height: 0.95;
}

.show-desc {
  max-width: 34ch;
  margin-top: clamp(0.875rem, 1.5vw, 1.25rem);
  font-family: var(--serif);
  font-size: clamp(1.1875rem, 0.6vw + 0.95rem, 1.4375rem);
  line-height: 1.4;
}

.show-stats {
  display: flex;
  gap: 0.75rem clamp(1.25rem, 4vw, 3.5rem);
  align-self: stretch;
  justify-self: stretch;
  align-items: flex-start;
  margin-top: clamp(1.5rem, 2.5vw, 2rem);
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.35;
}

/* Short stats keep their width; only the last, longest label wraps. */
.show-stats li {
  flex-shrink: 0;
}

.show-stats li:last-child {
  flex-shrink: 1;
}

.show-stats strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ink);
  font-size: clamp(1.5rem, 1.2vw + 1rem, 2rem);
  font-weight: 800;
  font-stretch: 87.5%;
  letter-spacing: -0.03em;
  line-height: 1;
}

.show-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

/* The whole card is clickable. */
.show-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* Keyboard focus outlines the whole card. */
@supports selector(:has(*)) {
  .show-link:focus-visible {
    outline: none;
  }

  .show:has(.show-link:focus-visible) {
    outline: 2px solid var(--ink);
    outline-offset: 0.75rem;
  }

  .show:has(.show-link:focus-visible) .show-still {
    transform: scale(1.04);
  }
}

/* Selected brand partners ----------------------------------------------- */

.partners {
  padding-top: var(--space);
}

.partner-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem 3rem;
  padding-top: clamp(2rem, 4vw, 3rem);
}

.partner-list img {
  width: auto;
  height: var(--logo-h, 2rem);
}

/* Text stand-in for a brand without a logo file */
.partner-name {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

@media (max-width: 44.99em) {
  .partner-list {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    justify-content: space-between;
    gap: 2.25rem 1.5rem;
  }

  .partner-list img {
    height: calc(var(--logo-h, 2rem) * 0.8);
  }
}

@media (max-width: 19.99em) {
  .partner-list {
    display: flex;
    justify-content: flex-start;
  }
}

/* Contact --------------------------------------------------------------- */

.contact {
  padding-block: var(--space) clamp(4rem, 8vw, 7rem);
}

.contact-title {
  margin-top: clamp(2rem, 5vw, 4rem);
  font-size: clamp(3rem, 9.5vw, 9.5rem);
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin-top: clamp(1.75rem, 4vw, 3rem);
  font-size: clamp(1.25rem, 3.2vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-thickness: 0.05em;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

.contact-email .icon {
  width: 0.85em;
  height: 0.85em;
  stroke-width: 2;
}

/* Footer ---------------------------------------------------------------- */

.site-footer {
  padding-block: 1.5rem 2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

/* Hover — only on devices with a real pointer --------------------------- */

@media (hover: hover) {
  .nav a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }

  .show:hover .show-still,
  .show:hover .show-media--black .show-logo {
    transform: scale(1.04);
  }

  .show:hover .show-link {
    text-decoration-thickness: 2px;
  }

  .show:hover .show-link .icon {
    transform: translate(0.15em, -0.15em);
  }

  .contact-email:hover {
    text-decoration-thickness: 0.09em;
  }

  .contact-email:hover .icon {
    transform: translateX(0.2em);
  }
}

/* Motion ---------------------------------------------------------------- */

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .show .show-still,
  .show .show-logo,
  .show .icon,
  .contact-email .icon {
    transform: none !important;
  }
}
