/* Learning How to Look & Listen
   ---------------------------------------------------------------
   One stylesheet. Tokens first, then layout, then components.
   Ground is a neutral gallery gray: it's the correct backdrop for
   judging video stills, and it keeps classroom footage from
   fighting the interface. */

/* ---------------------------------------------------------------
   0. Fonts — self-hosted
   These are the exact files Google was serving, moved in-repo so the
   site makes no third-party request. The latin-ext faces only download
   if a character in that range actually appears; nothing on the site
   uses one today, so in practice only the latin files load.
   Both families are SIL OFL 1.1 — see assets/fonts/OFL-*.txt.
   If you ever replace a font file, rename it too: /assets/fonts/ is
   cached for a year as immutable, so a same-named replacement would
   not reach anyone who has already visited.
   --------------------------------------------------------------- */
/* IBM Plex Sans normal, latin — variable */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/plex-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans normal, latin-ext — variable */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/plex-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Newsreader italic, latin — static */
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/newsreader-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Newsreader italic, latin-ext — static */
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/newsreader-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Newsreader normal, latin — variable */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Newsreader normal, latin-ext — variable */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/newsreader-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Mono normal, latin — static */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/plex-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono normal, latin — static */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/plex-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono normal, latin-ext — static */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/plex-mono-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Mono normal, latin-ext — static */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/plex-mono-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------- */
:root {
  --ink:      #14181c;
  --ink-2:    #4c5459;
  --ink-3:    #6f787d;
  --ground:   #ffffff;
  --surface:  #f4f6f5;
  --rule:     #d5d9d7;
  --rule-2:   #e6e9e7;

  /* cobalt: interaction only */
  --accent:   #1b44cc;
  /* burnt amber: reserved for the source clip everything refers to */
  --signal:   #b45309;

  --display: "Newsreader", ui-serif, Georgia, serif;
  --body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 68ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --page: 1240px;

  --ease: cubic-bezier(.2, .6, .3, 1);
}

/* The page stays white in every system theme — a dark variant made the
   classroom video stills read as backlit rather than printed. */
:root { color-scheme: light; }

/* ---------------------------------------------------------------
   2. Base
   --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, .96rem + .2vw, 1.075rem);
  line-height: 1.65;
  font-feature-settings: "kern";
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: .06em; }
a:hover { text-decoration-thickness: .12em; }

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

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--ground);
  padding: .7rem 1.1rem; z-index: 100;
  font: 500 .9rem/1 var(--body);
}
.skip:focus { left: var(--gutter); top: .6rem; }

/* ---------------------------------------------------------------
   3. Typography
   --------------------------------------------------------------- */
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 4rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.1rem); letter-spacing: -.012em; }
h3 { font-size: clamp(1.15rem, 1.05rem + .5vw, 1.35rem); }

p { margin: 0 0 1.15em; }

/* the eyebrow / label voice: mono, spaced, quiet */
.label {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 1.1rem;
}
.lede {
  font-size: clamp(1.1rem, 1.02rem + .45vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------
   4. Page frame
   --------------------------------------------------------------- */
.wrap { max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }
.prose { max-width: var(--measure); }

.masthead {
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.masthead__inner {
  display: flex; flex-wrap: wrap; gap: .6rem 2rem;
  align-items: baseline; justify-content: space-between;
  padding-block: .85rem;
}
.masthead__title {
  font-family: var(--display);
  font-size: 1.02rem; font-weight: 500; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.masthead__title:hover { color: var(--accent); }

.nav { display: flex; flex-wrap: wrap; gap: .15rem 1.35rem; margin: 0; padding: 0; list-style: none; }
.nav a {
  font-size: .875rem;
  color: var(--ink-2);
  text-decoration: none;
  padding-block: .2rem;
  border-bottom: 1.5px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--rule); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.foot {
  border-top: 1px solid var(--rule);
  margin-top: clamp(4rem, 10vw, 7rem);
  padding-block: 2.25rem 3rem;
  font-size: .875rem;
  color: var(--ink-3);
  text-align: center;
}
/* No measure cap: the credits run the width of the page so they settle
   into as few lines as possible, balanced rather than ragged. */
.foot p { margin: 0 0 .5em; text-wrap: balance; }
.foot a { color: var(--ink-2); }
.foot a:hover { color: var(--accent); }

/* ---------------------------------------------------------------
   5. Hero
   --------------------------------------------------------------- */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) 0; }
/* No measure cap here: the title and standfirst run the full width of
   .wrap and break only when the viewport is genuinely too narrow. The
   body copy below still holds to --measure, where a short line matters. */
.hero__title { text-wrap: balance; }
.hero__sub {
  font-family: var(--display);
  font-size: clamp(1.15rem, 1rem + .8vw, 1.6rem);
  font-style: italic;
  color: var(--ink-2);
  margin: .7rem 0 0;
  line-height: 1.3;
  text-wrap: balance;
}
.hero__figure { margin: clamp(2rem, 5vw, 3.25rem) 0 0; }
.hero__figure img {
  width: 100%; height: auto;
  border: 1px solid var(--rule);
  background: var(--surface);
}
/* The hero caption carries real information, so it reads a step darker
   and heavier than the small print elsewhere, and runs the full width
   rather than breaking to a second line. */
.hero__figure figcaption {
  font-family: var(--mono); font-size: .82rem; line-height: 1.5;
  font-weight: 500; color: var(--ink-2);
  margin-top: .8rem;
  text-wrap: balance;
}

/* the archive-at-a-glance line — real counts, not decoration */
.tally {
  display: flex; flex-wrap: wrap; gap: 0;
  margin: clamp(2rem, 5vw, 3rem) 0 0;
  border-top: 1px solid var(--rule);
  list-style: none; padding: 0;
}
.tally li {
  flex: 1 1 0; min-width: 8.5rem;
  padding: 1.1rem 1.4rem 1.2rem;
  border-right: 1px solid var(--rule-2);
  text-align: center;
}
.tally li:last-child { border-right: 0; }
.tally b {
  display: block;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.7rem);
  line-height: 1; letter-spacing: -.02em;
}
.tally span {
  display: block; margin-top: .45rem;
  font-family: var(--mono); font-size: .7rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}

/* ---------------------------------------------------------------
   6. Sections
   --------------------------------------------------------------- */
.section { padding-block: clamp(3rem, 8vw, 5.5rem); }
.section--tight { padding-block: clamp(2rem, 5vw, 3rem); }
.section__head { margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.section__head .prose { margin-top: 1.1rem; }

/* section index on the home page */
.index { display: grid; gap: 1px; background: var(--rule-2); border-block: 1px solid var(--rule); }
@media (min-width: 720px) { .index { grid-template-columns: 1fr 1fr; } }
.index__item {
  background: var(--ground);
  padding: 1.6rem 1.5rem 1.75rem;
  text-decoration: none; color: inherit;
  display: block;
  transition: background .2s var(--ease);
}
.index__item:hover { background: var(--surface); }
/* Card titles are sized by the component, not by their heading level: the
   home page nests them under an <h2> so they are h3s, the 404 page has no
   such heading above them so they are h2s. Both should look the same. */
.index__item :is(h2, h3) {
  font-size: clamp(1.15rem, 1.05rem + .5vw, 1.35rem);
  margin-bottom: .45rem;
}
.index__item:hover :is(h2, h3) { color: var(--accent); }
.index__item p { margin: 0; font-size: .93rem; color: var(--ink-2); }
.index__count {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: .8rem;
}

/* resource list (the PDFs) */
.docs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); max-width: var(--measure); }
.docs li { border-bottom: 1px solid var(--rule-2); }
.docs a {
  display: flex; align-items: baseline; gap: 1rem;
  padding: .95rem .2rem; text-decoration: none; color: var(--ink);
}
.docs a:hover { color: var(--accent); }
.docs .doc__name { flex: 1 1 auto; }
.docs .doc__meta { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); white-space: nowrap; }
.docs a:hover .doc__meta { color: var(--accent); }
/* a docs list sitting between other blocks rather than closing a section */
.docs--after { margin-block: clamp(2rem, 5vw, 3.25rem); }


/* ---------------------------------------------------------------
   7. Contact sheet — the signature element
   Many viewings of one clip, laid out like a film contact sheet.
   --------------------------------------------------------------- */
.sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: clamp(1.25rem, 3vw, 2rem) clamp(1rem, 2.4vw, 1.75rem);
  margin: 0; padding: 0; list-style: none;
}

.viewing { margin: 0; }
/* These are <h2> because they are the page's second-level headings, not
   because they should look like one — size and tracking are pinned here so
   the heading level stays a structural decision. */
.viewing__name {
  font-family: var(--display);
  font-size: 1.02rem; line-height: 1.3;
  letter-spacing: normal;
  margin-top: .7rem;
}
.viewing__meta {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3); margin-top: .3rem;
}

/* the source clip gets the one warm accent in the system */
.viewing--source .viewing__meta { color: var(--signal); }
.viewing--source .facade { outline: 2px solid var(--signal); outline-offset: 3px; }

/* full-width feature treatment for the source clip / group session */
.viewing--feature { grid-column: 1 / -1; max-width: 62rem; }
.viewing--feature .viewing__name { font-size: clamp(1.2rem, 1.05rem + .6vw, 1.55rem); margin-top: .9rem; }

/* ---------------------------------------------------------------
   8. Video facade — click to load, no YouTube JS until asked
   --------------------------------------------------------------- */
.facade {
  position: relative; display: block; width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0; margin: 0;
  border: 1px solid var(--rule);
  background: var(--surface);
  cursor: pointer; overflow: hidden;
  font: inherit; color: inherit;
}
.facade img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--ease), filter .3s var(--ease);
}
.facade:hover img { transform: scale(1.028); filter: brightness(.9); }

/* The play badge is drawn here rather than inlined as SVG in every card.
   It is decoration — 34 copies of the same path was 34 places to edit.
   Proportions follow the original 68x48 mark: the triangle is 18/68 of
   the badge width and sits a hair right of centre. */
.facade::before, .facade::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  pointer-events: none;
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.facade::before {                       /* the rounded badge */
  width: clamp(2.9rem, 6vw, 3.6rem); aspect-ratio: 68 / 48;
  translate: -50% -50%;
  border-radius: 22% / 32%;
  background: rgb(20 24 28 / .78);
  filter: drop-shadow(0 2px 10px rgb(0 0 0 / .45));
  opacity: .93;
}
.facade::after {                        /* the triangle */
  width: clamp(.768rem, 1.588vw, .953rem); aspect-ratio: 18 / 20;
  translate: -39% -50%;
  background: #fff;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.facade:hover::before, .facade:hover::after { transform: scale(1.09); }
.facade:hover::before { opacity: 1; }

.facade iframe { width: 100%; height: 100%; border: 0; display: block; }
/* On play, js/site.js replaces the <button> with a plain div carrying both
   classes, so the frame keeps its border and 16:9 box. All that has to be
   undone is the badge, which would otherwise sit on top of the player. */
.facade.is-playing::before, .facade.is-playing::after { content: none; }

/* ---------------------------------------------------------------
   9. Long-form: themes + chronology
   --------------------------------------------------------------- */
.theme { padding-block: clamp(2rem, 5vw, 3rem); border-top: 1px solid var(--rule-2); }
.theme:first-of-type { border-top: 1px solid var(--rule); }
.theme h2 { margin-bottom: .9rem; }
.theme .prose { color: var(--ink-2); }

/* the bibliography as an actual chronology: year in a mono gutter */
.chron { margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.chron__entry {
  display: grid; gap: .15rem 1.75rem;
  grid-template-columns: 1fr;
  padding-block: 1.05rem;
  border-bottom: 1px solid var(--rule-2);
}
@media (min-width: 700px) {
  .chron__entry { grid-template-columns: 4.5rem 1fr; }
}
.chron__year {
  font-family: var(--mono); font-size: .82rem; font-weight: 500;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
  padding-top: .18em;
}
.chron__cite { font-size: .95rem; line-height: 1.6; color: var(--ink-2); max-width: 74ch; }
.chron__entry:hover { background: var(--surface); }

/* ---------------------------------------------------------------
   10. Motion
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .facade:hover img { transform: none; }
}
