/* Cryptarium page. Tokens come from ../onchain/portal.css. */

/* ── title ── */
.title { padding-bottom: 1.6rem; container-type: inline-size; } /* the title scales to its column, so CRYPTARIUM stays the widest line (the subtitle is ~0.86 of it) */
.kicker { display: inline-block; font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.14em; color: var(--muted); text-decoration: none; }
.kicker:hover { color: var(--accent); }
.title h1 { margin: 0.2rem 0 0; font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: clamp(3rem, min(15.5cqi, 7.2vw), 6.75rem); line-height: 0.92; letter-spacing: 0.01em; color: var(--text); margin-left: -0.05em; }

/* ── intro: copy left, live hero right ── */
.title .subtitle { margin: 0.9rem 0 0; font-family: var(--font-display); font-size: max(1.05rem, calc(clamp(3rem, min(15.5cqi, 7.2vw), 6.75rem) * 0.205)); line-height: 1.3; letter-spacing: 0.04em; color: var(--accent); }
/* The hero column's width before app.js measures it (fitHero), worked out the same way in CSS so the first paint
   already has the final layout instead of jumping when the script runs. */
.intro { display: grid; grid-template-columns: minmax(0, 1fr) var(--hero-w, max(360px, min(46%, calc(100vh - var(--nav-h) - 2.6rem - 207px)))); gap: 3rem; align-items: start; padding-top: calc(var(--nav-h) + 2.6rem); padding-bottom: 2.4rem; }
.lead { min-width: 0; }
.copy { padding-top: 0; max-width: 34rem; }
.copy p { color: var(--body); margin: 0 0 1.1rem; }
.copy .tagline { font-family: var(--font-display); font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.3; letter-spacing: 0.04em; color: var(--accent); margin: 0 0 0.9rem; }
.copy .lede { color: var(--text); font-size: 1.18rem; line-height: 1.55; margin-bottom: 1.2rem; }
.copy em { font-style: normal; color: var(--accent); font-family: var(--font-display); letter-spacing: 0.04em; }
.pass { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 1rem 0; margin-top: 1.6rem !important; }
.pass span { display: block; font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 0.3rem; }
.pass strong { color: var(--text); font-family: var(--font-display); font-weight: 400; letter-spacing: 0.08em; }
.facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0.6rem 2.8rem; margin: 1.6rem 0 0; }
.facts dt { font-size: 0.8rem; color: var(--muted); }
.facts dd { margin: 0.1rem 0 0; font-family: var(--font-display); font-size: 1.02rem; color: var(--text); }

.hero { margin: 0; width: 100%; }
/* Desktop: the 3D view is sized (app.js, fitHero) so the intro ends about 150px above the bottom of the window,
   leaving the start of the next section in view: the page visibly continues. */
.scroll-cue { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); z-index: 40; display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.55rem 1rem; border: 1px solid var(--border2); background: rgba(12, 12, 12, 0.85); backdrop-filter: blur(6px); color: var(--text); font-family: var(--font-display); font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; transition: opacity 0.3s ease; }
.scroll-cue i { display: inline-block; width: 0.5em; height: 0.5em; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-0.15em) rotate(45deg); animation: cueBob 1.8s ease-in-out infinite; }
.scroll-cue.gone { opacity: 0; pointer-events: none; }
@keyframes cueBob { 0%, 100% { transform: translateY(-0.25em) rotate(45deg); } 50% { transform: translateY(0.05em) rotate(45deg); } }
.stage { position: relative; aspect-ratio: 1 / 1; width: 100%; max-height: min(78vh, 820px); margin-left: auto; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); }
.stage canvas:active { cursor: grabbing; }
.busy { position: absolute; left: 18%; right: 18%; bottom: 6%; height: 1px; background: var(--border); overflow: hidden; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.busy.on { opacity: 1; }
.busy i { position: absolute; top: 0; bottom: 0; width: 30%; background: var(--accent); animation: scan 1.1s ease-in-out infinite alternate; }
@keyframes scan { from { left: 0; } to { left: 70%; } }
.hero-bar { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; margin-top: 0.6rem; text-align: center; }
.hero-traits { margin: 0; font-family: var(--font-display); font-size: 0.86rem; color: var(--text); letter-spacing: 0.02em; min-height: 1.3em; }

/* ── mint: price, then the button with quantity beside it, then small details ── */
.mint { padding-bottom: 5rem; }
.mint-panel { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; border: 1px solid var(--border2); background: var(--surface); padding: 2.4rem 1.5rem 2rem; text-align: center; }
.mint-panel p { margin: 0; }
.price { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1; color: var(--text); white-space: nowrap; }
.price small { font-size: 0.45em; margin-left: 0.45em; color: var(--accent); letter-spacing: 0.1em; }
.mint-row { display: flex; align-items: stretch; justify-content: center; gap: 0.6rem; flex-wrap: wrap; }
.mint-btn { height: 52px; min-width: 190px; padding: 0 1.6rem; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; letter-spacing: 0.32em; text-indent: 0.32em; text-transform: uppercase; cursor: pointer; transition: background 0.15s, box-shadow 0.15s; }
.mint-btn:hover:not(:disabled) { background: #5ff0ff; box-shadow: 0 0 0 5px var(--accent-dim); }
.mint-btn:disabled { background: none; color: var(--muted); border-color: var(--border2); cursor: not-allowed; letter-spacing: 0.16em; text-indent: 0.16em; font-size: 0.95rem; }
.stepper { display: inline-grid; grid-template-columns: 34px 44px 34px; height: 52px; border: 1px solid var(--border2); }
.stepper button { background: none; border: 0; font-size: 1.1rem; cursor: pointer; color: var(--text); }
.stepper button:hover:not(:disabled) { background: var(--raise); color: var(--accent); }
.stepper button:disabled { color: var(--faint); cursor: not-allowed; }
.stepper input { width: 100%; text-align: center; background: var(--bg); border: 0; border-left: 1px solid var(--border2); border-right: 1px solid var(--border2); font-family: var(--font-display); font-size: 1.05rem; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mint-meta { font-family: var(--font-display); font-size: 0.85rem; color: var(--body); display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
.mint-meta #minted { color: var(--accent); }
.mint-meta .dot { width: 3px; height: 3px; background: var(--muted); border-radius: 50%; }
.mint-total { font-size: 0.82rem; color: var(--muted); }
.mint-note { font-size: 0.78rem; color: var(--muted); max-width: 52ch; }
.mint-note .warn { color: var(--warn); }
.mint-note a { color: var(--body); }

/* ── ROLU Studio deck ── */
.deck { padding-bottom: 5rem; }
.deck-head, .gal-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.6rem 2rem; padding-bottom: 1rem; margin-bottom: 1.6rem; border-bottom: 1px solid var(--border); }
.deck-head h2, .gal-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 3.2vw, 2.2rem); letter-spacing: 0.05em; }
.deck-head p { margin: 0; color: var(--body); max-width: 52ch; }
.deck-frame { border: 1px solid var(--border2); background: var(--surface); }
.deck-tabs { display: flex; border-bottom: 1px solid var(--border2); overflow-x: auto; scrollbar-width: none; }
.deck-tabs button { flex: 1 0 auto; background: none; border: 0; border-right: 1px solid var(--border); padding: 1rem 1.3rem; font-family: var(--font-display); font-size: 0.86rem; letter-spacing: 0.08em; color: var(--muted); cursor: pointer; white-space: nowrap; }
.deck-tabs button:last-child { border-right: 0; }
.deck-tabs button:hover { color: var(--text); }
.deck-tabs button[aria-selected=true] { color: var(--accent); background: var(--bg); box-shadow: inset 0 -2px 0 var(--accent); }
.deck-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); min-height: 560px; }
.deck-text { padding: 2.4rem 2.4rem 2rem; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.deck-text h3 { margin: 0 0 1rem; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.15; color: var(--text); }
.deck-text p { color: var(--body); margin: 0 0 1rem; max-width: 46ch; }
.deck-text .big { margin-top: auto; padding-top: 1.6rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.deck-text .big b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; color: var(--accent); line-height: 1.1; }
.deck-text .big span { font-size: 0.82rem; color: var(--muted); }
.deck-text code { font-family: var(--font-display); font-size: 0.78rem; color: var(--muted); word-break: break-all; display: block; max-height: 6.2em; overflow: hidden; border-left: 1px solid var(--border2); padding-left: 0.8rem; margin-top: 0.4rem; }
.deck-demo { display: flex; flex-direction: column; min-width: 0; }
.deck-stage { position: relative; flex: 1; min-height: 420px; background: var(--bg); }
.deck-stage > canvas, .deck-stage .plate { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.deck-stage > canvas#deckCanvas { cursor: grab; touch-action: none; }
.deck-stage .plate, .deck-overlay { pointer-events: none; }
.deck-inset { position: absolute; right: 18px; bottom: 18px; width: 30%; max-width: 220px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.deck-inset .frame { display: block; aspect-ratio: 1; border: 1px solid var(--accent); background: var(--bg); overflow: hidden; }
.deck-inset img { width: 100%; height: 100%; object-fit: cover; display: block; }
.deck-inset .cap { display: block; margin-top: 6px; font-family: var(--font-display); font-size: 0.85rem; color: var(--accent); letter-spacing: 0.06em; }
.deck-inset:hover .frame { box-shadow: 0 0 0 4px var(--accent-dim); }
.deck-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.9rem 1.2rem; border-top: 1px solid var(--border); min-height: 64px; }
.deck-controls .seg button { padding: 0.5rem 0.8rem; }
.deck-controls label { display: grid; grid-template-columns: 11.5rem minmax(120px, 1fr) 4.2rem; align-items: center; gap: 0.8rem; font-size: 0.86rem; color: var(--body); flex: 1 1 280px; }
.deck-controls output { font-family: var(--font-display); font-size: 0.85rem; color: var(--text); text-align: right; }
input[type=range] { accent-color: var(--accent); width: 100%; }
.seg { display: flex; flex-wrap: wrap; border: 1px solid var(--border2); }
.seg button { background: none; border: 0; border-right: 1px solid var(--border); padding: 0.55rem 1rem; font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--muted); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed=true], .seg button[aria-selected=true] { color: var(--accent); background: var(--accent-dim); }

/* ── gallery ── */
.gallery { padding-bottom: 5rem; }
.gal-stats { display: flex; flex-wrap: wrap; gap: 0.4rem 2.2rem; margin: 0; }
.gal-stats div { display: flex; flex-direction: column-reverse; }
.gal-stats dt { font-size: 0.78rem; color: var(--muted); }
.gal-stats dd { margin: 0; font-family: var(--font-display); font-size: 1.15rem; }
.gal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1rem; margin-bottom: 1.4rem; }
.gal-note { margin: 0 0 0 auto; color: var(--muted); font-size: 0.82rem; }
.gal-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 2rem; align-items: start; }
.filters { position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100vh - var(--nav-h) - 32px); overflow: auto; padding-right: 0.6rem; scrollbar-width: thin; }
.filters-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.filters-head h3 { margin-right: auto !important; }
.filters-toggle { display: none; }
.filters-head h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 1.05rem; letter-spacing: 0.06em; }
.filters-hint { color: var(--muted); font-size: 0.8rem; margin: 0.3rem 0 1rem; }
.cat { border-top: 1px solid var(--border); }
.cat > button { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; padding: 0.7rem 0; cursor: pointer; font-size: 0.95rem; color: var(--text); text-align: left; }
.cat > button span { font-family: var(--font-display); font-size: 0.78rem; color: var(--muted); }
.cat > button .on { color: var(--accent); }
.opts { padding-bottom: 0.7rem; }
.opt { display: grid; grid-template-columns: minmax(0, 1fr) auto 2.4rem; gap: 0.6rem; align-items: center; width: 100%; background: none; border: 0; padding: 0.32rem 0.45rem; margin: 0 -0.45rem; cursor: pointer; text-align: left; color: var(--body); }
.opt:hover { background: var(--raise); color: var(--text); }
.opt[aria-pressed=true] { color: var(--accent); background: var(--accent-dim); }
.opt .n { font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt .p { font-family: var(--font-display); font-size: 0.76rem; }
.opt .c { font-family: var(--font-display); font-size: 0.76rem; color: var(--muted); text-align: right; }
.opt .t { grid-column: 1 / -1; height: 1px; background: var(--border); }
.opt .t i { display: block; height: 100%; background: currentColor; opacity: 0.7; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.8rem; }
.tile { display: block; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: inherit; }
.tile:hover { border-color: var(--border2); }
.tile .img { aspect-ratio: 1; background: var(--surface); display: grid; place-items: center; overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.tile:hover img { transform: scale(1.03); }
.tile .img i { width: 34%; height: 1px; background: var(--border2); position: relative; overflow: hidden; }
.tile .img i::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--muted); animation: scan 1.2s ease-in-out infinite alternate; }
.tile .meta { padding: 0.7rem 0.8rem 0.85rem; }
.tile .meta b { display: flex; justify-content: space-between; gap: 0.5rem; font-family: var(--font-display); font-weight: 400; font-size: 0.92rem; color: var(--text); }
.tile .meta b em { font-style: normal; color: var(--muted); font-size: 0.78rem; }
.tile .meta span { display: block; font-size: 0.82rem; color: var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .meta .rare { color: var(--warn); }
.tile:hover .meta b { color: var(--accent); }
.grid-empty { grid-column: 1 / -1; border: 1px dashed var(--border2); padding: 3rem 1.5rem; text-align: center; color: var(--body); margin: 0; }
.grid-more { display: flex; justify-content: center; margin-top: 1.4rem; }

/* ── mint flow dialog ── */
.flow { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #050505; overflow: auto; }
.flow::backdrop { background: #050505; }
.flow-run { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); grid-template-rows: 1fr auto; gap: 0 3rem; padding: 3rem; align-items: center; }
.pv { position: relative; aspect-ratio: 1; width: min(100%, 72vh); justify-self: center; }
.pv canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { position: relative; padding: 0.9rem 0 0.9rem 3rem; border-top: 1px solid var(--border); color: var(--faint); counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0.95rem; width: 1.9rem; height: 1.9rem; border: 1px solid currentColor; display: grid; place-items: center; font-family: var(--font-display); font-size: 0.85rem; }
.steps b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.05rem; letter-spacing: 0.04em; }
.steps small { display: block; font-size: 0.84rem; margin-top: 0.2rem; }
.steps small a { color: var(--accent); }
.steps li.now { color: var(--text); }
.steps li.now::before { border-color: var(--accent); color: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.steps li.done { color: var(--body); }
.steps li.done::before { content: '✓'; border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.steps li.fail::before { content: '!'; border-color: var(--bad); color: var(--bad); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--accent-dim); } }
.flow-err { grid-column: 2; color: var(--bad); margin-top: 1rem; }
.flow-actions { grid-column: 2; display: flex; gap: 0.6rem; margin-top: 1rem; }

.reveal { position: relative; min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 3rem; animation: revealIn 0.6s ease both; }
@keyframes revealIn { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
.reveal-x { position: absolute; top: 1rem; right: 1.2rem; background: none; border: 0; font-size: 2rem; color: var(--muted); cursor: pointer; z-index: 3; }
.reveal-x:hover { color: var(--text); }
.reveal-main { display: grid; grid-template-columns: minmax(0, auto) minmax(260px, 380px); gap: 3rem; align-items: center; justify-content: center; }
.frame-wrap { position: relative; width: min(66vh, 60vw); }
.frame { position: relative; z-index: 2; aspect-ratio: 1; border: 1px solid var(--border2); background: var(--surface); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.frame canvas, .frame .plate { position: absolute; inset: 0; width: 100%; height: 100%; }
.frame canvas { cursor: grab; touch-action: none; }
.frame .plate { pointer-events: none; }
.frame.flip { animation: flipIn 0.7s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes flipIn { from { opacity: 0; transform: translateY(26px) scale(0.96); } to { opacity: 1; transform: none; } }
.stack { position: relative; height: 0; }
.stack i { position: absolute; left: 0; right: 0; height: 12px; border: 1px solid #3c3c3c; border-top: 0; background: #151515; }
.reveal-side .reveal-k { font-family: var(--font-display); color: var(--accent); letter-spacing: 0.1em; margin: 0.6rem 0 1.2rem; font-size: 1.05rem; }
.reveal-side h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 3.4vw, 2.8rem); line-height: 1.05; }
.reveal-rare { color: var(--body); margin: 1.8rem 0 0.9rem; padding-top: 1.2rem; border-top: 1px solid var(--border); font-size: 0.9rem; }
.traits { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.35rem 1rem; margin: 0; font-size: 0.9rem; }
.traits dt { color: var(--muted); }
.traits dd { margin: 0; color: var(--text); }
.traits dd.p { font-family: var(--font-display); font-size: 0.78rem; color: var(--muted); text-align: right; align-self: center; }
.traits dd.rare { color: var(--warn); }
.reveal-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.reveal-actions .btn-solid { min-width: 11rem; }
.reveal-strip { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.2rem; }
.reveal-strip[hidden] { display: none; }
.reveal-strip button { width: 64px; padding: 0; border: 1px solid var(--border2); background: var(--surface); cursor: pointer; }
.reveal-strip button[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.reveal-strip img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; }
.reveal-strip span { display: block; font-family: var(--font-display); font-size: 0.7rem; color: var(--body); padding: 0.2rem 0; }

/* ── responsive ── */
@media (max-width: 1000px) {
  .intro { grid-template-columns: 1fr; gap: 1.5rem; padding-top: calc(var(--nav-h) + 1.8rem); }
  .lead { display: contents; }
  .title { order: 0; padding-bottom: 0; }
  .copy { max-width: none; order: 2; }
  .hero { order: 1; }
  .stage { max-height: none; }
  .deck-body { grid-template-columns: 1fr; }
  .deck-text { border-right: 0; border-bottom: 1px solid var(--border); padding: 1.6rem; }
  .deck-stage { min-height: min(92vw, 520px); }
  .gal-layout { grid-template-columns: 1fr; gap: 1.2rem; }
  .filters { position: static; max-height: none; padding-right: 0; border: 1px solid var(--border); padding: 0.6rem 0.9rem; }
  .filters-toggle { display: inline-flex; min-height: 34px; padding: 0.3rem 0.8rem; }
  .filters-body { display: none; padding-top: 0.6rem; }
  .filters.open .filters-body { display: block; }
  .flow-run { grid-template-columns: 1fr; grid-template-rows: auto auto; padding: 1.5rem; gap: 1.5rem; align-content: center; }
  .pv { width: min(100%, 52vh); }
  .flow-err, .flow-actions { grid-column: 1; }
  .reveal { padding: 4rem 1.25rem 2rem; justify-content: flex-start; }
  .reveal-main { grid-template-columns: 1fr; gap: 2rem; }
  .frame-wrap { width: min(100%, 60vh); justify-self: center; }
}
@media (max-width: 600px) {
  .facts { gap: 0.6rem 1.6rem; }
  .mint-btn { min-width: 0; flex: 1 1 auto; max-width: 200px; padding: 0 1rem; }
  .mint-row { flex-wrap: nowrap; width: 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .tile .meta span:nth-of-type(n+3) { display: none; }
  .deck-controls label { grid-template-columns: 1fr 4.2rem; } .deck-controls label input { grid-column: 1 / -1; grid-row: 2; }
}
