:root {
  --blue: #1A3FA8;
  --ink: #10162C;
  --grey: #5B6584;
  --rule: #D8DDEA;
  --font: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 56px);
  /* One type scale. Every uppercase label is the same size, weight and
     tracking wherever it appears; body text has three steps and no more. */
  --label: 12px;              /* uppercase labels: nav, strip, dt, pill, foot */
  --track: 0.12em;            /* the tracking those labels always use */
  --small: 13px;              /* captions and fine print */
  --mid: 15px;                /* secondary body: cube blurbs, meta values */
}
* { box-sizing: border-box; }
body {
  margin: 0;
  /* Sticky footer. Without this the footer stops wherever the content does,
     so a short page leaves it floating mid-window with white below it.
     dvh rather than vh so mobile browser chrome does not push it off. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
.skip {
  position: absolute; left: -9999px;
  background: var(--blue); color: #fff; padding: 10px 16px; z-index: 10;
}
.skip:focus { left: var(--gutter); top: 10px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* --- bar --- */
.bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding: 18px var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--blue); }
.brand-mark { width: 38px; display: block; }
.brand-mark svg { width: 100%; height: auto; display: block; }
.brand-name {
  font-weight: 800; font-size: 14px; line-height: 1.1;
  letter-spacing: 0.02em; text-transform: uppercase;
}
.bar nav {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px clamp(14px, 2.4vw, 30px);
  /* min-width:0 lets the nav shrink so its links wrap. Without it the flex
     item keeps its content width and pushes the page sideways. */
  flex: 1 1 auto; min-width: 0; justify-content: flex-end;
}
.bar nav a, .bar .cta {
  font-size: var(--label); font-weight: 600; letter-spacing: var(--track);
  text-transform: uppercase; text-decoration: none; color: var(--ink);
}
.bar nav a { padding-bottom: 2px; border-bottom: 2px solid transparent; }
.bar nav a:hover { border-bottom-color: var(--rule); }
.bar nav a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--blue); }
/* padding-right takes back the trailing space letter-spacing adds after the
   last letter, so the word is optically centred rather than 1.5px left. */
.bar .cta { background: var(--blue); color: #fff; padding: 9px 18px; padding-right: calc(18px - 0.12em); }
.bar .cta:hover { background: #14328A; }
.menu { display: none; }

/* Phones: logo, then Register and a menu button; the links fold away under the button.
   Only with JavaScript (the .js class): without it the links just stay showing. */
@media (max-width: 720px) {
  .bar { gap: 14px; padding-block: 14px; }
  .brand { margin-right: auto; }
  .bar nav { order: 3; flex-basis: 100%; justify-content: flex-start; }
  /* Three rounded lines, 2px thick and 6px apart, so each outer line travels 8px to meet in the middle as the cross. */
  .js .menu {
    display: grid; place-content: center; gap: 6px; width: 44px; height: 44px; margin-right: -10px; padding: 0;
    border: 0; background: none; cursor: pointer;
  }
  .menu span {
    display: block; width: 24px; height: 2px; border-radius: 2px; background: var(--ink);
    transition: transform .25s cubic-bezier(.6, 0, .2, 1), opacity .15s ease, background-color .15s ease;
  }
  .menu:hover span, .menu[aria-expanded="true"] span { background: var(--blue); }
  .menu[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .menu[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(.2); }
  .menu[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .js .bar nav { display: none; flex-direction: column; align-items: stretch; gap: 0; border-top: 1px solid var(--rule); }
  .js .bar nav.open { display: flex; }
  .js .bar nav a { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .js .bar nav a:last-child { border-bottom: none; }
  .js .bar nav a[aria-current="page"] { border-bottom-color: var(--rule); }
}
@media (prefers-reduced-motion: reduce) { .menu span { transition: none; } }

/* --- page --- */
/* width:100% because a flex item with auto margins shrinks to its content:
   a page of narrow content would otherwise sit centred, off the usual left edge. */
main { flex: 1 0 auto; width: 100%; max-width: 760px; margin: 0 auto; padding: clamp(48px, 8vw, 84px) var(--gutter); }
.lede { display: flex; flex-direction: column; gap: 26px; }
h1 {
  margin: 0; font-weight: 800; color: var(--blue); text-transform: uppercase;
  font-size: clamp(32px, 6.5vw, 54px); line-height: 1; letter-spacing: -0.015em;
}
h1 span { display: block; }
h2 {
  margin: 0; font-weight: 800; font-size: clamp(19px, 2.6vw, 23px);
  letter-spacing: -0.005em;
}
p { margin: 0; max-width: 56ch; }
section { display: flex; flex-direction: column; gap: 12px; }
main > * + * { margin-top: clamp(36px, 5vw, 52px); }
.strip {
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 14px 0; display: flex; flex-wrap: wrap; gap: 6px 26px;
  font-size: var(--label); font-weight: 600; letter-spacing: var(--track); text-transform: uppercase;
}
.strip .blue { color: var(--blue); }
.note { color: var(--blue); font-weight: 600; }
.muted { color: var(--grey); }
dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; }
dt { font-size: var(--label); font-weight: 600; letter-spacing: var(--track); text-transform: uppercase; color: var(--grey); padding-top: 3px; }
dd { margin: 0; }
@media (max-width: 480px) { dl { grid-template-columns: 1fr; gap: 3px 0; } dd { margin-bottom: 12px; } }

/* Prizes: the Cup, the medals and the Librarian in one row, each in the same
   63:88 card frame (the photos are cropped to it at source), its line beneath.
   Phones: one prize to a row, at about the desktop size, words still beneath. */
.cabinet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; perspective: 900px; }
.cabinet figure { margin: 0; display: flex; flex-direction: column; gap: 16px; }
.cabinet .holo { width: 100%; }
.cabinet img {
  display: block; width: 100%; height: auto; aspect-ratio: 63 / 88; object-fit: cover;
  border-radius: 4.6% / 3.3%; background: #2a2d36; box-shadow: 0 22px 40px -18px rgba(0, 0, 0, .55);
}
.cabinet figcaption { font-size: var(--mid); line-height: 1.5; text-align: center; text-wrap: balance; }
.cabinet figcaption b {
  display: block; margin-bottom: 4px;
  font-size: var(--label); font-weight: 600; letter-spacing: var(--track); text-transform: uppercase; color: var(--grey);
}
/* Boosters have no picture: one centred line under a rule, label above like the others. */
.boosters { display: block; text-align: center; border-top: 1px solid var(--rule); padding-top: 20px; margin-top: 14px; }
.boosters dt { margin-bottom: 4px; }
.boosters dd { margin: 0; }
@media (max-width: 640px) {
  .cabinet { grid-template-columns: 1fr; justify-items: center; gap: 36px; }
  .cabinet figure { width: 100%; max-width: 230px; }
}
.holo {
  --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg; --o: 0;
  position: relative; width: 240px; max-width: 100%; aspect-ratio: 63 / 88; border-radius: 4.6% / 3.3%;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .12s ease-out;
  box-shadow: 0 22px 40px -18px rgba(0, 0, 0, .55); touch-action: pan-y;
}
.holo > div { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
.holo-face { background: center / cover no-repeat; }
/* Rainbow bands slide with the tilt, colour-dodged over the art like real foil. */
.holo-shine {
  opacity: calc(.11 + var(--o) * .36); mix-blend-mode: color-dodge; filter: brightness(.6) contrast(1.2) saturate(1.2);
  background: repeating-linear-gradient(115deg, #ff4d6d 0%, #ffcf4d 6%, #5dff7a 12%, #4dd7ff 18%, #8a5cff 24%, #ff4d6d 30%),
              repeating-linear-gradient(25deg, transparent 0 3px, rgba(255, 255, 255, .22) 3px 4px);
  background-size: 300% 300%, 100% 100%; background-position: var(--mx) var(--my), 0 0;
}
/* A second rainbow running the other way, so the colours shift against each other as it tilts. */
.holo-shine::after {
  content: ""; position: absolute; inset: 0; mix-blend-mode: color-dodge; opacity: .22;
  background: repeating-linear-gradient(-55deg, #4dd7ff 0%, #ff4d6d 7%, #ffcf4d 14%, #8a5cff 21%, #4dd7ff 28%);
  background-size: 260% 260%; background-position: calc(100% - var(--mx)) calc(100% - var(--my));
}
.holo-glare {
  mix-blend-mode: overlay; opacity: calc(.28 + var(--o) * .47);
  background: radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, .3) 19%, rgba(0, 0, 0, .5) 90%);
}
@media (prefers-reduced-motion: reduce) { .holo { transition: none; } }
.holo-open { all: unset; cursor: zoom-in; display: block; border-radius: 4.6% / 3.3%; }
.holo-open:focus-visible { outline: 2px solid var(--blue); outline-offset: 6px; }
.holo-dialog { border: 0; padding: 0; background: transparent; overflow: visible; perspective: 1100px; }
.holo-dialog::backdrop { background: rgba(10, 14, 26, .82); }
.holo-dialog .holo { width: min(86vw, calc(84vh * 63 / 88), 480px); }
.dialog-close {
  position: absolute; top: -14px; right: -14px; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: #fff; color: var(--blue); font-size: 22px; line-height: 36px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
}

/* --- foot --- */
.foot {
  border-top: 1px solid var(--rule); padding: 22px var(--gutter);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  font-size: var(--label); font-weight: 600; letter-spacing: var(--track);
  text-transform: uppercase; color: var(--grey);
}
.foot p { margin: 0; }
.foot a { color: inherit; }
/* Date and socials travel together on the left, so the footer stays a
   two-item row and the charity line does not get stranded in the middle. */
.foot-left { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.socials { display: flex; align-items: center; gap: 12px; }
.socials a { display: block; line-height: 0; color: var(--grey); }
.socials a:hover { color: var(--blue); }

.fineprint { font-size: var(--small); color: var(--grey); }

/* --- cubes --- */
.cubes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cube {
  border-top: 1px solid var(--rule);
  padding: 22px 0;
  display: flex; flex-direction: column; gap: 16px;
}
/* Art sits beside the name and stats; the blurb runs full width below both. */
.cube-head { display: flex; align-items: center; gap: 20px; }
.cube-titles { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
/* height:auto is load-bearing: the img carries width and height attributes,
   and without it those win and aspect-ratio never applies. */
.cube-art {
  width: 140px; flex: none; height: auto; aspect-ratio: 4 / 3;
  object-fit: cover; display: block; background: #EDEFF6;
}
@media (max-width: 480px) {
  .cube-head { gap: 14px; }
  .cube-art { width: 96px; }
}
.cube:last-child { border-bottom: 1px solid var(--rule); }
.cube h3 { margin: 0; font-size: clamp(19px, 2.6vw, 23px); font-weight: 800; letter-spacing: -0.005em; }
.cube h3 a { text-decoration: none; }
.cube h3 a:hover { text-decoration: underline; }
/* One flex row of dt/dd pairs, each pair wrapped in a div. Simpler than the
   grid this replaced, whose auto columns stretched and shoved the last pair
   out to the right edge. */
.meta { display: flex; flex-wrap: wrap; gap: 12px 34px; margin: 0; }
.meta > div { display: flex; flex-direction: column; gap: 2px; }
.meta dt {
  font-size: var(--label); font-weight: 600; letter-spacing: var(--track);
  text-transform: uppercase; color: var(--grey);
}
.meta dd { margin: 0; font-size: var(--mid); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Cube descriptions carry bare URLs, which have no break points. */
.cube-blurb { font-size: var(--mid); color: var(--grey); max-width: 62ch; margin: 0;
              overflow-wrap: anywhere; }
.cube-blurb + .cube-blurb { margin-top: 8px; }
.cube-blurb a { color: var(--blue); }

/* Visually hidden, for screen readers only. */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }



/* Venue photographs. Two up on a wide screen, stacked on a phone. */
.photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
          gap: 14px; margin: 0; }
.photos figure { margin: 0; }
/* 4:3 rather than a fixed pixel height, so the frames scale with the column.
   The hall photo is natively 4:3 and crops to nothing; the square balcony shot
   loses far less than it did squeezed into a 220px band.
   height:auto is load-bearing. The width/height attributes on the <img> are
   presentational hints, and a definite height from them makes the browser
   ignore aspect-ratio entirely. */
.photos img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3;
              object-fit: cover; object-position: center;
              border-radius: 3px; background: #f2f2f4; }
.photo-open { all: unset; display: block; cursor: zoom-in; }
.photo-open:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.photo-dialog { border: 0; padding: 0; background: transparent; overflow: visible; max-width: none; max-height: none; }
.photo-dialog::backdrop { background: rgba(10, 14, 26, .86); }
.photo-dialog img { display: block; max-width: 92vw; max-height: 88vh; width: auto; height: auto; border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.photos figcaption { font-size: var(--small); color: var(--grey); margin-top: 6px; }

/* Partner logo. Capped by height so it sits at its own weight rather than
   filling the column.
   align-self is load-bearing: section is a column flex container, so the
   default align-items:stretch pulls the image across the full column width
   while height holds it short, which squashes it flat. */
.partner { display: block; align-self: flex-start;
           width: auto; height: 72px; max-width: 100%; }

/* Small outlined action. align-self keeps it to its own width inside the
   column flex containers it sits in, rather than stretching across them. */
.pill {
  align-self: flex-start; display: inline-block; text-decoration: none;
  border: 1px solid var(--rule); border-radius: 3px; padding: 7px 13px;
  font-size: var(--label); font-weight: 600; letter-spacing: var(--track);
  text-transform: uppercase; color: var(--blue); background: #FFFFFF;
}
.pill:hover { border-color: var(--blue); background: var(--blue); color: #FFFFFF; }
/* Marks a cube added in the last 14 days. Filled, so it never reads as the
   outlined Practice draft link. */
.new {
  align-self: flex-start; border-radius: 3px; padding: 3px 8px;
  font-size: var(--label); font-weight: 600; letter-spacing: var(--track);
  text-transform: uppercase; color: #FFFFFF; background: var(--blue);
}

/* Run sheet. Times in a fixed column so the colon lines up down the page. */
.runsheet { border-collapse: collapse; width: 100%; max-width: 420px; }
.runsheet td { padding: 9px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.runsheet tr:last-child td { border-bottom: 0; }
.runsheet td:first-child {
  width: 104px; color: var(--blue); font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.runsheet td:last-child { font-weight: 600; }

/* Long cube descriptions. <details> rather than JavaScript: the browser
   already does disclosure, keyboard access and find-in-page for free.
   The truncated head is hidden once open so the text is not repeated. */
.blurb summary { list-style: none; cursor: pointer; }
.blurb summary::-webkit-details-marker { display: none; }
.blurb .head { font-size: var(--mid); color: var(--grey); }
.blurb .toggle {
  display: inline-block; margin-top: 8px;
  font-size: var(--label); font-weight: 600; letter-spacing: var(--track);
  text-transform: uppercase; color: var(--blue);
}
.blurb summary:hover .toggle { text-decoration: underline; }
.blurb .less { display: none; }
.blurb[open] .head, .blurb[open] .more { display: none; }
.blurb[open] .less { display: inline-block; margin: 0 0 12px; }

/* An author's formatted description. Their structure, our type scale: the
   headings arrive as h4-h6 so they stay under the cube's own name, and are
   sized as small caps labels rather than as competing titles. */
.cube-desc { font-size: var(--mid); color: var(--grey); max-width: 62ch; overflow-wrap: anywhere; }
.cube-desc > :first-child { margin-top: 0; }
.cube-desc > :last-child { margin-bottom: 0; }
.cube-desc p, .cube-desc ul, .cube-desc ol, .cube-desc blockquote { margin: 0 0 12px; }
.cube-desc h4, .cube-desc h5, .cube-desc h6 {
  margin: 22px 0 8px; color: var(--ink); font-weight: 600;
  font-size: var(--label); letter-spacing: var(--track); text-transform: uppercase;
}
.cube-desc strong { color: var(--ink); font-weight: 600; }
.cube-desc ul, .cube-desc ol { padding-left: 20px; }
.cube-desc li + li { margin-top: 4px; }
.cube-desc a { color: var(--blue); }
/* Card preview on hover. Mouse only: on touch the tap just follows the link. */
.cube-desc .peek { display: none; }
@media (hover: hover) {
  .cube-desc a.card-link { position: relative; }
  .cube-desc a.card-link:hover .peek {
    display: block; position: absolute; left: 0; bottom: calc(100% + 6px);
    z-index: 10; pointer-events: none;
  }
  .cube-desc .peek img {
    display: block; width: 200px; max-width: none; height: auto;
    border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  }
}
.cube-desc blockquote { padding-left: 14px; border-left: 2px solid var(--rule); font-style: italic; }
.cube-desc hr { border: 0; border-top: 1px solid var(--rule); margin: 18px 0; }
.cube-desc img { max-width: 100%; height: auto; }
.cube-desc img.mana { display: inline-block; width: 15px; height: 15px; vertical-align: -2px; margin: 0 1px; }
.cube-desc table { border-collapse: collapse; font-size: var(--small); margin: 0 0 12px; }
.cube-desc th, .cube-desc td { border-bottom: 1px solid var(--rule); padding: 4px 10px 4px 0; text-align: left; }
.cube-desc code { font-size: 0.9em; }
