/* ==========================================================================
   10MS TOWNHALL 2023 — "One Evening". The page is the venue at night: a
   guest's walk from the invite to the group photo. The event's own kit only:
   near-black, 10 Minute School red, white, Poppins ExtraBold, and the
   outlined "Together Towards Tomorrow" line as the backdrop. Gold appears
   once, for the Legacy Club.
   ========================================================================== */

.th-page {
  --bg: #0f0f10;
  --panel: #18181a;
  --red: #eb2026;
  --red-d: #c9151b;
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.72);
  --text-3: rgba(255, 255, 255, 0.48);
  --line: rgba(255, 255, 255, 0.12);
  --gold: #d9b46a;
  --gold-2: #f3d79a;
  --display: "Poppins", "Geist", system-ui, sans-serif;
  --mono: "Google Sans Code", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hdr: 121px; /* .site-header's height (site.css) */
  background: var(--bg);
  color: var(--text);
}

@media (max-width: 767px) {
  .th-page {
    --hdr: 66px;
  }
}

.th-page .brand {
  color: var(--text);
}

.th-page .pill-nav {
  color: #111;
}

.th-page .site-header {
  position: relative;
  z-index: 5;
}

.th-page .site-header .pill-chat {
  background: var(--red);
  color: #fff;
}

/* the hero's backdrop runs up behind the header, so the top reads as one surface */
.th {
  position: relative;
  margin-top: calc(-1 * var(--hdr));
  overflow: clip;
  font-family: "Geist", system-ui, sans-serif;
}

.th-wrap {
  width: min(1160px, 100% - 32px);
  margin-inline: auto;
}

/* ---------- Shared type ---------- */
.th-step {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}

.th-step b {
  color: var(--red);
  font-weight: 600;
}

.th-h2 {
  margin: 0 0 22px;
  max-width: 820px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 4.6vw, 60px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.th-red {
  color: var(--red);
}

.th-ink {
  color: #111;
}

.th-gold-t {
  color: var(--gold);
}

.th-gold-t b {
  color: var(--gold-2);
}

.th-intro,
.th-copy p:not(.th-step) {
  max-width: 640px;
  margin: 0 0 40px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-2);
}

.th-center {
  margin-inline: auto;
  text-align: center;
}

.th-sec {
  position: relative;
  padding: 88px 0;
}

.th img {
  display: block;
  max-width: 100%;
  height: auto;
}

.th [data-zoom] {
  cursor: zoom-in;
}

.th figure {
  margin: 0;
}

.th figcaption {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

/* a print, as if it came out of the photobooth */
.th-photo img {
  border: 8px solid #fff;
  border-radius: 4px;
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.45);
}

.th-photo figcaption {
  margin-top: 14px;
}

/* ---------- The backdrop: the theme line in outline, drifting ---------- */
.th-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.06em;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(84px, 12.5vw, 200px);
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
  overflow: hidden;
}

.th-line {
  display: flex;
  width: max-content;
  white-space: nowrap;
}

.th-line span {
  flex: none;
  padding-right: 0.3em;
  color: transparent;
  -webkit-text-stroke: 1.4px rgb(255 255 255 / 0.075);
  animation: th-drift 140s linear infinite;
}

.th-line[data-dir="-1"] span {
  animation-direction: reverse;
}

@keyframes th-drift {
  to {
    transform: translateX(-100%);
  }
}

/* ---------- Hero ---------- */
.th-hero {
  position: relative;
  min-height: min(100svh, 980px);
  display: grid;
  align-items: center;
  padding: calc(104px + var(--hdr)) 0 72px;
  background: radial-gradient(60% 55% at 78% 70%, rgb(235 32 38 / 0.16), transparent 70%);
}

.th-hero-in {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  align-items: end;
  gap: 64px;
}

.th-h1 {
  margin: 0 0 28px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(64px, 9.4vw, 140px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.th-h1 span {
  display: block;
}

.th-lead {
  max-width: 560px;
  margin: 0 0 36px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-2);
}

.th-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  max-width: 640px;
  margin: 0;
  border-top: 1px solid var(--line);
}

.th-facts div {
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid var(--line);
}

.th-facts dt {
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}

.th-facts dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

/* the welcome X-banner, standing on the floor */
.th-stand {
  position: relative;
  justify-self: center;
  width: min(100%, 300px);
}

.th-stand img {
  position: relative;
  z-index: 1;
  box-shadow: 0 30px 60px rgb(0 0 0 / 0.5);
}

.th-stand::after {
  content: "";
  position: absolute;
  left: -30%;
  right: -30%;
  bottom: -22px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(0 0 0 / 0.75), transparent);
}

/* ---------- 01 Invited ---------- */
.th-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 72px;
}

.th-ticket {
  display: grid;
  grid-template-columns: repeat(4, auto);
  max-width: 600px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.th-ticket div {
  padding: 16px 18px;
  border-left: 1px dashed var(--line);
}

.th-ticket div:first-child {
  border-left: 0;
}

.th-ticket span {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.th-ticket b {
  font-size: 15px;
  font-weight: 600;
}

/* the card slides out of an envelope, then sits in front of it */
.th-envelope {
  position: relative;
  width: min(100%, 440px);
  margin-inline: auto;
  padding-bottom: 70px;
}

.th-env-back,
.th-env-front {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 0;
  border-radius: 10px;
}

.th-env-back {
  height: 62%;
  background: #7d1015;
}

.th-env-front {
  z-index: 2;
  height: 42%;
  background: linear-gradient(160deg, var(--red) 0%, var(--red-d) 100%);
  clip-path: polygon(0 0, 50% 34%, 100% 0, 100% 100%, 0 100%);
  box-shadow: 0 -10px 30px rgb(0 0 0 / 0.3);
}

.th-card {
  position: relative;
  z-index: 3;
  border-radius: 6px;
  box-shadow: 0 30px 60px rgb(0 0 0 / 0.5);
}

/* ---------- 02 Wristbands: five real loops, turning ---------- */
.th-loops {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 8px;
  padding: 64px 24px 44px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: radial-gradient(60% 70% at 50% 45%, rgb(255 255 255 / 0.07), transparent 70%), var(--panel);
}

.th-loop {
  display: grid;
  justify-items: center;
  gap: 26px;
  width: calc(var(--c, 400px) / 3.1416 + 64px);
  perspective: 900px;
}

/* the ring: --n slices of the band artwork around a circle (built in townhall.js) */
.th-loop-r {
  position: relative;
  width: var(--sw);
  height: var(--h);
  margin-top: calc(var(--h) * 0.6);
  transform-style: preserve-3d;
  transform: rotateX(-16deg);
  animation: th-spin 18s linear infinite;
  animation-delay: calc(var(--i) * -3.6s);
}

.th-loop:hover .th-loop-r {
  animation-play-state: paused;
}

.th-loop-r i {
  position: absolute;
  inset: 0;
  width: calc(var(--sw) + 0.6px);
  transform-style: preserve-3d;
}

/* outside: the printed artwork; inside: the band's plain colour, in shade */
.th-loop-r i::before,
.th-loop-r i::after {
  content: "";
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.th-loop-r i::before {
  background-image: var(--img);
  background-size: var(--c) var(--h);
  background-position: var(--bp) 0;
  background-repeat: no-repeat;
}

.th-loop-r i::after {
  background: linear-gradient(180deg, rgb(0 0 0 / 0.25), rgb(0 0 0 / 0.55)), var(--in);
  transform: rotateY(180deg);
}

@keyframes th-spin {
  from { transform: rotateX(-16deg) rotateY(0deg); }
  to { transform: rotateX(-16deg) rotateY(-360deg); }
}

.th-loop figcaption {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}

.th .th-band-flat {
  width: min(100%, 820px);
  margin: 40px auto 0;
  text-align: center;
}

.th-band-flat img {
  border-radius: 8px;
}

.th-band-flat figcaption {
  margin-top: 12px;
}

/* ---------- 03 Walk in: one floor, to scale ---------- */
.th-scale {
  --ft: calc(100cqw / 36);
  container-type: inline-size;
  display: flex;
  align-items: flex-end;
}

/* the containment above sizes the rows, so the rows read --ft from here */
.th-scale > .th-row {
  --ft: calc(100cqw / 36);
}

.th-row {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: calc(var(--ft) * 0.8);
  padding: 0 calc(var(--ft) * 0.4);
}

/* the floor */
.th-row::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  height: 1px;
  background: rgb(255 255 255 / 0.3);
}

.th-it {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.th-it figcaption {
  height: 40px;
  padding-top: 10px;
  text-align: center;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-2);
}

.th-it figcaption span {
  display: block;
  color: var(--text-3);
}

.th-xb-set {
  display: flex;
  align-items: flex-end;
  gap: calc(var(--ft) * 0.3);
}

.th-xb-set img {
  width: calc(var(--ft) * 2);
}

.th-side img {
  width: calc(var(--ft) * 3.5);
}

.th-booth img {
  width: calc(var(--ft) * 20);
}

.th-person svg {
  display: block;
  width: calc(var(--ft) * 1.6);
  height: calc(var(--ft) * 5.6);
  fill: rgb(255 255 255 / 0.32);
}

.th-scale img {
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.45);
}

/* ---------- 04 Props: a red wall ---------- */
.th-props-sec {
  background: var(--red);
}

.th-props-sec .th-step,
.th-props-sec .th-step b,
.th-props-sec .th-intro {
  color: rgb(255 255 255 / 0.85);
}

.th-props {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 34px 40px;
  margin: 20px 0 64px;
}

.th-prop {
  width: auto !important;
  height: clamp(120px, 15vw, 200px) !important;
  transform: rotate(var(--r));
  filter: drop-shadow(0 14px 18px rgb(0 0 0 / 0.28));
  transition: transform 0.4s var(--ease);
}

.th-prop:hover {
  transform: rotate(0deg) translateY(-10px) scale(1.04);
}

.th .th-photo-props {
  width: min(100%, 860px);
  margin-inline: auto;
}

/* tilts sit on the images: the figures themselves are moved by the reveal */
.th-photo-props img {
  transform: rotate(-1.2deg);
}

.th-photo-props figcaption {
  color: rgb(255 255 255 / 0.8);
  text-align: center;
}

/* ---------- 05 The wall ---------- */
.th .th-wall {
  width: min(1240px, 100% - 32px);
  margin-inline: auto;
}

.th-wall img {
  border-radius: 10px;
}

.th-wall figcaption {
  margin-top: 14px;
  text-align: center;
}

/* ---------- 06 The Legacy Club: lights change to gold ---------- */
.th-legacy {
  background: #070707;
  overflow: hidden;
}

.th-spots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.th-spots i {
  position: absolute;
  top: -20%;
  width: 60%;
  height: 90%;
  background: radial-gradient(closest-side, rgb(243 215 154 / 0.13), transparent);
  animation: th-sweep 14s ease-in-out infinite alternate;
}

.th-spots i:first-child {
  left: -10%;
}

.th-spots i:last-child {
  right: -10%;
  animation-delay: -7s;
  animation-direction: alternate-reverse;
}

@keyframes th-sweep {
  from { transform: translateX(-12%) rotate(-6deg); }
  to { transform: translateX(28%) rotate(6deg); }
}

.th-legacy-in {
  position: relative;
  z-index: 1;
  text-align: center;
}

.th-legacy .th-step {
  color: var(--gold);
}

.th-legacy-logo {
  width: min(560px, 90%);
  margin: 10px auto 30px;
}

/* the handovers: two large, eight small, nothing cropped away for good (each opens in full) */
.th .th-lc {
  margin: 24px 0 64px;
}

.th-lc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 10px;
}

.th-lc-grid img {
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 8px;
  filter: saturate(0.92);
  transition: filter 0.3s var(--ease);
}

.th-lc-grid img:hover {
  filter: saturate(1.05) brightness(1.05);
}

.th-lc-grid .th-lc-big {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}

.th-lc-grid .th-lc-big:last-child {
  grid-column: 3 / span 2;
  grid-row: 3 / span 2;
}

.th-lc figcaption {
  margin-top: 14px;
  color: var(--gold);
}

/* the crest shelf: nine in a row on one gold plank */
.th-shelf {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  column-gap: 0;
  row-gap: 48px;
}

.th-crest {
  display: grid;
  grid-template-rows: 1fr auto auto;
  justify-items: center;
  align-items: end;
  gap: 0;
  padding: 0 7px;
}

.th-crest img {
  filter: drop-shadow(0 16px 18px rgb(0 0 0 / 0.7));
  transition: transform 0.4s var(--ease);
}

.th-crest:hover img {
  transform: translateY(-8px);
}

/* the plank, drawn under each crest so it runs on unbroken across a row */
.th-crest::after {
  content: "";
  order: 1;
  width: calc(100% + 14px);
  height: 6px;
  margin-top: -2px;
  background: linear-gradient(180deg, #b48a42, #6d5121);
  box-shadow: 0 8px 18px rgb(0 0 0 / 0.6);
}

.th-crest figcaption {
  order: 2;
  min-height: calc(2 * 1.35em + 18px); /* two-line names keep every plank on one line */
  margin-top: 14px;
  font-family: "Geist", sans-serif;
  font-size: 12.5px;
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--text);
}

.th-crest figcaption span {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
}

.th-mine figcaption {
  color: var(--gold-2);
}

/* ---------- 07 The note ---------- */
.th-note {
  background: var(--panel);
}

.th-split-rev .th-copy {
  order: 2;
}

.th-table img {
  border-radius: 10px;
  box-shadow: 0 30px 70px rgb(0 0 0 / 0.5);
}

/* ---------- 08 Tee ---------- */
.th-tee img {
  border-radius: 14px;
}

/* ---------- Finale ---------- */
.th-end {
  position: relative;
  padding: 96px 0 110px;
  overflow: hidden;
}

.th-backdrop-end {
  justify-content: flex-start;
  padding-top: 40px;
}

.th-end-in {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 72px;
}

.th-group img {
  transform: rotate(1.4deg);
}

.th-end-copy p:not(.th-step) {
  margin: 0 0 30px;
  font-size: 18px;
  color: var(--text-2);
}

.th-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.th-btn {
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-family: var(--mono);
  font-size: 15px;
  text-decoration: none;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.th-btn:hover {
  background: var(--red-d);
  transform: translateY(-2px);
}

.th-btn-ghost {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.5);
}

.th-btn-ghost:hover {
  background: rgb(255 255 255 / 0.08);
}

.th-page .site-footer {
  position: relative;
  margin-top: 0;
  padding-top: 64px;
  background: #fff;
  color: #000;
}

/* ---------- Before the hero builds ---------- */
.pre-motion .th-hero-copy > *,
.pre-motion .th-stand,
.pre-motion .th-hero .th-line {
  opacity: 0;
}

/* ---------- Tablet ---------- */
@media (max-width: 1080px) {
  .th-hero-in {
    gap: 40px;
  }

  .th-crest figcaption {
    font-size: 11px;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .th-sec {
    padding: 60px 0;
  }

  .th-h2 {
    line-height: 1.12;
  }

  .th-intro,
  .th-copy p:not(.th-step) {
    font-size: 16px;
    margin-bottom: 32px;
  }

  .th-hero {
    min-height: 0;
    padding: calc(64px + var(--hdr)) 0 52px;
  }

  .th-hero-in,
  .th-split,
  .th-end-in {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
  }

  .th-h1 {
    font-size: clamp(54px, 17vw, 80px);
    line-height: 1.04;
  }

  .th-lead {
    font-size: 16px;
  }

  .th-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .th-stand {
    width: min(58%, 220px);
  }

  .th-ticket {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .th-ticket div:nth-child(3) {
    border-left: 0;
  }

  .th-ticket div:nth-child(n + 3) {
    border-top: 1px dashed var(--line);
  }

  .th-envelope {
    width: min(86%, 360px);
  }

  .th-loops {
    padding: 44px 8px 32px;
    gap: 22px 0;
  }

  .th-lc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .th-lc-grid .th-lc-big,
  .th-lc-grid .th-lc-big:last-child {
    grid-column: span 2;
    grid-row: auto;
    aspect-ratio: 3 / 2;
  }

  /* two floors on a phone, same scale: the small pieces, then the photobooth */
  .th-scale {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }

  .th-scale > .th-row {
    --ft: calc(100cqw / 21.4);
  }

  .th-it figcaption {
    font-size: 10px;
  }

  .th-props {
    gap: 22px 20px;
    margin-bottom: 64px;
  }

  .th-prop {
    height: clamp(84px, 25vw, 120px) !important;
  }

  .th-shelf {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .th-crest {
    padding: 0 12px;
  }

  .th-crest::after {
    width: calc(100% + 24px);
  }

  .th-split-rev .th-copy {
    order: 0;
  }

  .th-end {
    padding: 64px 0 80px;
  }
}

/* ---------- Reduced motion: everything still ---------- */
@media (prefers-reduced-motion: reduce) {
  .th-line span,
  .th-spots i,
  .th-loop-r {
    animation: none;
  }
}
