@font-face { font-family: Anton; src: url(fonts/anton.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Archivo; src: url(fonts/archivo.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --ink: #0c0b0a;
  --ink-2: #1a1816;
  --ink-3: #2c2926;
  --paper: #f5f1ea;
  --muted: #aaa49b;
  --red: #f0301f;
  --display: Anton, Impact, 'Arial Narrow', sans-serif;
  --bar-height: 60px;
}

* { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--paper); font: 400 16px/1.5 Archivo, system-ui, sans-serif; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }
[hidden] { display: none !important; }

.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Hero : reprend l'affiche de l'event (titre rouge flouté, grain, date empilée) */
.hero { position: relative; height: min(88svh, 62vw + 240px); min-height: 520px; overflow: hidden; display: grid; place-items: center; isolation: isolate; }
.hero__photos { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); z-index: -2; }
.hero__photos img { width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: 50% 28%; }
.hero__photos img:first-child { order: 1; }
.hero__photos img:nth-child(3) { order: 2; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(12 11 10 / .35), rgb(12 11 10 / .15) 40%, rgb(12 11 10 / .92)); }
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .3; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero__logo { position: absolute; top: 12px; left: 16px; width: 92px; }
.hero__title { align-self: end; margin-bottom: 104px; text-align: center; padding-inline: 16px; }
.hero__title h1 {
  margin: 0; font: 400 clamp(84px, 17vw, 270px)/.92 var(--display); text-transform: uppercase; letter-spacing: -.005em;
  color: var(--red); text-shadow: 0 0 .05em rgb(240 48 31 / .85), 0 .02em .3em rgb(0 0 0 / .35);
  max-width: 7ch; margin-inline: auto;
}
.hero__title p { margin: .55em 0 0; font: 400 clamp(20px, 2.4vw, 32px)/1 var(--display); letter-spacing: .14em; text-transform: uppercase; }
.hero__date { position: absolute; bottom: 20px; left: 50%; translate: -50% 0; display: grid; justify-items: center; font-family: var(--display); line-height: 1.04; text-transform: uppercase; }
.hero__date b { font-weight: 400; font-size: 44px; line-height: 1; }
.hero__date span { font-size: 17px; letter-spacing: .03em; }

/* Barre d'actions : en haut sur grand écran, sous le pouce sur téléphone */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px; min-height: var(--bar-height); padding: 6px 16px; background: rgb(12 11 10 / .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--ink-3); }
.bar__info { margin: 0 auto 0 0; display: flex; gap: 12px; align-items: baseline; min-width: 0; }
.bar__info strong { font: 400 22px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.bar__info span { color: var(--muted); font-size: 14px; }
.bar__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 4px; font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color .15s; }
.bar__btn:hover { background: var(--ink-3); }
.bar__btn[aria-pressed='true'] { color: var(--red); }
.bar__btn[aria-pressed='true'] .icon { fill: currentColor; }

.favs-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px; }
.favs-panel p { margin: 0; color: var(--muted); }

.cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; background: var(--red); color: #140403; border-radius: 4px; font-weight: 700; transition: filter .15s; }
.cta:hover { filter: brightness(1.1); }
.cta:disabled { opacity: .65; cursor: progress; }
.cta--ghost { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1px var(--ink-3); }

/* Grille : 12 rangées par largeur de colonne, donc la hauteur suit le ratio de chaque photo */
.grid-wrap { container-type: inline-size; padding: 4px; }
.grid { --columns: 2; display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); grid-auto-rows: calc(100cqw / var(--columns) / 12); grid-auto-flow: dense; }
@container (min-width: 700px) { .grid { --columns: 3; } }
@container (min-width: 1100px) { .grid { --columns: 4; } }
@container (min-width: 1700px) { .grid { --columns: 5; } }

.tile { position: relative; grid-column: span var(--col-span, 1); grid-row: span var(--rows); padding: 2px; min-width: 0; }
.tile--big { --col-span: 2; }
.tile__open { display: block; position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--tile-color, var(--ink-2)); cursor: zoom-in; }
.tile__open img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s, scale .5s cubic-bezier(.2, .7, .2, 1); }
.tile__open img.is-loaded { opacity: 1; }
.tile__open:hover img { scale: 1.025; }
.tile__fav { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 44px; height: 44px; color: #fff; opacity: 0; transition: opacity .15s; filter: drop-shadow(0 1px 3px rgb(0 0 0 / .75)); }
.tile:hover .tile__fav, .tile__fav:focus-visible, .tile__fav[aria-pressed='true'] { opacity: 1; }
.tile__fav[aria-pressed='true'] { color: var(--red); }
.tile__fav[aria-pressed='true'] .icon { fill: currentColor; }
@media (hover: none) { .tile__fav { opacity: .9; } }

.foot { padding: 40px 16px 48px; text-align: center; color: var(--muted); font-size: 14px; }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--paper); }

/* Visionneuse */
.viewer { position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #050505; color: var(--paper); overflow: hidden; }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer::backdrop { background: #050505; }
.viewer__top { display: flex; align-items: center; justify-content: space-between; padding: max(6px, env(safe-area-inset-top)) 8px 6px 16px; }
.viewer__count { margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.viewer__stage { position: relative; min-height: 0; touch-action: pan-y pinch-zoom; user-select: none; overflow: hidden; }
.viewer__stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background-repeat: no-repeat; background-position: center; background-size: contain; }
.viewer__actions { display: flex; justify-content: center; gap: 4px; padding: 6px 8px max(8px, env(safe-area-inset-bottom)); }
.viewer__action { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 4px; font-size: 15px; font-weight: 600; }
.viewer__action:hover { background: var(--ink-2); }
.viewer__action:disabled { opacity: .55; cursor: progress; }
.viewer__action[aria-pressed='true'] { color: var(--red); }
.viewer__action[aria-pressed='true'] .icon { fill: currentColor; }
.viewer__nav { position: absolute; top: 50%; translate: 0 -50%; background: rgb(0 0 0 / .45); }
.viewer__nav--prev { left: 12px; }
.viewer__nav--next { right: 12px; }
.icon-btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; transition: background-color .15s; }
.icon-btn:hover { background: var(--ink-3); }
.icon-btn:disabled { opacity: .25; cursor: default; }

/* Partage */
.sheet { width: min(420px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--ink-3); border-radius: 8px; background: var(--ink-2); color: var(--paper); }
.sheet::backdrop { background: rgb(0 0 0 / .7); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin: -8px -8px 12px 0; }
.sheet__head h2 { margin: 0; font: 400 26px/1.1 var(--display); text-transform: uppercase; }
.sheet__qr { width: min(240px, 100%); margin: 0 auto 16px; padding: 12px; background: #fff; border-radius: 4px; }
.sheet__qr svg { display: block; width: 100%; height: auto; }
.sheet__label { display: block; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.sheet__url { width: 100%; min-height: 44px; padding: 0 12px; margin-bottom: 12px; border: 1px solid var(--ink-3); border-radius: 4px; background: var(--ink); color: var(--paper); font: inherit; font-size: 15px; }
.sheet__actions { display: flex; gap: 8px; }
.sheet__actions .cta { flex: 1; }

.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(var(--bar-height) + 24px + env(safe-area-inset-bottom)); translate: -50% 0; width: max-content; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 4px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 600; }

/* Accueil */
.home__head { padding: 16px 16px 32px; }
.home__head img { width: 104px; margin-left: -4px; }
.home__head h1 { margin: 8px 0 8px; font: 400 clamp(72px, 15vw, 200px)/.95 var(--display); text-transform: uppercase; color: var(--red); text-shadow: 0 0 .05em rgb(240 48 31 / .85); }
.home__head p { margin: 0; max-width: 34em; color: var(--muted); font-size: 17px; }
.event-list { list-style: none; margin: 0; padding: 0 16px; border-top: 1px solid var(--ink-3); }
.event-list li { border-bottom: 1px solid var(--ink-3); }
.event-card { display: grid; grid-template-columns: minmax(110px, 200px) 1fr; align-items: center; gap: 20px; padding-block: 16px; text-decoration: none; }
.event-card img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; transition: scale .4s cubic-bezier(.2, .7, .2, 1); }
.event-card:hover img { scale: 1.02; }
.event-card__body { display: grid; gap: 6px; min-width: 0; }
.event-card__body time, .event-card__body span { color: var(--muted); font-size: 15px; }
.event-card__body strong { font: 400 clamp(40px, 8vw, 110px)/1 var(--display); text-transform: uppercase; transition: color .15s; overflow-wrap: anywhere; }
.event-card:hover strong { color: var(--red); }

/* Pages de texte */
.prose { max-width: 42em; padding: 16px 16px 8px; }
.prose img { width: 88px; margin-left: -4px; }
.prose h1 { margin: 16px 0 24px; font: 400 clamp(44px, 9vw, 84px)/1 var(--display); text-transform: uppercase; color: var(--red); }
.prose h2 { margin: 32px 0 8px; font: 400 24px/1.15 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.prose p { margin: 0 0 12px; color: #d2ccc3; }

@media (max-width: 699px) {
  .hero { height: 78svh; min-height: 460px; }
  .hero__photos { grid-template-columns: 1fr; }
  .hero__photos img:not(:first-child) { display: none; }
  .hero__logo { width: 76px; }
  .hero__title h1 { font-size: clamp(84px, 27vw, 170px); }

  .bar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--ink-3); border-bottom: 0; }
  .bar__info { display: none; }
  .bar__btn { flex: 1; flex-direction: column; gap: 2px; min-height: 52px; padding: 0 4px; font-size: 12px; }
  .bar__btn > span { display: inline-flex; gap: 4px; }
  body:not(.home) { padding-bottom: calc(var(--bar-height) + env(safe-area-inset-bottom)); }
  .favs-panel .cta { width: 100%; }

  .viewer__nav { display: none; }
  .viewer__actions { justify-content: space-around; }
  .viewer__action { flex-direction: column; gap: 2px; padding: 0 12px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
