/* Skin Museum — dense skin wall + detail modal, layered on the shared editorial styles.css */

.mono-inline { font-family: var(--mono); font-size: .92em; color: var(--text); }

/* Library controls ------------------------------------------------ */
.library { max-width: 1480px; margin: 0 auto; padding: 40px 60px 80px; }
.lib-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-bottom: 28px; position: sticky; top: 60px; z-index: 50;
  padding: 14px 0; background: var(--bg); }
.lib-search {
  flex: 1 1 280px; min-width: 220px; height: 44px; padding: 0 16px;
  font-family: var(--mono); font-size: .9rem; color: var(--text);
  background: var(--bg-alt); border: 1px solid var(--rule); border-radius: var(--radius); }
.lib-search:focus { outline: none; border-color: var(--dim); }
#shuffle { font-family: var(--mono); font-size: .74rem; letter-spacing: .04em;
  text-transform: uppercase; padding: 0 18px; height: 44px; cursor: pointer;
  background: var(--bg-alt); color: var(--dim);
  border: 1px solid var(--rule); border-radius: 100px; transition: .15s; }
#shuffle:hover { color: var(--text); border-color: var(--dim); }
#shuffle:active { background: var(--black); color: var(--bg); border-color: var(--black); }
.lib-count { font-family: var(--mono); font-size: .74rem; color: var(--dim);
  margin-left: auto; white-space: nowrap; }

/* Skin wall ------------------------------------------------------- */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.card {
  position: relative; cursor: pointer; border: 1px solid var(--rule);
  border-radius: var(--radius); overflow: hidden; background: var(--bg-alt);
  aspect-ratio: 275 / 348; transition: border-color .15s, transform .15s, box-shadow .15s; }
.card:hover { border-color: var(--dim); transform: translateY(-3px);
  box-shadow: var(--shadow-lg); z-index: 2; }
.card img { width: 100%; height: 100%; object-fit: cover; object-position: top center;
  display: block; image-rendering: pixelated; background: #111; }
/* name strip slides up on hover */
.card-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-family: var(--mono); font-size: .62rem; line-height: 1.3;
  letter-spacing: .02em; color: #fff;
  padding: 16px 8px 7px; background: linear-gradient(transparent, rgba(0,0,0,.86));
  transform: translateY(100%); transition: transform .18s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card:hover .card-name { transform: translateY(0); }

.grid-sentinel { height: 1px; }
.grid-end { text-align: center; font-family: var(--mono); font-size: .72rem;
  color: var(--faint); letter-spacing: .04em; padding: 50px 0 10px; }

/* Modal ----------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 500; display: flex;
  align-items: center; justify-content: center; padding: 30px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px); }
.modal-card { position: relative; z-index: 1; width: min(680px, 96vw);
  max-height: 92vh; overflow-y: auto; background: var(--bg-alt);
  border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); }
.modal-close { position: absolute; top: 10px; right: 14px; z-index: 3;
  font-size: 1.8rem; line-height: 1; color: #fff; background: rgba(0,0,0,.4);
  width: 34px; height: 34px; border-radius: 50%;
  border: none; cursor: pointer; }
.modal-close:hover { background: rgba(0,0,0,.7); }
.modal-body { padding: 0; }
.detail-stage { background: repeating-conic-gradient(#1a1a1a 0% 25%, #222 0% 50%) 50% / 22px 22px;
  display: flex; align-items: center; justify-content: center; padding: 34px 24px; }
.detail-stage img { width: 275px; max-width: 100%; height: auto;
  image-rendering: pixelated; box-shadow: 0 14px 34px rgba(0,0,0,.55); }
.detail-meta { padding: 22px 26px 28px; }
.detail-title { font-size: 1.3rem; font-weight: 700; line-height: 1.2;
  word-break: break-word; }
.detail-sub { font-family: var(--mono); font-size: .72rem; color: var(--dim);
  margin-top: 8px; letter-spacing: .03em; text-transform: uppercase; }
.detail-links { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.detail-links a, .detail-links button {
  font-family: var(--mono); font-size: .7rem; text-transform: uppercase;
  letter-spacing: .04em; padding: 9px 15px; border: 1px solid var(--rule);
  border-radius: 100px; color: var(--text); background: var(--bg); cursor: pointer; }
.detail-links a:hover, .detail-links button:hover { background: var(--black); color: var(--bg); border-color: var(--black); }

.site-foot { display: flex; justify-content: space-between; align-items: center;
  padding: 30px 60px; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: .72rem; color: var(--dim); }
.site-foot .sep { color: var(--faint); }
.foot-dim { color: var(--faint); }

@media (max-width: 640px) {
  .library { padding: 30px 14px 60px; }
  .lib-controls { top: 60px; gap: 10px; }
  .lib-search { min-width: 0; flex-basis: 140px; }   /* shrink so search + shuffle share one row */
  .lib-count { width: 100%; margin-left: 0; order: 3; }
  .grid { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); }
  .site-foot { padding: 24px 18px; flex-direction: column; gap: 8px; align-items: flex-start; }
  /* modal: hug the screen, bigger tap targets */
  .modal { padding: 10px; }
  .modal-card { max-height: 94vh; }
  .modal-close { width: 40px; height: 40px; top: 8px; right: 10px; }
  .detail-stage { padding: 22px 14px; }
  .detail-meta { padding: 18px 18px 24px; }
  .detail-links a, .detail-links button { padding: 12px 15px; }
}
/* tiny phones: one comfortable column of skins */
@media (max-width: 360px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ============================================================
   MOBILE OFF-CANVAS DRAWER
   Follows the 5 rules in MOBILE-DRAWER-MENU-GUIDE.md:
   body-level placement, inert backdrop (pointer-events:none until open),
   transform (not display) toggle, in-drawer close button, z-index pair.
   Editorial skin instead of the brutalist example styling.
   ============================================================ */
.nav-drawer-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 9998;
  opacity: 0; pointer-events: none;            /* <- without this it eats every tap */
  transition: opacity .25s ease;
}
.nav-drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.nav-drawer {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: var(--bg); border-bottom: 1px solid var(--rule);
  box-shadow: var(--shadow-lg); padding: 12px 20px 22px;
  max-height: 100vh; max-height: 100dvh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(-100%); pointer-events: none;   /* parked off-screen */
  transition: transform .3s cubic-bezier(.2,.7,.3,1);
}
.nav-drawer.open { transform: translateY(0); pointer-events: auto; }

.nav-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px; border-bottom: 1px solid var(--rule); margin-bottom: 6px;
}
.nav-drawer-brand { font-family: var(--mono); font-size: 14px; font-weight: 500;
  letter-spacing: 3px; color: var(--black); }
.nav-drawer-brand .sep { color: var(--faint); font-weight: 300; }
.nav-drawer-close {
  width: 44px; height: 44px; flex-shrink: 0; background: none; color: var(--dim);
  border: 1px solid var(--rule); border-radius: var(--radius);
  font-size: 22px; line-height: 1; cursor: pointer; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center; transition: .15s; }
.nav-drawer-close:hover { color: var(--black); border-color: var(--dim); }

.nav-drawer-links a {
  display: flex; align-items: center; min-height: 48px;
  font-family: var(--sans); font-size: 18px; font-weight: 500; color: var(--text);
  padding: 14px 4px; border-bottom: 1px solid var(--rule); text-decoration: none; }
.nav-drawer-links a:active { color: var(--black); }

body.nav-open { overflow: hidden; }

/* Match the burger breakpoint in styles.css (burger appears at 1100px) */
@media (max-width: 1100px) {
  .nav-drawer { display: block; }
  .nav-drawer-backdrop { display: block; }
}

/* ============================================================
   ABOUT PAGE — animated editorial long-read
   ============================================================ */
.ab-hero { max-width: 1100px; margin: 0 auto; padding: 80px 60px 30px; }
.ab-hero h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.02;
  letter-spacing: -0.02em; font-weight: 700; max-width: 17ch; }
.ab-hero .lede { font-size: clamp(1.05rem, 1.6vw, 1.35rem); color: var(--dim);
  max-width: 60ch; margin-top: 22px; line-height: 1.55; }
[data-theme="dark"] .ab-hero .lede { color: #aaa; }
.ab-kicker { font-family: var(--mono); font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim); margin: 64px 0 14px;
  display: flex; align-items: center; gap: 10px; }

/* animated equalizer bars (matches the favicon) */
.eq { display: inline-flex; gap: 3px; height: 16px; align-items: flex-end; }
.eq i { width: 3px; height: 5px; background: var(--success); display: block;
  animation: eq 1.1s ease-in-out infinite; }
.eq i:nth-child(1){ animation-delay: -.9s; }
.eq i:nth-child(2){ animation-delay: -.5s; }
.eq i:nth-child(3){ animation-delay: -.2s; }
.eq i:nth-child(4){ animation-delay: -.7s; }
.eq i:nth-child(5){ animation-delay: -.35s; }
@keyframes eq { 0%,100%{ height: 4px; } 50%{ height: 16px; } }
@media (prefers-reduced-motion: reduce){ .eq i { animation: none; height: 10px; } }

/* full-bleed scrolling skin marquee */
.ab-marquee { margin: 36px 0 10px; overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ab-track { display: flex; gap: 16px; width: max-content;
  animation: ab-scroll 82s linear infinite; }
.ab-track.rev { animation-direction: reverse; animation-duration: 98s; margin-top: 16px; }
.ab-marquee:hover .ab-track { animation-play-state: paused; }
.ab-track img { height: 168px; width: auto; object-fit: contain; border-radius: 3px;
  image-rendering: pixelated; border: 1px solid var(--rule); background: #111;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.35)); }
@keyframes ab-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce){ .ab-track { animation: none; } }

/* body long-read */
.ab-body { max-width: 760px; margin: 0 auto; padding: 30px 60px 40px; }
.ab-body p { font-size: 1.06rem; line-height: 1.72; margin-bottom: 18px; color: var(--text); }
[data-theme="dark"] .ab-body p { color: #c8c8c8; }
.ab-body p.big { font-size: clamp(1.3rem, 2.4vw, 1.7rem); line-height: 1.45;
  font-weight: 500; color: var(--text); margin: 6px 0 30px; }
.ab-body strong { font-weight: 600; color: var(--text); }
.ab-body em { font-style: italic; }
.ab-body a { color: var(--text); border-bottom: 1px solid var(--muted); }
.ab-body a:hover { border-color: var(--text); }

/* era blocks with oversized year */
.ab-era { display: grid; grid-template-columns: 170px 1fr; gap: 28px;
  padding: 38px 0; border-top: 1px solid var(--rule); align-items: start; }
.ab-era .yr { font-family: var(--mono); font-weight: 500; font-size: 2.4rem;
  line-height: 1; color: var(--text); letter-spacing: -0.02em; position: sticky; top: 80px; }
.ab-era .yr small { display: block; font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim); margin-top: 8px; font-weight: 400; }
.ab-era h3 { font-size: 1.5rem; font-weight: 700; line-height: 1.2; margin-bottom: 12px; }
.ab-era p { font-size: 1.02rem; line-height: 1.68; color: var(--text); margin-bottom: 14px; }
[data-theme="dark"] .ab-era p { color: #c0c0c0; }
@media (max-width: 680px){ .ab-era { grid-template-columns: 1fr; gap: 10px; }
  .ab-era .yr { position: static; font-size: 1.8rem; } }

/* pull quote */
.ab-quote { margin: 14px 0 8px; padding: 6px 0 6px 26px; border-left: 3px solid var(--text); }
.ab-quote p { font-size: clamp(1.25rem, 2.6vw, 1.75rem); line-height: 1.35;
  font-weight: 500; font-style: italic; color: var(--text); }
.ab-quote cite { display: block; font-family: var(--mono); font-style: normal;
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); margin-top: 14px; }

/* stat band */
.ab-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin: 30px 0; padding: 30px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.ab-stats .s .v { font-family: var(--mono); font-size: 2.3rem; font-weight: 500;
  line-height: 1; letter-spacing: -0.02em; }
.ab-stats .s .l { font-size: .86rem; color: var(--dim); margin-top: 10px; line-height: 1.4; }
@media (max-width: 680px){ .ab-stats { grid-template-columns: 1fr; gap: 18px; text-align: left; } }

/* closing CTA + sources */
.ab-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 10px; }
.ab-cta a { font-family: var(--mono); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .05em; padding: 12px 20px; border: 1px solid var(--text); border-radius: 100px; color: var(--text); }
.ab-cta a.primary { background: var(--black); color: var(--bg); }
.ab-cta a:hover { background: var(--text); color: var(--bg); }
.ab-sources { font-family: var(--mono); font-size: .68rem; line-height: 1.9;
  color: var(--faint); margin-top: 30px; }
.ab-sources a { color: var(--dim); border-bottom: 1px dotted var(--muted); }

/* scroll-reveal */
.reveal { opacity: 0; transform: translateY(26px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){ .reveal { opacity: 1; transform: none; transition: none; } }

@media (max-width: 640px){
  .ab-hero { padding: 44px 18px 18px; }
  .ab-hero h1 { font-size: clamp(1.85rem, 7.4vw, 2.6rem); max-width: 100%; }
  .ab-kicker { flex-wrap: wrap; margin: 48px 0 12px; }
  .ab-body { padding: 24px 18px 40px; }
  .ab-marquee { margin: 26px 0 6px; }
  .ab-track img { height: 124px; }
  .ab-quote { padding-left: 18px; }
  .ab-cta a { flex: 1 1 100%; text-align: center; padding: 14px 18px; }
}
