/* A BINDER YOU FLIP THROUGH.
 *
 * Jade: it should not scroll, it should look like a real binder flipped
 * through with left and right buttons, with cards to the left and cards to the
 * right. So the page IS the viewport: two facing leaves, rings down the
 * middle, the edges of the pages still to come stacked either side, and no
 * scrollbar anywhere.
 *
 * The leaves themselves keep the printed album: nine cards to a page, three
 * across, the word under the picture.
 */
:root {
  --desk: #e4d7bd; --board: #8a6a3f; --leaf: #fffdf9; --edge: #e8dfcd;
  --ink: #2b2620; --word: #6f8f83; --faint: #cabfa9; --gold: #e0a32a;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;      /* a binder does not scroll */
}
body {
  background: radial-gradient(120% 90% at 50% 0%, #efe4cd 0%, var(--desk) 100%);
  color: var(--ink); font-family: Geist, system-ui, sans-serif;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
}
.who { font-size: 14px; font-weight: 700; color: #5d5344; }
.back {
  font-size: 12.5px; color: #5d5344; text-decoration: none;
  border: 1px solid rgba(0,0,0,.12); border-radius: 999px;
  padding: 7px 13px; background: rgba(255,253,249,.7);
}

/* MARK: the desk */

.desk {
  flex: 1; min-height: 0; display: flex; align-items: center;
  justify-content: center; gap: clamp(6px, 2vw, 22px); padding: 0 12px;
}

.flip {
  flex: none; width: clamp(44px, 6vw, 62px); height: clamp(44px, 6vw, 62px);
  border-radius: 50%; border: 1px solid rgba(0,0,0,.14);
  background: rgba(255,253,249,.92); color: #5d5344; cursor: pointer;
  font-size: clamp(22px, 3vw, 30px); line-height: 1;
  display: grid; place-items: center;
  box-shadow: 0 6px 14px -8px rgba(70,52,24,.8);
}
.flip:disabled { opacity: .32; cursor: default; box-shadow: none; }
.flip span { transform: translateY(-2px); }

/* MARK: the binder itself */

.binder {
  position: relative; flex: 1; min-width: 0; max-width: 1180px;
  height: min(100%, 78vh);
  display: flex; align-items: stretch; justify-content: center;
}
/* the board it is all bound into */
.binder::before {
  content: ''; position: absolute; inset: -10px -14px;
  background: var(--board); border-radius: 12px;
  box-shadow: 0 20px 40px -24px rgba(50,34,12,.9);
}

/* the pages still to come, showing as edges either side */
.stack {
  position: relative; width: clamp(8px, 1.6vw, 18px); align-self: stretch;
  margin: 12px 0;
}
.stack i {
  position: absolute; top: 0; bottom: 0; width: 100%;
  background: #f6f0e4; border: 1px solid #e0d6c2; border-radius: 3px;
}

.spread {
  position: relative; z-index: 1; flex: 1; min-width: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 2vw, 26px);
  margin: 12px 0;
}
@media (max-width: 720px) { .spread { grid-template-columns: 1fr; } }

/* THE RING BINDING. Drawn as rings rather than as a repeating gradient, which
   came out looking like a barcode down the middle of the spread. A dark spine
   with a column of metal rings over it, spaced by the page height so they sit
   where a real binder's would. */
.rings {
  position: absolute; left: 50%; top: 14px; bottom: 14px; width: 30px;
  margin-left: -15px; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; justify-content: space-evenly;
  align-items: center;
}
.rings::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 50%;
  width: 3px; margin-left: -1.5px; background: rgba(40, 26, 8, .45);
  border-radius: 2px;
}
.rings i {
  position: relative; width: 26px; height: 13px; border-radius: 13px;
  border: 3px solid #cfc6b4;
  border-top-color: #fbf8f1; border-bottom-color: #9d927e;
  background: transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
@media (max-width: 720px) { .rings { display: none; } }

/* MARK: a leaf */

.leaf {
  background: var(--leaf); border-radius: 8px;
  padding: clamp(10px, 1.6vh, 18px) clamp(10px, 1.4vw, 18px);
  display: flex; flex-direction: column; min-height: 0;
  box-shadow: 0 10px 22px -18px rgba(70,52,24,.9);
}
.leaf.blank { background: #f7f1e6; box-shadow: none; }
.leafhead { flex: none; }
.leafhead h2 {
  margin: 0; font-size: clamp(12px, 1.5vh, 15px); font-weight: 800;
}
.leafhead .of {
  font-size: clamp(10px, 1.2vh, 11.5px); color: #9c9080; margin-top: 2px;
}

.slots {
  flex: 1; min-height: 0; margin-top: clamp(8px, 1.2vh, 14px);
  display: grid; grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr); gap: clamp(6px, 1vw, 14px);
}
.slot {
  background: #fff; border: 1px solid var(--edge); border-radius: 9px;
  padding: 6px 6px 0; display: flex; flex-direction: column; min-height: 0;
  box-shadow: 0 2px 4px -2px rgba(70,52,24,.3);
}
.slot .im { flex: 1; min-height: 0; border-radius: 5px; overflow: hidden;
            background: #fbf7ef; }
.slot .im img { width: 100%; height: 100%; object-fit: contain; display: block; }
.slot b {
  flex: none; padding: 4px 2px 6px; text-align: center;
  font-size: clamp(10px, 1.4vh, 14px); font-weight: 700; color: var(--word);
}
.slot.empty { box-shadow: none; }
.slot.empty .im img { filter: grayscale(1) brightness(1.16) contrast(.82); opacity: .3; }
.slot.empty b { color: var(--faint); }

.leaffoot {
  flex: none; display: flex; justify-content: space-between;
  margin-top: clamp(6px, 1vh, 12px);
  font-size: clamp(9px, 1.1vh, 11px); color: #a89b87;
}

/* MARK: the line under it all */

.status {
  flex: none; display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 10px 16px 16px; font-size: 13px; color: #5d5344;
  flex-wrap: wrap;
}
.status .star { width: 13px; height: 13px; }
.status .star.on path { fill: var(--gold); }
.status .star.off path { fill: rgba(0,0,0,.14); }
.claim {
  border: 0; border-radius: 999px; padding: 8px 16px; font: inherit;
  font-weight: 700; font-size: 13px; cursor: pointer;
  background: var(--gold); color: #24190a;
}
