/* Layout: one dark gallery wall. A sticky stage bar on top; each page is a single column of bands. */
:root {
  --void: #08080d; --panel: #111119; --raise: #181824; --line: #262634;
  --fg: #e8e8f1; --dim: #9a9ab0; --violet: #8b7cff; --agree: #6fd6a8; --disagree: #ff7a6b; --pass: #6b6b80;
  --display: "Unbounded", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--void); }
body { margin: 0; background: var(--void); color: var(--fg); font: 16px/1.6 var(--body); }
a { color: var(--fg); text-decoration-color: var(--violet); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
img, video { max-width: 100%; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
[hidden] { display: none !important; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.label { font: 500 12px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.lead { font-size: 18px; max-width: 62ch; color: var(--dim); margin: 0; }
.lead b { color: var(--fg); font-weight: 500; }

/* Stage bar */
.bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--void) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; align-items: center; gap: 18px; padding-block: 10px; overflow-x: auto; }
.bar .mark { font: 800 14px var(--display); letter-spacing: .04em; text-decoration: none; white-space: nowrap; }
.bar nav { display: flex; gap: 4px; }
.bar nav a { font: 12px var(--mono); text-decoration: none; color: var(--dim); padding: 6px 10px; border-radius: 99px; white-space: nowrap; }
.bar nav a[aria-current="page"] { color: var(--fg); background: var(--raise); }
.bar nav a.later { opacity: .45; pointer-events: none; }

.band { padding-block: 56px; border-top: 1px solid var(--line); }
.band h2 { font: 300 clamp(26px, 3.4vw, 40px)/1.15 var(--display); margin-bottom: 12px; }

.hero { position: relative; height: min(70vh, 560px); min-height: 360px; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero .over { position: absolute; inset: auto 0 0 0; padding-block: 24px; pointer-events: none; }

.pill { font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.pill.open { color: var(--void); background: var(--agree); border-color: var(--agree); }
.pill.next { color: var(--fg); border-color: var(--violet); }

/* Like button */
.like { display: inline-flex; align-items: center; gap: 6px; font: 13px var(--mono); color: var(--dim); background: var(--raise); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; cursor: pointer; }
.like { justify-content: center; line-height: 1; min-width: 44px; min-height: 32px; }
.like .n:empty { display: none; }
.like::before { content: "♡"; font-size: 15px; line-height: 1; }

/* + / − vote pair */
/* The +/− pill (#34): one small size everywhere, frosted glass over the media, quiet until hover or focus.
   The chosen side is pressed in (inner shadow), not coloured. */
.vote { display: inline-flex; align-items: center; z-index: 2; padding: 2px; border-radius: 99px; flex: none;
  background: rgb(14 14 22 / .38); border: 1px solid rgb(255 255 255 / .22); box-shadow: inset 0 1px 0 rgb(255 255 255 / .12);
  backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3); opacity: .7; transition: opacity .2s; }
.vote:hover, .vote:focus-within { opacity: 1; }
@media (hover: none) { .vote { opacity: 1; } } /* phones have no hover, so keep it readable */
.vote button { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 99px; background: none; color: rgb(255 255 255 / .8); font: 500 14px/1 var(--mono); text-shadow: 0 1px 2px rgb(0 0 0 / .5); cursor: pointer; }
.vote button:hover { color: #fff; }
.vote button:focus-visible { outline-offset: 0; } /* the site's violet ring shows on light and dark media */
.vote button[aria-pressed="true"] { color: #fff; background: rgb(0 0 0 / .4); box-shadow: inset 0 1px 3px rgb(0 0 0 / .7), inset 0 -1px 0 rgb(255 255 255 / .28); }
.vote button:disabled { cursor: default; opacity: .5; }
.vote .n { font: 11px var(--mono); color: rgb(255 255 255 / .85); min-width: 2ch; padding-inline: 2px; text-align: center; }
.vote .n:empty { display: none; }
/* Vote feedback (voteFx in votes.js): .fx covers the card's media box. + blooms light out from the vote corner, − cools and sinks. */
.fx { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; border-radius: inherit; animation: fxGlow .8s ease-out forwards; }
.fx.up { background: radial-gradient(circle at calc(100% - 48px) calc(100% - 28px), rgb(255 255 255 / .95), rgb(255 255 255 / .45) 25%, transparent 75%); mix-blend-mode: screen; }
.fx.up::before, .fx.up::after { content: ""; position: absolute; right: 48px; bottom: 28px; width: 220%; aspect-ratio: 1; translate: 50% 50%; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 28px 6px rgb(255 255 255 / .6), inset 0 0 28px 6px rgb(255 255 255 / .6); transform: scale(0); animation: fxRing .75s cubic-bezier(.2, .7, .3, 1) forwards; }
.fx.up::after { width: 120%; animation-delay: .12s; }
.fx.down { background: radial-gradient(circle, rgb(8 8 20 / .35) 20%, rgb(8 8 20 / .9)), linear-gradient(to top, color-mix(in srgb, var(--disagree) 50%, transparent), transparent 70%); }
.fx-up > :first-child { animation: fxLift .8s ease-out; }
.fx-down > :first-child { animation: fxSink .8s ease-in-out; }
@keyframes fxGlow { 0% { opacity: 0; } 12%, 45% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fxRing { 0% { transform: scale(0); opacity: 1; } 55% { opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
@keyframes fxLift { 25% { filter: brightness(1.7) saturate(1.5); } }
@keyframes fxSink { 40% { filter: grayscale(1) brightness(.45); transform: scale(.92); } }
@media (prefers-reduced-motion: reduce) {
  .fx { animation-duration: .4s; }
  .fx.up::before, .fx.up::after { display: none; }
  .fx-up > :first-child, .fx-down > :first-child { animation: none; }
}

/* Sketch tools, inline references, link peek */
.sketch .expand { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 99px; border: 1px solid rgb(255 255 255 / .25); background: rgb(0 0 0 / .35); color: #fff; font-size: 16px; cursor: pointer; }
.sketch canvas { touch-action: none; cursor: crosshair; }
.refs .ref { margin: 0; width: min(240px, 100%); display: grid; gap: 4px; }
.refs .ref figcaption { font: 11px var(--mono); color: var(--dim); }
.peek { position: fixed; z-index: 60; width: 320px; display: grid; gap: 4px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 12px 40px rgb(0 0 0 / .5); opacity: 0; pointer-events: none; transition: opacity .15s; }
.peek.show { opacity: 1; }
.peek img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 3px; background: var(--raise); }
.peek span { font: 11px var(--mono); color: var(--dim); }

/* Tap-to-focus layer: one item big in the middle, tap outside to go back. */
.zoomable { cursor: zoom-in; }
dialog.layer { border: 0; padding: 0; background: transparent; color: var(--fg); max-width: 94vw; max-height: 94vh; overflow: visible; }
dialog.layer::backdrop { background: rgb(4 4 10 / .84); backdrop-filter: blur(6px); }
dialog.layer .body { display: grid; gap: 10px; justify-items: center; }
dialog.layer img, dialog.layer video { max-width: min(94vw, 1400px); max-height: 84vh; width: auto; height: auto; display: block; border-radius: 4px; object-fit: contain; background: #000; }
dialog.layer .bigsketch { width: min(94vw, 1200px, calc(84vh * 4 / 3)); aspect-ratio: 4/3; border-radius: 4px; overflow: hidden; }
dialog.layer .bigsketch canvas { width: 100%; height: 100%; display: block; touch-action: none; }
dialog.layer .cap { font: 12px var(--mono); color: var(--dim); text-align: center; max-width: 70ch; }
dialog.layer .x { position: fixed; top: 14px; right: 14px; font: 20px var(--mono); width: 44px; height: 44px; border-radius: 99px; border: 1px solid var(--line); background: var(--raise); color: var(--fg); cursor: pointer; }
.like[aria-pressed="true"] { color: var(--void); background: var(--fg); border-color: var(--fg); }
.like[aria-pressed="true"]::before { content: "♥"; color: #e0457b; }
.like:disabled { cursor: default; opacity: .5; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { font: 12px var(--mono); color: var(--dim); background: none; border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; cursor: pointer; }
.chips button[aria-pressed="true"] { color: var(--fg); border-color: var(--violet); background: var(--raise); }

/* Inspiration drop: form and the shared-item cards. */
.drop { display: grid; gap: 12px; max-width: 640px; margin-top: 20px; }
.drop label { display: grid; gap: 6px; font: 12px var(--mono); color: var(--dim); }
.drop input, .drop textarea { font: 15px var(--body); color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; }
.drop input:focus, .drop textarea:focus { outline: 2px solid var(--violet); outline-offset: 1px; }
.drop .or { font: 11px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .12em; }
.drop button[type="submit"] { justify-self: start; font: 500 15px var(--body); padding: 11px 22px; border-radius: 99px; border: 1px solid var(--violet); background: var(--raise); color: var(--fg); cursor: pointer; }
.drop button[disabled] { opacity: .5; cursor: default; }
.linkcard { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); text-decoration: none; color: var(--fg); }
.linkcard b { font: 500 15px/1.35 var(--body); overflow-wrap: anywhere; }
.linkcard audio { width: 100%; }
button.yt { position: relative; padding: 0; border: 0; background: #000; cursor: pointer; display: block; width: 100%; }
button.yt img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; border-radius: 3px; }
button.yt span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; color: #fff; text-shadow: 0 2px 12px #000; }
.ytframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 3px; display: block; }

.note { border: 1px dashed var(--line); border-radius: 4px; padding: 14px 16px; color: var(--dim); font-size: 14px; max-width: 70ch; }
.note b { color: var(--fg); font-weight: 500; }

#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; transition: .25s; background: var(--fg); color: var(--void); font-size: 14px; padding: 10px 16px; border-radius: 6px; z-index: 50; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

footer { padding-block: 40px 64px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }
footer .me { margin: 10px 0 0; }
footer .me a { color: var(--dim); }
footer .me button { font: inherit; color: var(--dim); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
