/* Lucie - hula hoop performer. Mobile first: wider layouts at 600px and 900px. */

/* Fonts: the latin files from Google Fonts, served from our own server.
   Space Grotesk is a variable font: one file has every weight. */
@font-face {
  font-family: "Space Grotesk";
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/space-grotesk.woff2") format("woff2");
}

@font-face {
  font-family: "Syne";
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/syne-800.woff2") format("woff2");
}

/* Themes. Only these values change between them.
   --hero-fit and --h2-fit are the widths (in em) of "HOOP" and "CONTACT" (the widest h2) in the display font,
   used to shrink those headings to fit narrow screens. */
[data-theme="neon"] {
  --bg: #0b0b0b;
  --accent: #e8ff47;
  --hero-ink: #e8ff47;
  --nav-ink: #e8ff47;
  --secondary: #fff;
  --meta: #fff;
  --muted: #777;
  --border: #333;
  --font-display: "Archivo Black", sans-serif;
  --font-body: "Space Grotesk", sans-serif;
  --display-weight: 400;
  --display-hero: 220px;
  --hero-leading: .82;
  --hero-fit: 3.15;
  --h2-fit: 5.55;
}

[data-theme="editorial"] {
  --bg: #faf8f4;
  --accent: #1f1d1a;
  --hero-ink: #faf8f4;
  --nav-ink: #faf8f4;
  --secondary: #faf8f4;
  --meta: #857c70;
  --muted: #857c70;
  --border: #d6d0c6;
  --font-display: "Cormorant Garamond", serif;
  --font-body: "Karla", sans-serif;
  --display-weight: 400;
  --display-hero: 220px;
  --hero-leading: .82;
  --hero-fit: 2.75;
  --h2-fit: 4.9;
}

[data-theme="ember"] {
  --bg: #2b1612;
  --accent: #ff8a5b;
  --hero-ink: #ffe9dd;
  --nav-ink: #ff8a5b;
  --secondary: #ffe9dd;
  --meta: #ffe9dd;
  --muted: #a8857a;
  --border: #4a2a24;
  --font-display: "Syne", sans-serif;
  --font-body: "Space Grotesk", sans-serif;
  --display-weight: 800;
  --display-hero: 150px;
  --hero-leading: .85;
  --hero-fit: 5.1;
  --h2-fit: 8.7;
}

:root {
  --pad: 20px;
  --space: 48px;
}

@media (min-width: 600px) {
  :root {
    --pad: 32px;
    --space: 72px;
  }
}

/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--accent);
  font: 16px/1.5 var(--font-body);
}

h1,
h2,
p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

/* A picture only offers its img other files: the img lays out as if the picture weren't there. */
picture {
  display: contents;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity .2s;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.wrap {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--pad);
  container-type: inline-size;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  text-transform: uppercase;
}

/* Fills the width of its .wrap or column (100cqi), up to 64px. */
h2 {
  font-size: min(64px, 100cqi / var(--h2-fit));
  line-height: 1;
}

/* Hero */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #000;
}

.hero-poster,
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .5));
}

.nav {
  position: absolute;
  z-index: 1;
  top: 28px;
  left: var(--pad);
  right: var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--nav-ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nav-links {
  display: none;
  gap: 28px;
}

/* Bigger tap target without moving the text. */
.nav-book {
  margin: -12px 0;
  padding: 12px 0 12px 24px;
}

.hero-text {
  position: absolute;
  z-index: 1;
  left: var(--pad);
  right: var(--pad);
  bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Fills the width on small screens, capped by the design size and the screen height. */
.hero-title {
  color: var(--hero-ink);
  font-size: min(var(--display-hero), 30vh, (100vw - 2 * var(--pad)) / var(--hero-fit));
  line-height: var(--hero-leading);
  letter-spacing: -.04em;
}

.hero-sub {
  max-width: 280px;
  color: var(--secondary);
  font-size: 18px;
  line-height: 1.3;
}

/* Shows */

.shows {
  padding-block: var(--space);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 24px;
}

.count {
  color: var(--meta);
  font-size: 14px;
}

.show-grid {
  display: grid;
  gap: 16px;
}

.show {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.show img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s ease;
}

.chip {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font: 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

/* Photos */

.photos {
  padding-bottom: var(--space);
}

#photos,
#contact {
  scroll-margin-top: var(--space);
}

.photos h2 {
  margin-bottom: 24px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 200px;
  gap: 8px;
}

/* Tile shapes, picked by devops/scripts/images.sh. */
.photo-grid .big {
  grid-column: span 2;
  grid-row: span 2;
}

.photo-grid .wide {
  grid-column: span 2;
}

.photo-grid .full {
  grid-column: 1 / -1;
  grid-row: span 2;
}

.photo-grid a {
  display: block;
  height: 100%;
  cursor: zoom-in;
}

.photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

/* About and Book: colours swap here. */

.book {
  padding-block: var(--space);
  background: var(--accent);
  color: var(--bg);
}

.book-grid {
  display: grid;
  gap: 48px;
}

/* Each column sizes its own heading, and nothing inside can make it wider. */
.book-grid > div {
  container-type: inline-size;
}

.book h2 {
  margin-bottom: 24px;
}

.bio {
  max-width: 480px;
  font-size: 20px;
  line-height: 1.35;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form input,
.form textarea {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--bg);
  border-radius: 0;
  background: transparent;
  color: var(--bg);
  font: 16px/1.4 var(--font-body);
  appearance: none;
}

.form textarea {
  resize: vertical;
}

.form ::placeholder {
  color: inherit;
  opacity: .6;
}

.form button {
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  color: var(--accent);
  font: 700 16px var(--font-body);
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}

.form button:disabled {
  opacity: .6;
  cursor: wait;
}

.form-status:empty {
  display: none;
}

.form-done {
  font-size: 22px;
  line-height: 1.35;
}

.trap {
  position: absolute;
  left: -10000px;
}

/* Spam check: never shown. ALTCHA's own CSS isn't loaded, so it's hidden here. */
altcha-widget {
  display: none;
}

/* Footer */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Taller tap targets without moving the text. */
.footer a {
  display: inline-block;
  margin-block: -8px;
  padding-block: 8px;
}

/* Lightbox */

.lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  overscroll-behavior: contain;
}

html:has(.lightbox[open]) {
  overflow: hidden;
}

.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 56px 8px;
}

.lightbox-stage img,
.lightbox-stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 0;
  background: rgba(0, 0, 0, .4);
  color: #fff;
  font: 36px/1 system-ui, sans-serif;
  cursor: pointer;
}

.lightbox-close {
  top: 4px;
  right: 4px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 4px;
}

.lightbox-next {
  right: 4px;
}

.lightbox.is-video .lightbox-prev,
.lightbox.is-video .lightbox-next {
  display: none;
}

/* Hover effects only where there is a mouse, so they don't stick after a tap. */
@media (hover: hover) {
  a:hover {
    opacity: .7;
  }

  .show:hover {
    opacity: 1;
  }

  .show:hover img {
    transform: scale(1.02);
  }

  .form button:hover {
    opacity: .85;
  }
}

/* Wider screens */

@media (min-width: 600px) {
  .nav-links {
    display: flex;
  }

  .nav-book {
    display: none;
  }
}

@media (min-width: 900px) {
  .hero-text {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }

  /* Leaves room for the subtitle beside it. */
  .hero-title {
    font-size: min(var(--display-hero), 30vh, (100vw - 2 * var(--pad) - 312px) / var(--hero-fit));
  }

  .hero-sub {
    margin-bottom: 12px;
    text-align: right;
  }

  .show-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .photo-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 260px;
  }

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

  .bio {
    font-size: 22px;
  }
}
