/* Halls of Greatness — shared "extremely modern" dark-gallery styling.
   One look across Quotes, Books, Devices and Foods. */

:root {
  --bg: #07090f;
  --bg2: #0c1018;
  --ink: #f4f6fb;
  --muted: #9aa6bd;
  --line: rgba(255, 255, 255, 0.10);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.07);
  --c1: #22d3ee;
  --c2: #818cf8;
  --c3: #e879f9;
  --gold: #fbbf24;
  --grad: linear-gradient(120deg, var(--c1), var(--c2) 52%, var(--c3));
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8), 0 8px 24px -12px rgba(99, 102, 241, 0.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(34, 211, 238, 0.10), transparent 60%),
    radial-gradient(55% 45% at 90% 5%, rgba(232, 121, 249, 0.10), transparent 60%),
    radial-gradient(70% 60% at 50% 110%, rgba(129, 140, 248, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  padding: 0 0 5rem;
}
::selection { background: rgba(129, 140, 248, 0.35); }
a { color: inherit; text-decoration: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 0 6px; position: sticky; top: 0; z-index: 30;
}
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--bg) 40%, transparent);
  pointer-events: none;
}
.backlink {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line);
  color: var(--muted); font-weight: 600; font-size: 0.9rem;
  backdrop-filter: blur(12px); transition: all 0.25s var(--ease);
}
.backlink:hover { color: var(--ink); border-color: var(--c2); transform: translateX(-2px); }
.hall-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.hall-switch a {
  padding: 9px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  color: var(--muted); border: 1px solid transparent; transition: all 0.25s var(--ease);
}
.hall-switch a:hover { color: var(--ink); background: var(--glass); }
.hall-switch a.on { color: var(--ink); background: var(--glass-2); border-color: var(--line); }

/* Hero */
.hero { padding: clamp(28px, 7vw, 68px) 0 clamp(20px, 4vw, 34px); text-align: center; }
.hero .kicker {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted);
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass);
  margin-bottom: 18px;
}
.hero h1 {
  margin: 0; font-weight: 800; letter-spacing: -0.04em; line-height: 1.02;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  background: linear-gradient(110deg, var(--c1), var(--c2) 38%, var(--c3) 60%, var(--c2) 80%, var(--c1));
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 11s ease-in-out infinite;
}
@keyframes shine { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.hero p { margin: 14px auto 0; max-width: 640px; color: var(--muted); font-size: clamp(1rem, 2.5vw, 1.18rem); }

/* Toolbar: search + chips + sort */
.toolbar { display: flex; flex-direction: column; gap: 14px; margin: 8px 0 26px; }
.searchrow { display: flex; gap: 10px; flex-wrap: wrap; }
.search {
  flex: 1 1 260px; position: relative; display: flex; align-items: center;
}
.search svg { position: absolute; left: 16px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; padding: 15px 16px 15px 46px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--line); color: var(--ink);
  font: inherit; font-size: 1rem; outline: none; transition: all 0.25s var(--ease);
  backdrop-filter: blur(12px);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--c2); background: var(--glass-2); box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.14); }
.sortsel {
  padding: 15px 42px 15px 16px; border-radius: 16px; font: inherit; font-size: 0.95rem; font-weight: 600;
  background: var(--glass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%239aa6bd' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center;
  border: 1px solid var(--line); color: var(--ink); appearance: none; outline: none; cursor: pointer;
  backdrop-filter: blur(12px);
}
.sortsel:focus { border-color: var(--c2); }
/* the native dropdown list was white-on-white; make its options readable */
.sortsel option { background: #161a26; color: #f4f6fb; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip {
  padding: 9px 16px; border-radius: 999px; font-size: 0.86rem; font-weight: 600; cursor: pointer;
  color: var(--muted); background: var(--glass); border: 1px solid var(--line);
  transition: all 0.22s var(--ease); white-space: nowrap;
}
.chip:hover { color: var(--ink); transform: translateY(-1px); }
.chip.on { color: #0a0d14; background: var(--grad); border-color: transparent; box-shadow: 0 6px 18px -6px rgba(129, 140, 248, 0.6); }
.chip.fav.on { background: linear-gradient(120deg, var(--gold), #f59e0b); box-shadow: 0 6px 18px -6px rgba(251, 191, 36, 0.6); }
.count { color: var(--muted); font-size: 0.85rem; margin-left: auto; }

/* Card grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.gcard {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  background: var(--glass); border: 1px solid var(--line);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  animation: rise 0.6s var(--ease) backwards;
  /* It is a <button>: buttons don't inherit the page font or colour. */
  font: inherit; color: var(--ink); text-align: left; padding: 0; width: 100%; display: block;
}
.gcard:hover { transform: translateY(-6px); border-color: rgba(255,255,255,0.22); box-shadow: var(--shadow); }
.gcard:focus-visible { outline: 2px solid var(--c2); outline-offset: 2px; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.poster {
  aspect-ratio: 16 / 10; display: grid; place-items: center; position: relative;
  font-size: 3.4rem; overflow: hidden;
}
.poster::before { content: ""; position: absolute; inset: 0; opacity: 0.9; }
.poster::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% -20%, rgba(255,255,255,0.22), transparent 60%); }
.poster .ptype, .hero-poster .ptype { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; padding: 18px; text-align: center; }
.pt-title { font-weight: 800; font-size: clamp(1rem, 2.4vw, 1.4rem); line-height: 1.12; letter-spacing: -0.01em;
  color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,0.45); }
.posters-portrait .pt-title { font-size: clamp(1.1rem, 3vw, 1.55rem); }
.pt-sub { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.82); text-shadow: 0 1px 8px rgba(0,0,0,0.4); }
.gcard:hover .ptype { transform: scale(1.05); transition: transform 0.5s var(--ease); }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.fav-star {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 0.95rem;
  background: linear-gradient(120deg, var(--gold), #f59e0b); color: #1a1205;
  box-shadow: 0 6px 16px -6px rgba(251, 191, 36, 0.8);
}
.gbody { padding: 16px 16px 18px; }
.gcat { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c1); }
.gtitle { margin: 6px 0 4px; font-size: 1.1rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; color: var(--ink); }
.gby { color: var(--muted); font-size: 0.86rem; }
.gwatched { color: var(--c1); font-size: 0.8rem; font-weight: 600; margin-top: 6px; }
.gtags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.gtags span { font-size: 0.7rem; color: var(--muted); padding: 4px 9px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 1.05rem; }

/* Detail modal */
.modal {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 40px); background: rgba(4, 6, 11, 0.72); backdrop-filter: blur(10px);
}
.modal.open { display: flex; animation: fade 0.3s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: min(680px, 100%); max-height: 90vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--bg2), var(--bg)); border: 1px solid var(--line);
  border-radius: 28px; box-shadow: var(--shadow); animation: pop 0.4s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(0.97); } }
.sheet .hero-poster {
  height: clamp(160px, 34vw, 260px); display: grid; place-items: center; font-size: clamp(4rem, 14vw, 7rem);
  position: relative; border-radius: 28px 28px 0 0; overflow: hidden;
}
.sheet .hero-poster span { filter: drop-shadow(0 10px 24px rgba(0,0,0,0.5)); }
.sheet .hero-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.mclose {
  position: absolute; top: 18px; right: 18px; z-index: 5; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(8, 10, 16, 0.6); color: var(--ink); font-size: 1.3rem;
  cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(8px); transition: all 0.2s var(--ease);
}
.mclose:hover { background: rgba(232, 121, 249, 0.3); transform: rotate(90deg); }
.mbody { padding: clamp(20px, 4vw, 32px); }
.mbody .gcat { font-size: 0.78rem; }
.mbody h2 { margin: 8px 0 6px; font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.mbody .mby { color: var(--muted); font-size: 1rem; font-weight: 600; }
.mbody .mfav {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 7px 14px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; color: #1a1205; background: linear-gradient(120deg, var(--gold), #f59e0b);
}
.mresume { margin: 18px 0 0; color: #d7deec; font-size: 1.04rem; line-height: 1.65; }
.mtags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.mtags span { font-size: 0.78rem; color: var(--muted); padding: 6px 12px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); }
.mlabel { margin: 26px 0 12px; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.linkbtn {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 15px;
  background: var(--glass); border: 1px solid var(--line); font-weight: 600; font-size: 0.92rem;
  transition: all 0.25s var(--ease);
}
.linkbtn:hover { border-color: var(--c2); background: var(--glass-2); transform: translateY(-2px); }
.linkbtn .ico { font-size: 1.15rem; }
.linkbtn .arr { margin-left: auto; color: var(--muted); }

/* Footer */
.hall-foot { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 54px; }
.hall-foot a { color: var(--c2); }

@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .poster { font-size: 2.6rem; }
  .gtitle { font-size: 0.98rem; }
  .hall-switch { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.08s !important; }
}

/* ── Quotes: the moving wall ─────────────────────────────────────────────── */
/* overflow:hidden here (not on the row) clips the long track horizontally, which
   frees each row to let a hovered card pop up and out without being cut off. */
.wall { position: relative; margin: 10px 0 8px; padding: 22px 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.qrow { display: flex; overflow: visible; padding: 13px 0; }
.qtrack { display: flex; gap: 20px; flex: none; will-change: transform; animation: drift var(--dur, 60s) linear infinite; }
.qrow.rev .qtrack { animation-direction: reverse; }
/* The row never freezes on hover: the cards you aren't pointing at keep
   circulating underneath the lifted one, and slide back into line when you
   move the cursor away. */
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.qcard { flex: none; width: clamp(260px, 72vw, 360px); padding: 24px 24px 20px; border-radius: 22px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(12px);
  position: relative; cursor: pointer;
  transition: transform .45s var(--ease), border-color .45s var(--ease), box-shadow .45s var(--ease), opacity .45s var(--ease), filter .45s var(--ease), background .45s var(--ease); }
/* The hovered quote is lifted out as a FROZEN clone (quotes.js) that stays put
   while the real row keeps scrolling underneath it. */
.qfrozen { z-index: 60; cursor: pointer; backdrop-filter: none;
  background: rgba(15, 19, 30, 0.97) !important; border-color: rgba(255, 255, 255, 0.30) !important;
  box-shadow: 0 34px 80px -22px rgba(0, 0, 0, 0.9), 0 0 48px -10px rgba(129, 140, 248, 0.55);
  transform: scale(1); transform-origin: center;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), left 0.55s cubic-bezier(0.33, 0, 0.2, 1), top 0.55s cubic-bezier(0.33, 0, 0.2, 1); }
.qfrozen.in { transform: scale(1.06); }
.qcard .mark { font-family: Georgia, "Times New Roman", serif; font-size: 3.4rem; line-height: 0.6; color: transparent;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; opacity: 0.85; }
.qcard .qtext { margin: 6px 0 16px; font-size: 1.12rem; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em; }
.qcard .qwho { font-weight: 800; font-size: 0.98rem; }
.qcard .qfrom { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.qcard .qemoji { position: absolute; top: 18px; right: 20px; font-size: 1.5rem; opacity: 0.9; }
.qcard .qcat { position: absolute; bottom: 18px; right: 20px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--c1); }
.toast { position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px); z-index: 200;
  padding: 13px 22px; border-radius: 999px; background: var(--grad); color: #0a0d14; font-weight: 700; font-size: 0.92rem;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all 0.3s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Portrait posters (books, movies) ─────────────────────────────────────── */
.posters-portrait .poster { aspect-ratio: 2 / 3; }

/* ── Detail facts (movies: director/cast/watched) ─────────────────────────── */
.mfacts { margin-top: 18px; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.mfact { display: flex; justify-content: space-between; gap: 18px; padding: 11px 15px; font-size: 0.93rem; border-bottom: 1px solid var(--line); }
.mfact:last-child { border-bottom: 0; }
.mfact .k { color: var(--muted); font-weight: 600; white-space: nowrap; }
.mfact .v { text-align: right; color: var(--ink); }

/* ── View toggle (foods: cards ↔ nutrition labels) ────────────────────────── */
.viewrow { display: flex; gap: 8px; flex-wrap: wrap; }
.viewbtn { padding: 10px 16px; border-radius: 999px; font-size: 0.86rem; font-weight: 700; color: var(--muted); background: var(--glass); border: 1px solid var(--line); transition: all .25s var(--ease); }
.viewbtn:hover { color: var(--ink); }
.viewbtn.on { color: #0a0d14; background: var(--grad); border-color: transparent; box-shadow: 0 6px 18px -6px rgba(129,140,248,.6); }
.toolbar.nl-mode .chip { display: none; }

/* ── Nutrition labels (FDA-style, light card on the dark page) ─────────────── */
.nlgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.nlabel { background: #fff; color: #111; border: 2px solid #111; border-radius: 8px; padding: 12px 15px 14px;
  font-family: "Helvetica Neue", Arial, sans-serif; animation: rise .5s var(--ease) backwards; }
.nl-name { font-weight: 800; font-size: 1.02rem; margin-bottom: 4px; color: #111; }
.nl-hd { font-weight: 900; font-size: 1.75rem; letter-spacing: -0.03em; line-height: 1; border-bottom: 1px solid #111; padding-bottom: 3px; }
.nl-serv { font-size: 0.8rem; font-weight: 700; padding: 4px 0; }
.nl-rule { background: #111; margin: 2px 0; } .nl-rule.lg { height: 11px; } .nl-rule.md { height: 5px; }
.nl-cal { display: flex; justify-content: space-between; align-items: baseline; font-weight: 900; }
.nl-cal span:first-child { font-size: 1.15rem; } .nl-cal span:last-child { font-size: 2rem; }
.nl-row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.86rem; border-bottom: 1px solid #c8c8c8; padding: 3px 0; }
.nl-row.b { font-weight: 800; }
.nl-ben { font-size: 0.82rem; margin-top: 9px; line-height: 1.45; color: #1a1a1a; }
.nl-note { font-size: 0.68rem; color: #666; margin-top: 7px; font-style: italic; }
.mbody .nlabel { margin-top: 10px; max-width: 320px; }

/* Score meter (TMDB), shown top-left of a poster and in the detail view. */
.poster .score, .hero-poster .score { position: absolute; top: 12px; left: 12px; z-index: 3; padding: 3px 9px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 800; color: #fff; box-shadow: 0 4px 12px -4px rgba(0,0,0,.6); }
.hero-poster .score { top: 16px; left: 16px; font-size: 0.95rem; padding: 4px 11px; }
.score.sg, .mscore.sg { background: #16a34a; } .score.sm, .mscore.sm { background: #d97706; } .score.sb, .mscore.sb { background: #dc2626; }
.mscore { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px; font-size: 0.82rem; font-weight: 800; color: #fff; vertical-align: middle; }
.chip.twist.on { color: #fff; background: linear-gradient(120deg, #a855f7, #6366f1); border-color: transparent; box-shadow: 0 6px 18px -6px rgba(168,85,247,.6); }
