/* home.css: styles used only by this part of the site, loaded after site.css (inc/layout.php). Split from site.css in v61.
   Tokens, base and shared parts stay in site.css. DESIGN.md describes them. */
/* ===== 10. Home: the score, the sweep, the doors ===== */
/* The first screen of a phone must hold the headline, the defining sentence and the top of the map. So this band starts tight. */
.hint-slot + .home-score { padding-top: var(--space-2); }
.home-score-grid { display: grid; gap: var(--space-3); }
.home-plate-a > * + * { margin-top: var(--space-3); }
.home-score-grid > * { min-width: 0; }
/* The plate: text never sits on the map itself. Where the two meet on wide screens, the plate is solid and lies on top. */
.home-plate { position: relative; z-index: 1; background: var(--night); }
.home-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); padding-left: var(--drop); padding-bottom: var(--drop); }
.home-map-wrap { position: relative; }
/* The map is as wide as its column, but never taller than the screen can show */
/* The room for the map is kept free before it is drawn, so nothing below it jumps. 1000 by 860 is the size of the outline file. */
.home-map { max-width: calc(80vh * 1.16); margin-inline: auto; aspect-ratio: 1000 / 860; }
.home-map svg { max-height: none; }
.home-map.map-failed { display: none; }
@media (max-width: 600px) { .home-score .lead { font-size: var(--step-0); line-height: 1.45; } }
@media (min-width: 600px) {
  .hint-slot + .home-score { padding-top: var(--space-4); }
  .home-score-grid { gap: var(--space-4); }
  .home-plate-a > * + * { margin-top: var(--space-4); }
}
/* Wide screens: text on the left, the map on the right. The plate reaches one column into the map, over open sea. */
@media (min-width: 1000px) {
  .hint-slot + .home-score { padding-top: var(--space-5); }
  .home-score-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 1fr; gap: var(--space-5) var(--space-4); align-items: start; }
  .home-plate-a { grid-column: 1 / span 6; grid-row: 1; padding-right: var(--space-4); }
  .home-plate-b { grid-column: 6 / -1; grid-row: 2; }
  .home-map-wrap { grid-column: 6 / -1; grid-row: 1; }
  .home-map { margin-right: 0; }
}
/* The legend of the map with its Play key stands below the map (since v26), one size smaller than the text around it. */
.home-plate-b { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); }
.home-legend { flex: 1 1 16rem; min-width: 0; }
.home-legend > * + * { margin-top: var(--space-2); }
.home-plate-b h2 { font-size: var(--step-0); }
.home-plate-b .legend { font-size: var(--step--1); }
.home-plate-b .home-controls { flex: none; }
.home-plate-b .btn { font-size: var(--step--1); }
/* The sweep. A dot that has not sounded yet is small and white. Struck, it blooms into the colour of its note. */
.home-map.is-waiting .sm-dot, .home-map.is-playing .sm-node:not(.is-played) .sm-dot { fill: var(--white); transform: scale(0.6); }
.home-map.is-playing .sm-node.is-played .sm-dot { animation: bloom var(--slow) var(--ease-bounce) backwards; }
/* Since v37: the text of the home sections after the score runs the width of its section, so no paragraph stops halfway across the page.
   Lines are balanced, so a paragraph does not end on a single word. The reading pages keep their 68 characters. */
.home-wide .lead, .home-wide .prose > p, .home-wide .wrap.prose > *, .home-wide .wrap.flow > p { max-width: none; }
.home-wide p { text-wrap: pretty; }
.home-wide .lead { text-wrap: balance; }
/* "Who we are. What we do.": the paragraph and the logo side by side from 900 px, the logo under the paragraph on phones */
.who-intro { display: grid; gap: var(--space-4); align-items: center; }
@media (min-width: 900px) { .who-intro { grid-template-columns: minmax(0, 1fr) minmax(14rem, 22rem); gap: var(--space-6); } }
.who-logo { display: grid; justify-items: start; gap: var(--space-3); max-width: 22rem; }
.who-logo-stage { position: relative; width: 100%; }
.who-logo-stage img { display: block; width: 100%; height: auto; }
.who-logo-head { position: absolute; top: -10%; bottom: -10%; left: 0; width: 4px; border-radius: var(--radius-pill); opacity: 0; pointer-events: none;
  background: linear-gradient(to bottom, var(--tone-4), var(--tone-3), var(--tone-2), var(--tone-1), var(--tone-0)); }
.who-logo-scale i { border-color: var(--ink); }
/* Covered only once the script is ready (is-ready). The sweep: the playhead crosses, the logo is uncovered behind it, bounces, and the notes light up. */
.who-logo.is-ready .who-logo-stage img { clip-path: inset(0 100% 0 0); }
.who-logo.is-ready .who-logo-scale i { transform: scale(0); }
.who-logo.is-on .who-logo-stage img { animation: logo-uncover 1400ms var(--ease-press) forwards, logo-bounce var(--slow) var(--ease-bounce) 1400ms; }
.who-logo.is-on .who-logo-head { animation: logo-head 1400ms var(--ease-press) forwards; }
.who-logo.is-on .who-logo-scale i { animation: logo-note var(--slow) var(--ease-bounce) forwards; }
.who-logo.is-on .who-logo-scale i:nth-child(1) { animation-delay: 1400ms; } .who-logo.is-on .who-logo-scale i:nth-child(2) { animation-delay: 1520ms; }
.who-logo.is-on .who-logo-scale i:nth-child(3) { animation-delay: 1640ms; } .who-logo.is-on .who-logo-scale i:nth-child(4) { animation-delay: 1760ms; }
.who-logo.is-on .who-logo-scale i:nth-child(5) { animation-delay: 1880ms; }
@keyframes logo-uncover { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes logo-head { 0% { left: 0; opacity: 1; } 92% { left: 100%; opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes logo-bounce { 0% { transform: scale(1); } 40% { transform: scale(0.96); } 100% { transform: scale(1); } }
@keyframes logo-note { from { transform: scale(0); } to { transform: scale(1); } }
/* Five doors since v37: three above two on wide screens, two per row from 600 px with the last one across. */
/* Four doors as large keys (three until v25). The lamp of a door is the note colour of its menu key. */
.door-keys { display: grid; gap: var(--space-4); padding-left: var(--drop); padding-bottom: var(--drop); }
@media (min-width: 600px) { .door-keys { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 600px) and (max-width: 1179.98px) { .door-keys li:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 1180px) { .door-keys { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Since v46 the home page has four doors: two by two on every screen from 600 px. The Resources page keeps three in a row. */
@media (min-width: 1180px) { .door-keys-four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.door-keys li { display: flex; }
/* Latest news on the home page (v28): one card-like entry per item with its picture on top, two side by side from 780 px, with wide gaps between them */
.home-news { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6) var(--space-5); margin-top: var(--space-5); }
@media (min-width: 780px) { .home-news { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); } }
.home-news-item { display: grid; grid-template-rows: auto auto auto 1fr auto; align-content: start; gap: var(--space-3); min-width: 0; }
.home-news-item .shot { border-color: var(--white); }
.home-news-item .gap.shot { border-color: var(--ink); }
.home-news-item h3 { margin: 0; font-size: var(--step-1); }
.home-news-item > p:not([class]) { max-width: var(--measure); }
.home-news-more { align-self: end; padding-left: var(--drop); padding-bottom: var(--drop); }
.home-news-all { margin-top: var(--space-6); padding-top: var(--space-5); border-top: var(--line) solid currentColor; }
.pillar-cap { display: block; height: var(--space-4); margin-inline: calc(var(--space-4) * -1 - var(--line)); border: var(--line) solid var(--ink); outline: var(--line) solid currentColor; outline-offset: 0; border-radius: var(--radius-s) var(--radius-s) 0 0; }
/* Projects on the home page: small white cards. The state of a project is a lamp with its word beside it. */
.home-projects { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); padding-left: var(--drop); padding-bottom: var(--drop); }
@media (min-width: 700px) { .home-projects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .home-projects { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.home-project { display: grid; grid-template-rows: auto auto 1fr auto; align-content: start; gap: var(--space-2); }
.home-project h3 { margin-top: 0; }
.home-project .project-link { align-self: end; }
/* Home, since v60: the conference map after the members. A quiet dot map as one link to the Conferences page, and the next four conferences. */
.home-conf-grid { display: grid; gap: var(--space-5); align-items: start; }
@media (min-width: 900px) { .home-conf-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-6); } }
.home-conf-map { display: block; aspect-ratio: 252 / 162; padding: var(--space-3); border: var(--line) solid var(--muted-on-night); border-radius: var(--radius-m); background: var(--night-2); }
.home-conf-map:hover, .home-conf-map:focus-visible { border-color: var(--white); }
.home-conf-list { display: grid; gap: var(--space-3); }
.home-conf-list li { display: grid; gap: var(--space-1); padding-bottom: var(--space-3); border-bottom: 1px solid rgb(255 255 255 / 0.2); }
.home-conf-list a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--white); }
.home-conf-list .readout { color: var(--muted-on-night); }
@media (max-width: 599.98px) {
  .who-logo { max-width: 15rem; }
}
.intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-words { position: absolute; left: var(--gutter); right: var(--gutter); bottom: max(6vh, 4.5rem); margin: 0 auto; max-width: 22ch; text-align: center; perspective: 900px; text-shadow: 0 0.1em 0.6em var(--night), 0 0 1.5em var(--night);
  font-family: var(--font-display); font-weight: 800; font-stretch: 110%; font-size: var(--step-3); line-height: 1.05; text-wrap: balance; }
.intro-line { display: block; }
.intro-line + .intro-line { margin-top: 0.15em; }
.intro-word { display: inline-block; opacity: 0; transform: translateY(0.6em) translateZ(-260px) rotateX(-80deg); transform-origin: 50% 100%; filter: blur(6px);
  transition: opacity 700ms var(--ease-press), transform 900ms var(--ease-bounce), filter 700ms var(--ease-press);
  transition-delay: calc(var(--i) * 60ms + var(--l) * 250ms); }   /* since v62 quicker, for the 6.5-second opening */
.intro-line + .intro-line .intro-word { color: var(--tone-1); }
.intro.is-speaking .intro-word { opacity: 1; transform: none; filter: none; }
.intro:not(.is-speaking) .intro-word { transition-delay: calc(var(--i) * 25ms); }
.intro-logo { position: absolute; left: 50%; top: 42%; height: auto; max-width: none; transform: translate(-50%, -50%) scale(0.96); opacity: 0; filter: blur(8px);
  transition: opacity 700ms var(--ease-press), transform 900ms var(--ease-bounce), filter 700ms var(--ease-press); }
.intro.is-logo .intro-logo { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: none; }
.intro-keys { position: absolute; right: var(--space-4); top: var(--space-4); display: flex; gap: var(--space-3); padding: 0 0 var(--drop) var(--drop); }
.intro-skip, .intro-sound { font-size: var(--step--1); }
.intro-sound.is-heard .sound-lamp { background: var(--tone-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone-2) 35%, transparent); }
@media (max-width: 599.98px) { .intro-words { font-size: var(--step-2); font-stretch: 100%; } .intro-keys { right: var(--space-3); top: var(--space-3); } }
