/* ===========================================================
   The Shelf — Young Authors Club book showcase
   Direction: The Zine. Single committed visual world, no dark
   mode — this is the brand, not a themeable app surface.
   =========================================================== */

:root{
  --bg:#fdf6e6;
  --bg-soft:#fbeed4;
  --ink:#1c1a16;
  --muted:#6b6353;
  --card:#fffdf6;
  --line:#1c1a16;

  --pink:#e64a83;
  --blue:#2f8fd1;
  --yellow:#f2b705;
  --green:#3fa66b;

  --radius-lg:20px;
  --radius-md:14px;
  --radius-sm:8px;
  --shelf-max:1180px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *{ animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; }
}

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:"Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing:antialiased;
}

h1,h2,h3{
  font-family:"Fredoka", -apple-system, sans-serif;
  font-weight:700;
  margin:0;
  text-wrap:balance;
}
p{ margin:0; line-height:1.55; }
a{ color:inherit; }
img,svg{ max-width:100%; display:block; }

.wrap{ max-width:var(--shelf-max); margin:0 auto; padding:0 24px; }

/* ---------- nav ---------- */
.nav{
  position:sticky; top:0; z-index:60;
  background:rgba(253,246,230,0.9);
  backdrop-filter:blur(10px);
  border-bottom:3px solid var(--line);
}
.nav .inner{
  display:flex; align-items:center; gap:16px;
  padding:14px 24px; max-width:var(--shelf-max); margin:0 auto;
}
.nav .brand{
  display:flex; align-items:center; gap:8px;
  font-family:"Fredoka", sans-serif; font-weight:700; font-size:1.15rem;
  text-decoration:none; white-space:nowrap;
}
.nav .brand .dot{
  width:26px; height:26px; border-radius:50%;
  background:var(--pink); border:2.5px solid var(--line);
  display:inline-block;
}
.nav .search{
  flex:1; max-width:360px; position:relative;
}
.nav .search input{
  width:100%; font-family:"Nunito", sans-serif; font-size:0.92rem;
  padding:9px 14px 9px 34px; border-radius:999px;
  border:2.5px solid var(--line); background:var(--card); color:var(--ink);
  outline:none;
}
.nav .search input::placeholder{ color:var(--muted); }
.nav .search input:focus-visible{ box-shadow:0 0 0 3px var(--yellow); }
.nav .search svg{
  position:absolute; left:11px; top:50%; transform:translateY(-50%);
  width:15px; height:15px; opacity:0.6;
}
.nav .cta{
  margin-left:auto; white-space:nowrap;
  font-family:"Fredoka", sans-serif; font-weight:600; font-size:0.86rem;
  padding:9px 16px; border-radius:999px;
  background:var(--blue); color:#fff; border:2.5px solid var(--line);
  text-decoration:none;
}
.nav .cta:hover{ transform:translateY(-1px); }
.nav .cta:focus-visible{ outline:3px solid var(--yellow); outline-offset:2px; }

@media (max-width:640px){
  .nav .brand span.word{ display:none; }
  .nav .search{ max-width:none; }
}

/* ---------- hero ---------- */
.hero{
  position:relative; overflow:hidden;
  border-bottom:3px solid var(--line);
  background:var(--bg-soft);
}
.hero .art{
  position:absolute; inset:0;
  background-image:url("/assets/hero.svg");
  background-repeat:no-repeat;
  background-position:right -40px bottom -20px;
  background-size:min(920px, 72%) auto;
  opacity:0.98;
}
.hero .inner{
  position:relative; max-width:var(--shelf-max); margin:0 auto;
  padding:76px 24px 96px;
}
.hero .kicker{
  display:inline-block; font-family:"Fredoka", sans-serif; font-weight:600;
  font-size:0.8rem; letter-spacing:0.02em; color:#fff; background:var(--pink);
  padding:6px 14px; border-radius:999px; border:2.5px solid var(--line);
  transform:rotate(-2deg);
}
.hero h1{
  margin-top:18px; font-size:clamp(2.6rem, 7vw, 4.4rem); line-height:0.98;
  max-width:12ch; letter-spacing:-0.01em;
}
.hero p.sub{
  margin-top:16px; max-width:38ch; font-size:1.08rem; color:var(--muted);
}
.hero .actions{ margin-top:28px; display:flex; gap:14px; flex-wrap:wrap; }
.btn{
  font-family:"Fredoka", sans-serif; font-weight:600; font-size:0.92rem;
  padding:12px 24px; border-radius:14px; border:3px solid var(--line);
  text-decoration:none; display:inline-block; transition:transform 0.15s ease;
}
.btn:hover{ transform:translateY(-2px) rotate(-0.5deg); }
.btn:focus-visible{ outline:3px solid var(--yellow); outline-offset:2px; }
.btn-primary{ background:var(--blue); color:#fff; box-shadow:4px 4px 0 var(--line); }
.btn-ghost{ background:var(--card); color:var(--ink); box-shadow:4px 4px 0 var(--line); }

@media (max-width:820px){
  .hero .art{ position:static; height:220px; margin-top:28px;
    background-position:center bottom; background-size:contain; }
  .hero .inner{ padding-bottom:0; }
}

/* ---------- section frame ---------- */
.section{ padding:64px 0; }
.section-head{ margin-bottom:32px; }
.section-head .eyebrow{
  font-family:"Fredoka", sans-serif; font-weight:600; font-size:0.78rem;
  text-transform:uppercase; letter-spacing:0.08em; color:var(--pink);
}
.section-head h2{ margin-top:8px; font-size:clamp(1.7rem, 4vw, 2.3rem); }
.section-head p{ margin-top:10px; max-width:56ch; color:var(--muted); }

/* ---------- shelf grid ---------- */
.grid{
  display:grid; gap:34px 26px;
  grid-template-columns:repeat(auto-fill, minmax(190px, 1fr));
}
.card{
  background:var(--card); border:3px solid var(--line); border-radius:var(--radius-md);
  padding:14px; display:flex; flex-direction:column; gap:10px;
  box-shadow:6px 6px 0 var(--line); cursor:pointer;
  transition:transform 0.15s ease, box-shadow 0.15s ease;
}
.card:nth-child(3n+1){ transform:rotate(-1.4deg); }
.card:nth-child(3n+2){ transform:rotate(1.1deg); }
.card:nth-child(3n){ transform:rotate(-0.5deg); }
.card:hover, .card:focus-visible{
  transform:rotate(0deg) translateY(-4px);
  box-shadow:8px 8px 0 var(--line);
}
.card:focus-visible{ outline:3px solid var(--yellow); outline-offset:2px; }

.card .cover{
  aspect-ratio:2/3; border-radius:var(--radius-sm); border:2.5px solid var(--line);
  display:flex; align-items:flex-end; padding:12px; overflow:hidden; position:relative;
}
.card .cover img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.card .cover span{
  position:relative; font-family:"Fredoka", sans-serif; font-weight:700;
  color:#fff; font-size:1rem; line-height:1.12; text-shadow:0 2px 4px rgba(0,0,0,0.35);
}
.card .badges{ display:flex; gap:6px; flex-wrap:wrap; }
.badge{
  font-family:"Fredoka", sans-serif; font-size:0.62rem; font-weight:600;
  text-transform:uppercase; letter-spacing:0.02em;
  padding:3px 9px; border-radius:999px; border:2px solid var(--line); background:var(--yellow);
}
.badge.status-in-progress{ background:#ffe3ac; }
.badge.status-coming-soon{ background:#fff; }
.badge.status-published{ background:var(--green); color:#fff; }
.card .title{ font-family:"Fredoka", sans-serif; font-weight:700; font-size:1.02rem; line-height:1.2; }
.card .author{ font-size:0.82rem; color:var(--pink); font-weight:700; }
.card .blurb{
  font-size:0.8rem; color:var(--muted); line-height:1.42;
  overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
}

/* ---------- empty state ---------- */
.empty-state{
  grid-column:1/-1; border:3px dashed var(--line); border-radius:var(--radius-lg);
  padding:52px 28px; text-align:center; background:var(--card);
}
.empty-state h3{ font-size:1.4rem; }
.empty-state p{ margin-top:10px; color:var(--muted); max-width:44ch; margin-left:auto; margin-right:auto; }
.empty-state .btn{ margin-top:20px; }

/* ---------- search-empty ---------- */
.no-results{ grid-column:1/-1; text-align:center; color:var(--muted); padding:40px 0; }

/* ---------- about / submit split ---------- */
.split{ display:grid; gap:40px; grid-template-columns:1fr 1fr; align-items:start; }
@media (max-width:760px){ .split{ grid-template-columns:1fr; } }
.panel{
  background:var(--card); border:3px solid var(--line); border-radius:var(--radius-lg);
  padding:28px; box-shadow:6px 6px 0 var(--line);
}
.panel h3{ font-size:1.3rem; }
.panel p{ margin-top:12px; color:var(--muted); }
.panel ol{ margin:14px 0 0; padding-left:20px; color:var(--muted); }
.panel ol li{ margin-bottom:8px; }
.panel .btn{ margin-top:18px; }

/* ---------- footer ---------- */
footer{
  border-top:3px solid var(--line); padding:36px 0 48px; background:var(--bg-soft);
}
footer .foot-grid{ display:flex; justify-content:space-between; gap:20px; flex-wrap:wrap; }
footer p{ color:var(--muted); font-size:0.86rem; max-width:52ch; }
footer .promise{
  font-weight:700; color:var(--ink);
}
footer a.footlink{ text-decoration:underline; }

/* ---------- modal ---------- */
.modal-overlay{
  position:fixed; inset:0; background:rgba(28,26,22,0.55);
  display:none; align-items:center; justify-content:center; padding:20px; z-index:100;
}
.modal-overlay.open{ display:flex; }
.modal{
  background:var(--card); border:3px solid var(--line); border-radius:var(--radius-lg);
  max-width:560px; width:100%; max-height:88vh; overflow-y:auto;
  box-shadow:8px 8px 0 var(--line); padding:28px; position:relative;
}
.modal .close{
  position:absolute; top:14px; right:14px; width:34px; height:34px; border-radius:50%;
  border:2.5px solid var(--line); background:var(--yellow); font-family:"Fredoka",sans-serif;
  font-weight:700; cursor:pointer; font-size:1rem; line-height:1;
}
.modal .close:focus-visible{ outline:3px solid var(--blue); }
.modal-body{ display:flex; gap:20px; flex-wrap:wrap; }
.modal-cover{
  width:150px; aspect-ratio:2/3; border-radius:var(--radius-sm); border:2.5px solid var(--line);
  flex-shrink:0; display:flex; align-items:flex-end; padding:12px; overflow:hidden; position:relative;
}
.modal-cover img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.modal-cover span{ position:relative; color:#fff; font-family:"Fredoka",sans-serif; font-weight:700; text-shadow:0 2px 4px rgba(0,0,0,0.35); }
.modal-info{ flex:1; min-width:200px; }
.modal-info .title{ font-family:"Fredoka",sans-serif; font-size:1.3rem; font-weight:700; }
.modal-info .author{ color:var(--pink); font-weight:700; margin-top:4px; }
.modal-info .badges{ margin-top:10px; }
.modal-info .blurb{ margin-top:14px; }
.modal-info .why{
  margin-top:14px; font-style:italic; color:var(--muted); padding-left:12px;
  border-left:3px solid var(--yellow);
}
.modal-info .meta-row{ margin-top:14px; font-size:0.82rem; color:var(--muted); }
.modal-info .btn{ margin-top:18px; }

/* ---------- scroll reveal ---------- */
.reveal{ opacity:0; transform:translateY(16px); transition:opacity 0.5s ease, transform 0.5s ease; }
.reveal.in{ opacity:1; transform:translateY(0); }
