:root{
  --bg: #fbfbfa;
  --fg: #121212;
  --muted: #6a6a6a;
  --card: #ffffff;
  --border: rgba(0,0,0,.09);
  --shadow: 0 14px 40px rgba(0,0,0,.06);
  --radius: 18px;
  --radius-sm: 14px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.45;
}

a{ color: inherit; }
img{ max-width:100%; display:block; }

.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251,251,250,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 18px;
}
.brand{
  text-decoration:none;
  font-weight:650;
  letter-spacing:.2px;
}
.nav a{
  text-decoration:none;
  color: var(--muted);
  margin-left: 14px;
}
.nav a:hover, .nav a.active{ color: var(--fg); }

.wrap{
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 18px 70px;
}

h1{ font-size: clamp(26px, 3.4vw, 40px); margin: 0 0 10px; }
h2{ font-size: 20px; margin: 28px 0 12px; }
.lead{ color: var(--muted); max-width: 78ch; margin: 0 0 16px; }

.hero{
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.hero-inner{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 0;
}
@media (max-width: 860px){
  .hero-inner{ grid-template-columns: 1fr; }
}
.hero-media{
  min-height: 320px;
  background: linear-gradient(115deg, rgba(0,0,0,.06), rgba(0,0,0,0));
  position: relative;
}
.hero-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-copy{
  padding: 22px 22px 20px;
}
.kicker{
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.cta-row{ display:flex; gap: 10px; margin-top: 16px; flex-wrap:wrap; }
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  text-decoration:none;
  box-shadow: 0 10px 26px rgba(0,0,0,.05);
}
.btn.primary{
  border-color: rgba(0,0,0,.12);
  background: #111;
  color: #fff;
  box-shadow: 0 18px 40px rgba(0,0,0,.14);
}
.btn:hover{ transform: translateY(-1px); }

.note{
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

/* Shelf */
.shelf{
  margin-top: 14px;
  display:flex;
  gap: 14px;
  overflow-x:auto;
  padding: 12px 6px 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.shelf::-webkit-scrollbar{ height: 10px; }
.shelf::-webkit-scrollbar-thumb{ background: rgba(0,0,0,.12); border-radius: 999px; }

.book{
  flex: 0 0 260px;
  scroll-snap-align: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-decoration:none;
  overflow:hidden;
  transition: transform .15s ease;
}
.book:hover{ transform: translateY(-2px); }

.book-cover{
  height: 150px;
  background:
    radial-gradient(900px 180px at 20% 20%, rgba(0,0,0,.06), transparent 55%),
    linear-gradient(135deg, rgba(0,0,0,.07), rgba(0,0,0,0) 60%),
    #efe7da;
  border-bottom: 1px solid rgba(0,0,0,.06);
  position: relative;
}
.book-cover::after{
  content:"";
  position:absolute;
  inset: 10px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(0,0,0,.12);
  opacity:.55;
}
.book-meta{ padding: 12px 14px 14px; }
.book-title{ font-weight: 700; }
.book-sub{ color: var(--muted); font-size: 13px; margin-top: 4px; }

/* Book page */
.bookhead{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 14px;
  flex-wrap:wrap;
}
.pills{
  display:flex; gap: 8px; align-items:center;
}
.pill{
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 10px;
}

/* Mosaic tuned for landscape spreads */
.mosaic{
  margin-top: 16px;
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
@media (max-width: 520px){
  .mosaic{ grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

.tile{
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  overflow:hidden;
  cursor:pointer;
  padding:0;
  box-shadow: 0 10px 22px rgba(0,0,0,.04);
  position: relative;
}
.tile .ph{
  aspect-ratio: 16 / 9;
  width: 100%;
  background:
    radial-gradient(700px 140px at 10% 10%, rgba(0,0,0,.05), transparent 60%),
    linear-gradient(135deg, rgba(0,0,0,.07), rgba(0,0,0,0) 60%),
    #f3f0ea;
  display:flex;
  align-items:center;
  justify-content:center;
  color: rgba(0,0,0,.35);
  font-size: 12px;
  letter-spacing:.08em;
  text-transform: uppercase;
}
.tile img{
  width:100%;
  aspect-ratio: 16 / 9;
  object-fit: contain; /* do not crop the spread */
  background: #f3f0ea;
}
.tile .cap{
  position:absolute;
  left: 10px;
  bottom: 10px;
  font-size: 12px;
  color: rgba(255,255,255,.86);
  background: rgba(0,0,0,.55);
  padding: 4px 8px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .15s ease, transform .15s ease;
}
.tile:hover .cap{
  opacity: 1;
  transform: translateY(0);
}

/* Lightbox */
.lightbox{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.84);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 999;
}
.lb-fig{
  margin:0;
  max-width: min(1200px, 95vw);
  max-height: 88vh;
}
.lb-img{
  max-width: 100%;
  max-height: 82vh;
  display:block;
  border-radius: 16px;
  background: rgba(255,255,255,.06);
}
.lb-cap{
  color: rgba(255,255,255,.85);
  font-size: 13px;
  margin-top: 10px;
  text-align:center;
}
.lb-close, .lb-prev, .lb-next{
  position: fixed;
  top: 12px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: white;
  font-size: 24px;
  cursor:pointer;
  z-index: 1002;
}
.lb-close{ right: 14px; }
.lb-prev, .lb-next{
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
}
.lb-prev{ left: 12px; }
.lb-next{ right: 12px; }
@media (max-width: 720px){
  .lb-prev, .lb-next{ display:none; }
}

/* --- Vertical albums + horizontal per-album browsing (Netflix-style) --- */

.album{
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.album:first-of-type{
  border-top: 0;
  padding-top: 0;
}

.rowhead{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.rowhead h2{
  margin: 0;
  font-size: 18px;
}

.rowmeta{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items:center;
  color: var(--muted);
  font-size: 13px;
}

.strip{
  display:flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 6px 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  border-radius: 16px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(0,0,0,.06);
}

.strip .tile{
  flex: 0 0 280px;
  scroll-snap-align: start;
  border-radius: 0;
}


@media (max-width: 520px){
  .strip .tile{ flex-basis: 220px; }
}

.strip .tile img, .strip .tile .ph{
  aspect-ratio: 16 / 9;
}


/* Ensure hidden works */
[hidden]{ display:none !important; }

/* --- Minimal library layout (clean, tight, low-ink) --- */
.wrap{ padding-top: 18px; }

.album{
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,.06);
}

.strip{
  background: transparent;
  border: 0;
  padding: 6px 2px 10px;
  border-radius: 0;
  gap: 8px;
}

.strip .tile{
  flex: 0 0 260px;
  box-shadow: none;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
}

.strip .tile:hover img{ transform: none; }
.tile img{ background: #f6f4ef; }

.tile .cap{
  opacity: 0;
}

/* --- No visible scrollbars + square thumbnails (robust) --- */
.strip{
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* IE/Edge legacy */
}
.strip::-webkit-scrollbar{ display: none; } /* Chrome/Safari */

.strip .tile{
  border-radius: 0;
}

.strip .tile img,
.strip .tile .ph{
  border-radius: 0;
}

.tile{
  border-radius: 0;
}

.tile img{
  border-radius: 0;
}

/* --- Ultra-minimal: no rounded corners anywhere + ~1mm spacing --- */

/* Hard rule: remove all rounding (yes, everywhere) */
*, *::before, *::after{ border-radius: 0 !important; }

/* Tight spacing */
.album{
  margin-top: 1mm !important;
  padding-top: 1mm !important;
}

.strip{
  gap: 1mm !important;
  padding: 1mm !important;
}

/* Mosaic (book page) also tight */
.mosaic{
  gap: 1mm !important;
}

/* Reduce tile padding artifacts */
.strip .tile, .mosaic .tile{
  border-width: 1px;
}

/* Remove any remaining card-ish shadows if present on tiles */
.strip .tile{ box-shadow: none !important; }

/* --- Flat mode: no shadows, no cards, no glossy backgrounds --- */

:root{
  --card: transparent !important;
  --shadow: none !important;
}

.hero, .book, .tile{
  box-shadow: none !important;
  background: transparent !important;
}

.hero{
  border: 0 !important;
}

.hero-media{
  background: transparent !important;
}

.topbar{
  backdrop-filter: none !important;
  background: var(--bg) !important;
}

.strip{
  background: transparent !important;
  border: 0 !important;
}

.btn, .pill{
  box-shadow: none !important;
  background: transparent !important;
}

.btn.primary{
  background: transparent !important;
  color: var(--fg) !important;
  border-color: rgba(0,0,0,.14) !important;
}

.book-cover{
  background: transparent !important;
  border: 0 !important;
}

.book-cover::after{
  display:none !important;
}

/* Kill any leftover shadows */
*{ box-shadow: none !important; }
