/* ------------------------------------------------------------------
   Colours and fonts. Change the look of the whole site from here.
------------------------------------------------------------------ */
:root {
  --bg: #ECEDEA;
  --fg: #141513;
  --mute: #666963;
  --line: #CDCFCA;
  --accent: #B4381F;
  --band: #0B0B0C;
  --band-fg: #E8E8E3;
  --band-mute: #8E908A;
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --body: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease: cubic-bezier(.2, .6, .2, 1);
  --gap: clamp(6px, 1vw, 12px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F100F; --fg: #E9EAE6; --mute: #8C8F89; --line: #2A2C29; --accent: #E2694C;
    color-scheme: dark;
  }
}

/* A soft cross-fade when moving between pages (browsers that support it). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { display: block; max-width: 100%; }

.wrap {
  max-width: 1960px;
  margin-inline: auto;
  padding-left: max(clamp(14px, 3vw, 56px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(14px, 3vw, 56px), env(safe-area-inset-right, 0px));
}
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }

/* ------------------------------------------------------------------
   Header and footer
------------------------------------------------------------------ */
.top .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 22px; }
.mark { font-family: var(--display); font-size: 1.5rem; text-decoration: none; letter-spacing: .01em; }
nav { display: flex; gap: 6px 22px; flex-wrap: wrap; }
nav a { font-size: .95rem; text-decoration: none; padding: 2px 0; border-bottom: 1px solid transparent; transition: border-color .2s; }
nav a:hover, nav a[aria-current] { border-bottom-color: var(--accent); }

footer { margin-top: clamp(64px, 10vw, 140px); border-top: 1px solid var(--line); }
.foot { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: clamp(28px, 4vw, 64px); padding-block: clamp(44px, 6vw, 84px) 28px; align-items: start; }
footer { padding-bottom: 72px; }
.foot-name { font-family: var(--display); font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1; text-decoration: none; }
.foot-brand p { margin: 14px 0 0; color: var(--mute); line-height: 1.5; }
.foot-nav { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px clamp(24px, 4vw, 56px); align-items: start; justify-content: start; }
.foot-nav a { font-size: 1rem; }
.foot-contact { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.foot-contact .mono { margin-bottom: 4px; }
.foot-contact a { font-size: clamp(1.05rem, 1.5vw, 1.3rem); text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color .2s, color .2s; overflow-wrap: anywhere; }
.foot-contact a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.foot-bottom { grid-column: 1 / -1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; border-top: 1px solid var(--line); padding-top: 22px; margin-top: clamp(12px, 3vw, 36px); }
.foot-bottom a { text-decoration: none; }
.foot-bottom a:hover { color: var(--accent); }
@media (max-width: 800px) {
  .foot { grid-template-columns: 1fr 1fr; }
  .foot-brand, .foot-contact { grid-column: 1 / -1; }
  .foot-nav { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 20px; }
}

/* ------------------------------------------------------------------
   Photos
------------------------------------------------------------------ */
.ph, .card-img { position: relative; display: block; overflow: hidden; background: var(--ph-bg, #222); }
.ph img, .card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.ph:hover img, .card:hover .card-img img { transform: scale(1.03); }

/* Photos rise into place as they scroll into view (see reveal.js). */
.armed .reveal:not(.in) { opacity: 0; transform: translateY(22px); }
.reveal.in { transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }

/* ------------------------------------------------------------------
   Hand-made collages: a 12 column grid of square cells. Positions are set per photo.
------------------------------------------------------------------ */
.cq { container-type: inline-size; }
.collage {
  --cgap: clamp(6px, 1.2cqw, 14px);
  --cell: calc((100cqw - 11 * var(--cgap)) / 12);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: var(--cell);
  gap: var(--cgap);
}
.collage > * { grid-column: var(--c); grid-row: var(--r); min-width: 0; min-height: 0; }
.over { outline: clamp(4px, .9cqw, 10px) solid var(--bg); z-index: 2; }

/* ------------------------------------------------------------------
   Mixed gallery: wide photos, side blocks and rows of different heights
------------------------------------------------------------------ */
.mix { display: flex; flex-direction: column; gap: var(--gap); }

/* A row: photos side by side, all the same height, filling the width */
.row { display: flex; align-items: flex-start; gap: var(--gap); width: 100%; max-width: var(--maxw); margin-inline: auto; }
.row > .ph { flex: var(--ar) 1 0; min-width: 0; aspect-ratio: var(--ar); }

/* A wide photo, never taller than the screen */
.wide { width: min(100%, calc(85vh * var(--ar))); width: min(100%, calc(85svh * var(--ar))); margin-inline: auto; }
.wide > .ph { aspect-ratio: var(--ar); }

/* A featured photo large on one side with up to two stacked beside it */
.side {
  display: grid; grid-template-columns: var(--col) 1fr; gap: var(--gap); align-items: stretch;
  width: min(100%, calc(85vh * var(--wf))); width: min(100%, calc(85svh * var(--wf))); margin-inline: auto;
}
.side > .main { min-height: 0; }
.side > .main img { position: absolute; inset: 0; }
.side.flip { grid-template-columns: 1fr var(--col); }
.side.flip > .main { order: 2; }
.stack { display: grid; gap: var(--gap); align-content: start; min-width: 0; }
.stack > .ph { aspect-ratio: var(--ar); }

.spacer { height: var(--gap); }
.spacer.big { height: clamp(40px, 6vw, 96px); }

/* ------------------------------------------------------------------
   Sections and headings
------------------------------------------------------------------ */
section { padding-block: clamp(40px, 7vw, 88px); }
.sec-head { margin-bottom: clamp(20px, 3vw, 34px); }
h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(2.2rem, 6vw, 3.8rem); line-height: 1; }
h2 a { text-decoration: none; display: inline-flex; align-items: baseline; gap: .35em; }
.arr { font-family: var(--body); font-size: .6em; color: var(--mute); transition: transform .35s var(--ease), color .2s; }
h2 a:hover .arr { transform: translateX(.3em); color: var(--accent); }

/* Homepage opener: the name with generous space around it, then the collage */
.hero { padding-top: 0; padding-bottom: clamp(40px, 7vw, 88px); }
.hero-head { display: flex; flex-direction: column; gap: clamp(10px, 1.4vw, 20px); padding-block: clamp(56px, 9vw, 150px) clamp(40px, 6vw, 96px); }
.hero-head h1 { font-size: clamp(3.4rem, 12.5vw, 12rem); line-height: .9; letter-spacing: -.02em; }
.hero-head h1 em { font-style: italic; }
.intro { display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; }
.intro h1 { font-size: clamp(2.6rem, 8.2cqw, 6.2rem); line-height: .92; letter-spacing: -.01em; }
.intro h1 em { font-style: italic; }

/* Category and event pages */
.page-head { padding-block: clamp(16px, 4vw, 40px) 0; }
.page-head .wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.page-head h1 { font-size: clamp(2.8rem, 9vw, 6rem); line-height: .95; }
.page-head p { margin: 0; }
.lede { max-width: 52ch; color: var(--mute); font-size: 1.05rem; }
.back { text-decoration: none; border-bottom: 1px solid var(--line); }
.back:hover { border-bottom-color: var(--accent); }
.content { padding-top: clamp(24px, 4vw, 48px); }

/* Event covers: rows of photos in their own shape, the same height within a row */
.cards { display: flex; flex-direction: column; gap: clamp(22px, 3vw, 44px); }
.card-row { display: flex; gap: clamp(10px, 1.6vw, 28px); align-items: flex-start; }
.card-row.single { max-width: 52%; }
.card { flex: var(--ar) 1 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; text-decoration: none; }
.card-img { aspect-ratio: var(--ar); width: 100%; }
.card-meta { display: flex; flex-direction: column; gap: 2px; }
.card-title { font-family: var(--display); font-size: clamp(1.4rem, 2vw, 2rem); line-height: 1.1; transition: color .2s; }
.card:hover .card-title { color: var(--accent); }

/* Dark band, used for concerts */
.band { background: var(--band); color: var(--band-fg); }
.band .mono, .band .arr { color: var(--band-mute); }

/* ------------------------------------------------------------------
   Phones: collages and blocks become simple two column flows
------------------------------------------------------------------ */
@container (max-width: 620px) {
  .collage { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; --cgap: 8px; }
  .collage > * { grid-column: auto; grid-row: auto; }
  .collage > .full { grid-column: 1 / -1; }
  .collage > .ph { aspect-ratio: var(--ar, 1); }
  .over { outline: 0; }
  .intro h1 { font-size: clamp(2.6rem, 15cqw, 4rem); }
  .intro { padding-bottom: 12px; }
}
@media (max-width: 620px) {
  .row { flex-wrap: wrap; max-width: none; }
  .row > .ph { flex: calc(var(--ar) * 100) 1 calc(var(--ar) * 130px); }
  .side, .side.flip { grid-template-columns: 1fr; width: 100%; }
  .side > .main { aspect-ratio: var(--ar); order: 0; }
  .stack { grid-template-columns: 1fr 1fr; align-items: start; }
  .stack > .ph:only-child { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------
   Photo viewer
------------------------------------------------------------------ */
dialog.lb {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: rgba(8, 8, 8, .96); color: #eee;
}
dialog.lb::backdrop { background: transparent; }
dialog.lb[open] { display: grid; place-items: center; animation: lb-in .3s var(--ease); }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; padding: 56px 16px 20px; }
.lb img { max-width: min(100%, 96vw); max-height: calc(100dvh - 120px); width: auto; height: auto; object-fit: contain; }
.lb figcaption { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: #a5a7a1; text-align: center; min-height: 1.2em; }
.lb button {
  position: absolute; background: none; border: 0; color: #eee; cursor: pointer; font-size: 2rem; line-height: 1;
  width: 56px; height: 56px; display: grid; place-items: center;
}
.lb button:hover { color: var(--accent); }
.lb-close { top: max(0px, env(safe-area-inset-top, 0px)); right: max(0px, env(safe-area-inset-right, 0px)); }
.lb-prev { left: max(0px, env(safe-area-inset-left, 0px)); top: 50%; translate: 0 -50%; }
.lb-next { right: max(0px, env(safe-area-inset-right, 0px)); top: 50%; translate: 0 -50%; }

@media (prefers-reduced-motion: reduce) {
  .ph img, .card-img img, .arr { transition: none; }
  .ph:hover img, .card:hover .card-img img { transform: none; }
  .armed .reveal:not(.in) { opacity: 1; transform: none; }
  dialog.lb[open] { animation: none; }
  @view-transition { navigation: none; }
}

/* ------------------------------------------------------------------
   Tiled collages: every photo in a frame of exactly its own shape, no gaps, no cropping.
   Positions are fractions of the collage (see tiling.mjs). On phones the photos simply stack.
------------------------------------------------------------------ */
.tiling { display: flex; flex-wrap: wrap; gap: 6px; }
.tiling > .ph { flex: calc(var(--ar) * 100) 1 calc(var(--ar) * 150px); min-width: 0; aspect-ratio: var(--ar); }
@container (min-width: 621px) {
  .tiling { display: block; position: relative; aspect-ratio: var(--tar); gap: 0; }
  .tiling > .ph { position: absolute; flex: none; left: var(--x); top: var(--y); width: var(--w); height: var(--h); aspect-ratio: auto; }
}
.scenes { container-type: inline-size; display: flex; flex-direction: column; gap: max(8px, .9cqw); }

/* Videos */
.videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: clamp(20px, 3vw, 44px); max-width: 1500px; }
.video { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.video-frame, .video iframe { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; overflow: hidden; }
.video-frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease), opacity .3s; }
.video-frame:hover img { transform: scale(1.03); opacity: .85; }
.play { position: absolute; inset: 0; margin: auto; width: clamp(56px, 7vw, 88px); aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, .92); }
.play::after { content: ""; position: absolute; left: 53%; top: 50%; translate: -50% -50%; border-style: solid; border-width: .5em 0 .5em .85em; border-color: transparent transparent transparent #111; font-size: clamp(20px, 2.6vw, 32px); }
.video figcaption { display: flex; flex-direction: column; gap: 4px; }
.video-title { font-family: var(--display); font-size: clamp(1.25rem, 1.8vw, 1.7rem); line-height: 1.15; }
.intro-text { display: flex; flex-direction: column; gap: 10px; }
.intro-text .lede { font-size: clamp(1.05rem, 1.5vw, 1.35rem); max-width: 60ch; color: var(--fg); }

@media (max-width: 620px) {
  .card-row { flex-direction: column; align-items: stretch; }
  .card-row.single { max-width: none; }
  .card { flex: none; }
}

/* Phones: a compact one-line menu that scrolls sideways, a bigger name, tighter sections */
@media (max-width: 620px) {
  .top .wrap { flex-wrap: nowrap; flex-direction: column; align-items: flex-start; gap: 8px; padding-block: 14px 10px; }
  nav { flex-wrap: nowrap; overflow-x: auto; gap: 20px; width: 100%; margin-inline: 0; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  nav::-webkit-scrollbar { display: none; }
  nav a { white-space: nowrap; flex: none; padding-block: 6px; }
  .hero-head { padding-block: 36px 28px; gap: 8px; }
  .hero-head h1 { font-size: clamp(3.6rem, 21vw, 5.5rem); }
  .hero { padding-bottom: 20px; }
  section { padding-block: 32px; }
  .sec-head { margin-bottom: 16px; }
}

/* Contact page and the floating contact button */
.contact { padding-block: clamp(20px, 4vw, 56px) clamp(24px, 5vw, 64px); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 6vw, 110px); align-items: center; }
.contact-text { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(14px, 2vw, 24px); }
.contact-text h1 { font-size: clamp(2.8rem, 7.5vw, 6.6rem); line-height: .95; letter-spacing: -.01em; }
.contact-text h1 em { font-style: italic; color: var(--accent); }
.contact-text .lede { margin: 0; max-width: 34ch; font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: var(--mute); }
.c-list { width: 100%; margin-top: clamp(8px, 2vw, 24px); border-top: 1px solid var(--line); }
.c-row { display: grid; grid-template-columns: 5.5rem 1fr auto; align-items: baseline; gap: 12px; padding-block: clamp(16px, 2vw, 24px); border-bottom: 1px solid var(--line); text-decoration: none; transition: padding .35s var(--ease), color .2s; }
.c-text { font-family: var(--display); font-size: clamp(1.45rem, 3.2vw, 2.5rem); line-height: 1.1; overflow-wrap: anywhere; }
.c-arr { color: var(--mute); transition: transform .35s var(--ease), color .2s; }
.c-row:hover { color: var(--accent); padding-left: 10px; }
.c-row:hover .c-arr { transform: translateX(6px); color: var(--accent); }
.c-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.btn { display: inline-flex; align-items: center; padding: 14px 26px; border-radius: 999px; background: var(--fg); color: var(--bg); text-decoration: none; font-weight: 500; border: 1px solid var(--fg); transition: background .2s, color .2s, border-color .2s; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--fg); }
.btn.ghost:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.contact-photo { margin: 0; }
.contact-photo img { display: block; width: 100%; height: auto; }
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-photo { order: -1; max-width: 520px; }
  .c-row { grid-template-columns: 4.2rem 1fr auto; }
}
.fab {
  position: fixed; z-index: 20; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 999px;
  background: var(--fg); color: var(--bg); text-decoration: none; font-size: .95rem; font-weight: 500;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25); transition: transform .3s var(--ease), background .2s;
}
.fab::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.fab:hover { transform: translateY(-2px); background: var(--accent); }
.fab:hover::before { background: var(--bg); }
@media (max-width: 620px) { .fab { padding: 12px 18px; } }
@media print { .fab { display: none; } }
