/* Minimal theme: white page, violet #9478FF and green #00D24D used sparingly */
:root {
  --bg: #FFFFFF;
  --ink: #1C2330;
  --muted: #6B7280;
  --line: #ECEAF2;
  --pick: #9478FF;
  --green: #00D24D;
  --ok: #0A8F3C;
  --err: #C62828;
  /* Gallery "exhibition room" */
  --room: #131317;
  --room-ink: #ECEAF2;
  --room-muted: #8E8A9C;
  --poetic: "Cormorant Garamond", Garamond, Georgia, serif; /* photo titles */
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); overflow-anchor: none; } /* no auto-shift while photos load */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 .95rem/1.55 "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
}
img { max-width: 100%; display: block; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--pick); outline-offset: 2px; }

/* Banner: left 2/3 plain violet with logo + title, right 1/3 the shapes of background_site.jpg */
.hero {
  position: relative;
  aspect-ratio: 8 / 1;
  background: #9478FF;
  display: flex; align-items: center; gap: clamp(.6rem, 1.6vw, 1.6rem);
  padding: 0 1.25rem 0 max(1.25rem, calc((100% - 69.5rem) / 2));
}
.hero::after {
  content: "";
  position: absolute; top: 0; bottom: 0; right: 0; width: 33.334%;
  /* Scaled to the banner height and pinned right: shows the shapes, never upscaled past its width */
  background: url("visual/background_site.jpg") right center / auto 100% no-repeat;
}
.hero > * { position: relative; z-index: 1; }
.hero .logo {
  flex: none;
  width: clamp(2.2rem, 6vw, 6rem); height: auto;
  filter: drop-shadow(0 4px 10px rgba(40, 20, 110, .35));
}
.hero h1 {
  font-weight: 800;
  font-size: clamp(1rem, 3vw, 2.9rem);
  letter-spacing: -0.01em;
  line-height: 1.1;
  white-space: nowrap;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 18px rgba(35, 15, 100, .25);
}

/* Intro text and tagline above the themes */
.intro { margin: 0 0 4.5rem; font-size: 1.08rem; color: #3A4150; text-align: justify; hyphens: auto; }
.intro p { margin: 0 0 .5rem; }
.intro ul { margin: 0; padding-left: 1.3rem; }
.intro li { margin: 0 0 .35rem; }
.intro li::marker { color: var(--pick); }

/* Countdown */
.countdown { display: flex; justify-content: center; gap: clamp(.4rem, 1.6vw, .8rem); margin: 2rem 0 .5rem; }
.cd-box {
  display: grid; justify-items: center; gap: .15rem;
  min-width: clamp(3.4rem, 10.4vw, 5.2rem);
  padding: .64rem .4rem .56rem;
  background: #F4F1FF; border: 1px solid #E4DCFF; border-radius: .64rem;
}
.cd-num {
  font-size: clamp(1.28rem, 3.2vw, 2.08rem); font-weight: 800; line-height: 1;
  color: var(--pick); font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.cd-lbl { font-size: .62rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cd-done { margin: 0; font-weight: 700; color: var(--ink); text-align: center; }
.intro strong { color: var(--ink); }
.intro h3 { margin: 1.4rem 0 .5rem; font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.intro:empty, .tagline:empty { display: none; }
.tagline {
  margin: 0; text-align: center;
  font-family: var(--poetic); font-style: italic; font-weight: 600;
  font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.15; letter-spacing: .005em;
  color: var(--ink);
}

.voted-note {
  margin: 1.5rem auto 0; max-width: 40rem; text-align: center;
  padding: .7rem 1rem; border-radius: .6rem;
  background: #E9FBEF; color: #0A5C2A; font-weight: 600; font-size: .95rem;
}
.voted-note[hidden] { display: none; }

/* Theme tabs: simple underlined text */
main { max-width: 72rem; margin: 0 auto; padding: 2rem 1.25rem 1.75rem; }

/* Dark room for the photos. The background is drawn by ::before at z-index -2 (the
   section itself creates no stacking context), so the shooting star (z-index -1)
   still flies over it, behind the photos. */
.gallery { position: relative; color: var(--room-ink); padding: 0 0 9rem; }
.gallery::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--room); }
.gallery-inner { max-width: 96rem; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3.5rem); }
.tabs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  margin: 0 0 2.5rem;
  /* Stays at the top of the screen while scrolling through the gallery */
  position: sticky; top: 0; z-index: 6;
  background: rgba(19, 19, 23, .92);
  backdrop-filter: blur(10px);
  transition: box-shadow .2s ease;
}
.tabs.is-stuck { box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .8); }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; padding: 1.15rem .5rem 1rem;
  color: var(--room-ink); opacity: .5;
  font-weight: 600; font-size: clamp(.95rem, 1.5vw, 1.1rem); line-height: 1.3;
  text-align: center; cursor: pointer;
  transition: opacity .15s ease, border-color .15s ease, color .15s ease;
}
.tab:hover { opacity: .85; }
.tab[aria-selected="true"] { opacity: 1; color: #fff; border-bottom-color: var(--pick); }
.tab-head, .tab-sub { display: block; }
.tab-sub {
  margin-top: .3rem;
  font-family: var(--poetic); font-style: italic; font-weight: 400;
  font-size: clamp(.88rem, 1.25vw, 1rem); line-height: 1.25; letter-spacing: .01em;
}

/* Photo wall */
.status { color: var(--muted); }
/* Rows built by app.js (layoutWall): portrait-only or landscape-only rows, sized so every
   photo gets about the same area. Each photo's flex-grow is its aspect ratio (--ar). */
.wall { display: grid; gap: 3.2rem; }
.wall-row { display: flex; justify-content: center; align-items: flex-start; }
.print { --ar: 1.5; min-width: 0; margin: 0; }
@media (max-width: 720px) { .wall { gap: 2rem; } }

/* The photo and its "Choisir" button, laid over the photo's bottom-right corner */
.print .frame {
  position: relative; border-radius: 0;
  transition: transform .3s ease, box-shadow .3s ease, outline-color .2s ease;
  outline: 3px solid transparent; outline-offset: 4px;
}
.print .open { all: unset; cursor: zoom-in; display: block; }
.print img {
  width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover;
  display: block; background: #222228; border-radius: 0;
}
@media (hover: hover) {
  .print .frame:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -18px rgba(0, 0, 0, .9); }
}
.print .open:focus-visible { outline: 2px solid var(--pick); outline-offset: 3px; }
.print.is-picked .frame { outline-color: var(--green); }

.print .pick {
  position: absolute; right: .6rem; bottom: .6rem;
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(15, 15, 20, .55); color: #fff;
  backdrop-filter: blur(6px);
  padding: .35rem .9rem;
  opacity: 0; transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease, background-color .15s ease, border-color .15s ease;
}
.print .frame:hover .pick, .print .pick:focus-visible, .print .pick[aria-pressed="true"] { opacity: 1; transform: none; }
@media (hover: none) { .print .pick { opacity: 1; transform: none; } } /* phones: always visible */
.print .pick:hover { border-color: #fff; background: rgba(15, 15, 20, .75); }
.print .pick[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #06260F; }
.print .pick[hidden] { display: none; }

.print figcaption { padding: .75rem .1rem 0; }
.print .ptitle {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-family: var(--poetic); font-style: italic; font-weight: 500;
  font-size: 1.22rem; line-height: 1.25; letter-spacing: .01em; color: var(--room-ink);
}
.gallery .status { color: var(--room-muted); text-align: center; }
.pick {
  flex: none;
  border: 1px solid #D5D2DE; background: transparent; color: var(--ink);
  padding: .25rem .8rem; border-radius: 999px; cursor: pointer;
  font-size: .8rem; font-weight: 600;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.pick:hover { border-color: var(--pick); }
.pick[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #06260F; }
.pick:disabled { opacity: .4; cursor: not-allowed; }

/* Sticky vote bar */
.votebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: rgba(19, 19, 23, .9); color: var(--room-ink);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding: .8rem max(1.25rem, calc((100% - 69.5rem) / 2)) calc(.8rem + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template-columns: 1fr auto; gap: .4rem 1.25rem; align-items: center;
}
.votebar[hidden] { display: none; }
.status-block { display: flex; align-items: center; gap: .8rem; }
.count { margin: 0; font-size: .88rem; font-weight: 600; }
.catdots { display: flex; gap: .35rem; }
.catdots .dot {
  width: .55rem; height: .55rem; border-radius: 50%;
  border: 1.5px solid #5E5A6C; background: transparent;
  transition: background-color .15s ease, border-color .15s ease;
}
.catdots .dot.filled { background: var(--green); border-color: var(--green); }
.votebar button[type=submit] {
  position: relative;
  background: var(--green); color: #06260F; border: 0; border-radius: 6px;
  padding: .55rem 1.1rem; font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.votebar button:disabled { opacity: .4; cursor: not-allowed; }
/* Dimmed (not transparent, so the bubble below stays crisp) while a theme is missing */
.votebar button.incomplete { background: #2F5A3E; color: #9FC2AB; }
/* Floating bubble above the button, explaining what is missing */
.votebar button[data-tip]::after {
  content: attr(data-tip);
  position: absolute; right: 0; bottom: calc(100% + .7rem);
  width: max-content; max-width: min(20rem, calc(100vw - 2.5rem));
  padding: .65rem .85rem; border-radius: .55rem;
  background: #fff; color: var(--ink);
  font-size: .82rem; font-weight: 500; line-height: 1.45; text-align: left; white-space: normal;
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .6);
  opacity: 0; visibility: hidden; transform: translateY(6px); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.votebar button[data-tip]::before {
  content: ""; position: absolute; right: 1.4rem; bottom: calc(100% + .7rem - 12px);
  border: 6px solid transparent; border-top-color: #fff;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.votebar button[data-tip]:hover::after, .votebar button[data-tip]:hover::before,
.votebar button[data-tip]:focus-visible::after, .votebar button[data-tip]:focus-visible::before,
.votebar button.show-tip::after, .votebar button.show-tip::before { opacity: 1; visibility: visible; transform: none; }
.msg { grid-column: 1 / -1; margin: 0; font-size: .85rem; }
.msg:empty { display: none; }
.msg.ok { color: var(--ok); } .msg.err { color: var(--err); }
@media (max-width: 720px) {
  .votebar { grid-template-columns: 1fr; }
  .intro { text-align: left; }
  .tab { font-size: .95rem; padding: .85rem .3rem .75rem; }
  .tab-sub { font-size: .82rem; }
  .print .ptitle { font-size: 1.08rem; }
  .print .pick { right: .4rem; bottom: .4rem; padding: .25rem .7rem; font-size: .75rem; }
}

/* Viewer */
dialog#viewer {
  border: 0; padding: 0; background: transparent; color: #fff;
  width: 100%; height: 100%; max-width: 100%; max-height: 100%;
}
dialog#viewer::backdrop { background: rgba(12,15,20,.94); }
dialog#viewer[open] { display: grid; grid-template-columns: 3.5rem 1fr 3.5rem; align-items: center; }
#viewer figure { margin: 0; display: grid; justify-items: center; gap: .8rem; padding: 3.5rem 0 1.5rem; }
#viewer.is-zoomed figure { overflow: auto; max-width: 100%; max-height: 100vh; justify-items: start; }
.imgwrap { position: relative; display: inline-grid; max-width: 100%; }
#viewer img { max-height: calc(100vh - 9rem); max-width: 100%; width: auto; display: block; border-radius: 0; box-shadow: 0 25px 60px rgba(0,0,0,.5); }
#viewer.is-zoomed #vImg { max-height: none; max-width: none; cursor: zoom-out; }
.zoom {
  position: absolute; top: .5rem; right: .5rem;
  width: 2.2rem; height: 2.2rem; display: grid; place-items: center;
  background: rgba(0,0,0,.55); color: #fff; border: 1px solid rgba(255,255,255,.4);
  border-radius: 50%; cursor: zoom-in; font-size: 1.1rem; line-height: 1; padding: 0;
}
.zoom[aria-pressed="true"] { cursor: zoom-out; }
#viewer figcaption { display: flex; gap: 1rem; align-items: center; }
.v-text { display: grid; justify-items: center; gap: .15rem; text-align: center; }
#vCap { font-family: var(--poetic); font-style: italic; font-weight: 500; font-size: 1.45rem; line-height: 1.2; }
.v-author { font-size: .9rem; color: #C9BCFF; }
.v-author:empty { display: none; }
#viewer .pick { border-color: #fff; color: #fff; }
#viewer .pick[aria-pressed="true"] { border-color: var(--green); color: #06260F; }
#viewer .nav, #viewer .close {
  background: none; border: 0; color: #fff; font-size: 2.6rem; cursor: pointer; height: 100%;
}
#viewer .close { position: fixed; top: calc(.5rem + env(safe-area-inset-top, 0px)); right: 1rem; height: auto; font-size: 1.6rem; }

/* Review (recap before sending) */
dialog#review {
  border: 0; border-radius: 1rem; padding: clamp(1.2rem, 3vw, 2rem);
  width: min(56rem, calc(100% - 2rem)); max-height: calc(100% - 2rem);
  color: var(--ink); background: #fff;
  box-shadow: 0 30px 80px rgba(20, 10, 60, .35);
}
dialog#review::backdrop { background: rgba(20, 16, 40, .55); }
#review h2 { margin: 0 0 1.2rem; font-size: 1.3rem; font-weight: 800; }

.r-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.r-item { margin: 0; display: grid; gap: .45rem; align-content: start; }
.r-cat { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--pick); }
.r-zoom { all: unset; display: block; cursor: zoom-in; border-radius: 0; }
.r-zoom:focus-visible { outline: 2px solid var(--pick); outline-offset: 2px; }
.r-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 0; background: #F2F1F6; transition: opacity .15s ease; }
.r-zoom:hover img { opacity: .88; }
.r-title { font-family: var(--poetic); font-style: italic; font-weight: 600; font-size: 1.15rem; line-height: 1.25; }
.r-field { display: grid; gap: .35rem; margin: 1.5rem 0 .4rem; font-size: .9rem; font-weight: 600; }
.r-field input {
  width: 100%; padding: .65rem .8rem; border-radius: 6px;
  border: 1px solid #DAD7E3; background: #fff; color: var(--ink); font-size: 1rem; font-weight: 400;
}
.r-field input:focus { border-color: var(--pick); outline: none; box-shadow: 0 0 0 3px #EEE8FF; }
/* ⓘ next to the e-mail label: the note shows above the label row on hover, or on tap/focus */
.r-label { position: relative; display: flex; align-items: center; gap: .4rem; }
.info { color: var(--pick); font-size: 1.05rem; font-weight: 400; line-height: 1; cursor: help; border-radius: 50%; }
.info .tip {
  position: absolute; left: 0; bottom: calc(100% + .5rem); z-index: 2;
  width: max-content; max-width: min(24rem, 100%);
  padding: .55rem .75rem; border-radius: .5rem;
  background: #1C2330; color: #fff;
  font-size: .8rem; font-weight: 400; line-height: 1.45;
  box-shadow: 0 10px 24px -8px rgba(20, 10, 60, .45);
  opacity: 0; visibility: hidden; transform: translateY(4px); pointer-events: none;
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.info:hover .tip, .info:focus .tip { opacity: 1; visibility: visible; transform: none; }
#review .msg { min-height: 1.3em; }
.r-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: .8rem; }
.btn-ghost, .btn-green {
  border-radius: 6px; padding: .6rem 1.3rem; font-size: .95rem; font-weight: 600; cursor: pointer;
}
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid #D5D2DE; }
.btn-green { background: var(--green); color: #06260F; border: 0; font-weight: 700; }
.r-done { text-align: center; padding: 1rem .5rem .5rem; }
.r-done[hidden], #rForm[hidden] { display: none; }
.r-check {
  width: 3.2rem; height: 3.2rem; margin: 0 auto .9rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.6rem; font-weight: 800;
  background: var(--green); color: #06260F;
}
.r-done h2 { margin: 0 0 .5rem; }
.r-done p { margin: 0 auto 1.4rem; max-width: 34rem; color: #3A4150; }
.btn-ghost:disabled, .btn-green:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 640px) {
  .r-grid { grid-template-columns: 1fr; }
  .r-item { grid-template-columns: 5.5rem 1fr; grid-template-areas: "img cat" "img title"; column-gap: .9rem; }
  .r-zoom { grid-area: img; }
  .r-item img { aspect-ratio: 1; }
  .r-cat { grid-area: cat; align-self: end; }
  .r-title { grid-area: title; }
}

/* Star burst when a photo is picked */
.burst { position: fixed; width: 0; height: 0; pointer-events: none; z-index: 20; }
.burst img, #viewer .burst img {
  position: absolute; left: 0; top: 0; width: var(--s, 22px); height: auto; max-width: none; max-height: none;
  border-radius: 0; box-shadow: none;
  margin: calc(var(--s, 22px) / -2) 0 0 calc(var(--s, 22px) / -2);
  filter: drop-shadow(0 2px 3px rgba(60, 40, 140, .25));
  animation: burst .85s cubic-bezier(.2, .8, .3, 1) var(--d, 0s) both;
}
@keyframes burst {
  0%   { transform: translate(0, 0) rotate(-40deg) scale(0); opacity: 1; }
  35%  { transform: translate(calc(var(--x) * .7), calc(var(--y) * .7)) rotate(0deg) scale(1.15); opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) rotate(25deg) scale(.7); opacity: 0; }
}
.pick.just-picked { animation: pick-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pick-pop { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* Shooting star after voting: z-index -1 puts it behind the photos and text */
.sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.sky[hidden] { display: none; }
.shooting {
  position: absolute; top: 18vh; left: 0; width: 0; height: 0;
  transform: rotate(16deg); transform-origin: 0 0;
}
.ss {
  position: absolute; top: -18px; left: 0;
  display: flex; align-items: center;
  opacity: 0;
  animation: shoot 6s cubic-bezier(.35, .1, .65, .9) 1.5s infinite;
}
/* Single welcome pass when the page opens */
.sky.once .ss { animation: shoot-once 1.8s cubic-bezier(.35, .1, .65, .9) .8s 1 both; }
.ss-trail {
  width: clamp(90px, 14vw, 200px); height: 3px; margin-right: -8px; border-radius: 3px;
  background: linear-gradient(to right, rgba(255, 209, 92, 0), rgba(255, 209, 92, .95));
  box-shadow: 0 0 8px rgba(255, 209, 92, .6);
}
.ss img { width: clamp(24px, 2.6vw, 36px); height: auto; max-width: none; animation: ss-spin 1.6s linear infinite; }
@keyframes shoot {          /* ~1.6 s flight, then a pause, every 6 s */
  0%   { transform: translateX(-25vw); opacity: 0; }
  3%   { opacity: 1; }
  24%  { opacity: 1; }
  27%  { transform: translateX(125vw); opacity: 0; }
  100% { transform: translateX(125vw); opacity: 0; }
}
@keyframes shoot-once {
  0%   { transform: translateX(-25vw); opacity: 0; }
  10%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateX(125vw); opacity: 0; }
}
@keyframes ss-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sky { display: none !important; } }


@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Access page (gate.js): everything else stays hidden until the password is entered */
body.locked > :not(.gate) { display: none !important; }
.gate[hidden] { display: none; }
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 1.25rem;
  background: #9478FF url("visual/background_site.jpg") right center / auto 100% no-repeat;
}
.gate-card {
  width: min(26rem, 100%);
  display: grid; justify-items: center; gap: .9rem; text-align: center;
  padding: clamp(1.6rem, 5vw, 2.4rem);
  background: #fff; border-radius: 1rem;
  box-shadow: 0 30px 80px -20px rgba(35, 15, 100, .55);
}
.gate-logo { width: 5.5rem; height: auto; }
.gate-card h1 { margin: 0; font-size: 1.35rem; font-weight: 800; color: var(--ink); }
.gate-card p { margin: 0; color: #3A4150; font-size: .95rem; }
.gate-field { width: 100%; }
.gate-field input {
  width: 100%; padding: .7rem .85rem; border-radius: 6px; text-align: center;
  border: 1px solid #DAD7E3; background: #fff; color: var(--ink); font-size: 1rem;
}
.gate-field input:focus { border-color: var(--pick); outline: none; box-shadow: 0 0 0 3px #EEE8FF; }
.gate-card button {
  width: 100%; padding: .7rem 1rem; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--green); color: #06260F; font-size: 1rem; font-weight: 700;
}
.gate-msg { min-height: 1.3em; color: var(--err) !important; font-weight: 600; font-size: .88rem !important; }
.gate-card.shake { animation: gate-shake .4s ease; }
@keyframes gate-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
