/* ─────────────────────────────────────────────
   Deji Sam — YZY-style system.
   IBM Plex Mono, uppercase, white on black (dark by default); the top bar alone uses
   Samuel Ross type (Times name, bold grotesk links).
   Inactive = 20% opacity, square grid with codes.
   Phone layout is the base; min-width queries enhance up.
   ───────────────────────────────────────────── */
:root {
  --bg: #000;          /* dark by default */
  --fg: #fff;
  --dim: .3;           /* YZY inactive state (a touch higher on black) */
  --tile: #111;        /* empty square */
  color-scheme: dark;
  --gap: 12px;
  --pad: 16px;
  --size: 13px;
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --serif: "Times New Roman", Times, serif;
  --sans: "Neue Haas Grotesk Display Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@media (min-width: 760px) { :root { --size: 16px; --gap: 16px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 var(--size)/1.35 var(--mono); text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; text-transform: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }
::selection { background: var(--fg); color: var(--bg); }

/* ── Header: logo · toggle · contact ── */
.hd {
  position: sticky; top: 0; z-index: 10; background: var(--bg);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: max(14px, env(safe-area-inset-top)) var(--pad) 14px;
}
/* top bar only: Samuel Ross nav type — bold grotesk */
.logo { justify-self: start; }
.logo, .tog, .hd-r { font-family: var(--sans); font-weight: 600; letter-spacing: -.005em; }
.hd-r { justify-self: end; }
.tog { display: flex; gap: 14px; }
.tog a, .filters button { opacity: var(--dim); transition: opacity .2s; }
.tog a[aria-current="true"], .filters button[aria-selected="true"] { opacity: 1; }
.tog a:hover, .filters button:hover { opacity: 1; }

/* ── Filters ── */
.filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; padding: 6px var(--pad) 22px; }
.filters button { min-height: 32px; }

/* ── Grid ── */
.grid {
  list-style: none; margin: 0; padding: 14px var(--pad) 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px var(--gap);
}
.grid li[hidden] { display: none; }
.cell { display: block; text-align: center; }
.cell .sq { aspect-ratio: 1; background: var(--tile); overflow: hidden; }
.cell img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s cubic-bezier(.22, 1, .36, 1); }
.cell span { display: block; padding-top: 8px; font-size: .92em; }
@media (hover: hover) { .cell:hover img { transform: scale(1.02); } }
/* Empty frames — waiting for photos */
.frame { position: relative; background: var(--tile); display: grid; place-items: center; }
.frame i { font-style: normal; opacity: .35; padding: 10px; text-align: center; font-size: .85em; line-height: 1.3; }
.frame::before, .frame::after { content: ""; position: absolute; width: 14px; height: 1px; background: var(--fg); opacity: .25; top: 50%; left: 50%; translate: -50% -50%; }
.frame::after { width: 1px; height: 14px; }
.sq.frame i { position: absolute; bottom: 6px; left: 0; right: 0; font-size: .72em; }
.book .frames { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.book .frames .frame { aspect-ratio: 4 / 5; }
.book .frames .frame i { position: absolute; bottom: 10px; left: 0; right: 0; }
@media (min-width: 760px) { .book .frames { grid-template-columns: repeat(3, 1fr); } }

.note { padding: 28px var(--pad) 0; text-align: center; opacity: .35; font-size: .8em; margin: 0; }

@media (min-width: 600px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(6, 1fr); } }

/* ── Item: head + stacked book ── */
.item { padding: 8px var(--pad) 0; }
.item-head { display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; }
.item-head .i-code { grid-row: span 3; }
.i-role, .i-year { opacity: .45; }
.i-text { max-width: 60ch; margin: 18px 0 0; text-transform: none; line-height: 1.55; white-space: pre-line; }
.book { display: grid; gap: var(--gap); margin: 26px auto 0; max-width: 1100px; }
.book img { width: 100%; height: auto; background: var(--tile); }
.video { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--tile); overflow: hidden; }
.video img, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video .play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; padding: 12px 18px;
  background: var(--fg); color: var(--bg); font-weight: 500; transition: transform .2s;
}
.video:hover .play { transform: scale(1.05); }
.book a { justify-self: start; opacity: .45; }
/* pieces for sale: image + one line of edition / price / collect */
.piece { margin: 0; }
.sale { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; padding: 10px 0 6px; border-bottom: 1px solid color-mix(in srgb, var(--fg) 25%, transparent); }
.sale .dim { opacity: .45; }
.buy { background: var(--fg); color: var(--bg); padding: 8px 14px; min-height: 36px; }
.buy:hover { opacity: .8; }
.sale .buy { margin-left: auto; }

/* ── Checkout (USDT TRC-20) ── */
.co {
  width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  background: var(--bg); color: var(--fg); border: 1px solid color-mix(in srgb, var(--fg) 30%, transparent);
  padding: 0; font: inherit; text-transform: uppercase;
}
.co::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
.co-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid color-mix(in srgb, var(--fg) 20%, transparent); }
.co-x { opacity: .6; min-height: 32px; }
.co-x:hover { opacity: 1; }
.co p { margin: 0; }
.co .dim { opacity: .45; }
.co-item { display: grid; grid-template-columns: 88px 1fr; gap: 14px; padding: 16px; align-items: center; }
.co-item img { width: 88px; aspect-ratio: 4 / 5; object-fit: cover; background: var(--tile); }
.co-amt { font-size: 1.4em; margin-top: 6px !important; }
.co-steps { margin: 0; padding: 0 16px 18px 36px; display: grid; gap: 22px; }
.co-steps li > * + * { margin-top: 10px; }
.co-addr { display: flex; gap: 8px; align-items: stretch; }
.co-addr code { flex: 1; min-width: 0; padding: 10px; background: var(--tile); text-transform: none; word-break: break-all; font: inherit; font-size: .9em; }
.co-copy { border: 1px solid var(--fg); padding: 0 12px; }
.co-qr { background: #fff; padding: 8px; display: block; }
.co-warn { font-size: .8em; opacity: .6; }
.co-form { display: grid; gap: 12px; }
.co-field { display: grid; gap: 4px; font-size: .85em; }
.co-field input, .co-field textarea {
  font: inherit; font-size: 16px; text-transform: none; color: var(--fg); background: var(--tile);
  border: 1px solid color-mix(in srgb, var(--fg) 25%, transparent); padding: 10px; border-radius: 0; resize: vertical;
}
.co-field input:focus, .co-field textarea:focus { outline: none; border-color: var(--fg); }
.co-form .buy { justify-self: start; }
.co-alt { font-size: .85em; opacity: .6; text-decoration: underline; text-underline-offset: .2em; }
.co-note { font-size: .8em; opacity: .75; text-transform: none; }
.i-more, .book-links { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.book-links { margin: 0; }
.book-links a { opacity: .45; }
.book-links a:hover { opacity: 1; }
.i-more a { text-decoration: underline; text-underline-offset: .2em; }
.i-more a:hover { opacity: .45; }
@media (min-width: 760px) { .i-more { margin-left: 126px; } }
.book a:hover { opacity: 1; }
.item-nav { display: flex; justify-content: space-between; padding: 30px 0 10px; max-width: 1100px; margin: 0 auto; }
.item-nav a { min-height: 36px; display: inline-flex; align-items: center; }
@media (min-width: 760px) {
  .item-head { grid-template-columns: 110px 1fr auto auto; align-items: baseline; }
  .item-head .i-code { grid-row: auto; }
  .i-text { margin-left: 126px; }
}

/* ── Info: text rolling upward, Samuel Ross style ── */
.info { position: fixed; inset: 0; z-index: 5; background: var(--bg); padding-top: 52px; }
.roll { position: absolute; inset: 52px 0 56px; overflow: hidden; cursor: default; }
.roll::before, .roll::after { content: ""; position: absolute; left: 0; right: 0; height: 90px; z-index: 1; pointer-events: none; }
.roll::before { top: 0; background: linear-gradient(var(--bg), transparent); }
.roll::after { bottom: 0; background: linear-gradient(transparent, var(--bg)); }
.roll-track { padding: 0 var(--pad); will-change: transform; }
.roll-track p { margin: 0 0 1.4em; max-width: 1100px; font-size: 1.15em; line-height: 1.45; }
@media (min-width: 760px) { .roll-track p { font-size: 1.5em; } }
.roll-links a { text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
.roll-links a:hover { opacity: .45; }

/* ── Footer: one line of links ── */
.ft {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px;
  padding: 40px var(--pad) max(24px, env(safe-area-inset-bottom)); font-size: .8em;
}
.ft a:hover { opacity: .45; }
.ft-links { display: contents; }
.info-open .ft { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--bg); padding-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  .cell img { transition: none; }
}
