/* /assets/styles.css */
/* ==========================
   Base
   ========================== */

:root{
  --neb-border: #ddd;
  --neb-muted: #666;

  /* Hover motion values */
  --neb-hover-lift: -18%;
  --neb-hover-scale: 1.12;
  --neb-hover-tilt-odd: -1deg;
  --neb-hover-tilt-even: 1deg;
  --neb-glow-scale: 1.08;
}

*{ box-sizing: border-box; }

body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #111;
  background: #fff;
}

a{ color: #3b2dbf; }
a:hover{ text-decoration: underline; }

code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
}

/* ==========================
   Neb UI helpers
   ========================== */

.neb-card{
  padding: 14px;
  border: 1px solid var(--neb-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.neb-h2{
  margin: 0 0 10px 0;
  font-size: 1.25rem;
}

.neb-h3{
  margin: 0;
  font-size: 1.1rem;
}

.neb-muted{ color: var(--neb-muted); }

.neb-form{ margin-top: 10px; }

.neb-grid-2{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 720px){
  .neb-grid-2{ grid-template-columns: 1fr; }
}

.neb-label{
  display: block;
  font-weight: 650;
  margin-bottom: 6px;
}

.neb-input,
.neb-select{
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--neb-border);
  border-radius: 8px;
  background: #fff;
}

.neb-btn{
  padding: 8px 12px;
  border: 1px solid #222;
  border-radius: 10px;
  background: #111;
  color: #fff;
  cursor: pointer;
}
.neb-btn:hover{ filter: brightness(1.05); }

.neb-btn-outline{
  background: #fff;
  color: #111;
  border: 1px solid #222;
}

.neb-btn-warn{
  background: #fff7f2;
  color: #7a2f00;
  border: 1px solid #ffcfb3;
}

.neb-btn-danger{
  background: #fff;
  color: #b00020;
  border: 1px solid #f2b6bf;
}

.neb-link{
  text-decoration: none;
  font-weight: 650;
}

.neb-pill{
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e6e6e6;
  background: #fafafa;
  font-size: 0.9em;
}
.neb-pill-soft{
  background: #f6f6ff;
  border-color: #e6e6ff;
}

.neb-note{
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
  line-height: 1.5;
}

.neb-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================
   Try this today
   ========================== */

.neb-try-card{
  border-color: #e7e7ff;
  background: #fbfbff;
}

.neb-try-list{
  display: grid;
  gap: 10px;
}

.neb-try-item{
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.neb-try-check{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.neb-try-text{
  font-weight: 650;
  line-height: 1.3;
}

.neb-try-from{
  margin-top: 4px;
  font-size: 0.9em;
  color: #666;
}

.neb-try-done .neb-try-text{
  text-decoration: line-through;
  color: #777;
}
.neb-try-done .neb-try-from{
  color: #888;
}
.neb-try-done .neb-try-check{
  border-color: #cfcfff;
  background: #f4f4ff;
}

.neb-try-suggest{
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.neb-try-replace{
  border: 1px solid #efeaff;
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
}

/* ==========================
   Nebly bookshelf
   ========================== */

.neb-shelf-stage{
  position: relative;
  margin-top: 16px;
  padding-bottom: 28px;
  overflow: visible;
}

/* Books grid */
.neb-books{
  width: 100%;
  margin: 18px auto 0;

  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;

  padding: 0 6px;
  z-index: 3;
  position: relative;
  pointer-events: all;

  /* Makes hovered z-index behave reliably */
  isolation: isolate;
}

@media (max-width: 1100px){
  .neb-books{ grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 900px){
  .neb-books{ grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 650px){
  .neb-books{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 430px){
  .neb-books{ grid-template-columns: repeat(2, 1fr); }
}

/* Shelf graphic under the grid */
.neb-bookshelf{
  position: relative;
  height: 120px;
  margin-top: -42px;
  pointer-events: none;
  z-index: 1;
}

/* shelf lip */
.neb-bookshelf::before{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 42px;
  height: 16px;
  background: #f3f3f3;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  box-sizing: border-box;
  z-index: 2;
}

/* shelf front + shadow */
.neb-bookshelf::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 58px;
  height: 90px;
  box-sizing: border-box;

  background:
    linear-gradient(90deg, #fafafa 0%, #ffffff 100%) 0 0 / 100% 26px no-repeat,
    linear-gradient(180deg, #f3f3f3 0%, rgba(255,255,255,0) 100%) 0 26px / 100% 64px no-repeat;

  clip-path: polygon(0% 0%, 100% 0%, 97% 100%, 3% 100%);
  box-shadow:
    0 -1px 6px rgba(0,0,0,0.05),
    0 4px 16px rgba(0,0,0,0.25);

  z-index: 1;
}

/* ==========================
   Book tile (new structure)
   ========================== */

.neb-book{
  width: 100%;
  aspect-ratio: 115 / 180;
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  outline: none;

  z-index: 0;
}
.neb-book:hover{ z-index: 50; }

/* The element that moves (cover + badge + text all together) */
.neb-book-inner{
  position: absolute;
  inset: 0;
  border-radius: 3px 0.5px 0.5px 3px;

  transform-origin: 50% 85%;
  will-change: transform;
  transition: transform 520ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* cover image/gradient */
  background: var(--bg-image);
  box-shadow: 0 1px 1px rgba(0,0,0,0.25),
              inset 2px 0 2px 1px rgba(29,27,27,0.20);
}

/* Glow layer under the moving cover */
.neb-book-glow{
  position: absolute;
  inset: 0;
  border-radius: 3px 0.5px 0.5px 3px;

  background: var(--bg-image);
  filter: blur(10px);
  opacity: 1;

  transform-origin: 50% 85%;
  will-change: transform, opacity;
  transition: transform 520ms cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 300ms ease-out;

  z-index: 0;
}

.neb-book-inner{ z-index: 2; }

/* Hover motion */
.neb-book:hover .neb-book-inner{
  transform: translateY(var(--neb-hover-lift)) scale(var(--neb-hover-scale)) rotate(var(--neb-hover-tilt-odd));
}
.neb-book:hover .neb-book-glow{
  transform: translateY(var(--neb-hover-lift)) scale(var(--neb-glow-scale)) rotate(var(--neb-hover-tilt-odd));
  opacity: 0.95;
}

.neb-book:nth-of-type(even):hover .neb-book-inner{
  transform: translateY(var(--neb-hover-lift)) scale(var(--neb-hover-scale)) rotate(var(--neb-hover-tilt-even));
}
.neb-book:nth-of-type(even):hover .neb-book-glow{
  transform: translateY(var(--neb-hover-lift)) scale(var(--neb-glow-scale)) rotate(var(--neb-hover-tilt-even));
}

/* Badge and label (no transforms here now - they ride the inner element) */
.neb-book-badge{
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78em;
  background: rgba(255,255,255,0.9);
  color: #111;
  border: 1px solid rgba(0,0,0,0.06);
}

.neb-book-label{
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.55);
  line-height: 1.15;
}

.neb-book-title{
  display: block;
  font-weight: 800;
  font-size: 0.92em;
}

.neb-book-author{
  display: block;
  margin-top: 4px;
  font-size: 0.85em;
  opacity: 0.92;
}

/* Detail panels */
.neb-book-panel{
  display: none;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.neb-book-panel:target{ display: block; }
