/* Bands 2–6: proof strip, theme and mission, who takes the stage, programme, compete and create. */

/* ---------- 2 · Proof strip ---------- */

.band--proof {
  /* extra room below the note: the theme card's staircase reaches up into this band, plus 32px of air */
  padding-block: var(--space-band-tight) calc(var(--space-band-tight) + var(--step) * 2 + 2rem);
  background-color: var(--color-surface-soft);
  background-image: none; /* no dot grid here: the band directly under the hero stays plain */
}

/* Four figures in plain type. The hero already carries the dots and crosses, so this band
   stays quiet: one colour, one typeface for the figures, equal columns under a single rule. */
.proof {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.5rem clamp(1.5rem, 1rem + 2vw, 3rem);
  padding-top: var(--space-band-tight);
  background-image: var(--stitch);
  background-size: var(--stitch-pitch) var(--stitch-dot);
  background-repeat: repeat-x;
  background-position: 0 0;
}

/* Each column centred: the figure over a centred label */
.proof__item {
  display: grid;
  gap: 0.75rem;
  align-content: start;
  justify-items: center;
  text-align: center;
  min-width: 0;
}

.proof__figure {
  font-family: var(--font-display);
  font-size: var(--display-2);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums;
  color: var(--color-plum);
}

@media (max-width: 900px) {
  .proof {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.proof__label {
  max-width: 20ch;
  font-size: var(--text-small);
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-navy);
}

.proof__note {
  margin-top: var(--space-band-tight);
  padding-top: 1.25rem;
  background-image: var(--stitch);
  background-size: var(--stitch-pitch) var(--stitch-dot);
  background-repeat: repeat-x;
  background-position: 0 0;
  font-family: var(--font-display);
  font-size: var(--display-6);
  text-align: center;
  text-wrap: balance;
  color: var(--color-plum);
}

/* ---------- 3 · Theme and mission ---------- */

/* The card starts a step above its band so the staircase straddles the proof strip's edge;
   below, the band only clears its own staircase and lets the next band's padding set the gap */
.band--theme {
  padding-top: 0;
  padding-bottom: calc(var(--step) * 2);
}

.theme-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  margin-top: calc(var(--step) * -1);
  padding: clamp(2rem, 1.25rem + 3.5vw, 5rem);
  border-radius: var(--radius-card);
  background: var(--color-plum);
  color: var(--color-bone);
  --stitch-color: color-mix(in oklab, var(--color-bone) 35%, transparent);
}

/* Stepped-pixel edge from the deck's violet board: two staggered rows of squares, scaled to the
   card radius, along the top and the bottom. The width is rounded to whole pixels. */
.theme-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: calc(var(--step) * -2);
  bottom: calc(var(--step) * -2);
  --edge-inset: clamp(2rem, 6vw, 6rem);
  --stair: linear-gradient(90deg, var(--color-plum) 0 50%, transparent 50%);
  width: calc(100% - var(--edge-inset) * 2);
  width: round(down, calc(100% - var(--edge-inset) * 2), calc(var(--step) * 2));
  translate: -50% 0;
  background-image: var(--stair), var(--stair), var(--stair), var(--stair);
  background-size: calc(var(--step) * 2) var(--step);
  background-repeat: repeat-x;
  background-position:
    left 0 top 0,
    left var(--step) top var(--step),
    left 0 bottom 0,
    left var(--step) bottom var(--step);
  pointer-events: none;
}

/* Print grain on the jewel surface */
.theme-card::after,
.programme::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background-image: var(--grain);
  background-size: 180px 180px;
  mix-blend-mode: soft-light;
  opacity: 0.55;
  pointer-events: none;
}

.theme-card__body {
  display: flex;
  flex-direction: column;
}

.theme-card__title {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--display-3);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--color-white);
  text-wrap: balance;
}

.theme-card__mission {
  margin-top: 1.75rem;
  max-width: 48ch;
  display: grid;
  gap: 1rem;
  font-size: var(--text-base);
  line-height: 1.55;
  color: color-mix(in oklab, var(--color-bone) 88%, var(--color-plum));
}

.theme-card__mission p {
  text-wrap: pretty;
}

.theme-card__mission strong {
  color: var(--color-white);
  font-weight: 700;
}

.theme-card__questions-label {
  font-size: var(--text-caps);
  font-weight: 700;
  letter-spacing: var(--caps-tracking);
  text-transform: uppercase;
  color: color-mix(in oklab, var(--color-bone) 70%, var(--color-plum));
}

.questions {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.questions__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5em 0;
  background-image: var(--stitch);
  background-size: var(--stitch-pitch) var(--stitch-dot);
  background-repeat: repeat-x;
  background-position: 0 0;
  font-family: var(--font-display);
  font-size: var(--text-question);
  white-space: nowrap;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--color-white);
  transition: color var(--duration-normal) var(--ease-out-expo);
}

.questions__item:last-child {
  background-image: var(--stitch), var(--stitch);
  background-size: var(--stitch-pitch) var(--stitch-dot);
  background-repeat: repeat-x;
  background-position: 0 0, 0 100%;
}

@media (hover: hover) {
  .questions__item:hover {
    color: var(--hue);
  }

  .questions__item:hover .questions__chip {
    transform: rotate(45deg) scale(1.1);
  }
}

.questions__chip {
  flex: none;
  width: clamp(28px, 2.6vw, 40px);
  color: var(--hue);
  transition: transform var(--duration-normal) var(--ease-spring);
}

/* ---------- 4 · Who takes the stage ---------- */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-band-tight);
  align-items: start;
}

/* Past speakers: a collapsed drawer under the card */
.past__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-plum);
  background-image: var(--stitch), var(--stitch);
  background-size: var(--stitch-pitch) var(--stitch-dot);
  background-repeat: repeat-x;
  background-position: 0 0, 0 100%;
}

.past__summary::-webkit-details-marker {
  display: none;
}

.past[open] .past__summary {
  background-image: var(--stitch);
  background-size: var(--stitch-pitch) var(--stitch-dot);
  background-repeat: repeat-x;
  background-position: 0 0;
}

/* A plus made of two stitches; turns into a cross when open */
.past__plus {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
  transition: transform var(--duration-normal) var(--ease-spring);
}

.past__plus::before,
.past__plus::after {
  content: "";
  position: absolute;
  inset: 6px 0;
  background: currentColor;
  border-radius: 1px;
}

.past__plus::after {
  inset: 0 6px;
}

.past[open] .past__plus {
  transform: rotate(45deg);
}

/* Four category cells, two by two, bordered like a table: a stitch on the grid's top and left,
   on every cell's right and bottom */
.speaker-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background-image: var(--stitch), var(--stitch);
  background-size: var(--stitch-pitch) var(--stitch-dot), var(--stitch-dot) var(--stitch-pitch);
  background-repeat: repeat-x, repeat-y;
  background-position: 0 0, 0 0;
}

.speaker-row {
  display: grid;
  gap: 0.85rem;
  align-content: start;
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem) clamp(1.25rem, 1rem + 1.2vw, 2rem);
  background-image: var(--stitch), var(--stitch);
  background-size: var(--stitch-pitch) var(--stitch-dot), var(--stitch-dot) var(--stitch-pitch);
  background-repeat: repeat-x, repeat-y;
  background-position: 0 100%, 100% 0;
}

.speaker-row__cat {
  margin: 0;
  font-size: var(--text-caps);
  font-weight: 700;
  letter-spacing: var(--caps-tracking);
  text-transform: uppercase;
  color: var(--hue);
}

.speaker-row__body {
  min-width: 0;
}

/* Lead names: serif at list size, role beside the name */
.speaker-lead {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0 0.75rem;
}

.speaker-lead + .speaker-lead {
  margin-top: 0.75rem;
}

.speaker-lead__text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.75rem;
}

/* Black halftone portrait before the name (baked, transparent): decorative, the name beside it is the label.
   33px = the earlier 44px less a quarter. No ring or frame, the dots are the edge. */
.speaker-lead__avatar {
  width: 33px;
  height: 33px;
  object-fit: contain;
}

.speaker-lead__name {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3em;
  font-family: var(--font-display);
  font-size: var(--display-6);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--color-plum);
  transition: color var(--duration-normal) var(--ease-out-expo);
}

.speaker-lead__name:hover,
.speaker-lead__name:focus-visible {
  color: var(--hue);
}

/* 45° arrow: the person's public page. Nudges up and right on hover. */
.speaker-lead__arrow {
  width: 0.4em;
  height: 0.4em;
  flex: none;
  align-self: center;
  fill: none;
  stroke: var(--hue);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--duration-normal) var(--ease-spring);
}

.speaker-lead__name:hover .speaker-lead__arrow,
.speaker-lead__name:focus-visible .speaker-lead__arrow {
  transform: translate(0.12em, -0.12em);
}

.speaker-lead__role {
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-text-muted);
}

/* The other names: one wrapping sans line under a stitch, a hue dot before each name */
.speaker-also {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  background-image: var(--stitch);
  background-size: var(--stitch-pitch) var(--stitch-dot);
  background-repeat: repeat-x;
  background-position: 0 0;
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-navy);
}

.speaker-also li {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.speaker-also li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--hue);
}

/* The card: the deck's kolam mandala, one cell per speaker, categories as concentric bands.
   Sideways from 641px: mandala left, title and legend right. */
.stage__mix {
  padding: clamp(1.5rem, 1rem + 1.6vw, 2.25rem);
  border-radius: 24px;
  background-color: var(--color-surface-soft);
}

@media (min-width: 641px) {
  .stage__mix {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 0 clamp(2rem, 1rem + 3vw, 4rem);
    align-items: center;
  }

  .stage__mix .eyebrow {
    grid-column: 1 / -1;
    margin-bottom: 1.25rem;
  }

  .dot-motif {
    grid-row: 2 / span 3;
    margin-top: 0;
  }

  .stage__mix-title {
    margin-top: 0;
  }

  .legend--keys {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Kolam mandala: the deck's tile, one cell per speaker, categories as concentric bands */
.dot-motif {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--size), 1fr);
  grid-template-rows: repeat(var(--size), 1fr);
  gap: 1px;
  aspect-ratio: 1;
  margin-top: 1.25rem;
  padding: 2px;
  border-radius: 14px;
  background: var(--color-surface-soft) center / cover no-repeat; /* baked halftone photo set inline by dot-chart.js */
  overflow: hidden;
}

.dot-motif__cell {
  grid-column: var(--c);
  grid-row: var(--r);
  position: relative;
  border-radius: 28%;
  background: var(--hue);
  transform: scale(0);
  transition:
    transform 460ms var(--ease-spring) var(--d, 0ms),
    opacity 200ms ease;
}

.is-in .dot-motif__cell {
  transform: scale(1);
}

/* Hovering a legend key (or a cell) lights that category and calms the rest */
.dot-motif:has(.is-hot) .dot-motif__cell:not(.is-hot) {
  opacity: 0.28;
}

/* Patchwork (alternate mode): one block per category, block area = count */
.patchwork {
  --cell: 1fr;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), 1fr);
  gap: 3px;
  aspect-ratio: var(--cols) / var(--rows);
  margin-top: 1.25rem;
}

.patchwork__block {
  display: grid;
  grid-template-columns: repeat(var(--w), 1fr);
  grid-auto-rows: 1fr;
  gap: 3px;
  align-content: start;
  transition: opacity var(--duration-normal) var(--ease-out-expo);
}

.patchwork:has(.is-hot) .patchwork__block:not(.is-hot) {
  opacity: 0.35;
}

.patchwork__cell {
  aspect-ratio: 1;
  border-radius: 28%;
  background: var(--hue);
  transform: scale(0);
  transition: transform 460ms var(--ease-spring);
  transition-delay: var(--d, 0ms);
}

.is-in .patchwork__cell {
  transform: scale(1);
}

.legend--keys li {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  row-gap: 0.75rem;
  cursor: default;
  transition: color var(--duration-normal) var(--ease-out-expo);
}

/* The count is drawn in the logo's own 3×5 dot alphabet at the header "27" size (10px dots,
   1px gap), one hue per category, so no bullet is needed beside it */
.legend--keys li::before {
  content: none;
}

.legend--keys b {
  --dot: 10px;
  --dot-gap: 1px;
  justify-self: start;
  min-width: 0;
}

.legend--keys span {
  grid-column: 1 / -1;
  font-size: var(--text-small);
  line-height: 1.3;
  color: var(--color-navy);
}

.legend--keys li.is-hot {
  color: var(--hue);
}

.legend--keys li.is-hot span {
  color: var(--hue);
}

/* The count is the card's title; the categories read as stats, number first */
.stage__mix-title {
  margin: 1.25rem 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--display-3);
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--color-plum);
  text-wrap: balance;
}

.legend--keys {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  gap: 1.5rem 2rem;
  background-image: var(--stitch);
  background-size: var(--stitch-pitch) var(--stitch-dot);
  background-repeat: repeat-x;
  background-position: 0 0;
}

/* ---------- 5 · Programme ---------- */

.tracks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.track {
  --fg: var(--color-navy);
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.75rem;
  min-height: 240px;
  padding: 1.5rem;
  border-radius: 24px;
  background: var(--color-surface-soft);
  color: var(--fg);
  transition:
    background-color var(--duration-normal) var(--ease-out-expo),
    color var(--duration-normal) var(--ease-out-expo),
    transform var(--duration-normal) var(--ease-out-expo);
}

@media (hover: hover) {
  .track:hover {
    --fg: var(--on-hue, var(--color-white));
    background: var(--hue);
    transform: translateY(-4px);
  }

  .track:hover .track__motif {
    color: var(--on-hue, var(--color-white));
  }
}

.track__motif {
  width: 56px;
  color: var(--hue);
  transition: color var(--duration-normal) var(--ease-out-expo);
}

.track__index {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
}

.track__title {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--display-5);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.track__desc {
  align-self: end;
  font-size: var(--text-small);
  line-height: 1.4;
  opacity: 0.85;
  text-wrap: pretty;
}

.formats {
  margin-top: var(--space-band-tight);
  padding-top: var(--space-band-tight);
  background-image: var(--stitch);
  background-size: var(--stitch-pitch) var(--stitch-dot);
  background-repeat: repeat-x;
  background-position: 0 0;
}

.formats__title {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--display-5);
  color: var(--color-plum);
}

.formats__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 3rem;
  margin: 0;
}

.formats__list > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.45fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem 0;
  background-image: var(--stitch);
  background-size: var(--stitch-pitch) var(--stitch-dot);
  background-repeat: repeat-x;
  background-position: 0 100%;
}

.formats__list dt {
  font-weight: 700;
  color: var(--color-navy);
}

.formats__list dd {
  font-size: var(--text-small);
  line-height: 1.4;
  color: var(--color-text-muted);
}

/* ---------- 6 · Compete and create (bento: the pitch earns the big slot) ---------- */

.programmes {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 1rem;
}

.programme {
  --programme-pad: clamp(1.5rem, 1rem + 2.5vw, 3rem);
  position: relative;
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: var(--programme-pad);
  isolation: isolate;
  border-radius: var(--radius-card);
  background: var(--hue);
  color: var(--color-white);
  overflow: hidden;
  --stitch-color: color-mix(in oklab, var(--color-white) 40%, transparent);
}

.programme--pitch {
  grid-row: 1 / span 2;
  min-height: 520px;
  /* six rows of copy, then the photo's own row takes the leftover height */
  grid-template-rows: repeat(6, auto) minmax(0, 1fr);
}

.programme__kicker {
  font-size: var(--text-caps);
  font-weight: 700;
  letter-spacing: var(--caps-tracking);
  text-transform: uppercase;
  opacity: 0.8;
}

.programme__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-card-title);
  line-height: 1;
  letter-spacing: -0.015em;
}

.programme__desc {
  max-width: 42ch;
  line-height: 1.5;
  opacity: 0.92;
  text-wrap: pretty;
}

.programme__proof {
  display: grid;
  gap: 0.4rem;
  margin: 0.5rem 0;
  padding: 1rem 0;
  background-image: var(--stitch), var(--stitch);
  background-size: var(--stitch-pitch) var(--stitch-dot);
  background-repeat: repeat-x;
  background-position: 0 0, 0 100%;
  font-size: var(--text-base);
}

/* Figures in the serif; phrases stay in the sans */
.programme__proof b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--display-6);
  line-height: 1;
  margin-right: 0.25rem;
}

.programme__deadline {
  font-size: var(--text-small);
  font-weight: 600;
  opacity: 0.9;
}

.programme .btn {
  justify-self: start;
}

/* The three "open" dots breathe out of phase, so they read as three things */
.programme--hack .dot-pulse {
  animation-delay: -0.6s;
}

.programme--art .dot-pulse {
  animation-delay: -1.2s;
}

/* Baked white halftone of the photograph: dots on the card's own hue, so the card dissolves into the picture.
   It is the card's last grid row, bled off the bottom-right corner, so it can never run under the copy. */
.programme__photo {
  justify-self: end;
  align-self: end;
  width: clamp(200px, 24vw, 320px);
  aspect-ratio: 1;
  margin: 0 calc(var(--programme-pad) * -1) calc(var(--programme-pad) * -1) 0;
  pointer-events: none;
  -webkit-mask: linear-gradient(135deg, transparent 0%, #000 45%);
  mask: linear-gradient(135deg, transparent 0%, #000 45%);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .tracks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 1024px) {

  .theme-card {
    grid-template-columns: 1fr;
  }
}

/* Two-up tiles are wide: the description sits beside the title instead of under it */
@media (max-width: 1024px) and (min-width: 521px) {
  .track {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    grid-template-rows: auto auto;
    column-gap: 1.5rem;
    min-height: 0;
  }

  .track__motif {
    grid-column: 1;
    grid-row: 1;
  }

  .track__title {
    grid-column: 1;
    grid-row: 2;
  }

  .track__desc {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 760px) {
  .programmes {
    grid-template-columns: 1fr;
  }

  .programme--pitch {
    grid-row: auto;
    min-height: 0;
  }

  .programme__photo {
    display: none;
  }

  .formats__list {
    grid-template-columns: 1fr;
  }

  .speaker-rows {
    grid-template-columns: 1fr;
  }
}

/* Speaker counts on phones: two columns, each count and label centred in its column */
@media (max-width: 640px) {
  .stage__mix .legend--keys {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1rem;
  }

  .legend--keys li {
    justify-items: center;
    text-align: center;
  }

  .legend--keys b {
    justify-self: center;
  }
}

@media (max-width: 520px) {
  .tracks {
    grid-template-columns: 1fr;
  }

  .track {
    min-height: 0;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    column-gap: 1rem;
  }

  .track__motif {
    grid-row: 1 / span 2;
    width: 48px;
  }

  .track__title {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
    padding-right: 2.25rem; /* room for the index in the corner */
  }

  .track__desc {
    grid-column: 2;
    grid-row: 2;
  }

  .legend {
    grid-template-columns: 1fr;
  }
}
