/* Fonts: self-hosted (SIL Open Font License), latin subset. */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("../fonts/dm-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "DM Serif Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dm-serif-display-latin.woff2") format("woff2");
}
@font-face {
  font-family: "DM Serif Display";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dm-serif-display-latin-italic.woff2") format("woff2");
}

:root {
  --bg: #0D0D0D;
  --card: #1A1A1A;
  --text: #F2F2F2;
  --muted: #A8A8A8;
  --saffron: #E6BA00;
  --orange: #F56409;
  --orchid: #BF06B6;

  --saffron-hover: #FFD21F;
  --orange-hover: #FF8A3D;
  --line: #3A3A3A;

  --serif: "DM Serif Display", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --bar-height: 4rem;
  --content-width: 68.75rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--bar-height);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  overflow-wrap: break-word;
}

h1,
h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2.125rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--orange);
}
a:hover {
  color: var(--orange-hover);
}

:focus-visible {
  outline: 3px solid var(--saffron);
  outline-offset: 3px;
}

/* ---------- top bar ---------- */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  height: var(--bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 var(--gutter);
  background: linear-gradient(#0D0D0DE6, #0D0D0D00);
}

.bar-name {
  font: 400 1.375rem/1 var(--serif);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.bar-name:hover {
  color: var(--saffron);
}

.bar-nav {
  display: none;
  gap: clamp(0.875rem, 2.4vw, 1.75rem);
  font-size: 0.9375rem;
}
.bar-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.625rem 0;
}
.bar-nav a:hover {
  color: var(--saffron);
}

.bar-tools {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.lang {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #0D0D0D99;
}
.lang button {
  min-width: 2.75rem;
  min-height: 2.25rem;
  padding: 0 0.625rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: 600 0.8125rem var(--sans);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.lang button:hover {
  color: var(--text);
}
.lang button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}
.lang button:focus-visible {
  outline-offset: -3px;
}

.icon-link {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--text);
}
.icon-link:hover {
  color: var(--saffron);
}

@media (min-width: 47.5em) {
  .bar-nav {
    display: flex;
  }
}

/* ---------- buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  background: var(--saffron);
  color: var(--bg);
  font: 700 1rem var(--sans);
  text-decoration: none;
}
.button:hover {
  background: var(--saffron-hover);
  color: var(--bg);
}
.button-small {
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.9375rem;
}
.button-ghost {
  background: #0D0D0D99;
  color: var(--text);
  border: 1px solid #FFFFFF55;
}
.button-ghost:hover {
  background: #0D0D0DCC;
  color: var(--saffron);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  place-items: end center;
  overflow: hidden;
  /* Still version of the paint, seen when WebGL is unavailable.
     Keep it roughly in line with the colours in site/js/hero-paint.js. */
  background: radial-gradient(
    circle at 50% 42%,
    var(--saffron) 0,
    var(--orange) 22%,
    var(--orchid) 38%,
    var(--bg) 50%
  );
}

.hero-paint {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}
.hero-paint[hidden] {
  display: none;
}

/* Darkens the bottom of the hero so the name and buttons stay readable. */
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(transparent 55%, var(--bg) 100%);
}

/* The shadow is on the wrapper: on the image itself it would be clipped by
   the mask and show the photo's rectangle. */
.hero-portrait {
  filter: drop-shadow(0 10px 40px #00000088);
}

/* As tall as the hero allows, but never wider than 120vw: on phones the
   portrait is a little wider than the screen and the hero crops her shoulders. */
.hero-portrait img {
  display: block;
  aspect-ratio: var(--ratio);
  width: auto;
  height: min(82svh, 56.25rem, 120vw / (var(--ratio)));
  /* Fades her out towards the bottom, under the name and buttons. */
  -webkit-mask-image: linear-gradient(#000 52%, transparent 92%);
  mask-image: linear-gradient(#000 52%, transparent 92%);
}

.hero-title {
  position: absolute;
  inset: auto 0 clamp(1.5rem, 7vh, 5rem);
  padding: 0 var(--gutter);
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 7.5vw, 6rem);
  line-height: 1;
  text-shadow: 0 4px 30px #000000AA;
}

.hero-subtitle {
  margin: 0.625rem 0 1.375rem;
  font-size: clamp(1rem, 2vw, 1.25rem);
  text-shadow: 0 2px 14px #000000BB;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem;
}
.hero .button-small {
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.9375rem;
}
.button-ghost {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* ---------- sections ---------- */

.section {
  --section-padding: clamp(4rem, 10vw, 7.5rem);
  max-width: calc(var(--content-width) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--section-padding) var(--gutter);
  /* A link to a section scrolls its heading to just below the fixed bar,
     skipping the padding above it (the bar's height is added by
     scroll-padding-top on html). */
  scroll-margin-top: calc(1rem - var(--section-padding));
}

.lead {
  max-width: 56ch;
  margin-bottom: 1.5rem;
  color: var(--muted);
}

/* ---------- About ---------- */

/* Photo above the bio on narrow screens, beside it on wide ones. */
.section-about {
  display: grid;
  gap: 1.75rem;
}
.about-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.5rem;
}
.about-text .placeholder-tag {
  display: inline-block;
  margin-bottom: 0.75rem;
}
.about-text p {
  max-width: 56ch;
}

@media (min-width: 50em) {
  .section-about {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
  }
}

/* ---------- Gallery ---------- */

/* Staggered grid: photos keep their own proportions and fill columns. */
.gallery {
  columns: 2;
  column-gap: 0.625rem;
  margin-top: 1.5rem;
}
.gallery-item {
  display: block;
  width: 100%;
  margin: 0 0 0.625rem;
  padding: 0;
  border: 0;
  border-radius: 0.875rem;
  overflow: hidden;
  background: var(--card);
  cursor: zoom-in;
  break-inside: avoid;
}
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: scale 0.4s;
}
.gallery-item:hover img {
  scale: 1.04;
}
.gallery-item:focus-visible {
  outline-offset: -3px;
}

@media (min-width: 47.5em) {
  .gallery {
    columns: 3;
    column-gap: 1rem;
  }
  .gallery-item {
    margin-bottom: 1rem;
    border-radius: 1.25rem;
  }
}

/* Full-screen viewer. The dialog fills the window; a click outside the photo lands on it. */
.viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  touch-action: pan-y pinch-zoom; /* horizontal drags are swipes between photos */
}
.viewer[open] {
  display: grid;
  place-items: center;
  animation: player-fade 0.25s;
}
.viewer::backdrop {
  background: #000000F2;
}
.viewer img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100dvh;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.viewer-count {
  position: absolute;
  top: 1.125rem;
  left: 1.125rem;
  margin: 0;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: #0D0D0DCC;
  font-size: 0.875rem;
}
.viewer-button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: #0D0D0DCC;
  color: #FFF;
  cursor: pointer;
}
.viewer-button:hover {
  color: var(--saffron);
}
.viewer-close {
  top: 0.625rem;
  right: 0.625rem;
}
.viewer-previous {
  left: 0.625rem;
  top: calc(50% - 1.5rem);
}
.viewer-next {
  right: 0.625rem;
  top: calc(50% - 1.5rem);
}

/* ---------- Contact ---------- */

.section-contact {
  text-align: center;
}
.contact-instagram {
  margin: 1.25rem auto 0;
}
.section-contact .lead {
  margin-inline: auto;
}

/* ---------- Concerts ---------- */

.concerts {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.concerts[hidden],
.concerts-empty[hidden] {
  display: none;
}

/* Date block on the left, details beside it; the Infos button drops below on narrow screens. */
.concert {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.25rem 1rem;
  align-items: center;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
}
.concert:last-child {
  border-bottom: 1px solid var(--line);
}

.concert-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--saffron);
  font-family: var(--serif);
  line-height: 1;
}
.concert-day {
  font-size: 2.75rem;
}
.concert-month {
  margin-top: 0.25rem;
  font-size: 1.125rem;
}
.concert-year {
  margin-top: 0.25rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}

.concert-details p {
  margin: 0;
}
.concert-place {
  font-size: 1.1875rem;
  font-weight: 600;
}
.concert-when {
  color: var(--muted);
}
.concert-when::first-letter {
  text-transform: uppercase;
}
.concert-note {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
  white-space: pre-line; /* keeps line breaks typed in the Sheet */
}

.concert .button {
  grid-column: 2;
  justify-self: start;
  margin-top: 0.5rem;
}

@media (min-width: 40em) {
  .concert {
    grid-template-columns: 6rem 1fr auto;
    gap: 0.25rem 1.5rem;
  }
  .concert-day {
    font-size: 3.5rem;
  }
  .concert .button {
    grid-column: 3;
    margin-top: 0;
  }
}

.concerts-empty {
  margin: 1.5rem 0 0;
  padding: 1.75rem 1.5rem;
  border-radius: 1.5rem;
  background: var(--card);
  color: var(--muted);
}

/* ---------- Clips: soap bubbles ---------- */

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

/* Narrow screens: a loose zig-zag down the page. */
.bubbles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bubble {
  position: relative;
  display: block;
  width: min(var(--size-narrow), 82vw);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: bubble-float var(--float-seconds) ease-in-out infinite alternate;
  transition: scale 0.25s;
}
.bubble:nth-child(odd) {
  align-self: flex-start;
}
.bubble:nth-child(even) {
  align-self: flex-end;
}
.bubble:hover {
  scale: 1.04;
}
.bubble:focus-visible {
  outline-offset: 6px;
}

/* Four different sizes; on wide screens also scattered positions (below). */
/* --size-wide, --x and --y are percentages of the cluster's width (size, x) and height (y). */
.bubble:nth-child(1) { --size-narrow: 72vw; --size-wide: 38.2%; --x: 0%;    --y: 3.9%;  --float-seconds: 9s; }
.bubble:nth-child(2) { --size-narrow: 52vw; --size-wide: 28.1%; --x: 40.4%; --y: 0%;    --float-seconds: 11s; --film-turn: 90deg; }
.bubble:nth-child(3) { --size-narrow: 62vw; --size-wide: 33.7%; --x: 66.3%; --y: 33.3%; --float-seconds: 8s; --film-turn: 200deg; }
.bubble:nth-child(4) { --size-narrow: 46vw; --size-wide: 24.7%; --x: 37.1%; --y: 54.9%; --float-seconds: 12s; --film-turn: 290deg; }

@media (min-width: 43.75em) {
  /* Wide screens: a tight cluster, centred, that scales with the section. */
  .bubbles {
    display: block;
    position: relative;
    width: min(100%, 55.625rem);
    aspect-ratio: 890 / 510;
    margin: 0 auto;
  }
  .bubble {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size-wide);
  }
}

.bubble-picture,
.bubble-film,
.bubble-sphere {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

/* CSS bubble (no WebGL): the preview in a circle under a soap film. */
.bubble-picture {
  overflow: hidden;
  background: #000;
}
.bubble-picture video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bubble-film {
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 24%, #FFFFFF 0, #FFFFFFAA 3%, transparent 14%),
    radial-gradient(circle at 72% 80%, #FFFFFF55 0, transparent 9%),
    conic-gradient(from var(--film-turn, 0deg), #E6BA0044, #F5640955, #BF06B666, #3FD0FF33, #E6BA0044);
  mix-blend-mode: screen;
  box-shadow:
    inset 0 0 0 2px #FFFFFF22,
    inset 0 0 28px 6px #BF06B655,
    inset 0 0 60px 8px #F5640933;
}

/* WebGL bubble: the canvas draws everything. The video stays in the page,
   tiny and invisible, because it must keep playing to feed the canvas. */
.bubble-sphere {
  display: none;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 18px 28px #00000077) drop-shadow(0 0 22px #BF06B622);
}
.bubble-webgl .bubble-sphere {
  display: block;
}
.bubble-webgl .bubble-film {
  display: none;
}
.bubble-webgl .bubble-picture {
  inset: 50% auto auto 50%;
  width: 2px;
  height: 2px;
  opacity: 0;
}

/* Popped: gone while its Clip plays. Reforming: springs back afterwards. */
.bubble.is-popped > * {
  animation: bubble-pop 0.16s ease-out forwards;
}
.bubble.is-reforming > * {
  animation: bubble-reform 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes bubble-float {
  from { translate: 0 -0.875rem; }
  to { translate: 0.625rem 1rem; }
}
@keyframes bubble-pop {
  60% { opacity: 1; }
  to { scale: 1.22; opacity: 0; }
}
@keyframes bubble-reform {
  from { scale: 0; opacity: 0; }
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- Clip player ---------- */

/* The dialog fills the window so that a click outside the box lands on it. */
.player {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
}
.player[open] {
  display: grid;
  place-items: center;
  animation: player-fade 0.3s;
}
.player[open]::backdrop {
  animation: player-fade 0.3s;
}
.player::backdrop {
  background: #000000DD;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* The box is only as wide as the video; the title wraps inside it. */
.player-box {
  position: relative;
  display: grid;
  grid-template-columns: min-content;
  border-radius: 1.25rem;
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 80px #000;
}
.player video {
  display: block;
  width: auto;
  height: auto;
  max-width: min(92vw, 60rem);
  max-height: 74dvh;
  background: #000;
}
.player-title {
  margin: 0;
  padding: 0.75rem 1rem 0.875rem;
  background: var(--card);
  font-size: 0.9375rem;
}
.player-close {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: #0D0D0DCC;
  color: #FFF;
  cursor: pointer;
}
.player-close:hover {
  color: var(--saffron);
}

@keyframes player-fade {
  from { opacity: 0; }
}

/* Marks a part of the page that a later ticket fills in. */
.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 11.25rem;
  margin: 0;
  padding: 2rem 1.25rem;
  border: 1px dashed var(--line);
  border-radius: 1.5rem;
  background: var(--card);
  color: var(--muted);
  text-align: center;
}
.placeholder-tag {
  padding: 0.1875rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--saffron);
  color: var(--saffron);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- footer ---------- */

.footer {
  padding: 2.5rem var(--gutter);
  border-top: 1px solid var(--card);
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}
.legal summary {
  display: inline-block;
  padding: 0.625rem;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  list-style: none;
}
.legal summary::-webkit-details-marker {
  display: none;
}
.legal summary:hover {
  color: var(--text);
}
.legal p {
  max-width: 60ch;
  margin: 0.5rem auto 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  /* No floating, popping or springing: bubbles simply hide and show. */
  .bubble,
  .bubble.is-reforming > *,
  .player[open],
  .player[open]::backdrop,
  .viewer[open] {
    animation: none;
  }
  .bubble.is-popped > * {
    animation: none;
    opacity: 0;
  }
  .gallery-item img {
    transition: none;
  }
}
