/* The BNI Education Library: a dark, holographic archive in BNI red. */

.library {
  --void: #0B0B0F;
  --deck: #15151B;
  --deck-2: #1C1C24;
  --glass: rgba(255, 255, 255, .04);
  --edge: rgba(255, 255, 255, .10);
  --text: #F2F2F4;
  --text-2: #B4B4BE;
  --text-3: #7A7A86;
  --glow: rgba(207, 32, 48, .55);
  --mono: "JetBrains Mono", Consolas, monospace;

  background: var(--void);
  color: var(--text);
  min-height: 100vh;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top nav: one bright glass button, centred ---------- */
.lib-topnav {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.glass-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 26px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .01em;
  text-decoration: none;
  background:
    radial-gradient(120% 140% at 50% -20%, rgba(255, 255, 255, .7), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .42), rgba(255, 120, 132, .22));
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -8px 16px -8px rgba(207, 32, 48, .45),
    0 0 24px rgba(255, 255, 255, .35),
    0 12px 34px -8px rgba(207, 32, 48, .85),
    0 0 0 6px rgba(255, 255, 255, .08);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  transition: transform .2s var(--ease), background .2s, box-shadow .2s;
}
.glass-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.glass-btn:hover {
  transform: translateY(-1px);
  background:
    radial-gradient(120% 140% at 50% -20%, rgba(255, 255, 255, .85), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 120, 132, .3));
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 34px rgba(255, 255, 255, .5),
    0 16px 44px -8px rgba(207, 32, 48, .95),
    0 0 0 6px rgba(255, 255, 255, .12);
}
.glass-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- Hero: the curved reel ---------- */
.lib-hero {
  position: relative;
  height: min(88vh, 860px);
  min-height: 560px;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 56%, rgba(207, 32, 48, .22), transparent 70%),
    linear-gradient(var(--void), #120A0D 60%, var(--void));
  border-bottom: 1px solid var(--edge);
}
.lib-hero::after {
  /* perspective floor grid under the reel */
  content: "";
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: 0;
  height: 34%;
  background:
    repeating-linear-gradient(90deg, rgba(207, 32, 48, .28) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg, rgba(207, 32, 48, .22) 0 1px, transparent 1px 40px);
  transform: perspective(400px) rotateX(62deg);
  transform-origin: bottom;
  mask-image: linear-gradient(transparent, #000 70%);
  -webkit-mask-image: linear-gradient(transparent, #000 70%);
  pointer-events: none;
}

.tg-band { position: absolute; inset: 0; pointer-events: none; transition: opacity .5s; z-index: 1; }
.tg-tile { position: absolute; transform-style: preserve-3d; }
.tg-strip { position: absolute; top: 0; overflow: hidden; background: var(--deck-2); }
.tg-strip.tg-first { border-radius: 10px 0 0 10px; }
.tg-strip.tg-last { border-radius: 0 10px 10px 0; }
.tg-strip img { position: absolute; top: 0; max-width: none; object-fit: cover; }

.lib-hero-copy,
.lib-hero-foot {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 0 16px;
}
.lib-hero-copy { top: max(84px, 9%); gap: 10px; }
.lib-hero-foot { bottom: 6%; gap: 18px; }

.lib-logo { width: 120px; height: auto; filter: drop-shadow(0 0 18px var(--glow)); }
.lib-kicker {
  font: 500 12px var(--mono);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: #FF6B76;
}
.lib-hero h1 {
  font: italic 900 clamp(34px, 5.6vw, 72px)/1 var(--font-display);
  letter-spacing: -.02em;
  background: linear-gradient(180deg, #fff 30%, #D6D6DE);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(207, 32, 48, .25);
}
.lib-tagline { width: min(440px, 86vw); height: auto; opacity: .92; }
.lib-enter {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--bni-red);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .15) inset, 0 12px 40px -10px var(--glow);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.lib-enter:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset, 0 16px 50px -8px var(--glow); }

/* ---------- Catalog ---------- */
.lib-main { max-width: 1240px; margin: 0 auto; padding: 84px 24px 80px; }

.lib-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 36px;
}
.lib-intro p { font-size: 19px; line-height: 1.6; color: var(--text-2); max-width: 60ch; }
.lib-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.lib-stats div { padding: 14px 16px; border: 1px solid var(--edge); border-radius: 14px; background: var(--glass); }
.lib-stats dt { font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.lib-stats dd { margin: 4px 0 0; font: italic 900 34px/1 var(--font-display); color: var(--text); }
.lib-stats div:first-child dd { color: #FF4655; }

.lib-toolbar {
  position: sticky;
  top: 64px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  background: linear-gradient(var(--void) 75%, transparent);
}
.lib-search {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--deck);
  transition: border-color .2s, box-shadow .2s;
}
.lib-search:focus-within { border-color: var(--bni-red); box-shadow: 0 0 0 4px rgba(207, 32, 48, .2); }
.lib-search svg { width: 18px; height: 18px; fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; }
.lib-search input {
  flex: 1;
  min-width: 0;
  padding: 13px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
}
.lib-search input::placeholder { color: var(--text-3); }

.lib-shelves { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 16px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: rgba(255, 255, 255, .3); color: var(--text); }
.chip.is-on { background: var(--bni-red); border-color: var(--bni-red); color: #fff; }

.lib-count { margin: 6px 0 18px; font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.lib-empty { padding: 40px; text-align: center; color: var(--text-2); border: 1px dashed var(--edge); border-radius: 18px; }

.lib-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}
.vol[hidden] { display: none; }

.vol {
  position: relative;
  border-radius: 20px;
  animation: rise .6s var(--ease) both;
}
.vol:nth-child(2) { animation-delay: .06s; }
.vol:nth-child(3) { animation-delay: .12s; }
.vol:nth-child(4) { animation-delay: .18s; }
.vol:nth-child(5) { animation-delay: .24s; }
.vol:nth-child(n+6) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.vol-code {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font: 500 11px var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Live volume */
.vol-live {
  grid-column: span 2;
  background: linear-gradient(var(--deck), var(--deck)) padding-box,
              linear-gradient(135deg, var(--bni-red), rgba(255, 255, 255, .12) 45%, var(--bni-red)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 30px 80px -40px var(--glow);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.vol-live:hover { transform: translateY(-4px); box-shadow: 0 40px 90px -36px var(--glow); }
.vol-link { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); height: 100%; color: inherit; text-decoration: none; }
.vol-cover { position: relative; align-self: center; aspect-ratio: 16 / 9; margin: 10px; border-radius: 14px; overflow: hidden; background: var(--deck-2); }
.vol-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.vol-live:hover .vol-cover img { transform: scale(1.04); }
.vol-status {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bni-red);
  color: #fff;
  font: 500 11px var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.vol-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #fff;
  vertical-align: middle;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .2; } }

.vol-body { display: grid; align-content: start; gap: 10px; padding: 24px 26px 26px 14px; }
.vol-body h2 { font: italic 900 30px/1.05 var(--font-display); }
.vol-author { color: #FF6B76; font-weight: 600; }
.vol-summary { color: var(--text-2); font-size: 15px; }
.vol-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.vol-meta span { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--edge); font-size: 12px; color: var(--text-2); }
.vol-cta { margin-top: 6px; font-weight: 700; color: #fff; }
.vol-cta span { display: inline-block; transition: transform .2s; }
.vol-live:hover .vol-cta span { transform: translateX(5px); }

/* Open slots: holographic outlines waiting for content */
.vol-slot,
.vol-add {
  min-height: 260px;
  border: 1px dashed rgba(255, 255, 255, .16);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 12px),
    var(--glass);
  overflow: hidden;
}
.vol-slot::after {
  /* slow scan line */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 40%;
  top: -40%;
  background: linear-gradient(transparent, rgba(207, 32, 48, .12), transparent);
  animation: scan 5s linear infinite;
  pointer-events: none;
}
.vol-slot:nth-child(odd)::after { animation-delay: -2.5s; }
@keyframes scan { to { top: 100%; } }

.vol-slot-inner { position: relative; display: grid; gap: 12px; padding: 22px; height: 100%; align-content: start; }
.vol-slot h2,
.vol-add h2 { font: italic 800 22px var(--font-display); color: var(--text-2); }
.vol-slot p:not(.vol-code) { color: var(--text-3); font-size: 14px; }
.slot-mark { display: grid; place-items: center; height: 92px; margin: 6px 0; border-radius: 12px; border: 1px solid var(--edge); }
.slot-mark img { width: 84px; height: auto; opacity: .18; }

.vol-add { border-color: rgba(207, 32, 48, .5); }
.vol-add h2 { color: #FF6B76; }
.add-steps { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--text-2); font-size: 14px; }
.add-steps code { font: 500 12px var(--mono); color: var(--text); background: rgba(255, 255, 255, .06); padding: 1px 5px; border-radius: 4px; word-break: break-all; }

/* ---------- Footer (same red band as the roadmap) ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 32px;
  padding: 20px 28px;
  background: #CF2030;
  color: rgba(255, 255, 255, .88);
  font-size: 13px;
}
.footer-brand { display: flex; align-items: center; gap: 20px; }
.footer-logo { height: 30px; width: auto; }
.footer-tagline { height: 16px; width: auto; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .lib-intro { grid-template-columns: 1fr; }
  .vol-live { grid-column: 1 / -1; }
  .vol-link { grid-template-columns: 1fr; }
  .vol-cover { aspect-ratio: 16 / 9; }
  .vol-body { padding: 8px 22px 24px; }
}

@media (max-width: 560px) {
  .lib-hero { height: 78vh; min-height: 520px; }
  .lib-logo { width: 90px; }
  .lib-main { padding: 36px 16px 60px; }
  .lib-intro p { font-size: 17px; }
  .lib-stats dd { font-size: 26px; }
  .lib-grid { grid-template-columns: 1fr; }
  .lib-toolbar { position: static; padding-top: 0; }
  .lib-shelves { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .chip { flex: none; }
  .footer { padding: 16px; }
  .footer-brand { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-tagline { height: auto; width: 100%; max-width: 300px; }
}
