/* The Shelf (freely.tapinug.com): a quiet storefront where everything is free */
:root {
  --ink: #111111;
  --muted: #6b665e;
  --faint: #9a948a;
  --line: #e9e4da;
  --paper: #ffffff;
  --tile: #f6f3ee;
  --tile2: #efe9de;
  --gold: #f0b84e;
  --gold-deep: #9a6a12;
  --night: #0b1020;
  --radius: 4px;
  --maxw: 1320px;
  --pad: clamp(24px, 5.2vw, 48px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: 'Inter', system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.disp { font-family: 'Fraunces', Georgia, serif; font-weight: 600; letter-spacing: -0.015em; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-deep); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 14px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.top.scrolled { border-bottom-color: var(--line); }
.top-in { display: flex; align-items: center; gap: 30px; height: 76px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--night); display: grid; place-items: center; }
.brand small { font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-left: 2px; }
.nav { display: flex; gap: 26px; font-size: 15px; font-weight: 500; }
.nav a { padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current] { border-bottom-color: var(--ink); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: none; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--tile); }
.menu-btn { display: none; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 15px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; white-space: nowrap; transition: transform 0.15s, background 0.15s; }
.pill:hover { transform: translateY(-1px); background: #2a2a2a; }
.pill.ghost { background: transparent; color: var(--ink); }
.pill.ghost:hover { background: var(--tile); }
.pill.gold { background: var(--gold); border-color: var(--gold); color: #1a1205; }
.pill.gold:hover { background: #f5c566; }
.pill small { font-size: 13px; font-weight: 500; opacity: 0.7; }
.pill.sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
@media (max-width: 860px) {
  .nav { display: none; position: absolute; top: 76px; left: 0; right: 0; background: #fff; flex-direction: column; gap: 0; padding: 8px var(--pad) 18px; border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; font-size: 18px; border-bottom: 1px solid var(--line); }
  .menu-btn { display: grid; }
  .top-right .pill { display: none; }
}

/* ---------- search ---------- */
.search { position: fixed; inset: 0; z-index: 60; background: rgba(255, 255, 255, 0.97); display: none; padding: 90px var(--pad) 40px; overflow: auto; }
.search.open { display: block; }
.search-in { max-width: 760px; margin: 0 auto; }
.search input { width: 100%; font-size: clamp(24px, 4vw, 38px); font-family: 'Fraunces', serif; border: 0; border-bottom: 2px solid var(--ink); padding: 10px 0; background: none; outline: none; }
.search-close { position: absolute; top: 20px; right: 20px; }
.hits { margin-top: 24px; display: grid; gap: 4px; }
.hit { display: grid; grid-template-columns: 54px 1fr; gap: 16px; align-items: center; padding: 10px; border-radius: 12px; }
.hit:hover, .hit:focus-visible { background: var(--tile); }
.hit img { width: 54px; aspect-ratio: 2/3; object-fit: cover; border-radius: 2px; }
.hit b { display: block; font-weight: 600; }
.hit span { color: var(--muted); font-size: 14px; }

/* ---------- the book, standing ---------- */
.tile { position: relative; background: var(--tile); aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius); transition: background 0.3s; }
.tile::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: 11%; height: 6%; background: radial-gradient(closest-side, rgba(40, 28, 10, 0.22), transparent); filter: blur(4px); }
.card:hover .tile { background: var(--tile2); }
.bk { position: relative; width: var(--w, 50%); aspect-ratio: 2 / 3; transform: perspective(1100px) rotateY(-17deg) rotateX(2deg); transform-origin: 50% 55%; transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); filter: drop-shadow(14px 16px 14px rgba(30, 20, 8, 0.32)); z-index: 1; }
.bk img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px 5px 5px 2px; }
.bk::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 6%; border-radius: 2px 0 0 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.02) 60%, rgba(0, 0, 0, 0.25)); z-index: 2; pointer-events: none; }
.bk::after { content: ''; position: absolute; top: 2px; bottom: 2px; right: -7px; width: 7px; background: repeating-linear-gradient(180deg, #f6f1e5 0 2px, #ddd5c4 2px 3px); border-radius: 0 3px 3px 0; transform: skewY(-3deg); }
.card:hover .bk, a:hover > .tile .bk { transform: perspective(1100px) rotateY(-8deg) rotateX(2deg) translateY(-6px); }
.badge { position: absolute; top: 12px; left: 12px; z-index: 3; background: #fff; border-radius: 999px; font-size: 12px; font-weight: 600; padding: 5px 12px; }
.badge.gold { background: var(--gold); color: #1a1205; }

/* ---------- grids and cards ---------- */
.grid { display: grid; gap: 22px 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1060px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; } .bk { --w: 56% !important; } }
.card { display: block; }
.card .kick { margin: 14px 0 3px; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep); }
.card h3 { margin: 0 0 3px; font-size: 16px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.card .sub { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.card .m { color: var(--muted); font-weight: 500; }
.card .meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 8px; font-size: 13px; font-weight: 600; }
.free { background: var(--gold); color: #1a1205; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.sec { padding-block: clamp(44px, 7vw, 96px) 0; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }
.sec-head p { margin: 6px 0 0; color: var(--muted); max-width: 54ch; }
.link { font-weight: 600; border-bottom: 1.5px solid var(--ink); padding-bottom: 1px; white-space: nowrap; }

/* ---------- home hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--night); color: #f6ecd4; border-radius: 0 0 28px 28px; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 70% at 70% 60%, rgba(240, 184, 78, 0.28), transparent 70%), radial-gradient(50% 60% at 10% 0%, rgba(80, 110, 210, 0.22), transparent 70%); }
.hero-in { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 30px; align-items: center; padding-top: clamp(40px, 7vw, 84px); padding-bottom: clamp(36px, 6vw, 70px); }
.hero h1 { margin: 14px 0 18px; font-size: clamp(42px, 6.4vw, 84px); line-height: 0.98; text-wrap: balance; }
.hero h1 em { font-style: italic; color: var(--gold); font-weight: 600; }
.hero .eyebrow { color: var(--gold); }
.hero p.lede { font-size: clamp(17px, 1.7vw, 20px); color: #d6cbb1; max-width: 46ch; margin: 0 0 26px; }
.hero .verse { margin-top: 26px; font-family: 'Newsreader', Georgia, serif; font-style: italic; color: #bfb391; font-size: 17px; }
.hero .verse b { font-family: 'Inter', sans-serif; font-style: normal; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 600; display: block; margin-top: 4px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .pill { background: var(--gold); border-color: var(--gold); color: #1a1205; }
.hero .pill.ghost { background: transparent; border-color: rgba(246, 236, 212, 0.45); color: #f6ecd4; }
.hero .pill.ghost:hover { background: rgba(255, 255, 255, 0.08); }
.shelf { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: clamp(8px, 1.6vw, 22px); padding-bottom: 20px; min-height: 360px; }
.shelf::after { content: ''; position: absolute; left: -4%; right: -4%; bottom: 0; height: 18px; background: linear-gradient(#5a3a1a, #2a1808); border-radius: 3px; box-shadow: 0 -2px 0 rgba(255, 220, 150, 0.25) inset, 0 18px 30px rgba(0, 0, 0, 0.6); }
.shelf .bk { --w: auto; width: clamp(92px, 14vw, 190px); filter: drop-shadow(10px 12px 12px rgba(0, 0, 0, 0.55)); transform: perspective(1100px) rotateY(-14deg); transition: transform 0.4s; }
.shelf a:nth-child(2) .bk { width: clamp(104px, 16vw, 214px); }
.shelf a:hover .bk { transform: perspective(1100px) rotateY(-4deg) translateY(-12px); }
@media (max-width: 860px) { .hero-in { grid-template-columns: 1fr; } .shelf { min-height: 260px; } }

/* ---------- start / series ---------- */
.start { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 60px); align-items: center; background: var(--tile); border-radius: var(--radius); padding: clamp(20px, 4vw, 50px); }
.start .tile { background: transparent; }
.start h2 { margin: 10px 0 12px; font-size: clamp(28px, 4vw, 44px); line-height: 1.05; }
.start p { color: var(--muted); max-width: 52ch; }
@media (max-width: 760px) { .start { grid-template-columns: 1fr; } }
.num { position: absolute; top: 12px; left: 12px; z-index: 3; font-family: 'Fraunces', serif; font-weight: 700; font-size: 15px; color: var(--faint); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { border-top: 2px solid var(--ink); padding-top: 14px; }
.step b { display: block; font-family: 'Fraunces', serif; font-size: 22px; margin-bottom: 4px; }
.step p { margin: 0; color: var(--muted); }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.soon { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.soon span { border: 1.5px dashed var(--faint); border-radius: 999px; padding: 8px 16px; font-weight: 500; color: var(--muted); }

/* ---------- catalog ---------- */
.page-head { padding: clamp(30px, 5vw, 64px) 0 10px; }
.page-head h1 { margin: 6px 0 8px; font-size: clamp(36px, 5.5vw, 64px); line-height: 1; }
.page-head p { color: var(--muted); max-width: 60ch; margin: 0; font-size: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 26px 0 28px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 18px; font-weight: 600; font-size: 14px; cursor: pointer; }
.chip[aria-pressed='true'] { background: var(--ink); color: #fff; border-color: var(--ink); }
.find { margin-left: auto; position: relative; }
.find input { height: 42px; border: 1.5px solid var(--line); border-radius: 999px; padding: 0 18px 0 42px; width: min(300px, 100%); outline: none; }
.find input:focus { border-color: var(--ink); }
.find svg { position: absolute; left: 14px; top: 12px; }
.empty { color: var(--muted); padding: 40px 0; display: none; }

/* ---------- book page ---------- */
.book { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); padding-top: clamp(18px, 3vw, 40px); align-items: start; }
.book .tile { position: sticky; top: 96px; aspect-ratio: 1 / 1.04; }
.book .bk { --w: 52%; }
.book .eyebrow { margin: 0; }
.crumbs { font-size: 14px; color: var(--muted); padding: 18px 0 0; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.book h1 { font-size: clamp(34px, 4.6vw, 58px); line-height: 1.02; margin: 10px 0 10px; text-wrap: balance; }
.book .sub { font-family: 'Newsreader', Georgia, serif; font-style: italic; font-size: clamp(19px, 2vw, 24px); color: var(--muted); margin: 0 0 12px; }
.book .credit { font-size: 14px; color: var(--muted); margin: 0 0 22px; }
.buy { display: grid; gap: 10px; margin: 18px 0 8px; max-width: 460px; }
.buy .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.buy .pill { min-height: 54px; font-size: 16px; padding: 0 16px; }
.price { display: flex; align-items: baseline; gap: 10px; font-size: 15px; color: var(--muted); }
.price b { font-size: 26px; color: var(--ink); font-family: 'Fraunces', serif; }
.desc p { font-size: 17px; line-height: 1.7; max-width: 62ch; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 26px 0; border-top: 1px solid var(--line); max-width: 460px; }
.facts div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.share { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 860px) { .book { grid-template-columns: 1fr; } .book .tile { position: relative; top: 0; } }

/* ---------- email + footer ---------- */
.join { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; padding-block: clamp(40px, 6vw, 80px); }
.join h2 { margin: 0 0 6px; font-size: clamp(28px, 3.6vw, 40px); }
.join p { margin: 0; color: var(--muted); }
.join form { position: relative; }
.join input { width: 100%; height: 64px; border-radius: 999px; border: 1.5px solid var(--line); padding: 0 70px 0 26px; font-size: 17px; outline: none; background: #fff; }
.join input:focus { border-color: var(--ink); }
.join button { position: absolute; right: 8px; top: 8px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; cursor: pointer; display: grid; place-items: center; }
.join .msg { margin-top: 10px; font-size: 14px; min-height: 20px; color: var(--muted); }
@media (max-width: 760px) { .join { grid-template-columns: 1fr; } }
.foot { border-top: 1px solid var(--line); padding-block: 28px 48px; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 14px 40px; justify-content: space-between; color: var(--muted); font-size: 14px; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.prose { max-width: 66ch; font-size: 18px; line-height: 1.75; }
.prose h2 { font-family: 'Fraunces', serif; font-size: 28px; margin: 38px 0 8px; }
.verse-big { font-family: 'Newsreader', Georgia, serif; font-style: italic; font-size: clamp(24px, 3.2vw, 36px); line-height: 1.3; border-left: 3px solid var(--gold); padding-left: 22px; margin: 28px 0; }
.verse-big small { display: block; font-family: 'Inter', sans-serif; font-style: normal; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep); font-weight: 600; margin-top: 8px; }
@media (max-width: 720px) {
  .tile { aspect-ratio: 1 / 1.08; }
  .tile::after { bottom: 9%; }
  .card h3 { font-size: 15px; }
  .card .sub { font-size: 13px; }
  .page-head p { font-size: 17px; }
  .find { margin-left: 0; width: 100%; }
  .find input { width: 100%; }
  .hero .cta .pill { flex: 1 1 100%; }
  .start { padding: 22px; }
  .book .tile { aspect-ratio: 1 / 1.05; }
  .book .bk { --w: 58%; }
  .facts { max-width: none; }
  .buy { max-width: none; }
  .foot { gap: 18px; }
  .join input { height: 58px; padding-right: 64px; }
  .join button { width: 42px; height: 42px; top: 8px; }
}
@media (max-width: 440px) {
  .buy .row { grid-template-columns: 1fr; }
  .share .pill { flex: 1 1 100%; }
  .top-in { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
