/* Structural styles shared by v2-v4. Colours come from each
   variant's custom properties: --bg, --text, --muted, --accent,
   --accent-ink, --surface, --line, --radius. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
main { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.is-hidden { display: none !important; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }

/* ── Modal ─────────────────────────────────────────────── */
.modal {
  width: min(860px, calc(100vw - 24px)); max-height: calc(100svh - 40px);
  padding: 0; border: 0; border-radius: var(--radius, 24px);
  background: var(--surface); color: var(--text);
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
}
.modal[open] { animation: modalIn .45s cubic-bezier(.2,.8,.2,1); }
.modal::backdrop { background: rgba(20, 16, 30, 0.45); backdrop-filter: blur(6px); }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface); color: var(--text); font-size: 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.modal__close:hover { background: var(--accent); color: var(--accent-ink); }
.modal__media { aspect-ratio: 16 / 9; background: #111; }
.modal__media img { width: 100%; height: 100%; object-fit: cover; }
.modal__media.is-contain img { object-fit: contain; background: #fff; padding: 8%; }
.modal__media iframe { width: 100%; height: 100%; border: 0; display: block; }
.modal__body { padding: 26px clamp(20px, 4vw, 40px) 36px; }
.modal__meta { margin: 0 0 6px; color: var(--muted); font-size: .85rem; font-weight: 700; }
.modal__title { margin: 0 0 14px; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.1; }
.modal__text { color: var(--muted); margin-top: 20px; line-height: 1.7; }
.modal__text p { margin: 0 0 1em; }
.modal__text .credits { font-size: .85rem; opacity: .8; }

.yt { position: relative; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; background: #000; }
.yt img { width: 100%; height: 100%; object-fit: cover; }
.yt__btn {
  position: absolute; inset: 0; margin: auto; width: 74px; height: 74px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); transition: transform .3s;
}
.yt:hover .yt__btn { transform: scale(1.1); }

/* ── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 72px; z-index: 200; transform: translate(-50%, 30px); opacity: 0;
  padding: 12px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 700; font-size: .9rem;
  transition: transform .4s, opacity .4s; pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
