/* Pundit Puppets: punditpuppets.com. Colours come from tokens.css (loaded first). */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("assets/fonts/montserrat-extrabold.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-201D, U+2026;
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/montserrat-medium.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-201D, U+2026;
}

/* ---- System ---------------------------------------------------------- */

:root {
  /* Derived from the tokens: dark studio by default. */
  --surface: var(--pp-surface);
  --muted: var(--pp-muted);
  --lead: rgb(var(--pp-text-rgb) / 0.88);
  --focus: var(--pp-accent);
  --emphasis: var(--pp-accent);
  --hairline: rgb(var(--pp-muted-rgb) / 0.18);
  --mark-height: 4px;

  /* Type scale: 1.25 ratio from 1 rem. */
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.953rem;
  --step-4: 2.441rem;
  --step-5: 3.052rem;
  --step-6: 3.815rem;
  --small: 0.8rem;

  /* Spacing scale. */
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 2rem;
  --space-l: 4rem;
  --space-xl: 8rem;

  --gutter: var(--space-s);
  --measure: 72rem;
  --section: var(--space-l);
  --radius: 0.75rem;

  --font: "Montserrat", "Helvetica Neue", Arial, sans-serif;
}

/* tokens.css flips bg, surface, text and muted for the light theme; here only the derived roles move. */
@media (prefers-color-scheme: light) {
  :root {
    --lead: var(--pp-text);
    /* The accent keeps its job as the pitch line; text-sized and ring uses need the dark ink. */
    --focus: var(--pp-text);
    --emphasis: var(--pp-text);
    --hairline: rgb(var(--pp-bg-rgb) / 0.14);
    --mark-height: 5px;
  }
}

/* The masthead (header and studio) stays dark in both themes: it is the studio. */
.site-header,
.hero {
  --pp-bg: var(--pp-studio-bg);
  --pp-text: var(--pp-studio-text);
  --muted: var(--pp-studio-muted);
  --focus: var(--pp-accent);
  background: var(--pp-bg);
  color: var(--pp-text);
}

@media (min-width: 37.5em) {
  :root {
    --gutter: var(--space-m);
  }
}

@media (min-width: 64em) {
  :root {
    --gutter: 3rem;
    --section: 6rem;
  }
}

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

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--pp-bg);
  color: var(--pp-text);
  font-family: var(--font);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1 0 auto;
}

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

h1,
h2,
h3 {
  font-weight: 800;
  line-height: 1.1;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--pp-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

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

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

::selection {
  background: var(--pp-accent);
  color: var(--pp-studio-bg);
}

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* The section mark: a short pitch line, the wordmark's accent, above each heading. */
.about h2::before,
.cast h2::before,
.channels h2::before,
.not-found h1::before {
  content: "";
  display: block;
  width: 3rem;
  height: var(--mark-height);
  margin-bottom: var(--space-s);
  border-radius: 2px;
  background: var(--pp-accent);
}

/* Secondary section headings: the cast and the channels. */
.section-title {
  margin-bottom: var(--space-m);
  font-size: clamp(var(--step-2), 1.1rem + 1.8vw, var(--step-4));
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

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

/* The header's background sits under the hero; its wordmark and tagline sit over it. */
.site-header {
  padding: var(--space-m) var(--gutter) var(--space-s);
  text-align: center;
}

.brand,
.tagline {
  position: relative;
  z-index: 2;
}

.brand {
  display: block;
  width: min(100%, 46rem);
  margin-inline: auto;
  color: var(--pp-studio-text);
  text-decoration: none;
}

.wordmark {
  width: 100%;
  height: auto;
}

.wordmark rect {
  fill: var(--pp-accent);
}

.tagline {
  margin-top: 0.75rem;
  color: rgb(var(--pp-text-rgb) / 0.82);
  font-size: var(--small);
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

@media (min-width: 64em) {
  .site-header {
    padding-top: var(--space-l);
  }

  .tagline {
    font-size: var(--step-1);
  }
}

/* ---- Hero ------------------------------------------------------------ */

.hero {
  position: relative;
  z-index: 1;
  margin-top: calc(-1 * var(--space-m));
}

.hero img {
  width: 100%;
  /* Phones: a taller 4:3 crop keeps the three pundits large; the sides of the set go. */
  aspect-ratio: 4 / 3;
  max-height: min(78vh, 60rem);
  object-fit: cover;
  object-position: 50% 45%;
}

/* A stepped scrim under the masthead, and the melt into the studio black at the bottom. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    var(--pp-bg) 0%,
    rgb(var(--pp-bg-rgb) / 0.92) 14%,
    rgb(var(--pp-bg-rgb) / 0.5) 26%,
    transparent 38%,
    transparent 62%,
    var(--pp-bg) 100%
  );
}

@media (min-width: 37.5em) {
  .hero img {
    aspect-ratio: auto;
  }
}

@media (min-width: 64em) {
  .hero {
    margin-top: calc(-1 * var(--space-xl));
  }

  .hero img {
    object-position: 50% 40%;
  }
}

/* ---- About ----------------------------------------------------------- */

.about {
  display: grid;
  gap: var(--space-m);
  padding-block: var(--space-l) var(--section);
}

.about h2 {
  font-size: clamp(var(--step-3), 1.2rem + 3.6vw, var(--step-6));
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.about p {
  max-width: 38rem;
  color: var(--lead);
  font-size: var(--step-1);
  line-height: 1.6;
}

@media (min-width: 64em) {
  .about {
    grid-template-columns: 1.15fr 1fr;
    align-items: end;
    gap: var(--space-l);
  }
}

/* ---- Cast ------------------------------------------------------------ */

.cast {
  padding-bottom: var(--section);
}

.cast-grid {
  display: grid;
  gap: var(--space-s);
}

.member {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
}

.member:hover {
  border-color: rgb(var(--pp-accent-rgb) / 0.5);
}

.member img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.member-text {
  padding: 1.5rem;
}

.member h3 {
  font-size: var(--step-2);
  letter-spacing: -0.01em;
}

.role {
  margin: 0.5rem 0 0.75rem;
  color: var(--emphasis);
  font-size: var(--small);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.member-text p:last-child {
  color: var(--muted);
}

@media (prefers-color-scheme: light) {
  .role {
    padding-left: 0.5rem;
    border-left: 3px solid var(--pp-accent);
  }
}

/* Phones and small tablets (under 768 px): a square thumbnail beside the text; three columns would
   leave each name about 120 px. */
@media (max-width: 47.99em) {
  .member {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    align-items: start;
  }

  .member-text {
    padding: var(--space-s);
  }

  .member h3 {
    font-size: var(--step-1);
  }

  .member-text p:last-child {
    font-size: 0.9375rem;
  }
}

@media (min-width: 37.5em) and (max-width: 47.99em) {
  .member {
    grid-template-columns: 10rem 1fr;
  }

  .member-text {
    padding: 1.5rem;
  }
}

@media (min-width: 48em) {
  .cast-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 48em) and (max-width: 63.99em) {
  .member h3 {
    font-size: var(--step-1);
  }

  .member-text p:last-child {
    font-size: 0.9375rem;
  }
}

@media (min-width: 64em) {
  .cast-grid {
    gap: var(--space-m);
  }

  .member-text {
    padding: var(--space-m);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .member {
    transition: border-color 160ms ease-out;
  }
}

/* ---- Channels -------------------------------------------------------- */

.channels {
  padding-bottom: var(--section);
}

.channel-list {
  display: grid;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hairline);
}

/* Phones: network over handle, the tag on the right. Tablets: one line each. Desktop: five tiles. */
.channel-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "network soon" "handle soon";
  align-items: center;
  column-gap: var(--space-s);
  padding-block: var(--space-s);
  border-bottom: 1px solid var(--hairline);
}

@media (min-width: 37.5em) {
  .channel-list li {
    grid-template-columns: 8rem 1fr auto;
    grid-template-areas: "network handle soon";
    align-items: baseline;
  }
}

.network {
  grid-area: network;
  font-size: var(--step-0);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.handle {
  grid-area: handle;
  color: var(--muted);
}

.soon {
  grid-area: soon;
  justify-self: end;
  padding: 0.125rem 0.625rem;
  border: 1px solid rgb(var(--pp-accent-rgb) / 0.35);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.6;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (min-width: 64em) {
  .channel-list {
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    border-top: 0;
  }

  .channel-list li {
    grid-template-columns: 1fr;
    grid-template-areas: "network" "handle" "soon";
    align-items: start;
    row-gap: 0.25rem;
    padding: var(--space-m) var(--space-s);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .soon {
    justify-self: start;
    margin-top: var(--space-s);
  }
}

/* ---- 404 ------------------------------------------------------------- */

.not-found {
  display: grid;
  place-content: center;
  text-align: center;
  padding-block: var(--space-xl);
}

.not-found h1 {
  margin-bottom: var(--space-s);
  font-size: clamp(var(--step-4), 1.4rem + 4vw, var(--step-6));
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.not-found h1::before {
  margin-inline: auto;
}

.not-found p {
  font-size: var(--step-1);
}

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

.site-footer {
  padding-block: var(--space-l);
  border-top: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.site-footer .wrap {
  display: grid;
  gap: var(--space-s);
}

.footer-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
}

.legal {
  max-width: 40rem;
}

.legal p + p {
  margin-top: var(--space-xs);
}

@media (min-width: 64em) {
  .site-footer .wrap {
    grid-template-columns: auto 1fr auto;
    gap: var(--space-m);
    align-items: start;
  }

  .copyright {
    justify-self: end;
  }
}
