/* Wordmark clip fix:
   Cause: .nav uses border-radius + backdrop-filter, which in WebKit/Safari
   clips descendants even when overflow:visible. The blur/fill/stroke stay on
   .nav::before so the 64px nav box itself does not clip. Keep overflow:visible
   on the header, footer, nav, logo, and img.wm.
   v23 wordmark (hangtag + SOLD BY FANS) uses viewBox -10 -10 612 114 (~4px of
   padding at 48px height) plus overflow=visible. Sizes stay 42px on the phone
   nav, 48px on desktop, 58px in the footer. Light pages use ink letters; dark
   pages use cream letters. Do not put backdrop-filter back on .nav. */
.site-header, .site-footer, .nav, .nav-logo, .foot-brand { overflow: visible; }

.nav {
  position: relative;
  isolation: isolate;
  overflow: visible;
  height: 64px;
  min-height: 64px;
  padding-top: 0;
  padding-bottom: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: transparent;
  border-color: transparent;
}
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  border: 1px solid var(--line-dark);
  background: #1c1c1cd9;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
}
.top-light .nav {
  background: transparent;
  border-color: transparent;
}
.top-light .nav::before {
  border-color: var(--line);
  background: #ffffffe6;
}

.nav-logo, .foot-brand {
  display: flex;
  align-items: center;
  line-height: normal;
  padding: 0;
  overflow: visible;
}
.nav > * { position: relative; z-index: 1; }
.nav-logo { flex: 0 0 auto; }
.foot-brand { flex-direction: column; align-items: flex-start; }

img.wm {
  display: block !important;
  flex: 0 0 auto;
  height: 48px !important;
  width: auto !important;
  max-width: none !important;
  overflow: visible;
}
.foot-brand img.wm { height: 58px !important; width: auto !important; }

@media (width <= 1000px) {
  img.wm { height: 42px !important; }
  .foot-brand img.wm { height: 58px !important; }
}

/* Library tiles: a tidy capped 3x2 of small 9:16 thumbs.
   The previous 9:16 change used the full mock column width, so each tile
   was as tall as (column width * 16/9). Combined with grid min-content
   from the 1080px intrinsic images (Safari) and overflow:hidden on .win,
   the first still filled most of the window with a dark empty panel
   beside it. Cap the grid, force 3 columns (2 on narrow phones), and
   take images out of flow so they cannot inflate a column. All 6 tiles
   stay visible; pills and the pause overlay are unchanged. */
.w-lib,
.w-lib[data-astro-cid-rcyrgvg2] {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  justify-self: start;
  width: 100%;
  max-width: 420px; /* ~132px columns → ~235px tall; 2 rows stay compact */
  min-width: 0;
}
@media (width <= 520px) {
  .w-lib,
  .w-lib[data-astro-cid-rcyrgvg2] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 280px;
  }
}
.w-thumb,
.w-thumb[data-astro-cid-rcyrgvg2] {
  aspect-ratio: 9 / 16;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  border-radius: 12px;
}
.w-thumb img,
.w-thumb[data-astro-cid-rcyrgvg2] img {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center;
  border-radius: 12px;
  display: block;
}
.w-thumb span,
.w-thumb[data-astro-cid-rcyrgvg2] span { z-index: 1; }
.win:has(.w-lib) .win-body {
  max-height: none;
  overflow: visible;
}

.nav-links .nav-login {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0.8;
  cursor: pointer;
}
.nav-links .nav-login:hover { opacity: 1; color: var(--amber); }
.top-light .nav-links .nav-login:hover { color: var(--black); }
.nav-panel .nav-login {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-dark);
  padding: 14px 12px;
  color: inherit;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}
.top-light .nav-panel .nav-login { border-bottom-color: var(--line); }
.nav-login:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--amber); border-radius: 8px; }

.login-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--black, #121212);
}
.login-dialog::backdrop { background: rgba(18, 18, 18, 0.48); }
.login-card {
  position: relative;
  background: #fff;
  color: #121212;
  border-radius: 24px;
  padding: 28px 24px 24px;
  font-family: var(--font, "Jost", system-ui, sans-serif);
  letter-spacing: 0.01em;
  box-shadow: 0 24px 60px rgba(18, 18, 18, 0.18);
}
.login-x {
  position: absolute;
  top: 16px;
  right: 16px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #e3e1dc;
  background: #fff;
  color: #121212;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}
.login-kicker {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #6b6b6b;
}
.login-card h2 {
  margin: 0 48px 16px 0;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.login-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 0 0 16px;
  background: #eceae4;
  border-radius: 999px;
}
.login-switch button {
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #121212;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
}
.login-switch button[aria-selected="true"] { background: #111; color: #fff; }
.login-switch button:focus-visible,
.login-x:focus-visible,
.login-card input:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 6px #111; }
.login-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff8ec;
  border-top: 3px solid #ffb74a;
  font-size: 14px;
  font-weight: 600;
}
.login-card form { display: grid; gap: 12px; }
.login-card label { display: grid; gap: 8px; font-size: 14px; font-weight: 700; }
.login-card input {
  width: 100%;
  height: 52px;
  box-sizing: border-box;
  border: 1.5px solid #e3e1dc;
  border-radius: 14px;
  padding: 0 16px;
  background: #fff;
  color: #121212;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.login-card .btn { width: 100%; }
@media (prefers-reduced-motion: reduce) {
  .login-dialog, .login-switch button { transition: none; }
}

/* Sign up tab (preview v21) */
.signup-opts { display: grid; gap: 12px; margin: 0 0 12px; }
.signup-opt {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1.5px solid #e3e1dc;
  border-radius: 16px;
  background: #fff;
  color: #121212;
  text-decoration: none;
}
.signup-opt strong { font-size: 18px; font-weight: 800; letter-spacing: 0.01em; }
.signup-opt span { font-size: 14px; line-height: 1.35; color: #5b5b5b; font-weight: 500; }
.signup-opt:hover, .signup-opt:focus-visible { border-color: #111; outline: none; box-shadow: 0 0 0 3px #ffb74a; }
.signup-foot { margin: 0; font-size: 12px; color: #6b6b6b; }
.login-card [hidden] { display: none !important; }
.login-switch { margin-right: 0; }
.login-card { padding-top: 64px; }
.login-x { top: 14px; }

.forgot-row { margin: 14px 0 0; text-align: center; }
.forgot-link { color: #121212; font-size: 14px; font-weight: 700; letter-spacing: 0.01em; text-decoration: underline; text-underline-offset: 3px; }
.forgot-link:hover, .forgot-link:focus-visible { color: #8a5a00; outline: none; }
.forgot-link:focus-visible { box-shadow: 0 0 0 3px #ffb74a; border-radius: 6px; }
