/* Dance Poses Catalog. Palette and type follow nirarieli.com:
   Lato Light, lowercase labels, warm beige ground, taupe accents. */

:root {
  --ink: #aeaca2;
  --ink-deep: #74736f;
  --ink-soft: #dedcd2;
  --paper: #e9e6dd;
  --wm: #a89a7a;
  --rule: #c8bc9e;
  --nav-inactive: #8a8275;
  --nav-active: #6e6452;
  --nav-deep: #544a3a;
  --night: #1e1c18;
  --gap: 10px;
  --row: 90px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  color: var(--ink-deep);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--paper) url('/background.png') center / cover fixed no-repeat;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input { font: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 56px);
  transition: background .4s var(--ease), padding .4s var(--ease), box-shadow .4s;
}
.top.scrolled {
  background: rgba(236, 233, 225, .86);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  padding-top: 12px; padding-bottom: 12px;
  box-shadow: 0 1px 0 rgba(168, 154, 122, .25);
}
.mark { display: flex; flex-direction: column; gap: 6px; user-select: none; }
.mark .name { font-size: clamp(22px, 2.6vw, 32px); color: #8c8a82; letter-spacing: -.01em; line-height: 1; }
.mark .sub { font-size: 10px; letter-spacing: .34em; text-transform: uppercase; color: var(--wm); }

.collect-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; color: var(--nav-active);
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid rgba(168, 154, 122, .45);
  background: rgba(255, 255, 255, .35);
  transition: background .3s, border-color .3s, transform .3s var(--ease);
}
.collect-btn:hover { background: rgba(255, 255, 255, .7); }
.collect-btn .count {
  min-width: 22px; height: 22px; border-radius: 999px; padding: 0 6px;
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 400;
  background: var(--nav-active); color: #f4f1e4;
}
.collect-btn.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.08); } }

/* ---------- hero ---------- */
.hero {
  padding: clamp(30px, 7vh, 90px) clamp(18px, 4vw, 56px) 10px;
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 30px;
}
.hero h1 {
  margin: 0; font-weight: 300; line-height: .9; letter-spacing: -.035em;
  font-size: clamp(52px, 8.4vw, 136px); color: rgba(116, 115, 111, .85);
}
.hero h1 em { font-style: normal; color: var(--wm); }
.howto { margin-top: 34px; }
.invite { margin: 0 0 16px; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.4; color: var(--nav-active); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 26px; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--nav-inactive); }
.steps b { font-weight: 400; color: var(--nav-active); }
.steps .num {
  width: 24px; height: 24px; border-radius: 999px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 11px; font-weight: 400;
  border: 1px solid var(--rule); color: var(--wm);
}
.star-ico {
  vertical-align: middle; margin: 0 2px;
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px;
  background: #fff; color: var(--nav-active); font-size: 12px; box-shadow: 0 3px 10px -5px rgba(0,0,0,.35);
}
@media (max-width: 760px) { .steps { flex-direction: column; } }

.tabs { display: flex; gap: clamp(18px, 3vw, 44px); padding-bottom: 14px; position: relative; }
.tab {
  position: relative; text-align: left; padding: 0 0 14px;
  color: var(--nav-inactive); transition: color .3s;
}
.tab .t { display: block; font-size: clamp(26px, 3vw, 40px); line-height: 1; letter-spacing: -.01em; }
.tab .n { display: block; margin-top: 8px; font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--rule); }
.tab::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--rule);
  transform-origin: left; transform: scaleX(.25); transition: transform .5s var(--ease), background .3s;
}
.tab:hover { color: var(--nav-active); }
.tab[aria-selected='true'] { color: var(--nav-deep); }
.tab[aria-selected='true'] .n { color: var(--wm); }
.tab[aria-selected='true']::after { transform: scaleX(1); background: var(--nav-active); }

/* ---------- sections ---------- */
.section { padding: 0 clamp(12px, 3vw, 44px); }
.eyebrow {
  display: flex; align-items: center; gap: 16px;
  margin: 44px 0 18px; font-size: 10px; letter-spacing: .34em; text-transform: uppercase; color: var(--wm);
}
.eyebrow::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to right, var(--rule), transparent); }

/* ---------- grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 6), 1fr);
  grid-auto-rows: var(--row);
  grid-auto-flow: dense;
  gap: var(--gap);
}
.tile {
  position: relative; overflow: hidden; background: #f3f1ec;
  opacity: 0; transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease), box-shadow .4s;
}
.tile.in { opacity: 1; transform: none; }
.tile img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 1.2s var(--ease), filter .4s;
  user-select: none; -webkit-user-drag: none;
}
.tile:hover { box-shadow: 0 18px 40px -22px rgba(60, 52, 40, .5); }
.tile:hover img { transform: scale(1.035); }
.tile .open { position: absolute; inset: 0; z-index: 1; }

.pick {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 34px; height: 34px; border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .82); color: var(--nav-active);
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .35);
  opacity: 0; transform: scale(.85);
  transition: opacity .3s, transform .3s var(--ease), background .3s, color .3s;
}
.tile:hover .pick, .pick.on { opacity: 1; transform: none; }
.pick.on { background: var(--nav-active); color: #f4f1e4; }
.pick svg { width: 16px; height: 16px; }
@media (hover: none) { .pick { opacity: .9; transform: none; } }

.badge-feat {
  display: none;
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: 9px; letter-spacing: .3em; text-transform: uppercase;
  color: #f4f1e4; background: rgba(110, 100, 82, .78); padding: 5px 8px 4px;
}

/* ---------- admin controls on tiles ---------- */
.adm {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; align-items: center; gap: 4px; padding: 8px;
  background: linear-gradient(to top, rgba(30, 28, 24, .72), rgba(30, 28, 24, 0));
  opacity: 0; transition: opacity .25s;
}
body.editing .tile:hover .adm, body.editing .tile:focus-within .adm { opacity: 1; }
@media (hover: none) { body.editing .adm { opacity: 1; } }
.adm button {
  height: 28px; min-width: 28px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 400; color: #f4f1e4;
  background: rgba(255, 255, 255, .14); transition: background .2s, color .2s;
}
.adm button:hover { background: rgba(255, 255, 255, .3); }
.adm button.on { background: #f4f1e4; color: var(--nav-deep); }
.adm .star.on { background: #d9b45c; color: #2b2416; }
.adm .sp { flex: 1; }
.adm .del:hover { background: #b5543f; }
.tile.is-hidden img { filter: grayscale(1) opacity(.35); }
.tile.is-hidden::after {
  content: 'removed'; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--nav-deep); pointer-events: none;
}
.tile .fname {
  position: absolute; top: 10px; left: 10px; z-index: 2; font-size: 10px; color: #fff;
  background: rgba(30, 28, 24, .5); padding: 3px 6px; opacity: 0; transition: opacity .2s;
}
body.editing .tile:hover .fname { opacity: 1; }
body.editing .tile.is-feat .badge-feat { display: block; }
body.editing .tile.is-feat:hover .badge-feat { display: none; }

/* ---------- admin bar ---------- */
.adminbar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 6px; padding: 6px;
  background: rgba(30, 28, 24, .9); color: #e9e5da; border-radius: 999px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
  backdrop-filter: blur(10px);
  font-size: 13px; max-width: calc(100vw - 24px); overflow-x: auto;
}
.adminbar .who { padding: 0 12px 0 14px; color: #a89a7a; white-space: nowrap; }
.adminbar button, .adminbar label {
  white-space: nowrap; padding: 9px 14px; border-radius: 999px; transition: background .2s; cursor: pointer;
}
.adminbar button:hover, .adminbar label:hover { background: rgba(255, 255, 255, .1); }
.adminbar .primary { background: #f4f1e4; color: var(--nav-deep); }
.adminbar .primary:hover { background: #fff; }
.adminbar input[type=checkbox] { accent-color: #a89a7a; margin-right: 6px; vertical-align: -2px; }
body.editing .collectbar { bottom: 86px; }

/* ---------- collection bar + drawer ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(440px, 100vw);
  background: #efece4; box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .35);
  transform: translateX(100%); visibility: hidden;
  transition: transform .55s var(--ease), visibility 0s linear .55s;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; visibility: visible; transition: transform .55s var(--ease); }
.drawer header { padding: 28px 28px 10px; display: flex; justify-content: space-between; align-items: start; }
.drawer h2 { margin: 0; font-weight: 300; font-size: 34px; color: var(--nav-deep); letter-spacing: -.02em; }
.drawer .hint { margin: 6px 0 0; font-size: 13px; color: var(--nav-inactive); line-height: 1.5; }
.drawer .list {
  flex: 1; overflow-y: auto; padding: 16px 28px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-content: start;
}
.drawer .list figure { margin: 0; position: relative; aspect-ratio: 2 / 3; background: #fff; }
.drawer .list img { width: 100%; height: 100%; object-fit: cover; }
.drawer .list button {
  position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 999px;
  background: rgba(255, 255, 255, .9); color: var(--nav-deep); font-size: 14px; line-height: 1;
}
.drawer .empty { grid-column: 1 / -1; padding: 50px 0; text-align: center; color: var(--ink); font-size: 15px; line-height: 1.7; }
.drawer footer { padding: 18px 28px 28px; display: flex; gap: 10px; border-top: 1px solid rgba(168, 154, 122, .3); }
.btn {
  flex: 1; padding: 14px 18px; border-radius: 999px; font-size: 14px; letter-spacing: .02em;
  border: 1px solid rgba(110, 100, 82, .4); color: var(--nav-active); transition: background .2s, color .2s;
}
.btn:hover { background: rgba(255, 255, 255, .6); }
.btn.solid { background: var(--nav-active); color: #f4f1e4; border-color: var(--nav-active); }
.btn.solid:hover { background: var(--nav-deep); }
.btn:disabled { opacity: .45; cursor: default; }
.x { font-size: 26px; line-height: 1; color: var(--nav-inactive); padding: 4px; }

.scrim {
  position: fixed; inset: 0; z-index: 55; background: rgba(40, 36, 30, .25);
  opacity: 0; pointer-events: none; transition: opacity .4s;
}
.scrim.on { opacity: 1; pointer-events: auto; }

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 70; background: rgba(26, 24, 21, .985);
  display: grid; grid-template-rows: auto 1fr auto;
  opacity: 0; pointer-events: none; transition: opacity .35s;
  color: #d8d3c6;
}
.lb.on { opacity: 1; pointer-events: auto; }
.lb .bar { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: #8a8275; }
.lb .bar .x { color: #d8d3c6; }
.lb .stage { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; padding: 0 70px; }
.lb .stage img { max-width: 100%; max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px); object-fit: contain; box-shadow: 0 30px 80px -30px #000; }
.lb .nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 54px; height: 54px; border-radius: 999px; font-size: 22px; color: #d8d3c6;
  background: rgba(255, 255, 255, .06); transition: background .2s;
}
.lb .nav:hover { background: rgba(255, 255, 255, .14); }
.lb .prev { left: 12px; } .lb .next { right: 12px; }
.lb .tools { display: flex; justify-content: center; gap: 8px; padding: 18px; flex-wrap: wrap; }
.lb .tools button {
  padding: 11px 18px; border-radius: 999px; font-size: 13px;
  border: 1px solid rgba(216, 211, 198, .25); transition: background .2s, color .2s;
}
.lb .tools button:hover { background: rgba(255, 255, 255, .08); }
.lb .tools button.on { background: #f4f1e4; color: var(--nav-deep); border-color: #f4f1e4; }
.lb .tools .star.on { background: #d9b45c; border-color: #d9b45c; color: #2b2416; }
.lb .tools .admin-only { display: none; }
body.editing .lb .tools .admin-only { display: inline-block; }
.lb .keys { display: none; text-align: center; font-size: 11px; color: #6e6452; padding-bottom: 14px; letter-spacing: .05em; }
body.editing .lb .keys { display: block; }
@media (max-width: 640px) { .lb .stage { padding: 0 8px; } .lb .nav { display: none; } }

/* ---------- modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px;
  background: rgba(40, 36, 30, .35); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.modal.on { opacity: 1; pointer-events: auto; }
.card {
  width: min(460px, 100%); max-height: calc(100vh - 40px); overflow-y: auto;
  background: #f3f0e8; padding: 34px; box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .55);
  transform: translateY(10px); transition: transform .4s var(--ease);
}
.modal.on .card { transform: none; }
.card.wide { width: min(640px, 100%); }
.card h3 { margin: 0 0 6px; font-weight: 300; font-size: 30px; color: var(--nav-deep); letter-spacing: -.02em; }
.card p.lead { margin: 0 0 22px; font-size: 14px; color: var(--nav-inactive); line-height: 1.6; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--wm); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 14px; border: 1px solid rgba(168, 154, 122, .5); background: #fbfaf6;
  color: var(--nav-deep); outline: none; transition: border-color .2s;
}
.field input:focus { border-color: var(--nav-active); }
.err { color: #a0452f; font-size: 13px; min-height: 18px; margin: 4px 0 10px; }
.row { display: flex; gap: 10px; }
.users { list-style: none; margin: 0 0 22px; padding: 0; border-top: 1px solid rgba(168, 154, 122, .3); }
.users li { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(168, 154, 122, .3); font-size: 14px; }
.users small { color: var(--wm); letter-spacing: .2em; text-transform: uppercase; font-size: 9px; margin-left: 8px; }
.users button { font-size: 12px; color: #a0452f; }

.drop {
  border: 1px dashed var(--rule); padding: 40px 20px; text-align: center; color: var(--nav-inactive);
  font-size: 15px; line-height: 1.7; transition: background .2s, border-color .2s; background: rgba(255, 255, 255, .4);
}
.drop.over { background: #fff; border-color: var(--nav-active); }
.drop b { font-weight: 400; color: var(--nav-active); }
.drop .row { justify-content: center; margin-top: 14px; }
.drop .row label { flex: 0 0 auto; cursor: pointer; }
.progress { margin-top: 20px; }
.progress .meter { height: 3px; background: rgba(168, 154, 122, .25); overflow: hidden; }
.progress .meter i { display: block; height: 100%; width: 0; background: var(--nav-active); transition: width .3s; }
.progress .stat { display: flex; justify-content: space-between; font-size: 13px; color: var(--nav-inactive); margin-top: 10px; }
.progress .log { margin-top: 10px; max-height: 120px; overflow-y: auto; font-size: 12px; color: #a0452f; line-height: 1.6; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; top: 22px; z-index: 90; transform: translate(-50%, -20px);
  background: rgba(30, 28, 24, .92); color: #efe9da; font-size: 13px;
  padding: 11px 16px 11px 20px; border-radius: 999px; display: flex; align-items: center; gap: 14px;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { color: #d9b45c; font-weight: 400; padding: 4px 6px; }

/* ---------- footer ---------- */
.foot { padding: 80px 20px 120px; text-align: center; font-size: 11px; letter-spacing: .12em; color: var(--ink); text-transform: uppercase; }
.foot .sep { color: #fff; margin: 0 6px; }
.loading { padding: 80px 0; text-align: center; color: var(--ink); letter-spacing: .3em; font-size: 11px; text-transform: uppercase; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .collect-btn .label { display: none; }
  :root { --gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .tile img, .drawer { transition: none; }
}
