/* Off Planet Books & Puzzles, Option A: Night Sky Library */
:root {
  --bg: #07091a;
  --bg-2: #0d1230;
  --panel: #111737;
  --line: rgba(190, 200, 255, .14);
  --fg: #eef0fa;
  --muted: #aab1cf;
  --accent: #dd322e;
  --accent-hi: #f04a45;
  --gold: #e9d9b0;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 14px;
  --gutter: clamp(16px, 5vw, 64px);
  --sec: clamp(3.5rem, 2rem + 6vw, 7.5rem);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 clamp(1rem, .95rem + .25vw, 1.0625rem)/1.65 var(--sans);
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 1.2rem + 4vw, 4rem); }
h2 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.6rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.muted { color: var(--muted); }
.wrap { max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 820px; }
.narrow-p { max-width: 68ch; }
.center { text-align: center; justify-content: center; }
.eyebrow { font: 600 .78rem/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.eyebrow a { text-decoration: none; }
.lede { font-size: clamp(1.05rem, 1rem + .35vw, 1.25rem); color: #d6daee; }

/* starfield: pure CSS, two layers of dots */
.stars { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 8%, #fff8 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 62%, #fffa 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 44%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 30%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 22% 84%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 88%, #fff7 50%, transparent 51%),
    radial-gradient(1200px 700px at 80% -10%, #1b2466 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 40%, #2a1033 0%, transparent 60%),
    var(--bg);
}
.stars::after { content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(1px 1px, #ffffff80 50%, transparent 51%);
  background-size: 190px 170px; opacity: .45; animation: twinkle 7s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .25; } to { opacity: .55; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: 0 1.5rem;
  border-radius: 999px; border: 1px solid transparent; font: 600 .95rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background .2s ease-out, border-color .2s ease-out, transform .2s ease-out; color: var(--fg); background: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 30px -10px rgba(221, 50, 46, .7); }
.btn-primary:hover { background: var(--accent-hi); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { border-color: rgba(238, 240, 250, .35); }
.btn-ghost:hover { border-color: var(--fg); background: rgba(255, 255, 255, .05); }
.btn-small { min-height: 44px; padding: 0 1rem; font-size: .85rem; border-color: var(--line); width: 100%; }
.btn-small:hover { border-color: var(--accent); color: #fff; background: rgba(221, 50, 46, .15); }
.btn.block { display: flex; width: 100%; margin-top: .75rem; }
.btn.big { min-height: 56px; font-size: 1.05rem; }
.text-link { color: var(--gold); text-underline-offset: 4px; display: inline-flex; align-items: center; min-height: 44px; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 1.75rem; }

/* header */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(7, 9, 26, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.hdr { display: flex; align-items: center; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; min-height: 44px; }
.logo img { height: 44px; width: auto; background: #fff; border-radius: 8px; padding: 3px 6px; }
.nav { order: 3; margin-left: auto; }
.nav-toggle { width: 44px; height: 44px; border: 1px solid var(--line); background: none; border-radius: 10px; color: var(--fg); cursor: pointer; display: grid; place-items: center; }
.burger, .burger::before, .burger::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -6px; } .burger::after { top: 6px; }
.navlist { display: none; list-style: none; margin: 0; padding: 0; }
.navlist.open { display: block; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; max-height: calc(100vh - 64px); overflow: auto; }
.navlist a { display: flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 500; }
.navlist a:hover { color: var(--gold); }
.sub { list-style: none; padding: 0 0 0 16px; margin: 0; }
.sub a { color: var(--muted); font-weight: 400; }
.search { order: 4; flex: 1 1 100%; padding-bottom: 10px; }
.search input, .filters select, .filters input { width: 100%; min-height: 44px; font: inherit; font-size: 16px; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; }
.cart-btn { order: 2; position: relative; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--fg); cursor: pointer; display: grid; place-items: center; margin-left: auto; }
.cart-btn:hover { border-color: var(--accent); }
.badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font: 600 .72rem/20px var(--sans); text-align: center; transform: scale(0); transition: transform .2s ease-out; }
.badge.on { transform: scale(1); }
@media (min-width: 1024px) {
  .hdr { flex-wrap: nowrap; min-height: 76px; gap: 28px; }
  .nav { order: 2; margin-left: 0; }
  .nav-toggle { display: none; }
  .navlist { display: flex; gap: 28px; }
  .has-sub { position: relative; }
  .sub { display: none; position: absolute; top: 100%; left: -16px; min-width: 280px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
  .has-sub:hover .sub, .has-sub:focus-within .sub { display: block; }
  .search { order: 3; flex: 0 1 260px; padding: 0; margin-left: auto; }
  .cart-btn { order: 4; margin-left: 0; }
}

/* hero */
.hero { padding: clamp(2.5rem, 1rem + 6vw, 6rem) 0 var(--sec); position: relative; }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.hero h1 { max-width: 14ch; }
.hero .lede { max-width: 46ch; }
.constellation { position: relative; aspect-ratio: 1 / .92; max-width: 620px; width: 100%; margin-inline: auto; }
.float { position: absolute; display: block; width: 30%; border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 24px 60px -12px rgba(0, 0, 0, .9), 0 0 60px -10px rgba(120, 140, 255, .35);
  animation: drift 9s ease-in-out infinite alternate; }
.float img { width: 100%; }
.f0 { left: 35%; top: 6%; width: 34%; z-index: 3; animation-delay: -2s; }
.f1 { left: 2%; top: 14%; width: 28%; z-index: 2; animation-delay: -5s; }
.f2 { left: 70%; top: 2%; width: 28%; z-index: 2; }
.f3 { left: 8%; top: 54%; width: 26%; z-index: 1; animation-delay: -3s; }
.f4 { left: 38%; top: 56%; width: 25%; z-index: 4; animation-delay: -7s; }
.f5 { left: 66%; top: 46%; width: 32%; z-index: 1; animation-delay: -1s; }
.f6 { display: none; }
@keyframes drift { from { transform: translateY(0) rotate(-1deg); } to { transform: translateY(-14px) rotate(1deg); } }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1fr 1.05fr; gap: 4rem; }
}

/* sections */
.section { padding-block: var(--sec) 0; }
.section.tight { padding-top: clamp(1.5rem, 1rem + 2vw, 3rem); }
main > .section:last-child, main > section:last-of-type { padding-bottom: var(--sec); }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 2rem; }
.sec-head h2 { margin: 0; }
.more { color: var(--gold); text-underline-offset: 4px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }

/* category tiles */
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.tile { position: relative; display: flex; align-items: flex-end; min-height: 200px; border-radius: var(--r); overflow: hidden; text-decoration: none; border: 1px solid var(--line); background: var(--panel); isolation: isolate; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .38; transition: opacity .3s ease-out, transform .5s ease-out; z-index: -1; }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 20%, rgba(7, 9, 26, .95)); }
.tile:hover img { opacity: .6; transform: scale(1.04); }
.tile-txt { padding: 20px; display: grid; gap: 4px; }
.tile-name { font: 400 1.45rem/1.15 var(--serif); }
.tile-sub { color: var(--muted); font-size: .88rem; }

/* product cards */
.row, .grid { display: grid; gap: clamp(16px, 2vw, 28px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .row, .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .row, .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card[hidden] { display: none; }
.card-link { text-decoration: none; display: block; }
.cover { aspect-ratio: 4 / 5; display: grid; place-items: center; padding: 10%; border-radius: var(--r);
  background: radial-gradient(circle at 50% 40%, #1c2458 0%, var(--panel) 70%); border: 1px solid var(--line); overflow: hidden; }
.cover img { max-height: 100%; width: auto; object-fit: contain; box-shadow: 0 16px 40px -10px #000, 0 0 40px -8px rgba(140, 160, 255, .35); transition: transform .3s ease-out; }
.card-link:hover .cover img { transform: translateY(-4px) scale(1.02); }
.card-title { font: 500 .98rem/1.35 var(--sans); margin: 6px 0 0; letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-link:hover .card-title { color: var(--gold); }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin: 0; }
.price { color: #ff6a64; font-weight: 600; }
.tag { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.card .add { margin-top: auto; }

/* spotlight + split layouts */
.split { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1.3fr; gap: 4rem; } .split.rev { grid-template-columns: .8fr 1.2fr; } }
.grid4 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.author-cover { max-width: 360px; margin-inline: auto; }
.author-cover img { border-radius: 6px; box-shadow: 0 30px 80px -20px #000, 0 0 80px -20px rgba(221, 50, 46, .45); }
.visit-band .visit-inner { text-align: center; max-width: 760px; border: 1px solid var(--line); border-radius: 24px; padding: clamp(2rem, 1rem + 5vw, 4.5rem) var(--gutter);
  background: radial-gradient(600px 300px at 50% 0%, rgba(221, 50, 46, .18), transparent 70%), var(--bg-2); }

/* faq */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; color: var(--gold); transition: transform .2s ease-out; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary h3 { margin: 0; font-size: 1.2rem; }
.faq details p { color: #d6daee; max-width: 68ch; }

/* crumbs */
.crumbs { padding-top: 20px; font-size: .85rem; color: var(--muted); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.crumbs a { text-underline-offset: 3px; }

/* filters */
.filters { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin: 2rem 0; align-items: end; }
.filters label { display: grid; gap: 6px; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.filters .grow { grid-column: 1 / -1; }
.filters .count { grid-column: 1 / -1; margin: 0; }
@media (min-width: 900px) { .filters { grid-template-columns: repeat(3, 200px) 1fr auto; } .filters .grow, .filters .count { grid-column: auto; } }
.empty { padding: 3rem 0; text-align: center; color: var(--muted); }
.back { margin-top: 2rem; }

/* product page */
.pdp { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .pdp { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 4.5rem; align-items: start; } .pdp-cover { position: sticky; top: 110px; } }
.pdp-cover { display: grid; place-items: center; padding: 8%; border-radius: 20px; background: radial-gradient(circle at 50% 35%, #232c6a 0%, var(--panel) 65%); border: 1px solid var(--line); }
.pdp-cover img { max-height: 560px; width: auto; box-shadow: 0 30px 80px -20px #000, 0 0 90px -20px rgba(140, 160, 255, .5); border-radius: 4px; }
.pdp-title { font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.8rem); }
.pdp-price { font: 600 1.8rem/1 var(--sans); color: #ff6a64; margin-bottom: .5rem; }
.stock { color: #9fe0b0; font-size: .92rem; }
.pdp .add.big { width: 100%; max-width: 380px; margin: .5rem 0 1.5rem; }
.facts { list-style: none; padding: 0; margin: 0 0 2rem; border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.facts span { color: var(--muted); }
.prose { max-width: 68ch; }
.prose p { color: #d6daee; }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .5rem; }

/* panels, visit, contact */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(20px, 3vw, 32px); margin-bottom: 16px; }
address { font-style: normal; line-height: 1.8; margin-bottom: 1rem; }
address a, .panel a:not(.btn) { color: var(--gold); text-underline-offset: 3px; overflow-wrap: anywhere; }
.visit-grid { display: grid; gap: 16px; margin-top: 2rem; }
@media (min-width: 900px) { .visit-grid { grid-template-columns: 1fr 1.4fr; } }
.visit-grid h2 { font-size: 1.4rem; }
.map-ph { min-height: 320px; border-radius: var(--r); border: 1px dashed var(--line); display: grid; place-items: center; text-align: center; padding: 24px;
  background: repeating-linear-gradient(45deg, transparent 0 22px, rgba(255, 255, 255, .02) 22px 44px), var(--bg-2); }
.contact-cards { display: grid; gap: 16px; margin: 2rem 0 16px; }
@media (min-width: 720px) { .contact-cards { grid-template-columns: 1fr 1fr; } }
.link-panel { display: grid; gap: 4px; text-decoration: none; margin: 0; transition: border-color .2s; }
.link-panel:hover { border-color: var(--accent); }
.big-link { font: 400 clamp(1.1rem, 1rem + .6vw, 1.35rem)/1.3 var(--serif); overflow-wrap: anywhere; }
.portrait { margin: 0; max-width: 300px; justify-self: center; }
.portrait img { border-radius: var(--r); width: 100%; box-shadow: 0 30px 80px -20px #000; }
.portrait figcaption { color: var(--muted); font-size: .88rem; margin-top: 10px; }

/* cart lines + drawer */
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line img { width: 56px; height: auto; border-radius: 3px; }
.line-info { display: grid; gap: 4px; min-width: 0; }
.line-info a { text-decoration: none; font-weight: 500; line-height: 1.35; }
.line-info a:hover { color: var(--gold); }
.qty { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.qty button { min-width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--fg); font-size: 1.1rem; cursor: pointer; }
.qty button:hover { border-color: var(--fg); }
.qty span { min-width: 24px; text-align: center; }
.qty .rm { font-size: .82rem; color: var(--muted); border: 0; padding: 0 8px; text-decoration: underline; text-underline-offset: 3px; }
.cart-empty { padding: 2rem 0; text-align: center; color: var(--muted); }
.subtotal { display: flex; justify-content: space-between; font-size: 1.05rem; margin: 1rem 0 0; }
.drawer-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 61; background: var(--bg-2); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s ease-out; visibility: hidden; }
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-title { font: 400 1.5rem/1 var(--serif); margin: 0; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--fg); font-size: 1.5rem; cursor: pointer; }
.drawer-body { flex: 1; overflow: auto; padding: 0 20px; }
.drawer-foot { padding: 16px 20px 24px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 150%); background: var(--fg); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: .9rem; z-index: 70; transition: transform .25s ease-out; max-width: calc(100% - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); }

/* checkout */
.checkout { display: grid; gap: 2rem; }
@media (min-width: 900px) { .checkout { grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: start; } }
.steps-bar { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 1.5rem; font-size: .85rem; color: var(--muted); }
.steps-bar li { flex: 1; border-top: 3px solid var(--line); padding-top: 8px; }
.steps-bar .done { border-color: var(--gold); color: var(--fg); }
.steps-bar .on { border-color: var(--accent); color: var(--fg); font-weight: 600; }
fieldset.ship { border: 1px solid var(--line); }
legend { font: 400 1.3rem/1 var(--serif); padding: 0 8px; }
.opt { display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; cursor: pointer; min-height: 56px; }
.opt:has(input:checked) { border-color: var(--accent); background: rgba(221, 50, 46, .08); }
.opt input { width: 20px; height: 20px; accent-color: var(--accent); }
.rate { font-size: .8rem; color: var(--muted); }
.demo-msg { margin-top: 16px; border-color: var(--gold); }
.summary h2 { font-size: 1.5rem; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: rgba(5, 6, 18, .85); margin-top: 0; padding-top: 3.5rem; }
.fgrid { display: grid; gap: 2rem; }
@media (min-width: 800px) { .fgrid { grid-template-columns: 1.4fr 1fr 1fr; } }
.f-brand { font: 400 1.5rem/1.2 var(--serif); margin-bottom: .25rem; }
.f-h { font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .78rem; color: var(--gold); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li a { display: inline-flex; min-height: 40px; align-items: center; text-decoration: none; color: var(--muted); }
.site-footer li a:hover { color: var(--fg); }
.fbottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); margin-top: 2.5rem; padding-block: 1.25rem 2rem; font-size: .85rem; color: var(--muted); }
.fbottom p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
