@font-face {
  font-family: 'Barlow Condensed';
  src: url('./assets/fonts/barlow-condensed-800-italic.ttf') format('truetype');
  font-style: italic;
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Semi Condensed';
  src: url('./assets/fonts/barlow-semi-condensed-500.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Semi Condensed';
  src: url('./assets/fonts/barlow-semi-condensed-600.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --black: #000;
  --text: #f4f4f4;
  --muted: #8f8f8f;
  --line: #333;
  --surface: #141414;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --ui: 'Barlow Semi Condensed', 'Arial Narrow', sans-serif;

  /* The page fits one screen: the stream gets whatever height is left
     after the masthead, the bar under the stream and the links row. */
  --vh: 100vh;
  --pad-y: clamp(1rem, 3.5vh, 2.5rem);
  --gutter: clamp(1rem, 3vw, 2.5rem);
  --mark: clamp(3rem, 9vh, 6rem);
  --mast: calc(var(--mark) * 1.1);
  --bar: 2.75rem;
  --foot: 3.5rem;
  --controls: 4.5rem;
  --stage-h: calc(var(--vh) - 2 * var(--pad-y) - var(--mast) - var(--bar) - var(--foot) - var(--controls) - .5rem);
}
@supports (height: 100dvh) { :root { --vh: 100dvh; } }

* { box-sizing: border-box; }
html { background: var(--black); font-size: clamp(100%, .5vw + .5rem, 118.75%); }
body {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: var(--pad-y) var(--gutter);
  background: var(--black);
  color: var(--text);
  font: 500 1.0625rem/1.35 var(--ui);
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, ul { margin: 0; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; cursor: pointer; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, [tabindex='-1']:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #000;
}
::selection { background: #fff; color: #000; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: .5rem; left: 1rem; z-index: 10; padding: .75rem 1rem; background: #fff; color: #000; transform: translateY(-200%); }
.skip-link:focus { transform: none; }

.icon { flex: none; width: 1.125rem; height: 1.125rem; fill: currentColor; }

.page {
  container-type: inline-size;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "mast contact"
    "stage stage"
    "social social";
  width: min(100%, max(20rem, calc(var(--stage-h) * 16 / 9)), 90rem);
  margin: auto;
}

/* Name and cow. The cow stands on the top edge of the stream. */
.masthead { grid-area: mast; display: flex; align-items: flex-end; font-size: var(--mark); }
.wordmark { margin-bottom: .14em; font: italic 800 1em/.8 var(--display); letter-spacing: -.01em; }
/* Taller than the row: the extra height rises into the top padding. */
.cow { display: block; flex: none; margin: -.3em 0 -.06em -.05em; }
.cow img { display: block; width: auto; height: 1.4em; }

.contact { grid-area: contact; align-self: end; display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 0 .75rem; margin-bottom: .375rem; }
.contact-label { color: var(--muted); }
.email-link { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; overflow-wrap: anywhere; }
.copy-button { min-width: 6.25rem; min-height: 2.25rem; padding: 0 .75rem; border: 1px solid var(--line); border-radius: 2px; background: none; color: var(--muted); font-size: .9375rem; }
.copy-button:hover { border-color: #666; color: var(--text); }

/* Stream */
.broadcast { grid-area: stage; min-width: 0; }
.stream-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--surface); }
.stream-cover { position: absolute; inset: 0; cursor: pointer; }
.stream-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.watch-panel { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-height: 3.75rem; padding-top: .5rem; }
.watch-button {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  min-height: 3rem;
  padding: 0 1.125rem 0 1rem;
  border: 0;
  border-radius: 2px;
  background: #fff;
  color: #000;
  font: 600 1.125rem/1 var(--ui);
}
.watch-button:hover { background: #d9d9d9; text-decoration: none; }
.watch-button.is-alt { background: rgba(0, 0, 0, .8); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.watch-button.is-alt:hover { background: #000; }
.watch-button[aria-pressed="true"] { outline: 2px solid #fff; outline-offset: 3px; }
.player-status { min-height: 1.25rem; color: var(--muted); font-size: .875rem; }
.play-icon { width: .625rem; height: .75rem; fill: currentColor; }
.stream-stage.is-playing { min-height: 300px; }
.is-playing .stream-cover { visibility: hidden; }
#player-mount { position: absolute; inset: 0; background: var(--black); }
#player-mount > div { width: 100%; height: 100%; }
#player-mount iframe { display: block; width: 100%; height: 100%; border: 0; }

.stream-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 1.25rem; min-height: var(--bar); color: var(--muted); font-size: .9375rem; }
.stream-bar a, .bar-button { display: inline-flex; align-items: center; min-height: var(--bar); }
.stream-bar a:hover, .bar-button:hover { color: var(--text); }
.handle { gap: .5rem; }
.handle .icon { width: 1rem; height: 1rem; }
.stream-bar-end { display: flex; align-items: center; gap: 0 1.25rem; }
.bar-button { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }

/* Links row */
.social { grid-area: social; align-self: center; }
.social ul { display: flex; flex-wrap: wrap; column-gap: 1.75rem; padding: 0; list-style: none; }
.social a { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; font-weight: 600; }

/* Phones: stacked, top aligned. */
@media (max-width: 40rem) {
  :root { --mark: 3.25rem; --pad-y: 1rem; }
  body { padding-inline: 1rem; }
  .page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "mast" "stage" "social" "contact";
    width: 100%;
    margin: 0 auto auto;
  }
  .contact { justify-content: flex-start; margin: 0; }
  .watch-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .watch-button { min-height: 2.75rem; padding: 0 .875rem 0 .75rem; font-size: 1rem; }
  .social ul { column-gap: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
