/* Raat Books - dark theme bookshop
   Palette: night #14110F, panel #221D19, bone #EDE6DA, lamp #E8B15C */

:root {
  --night: #14110F;
  --night-2: #1B1714;
  --panel: #221D19;
  --bone: #EDE6DA;
  --muted: #A99C8E;
  --dim: #8A7F73;
  --lamp: #E8B15C;
  --lamp-deep: #C98F3F;
  --line: rgba(237, 230, 218, .14);

  --display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --body: "Manrope", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1240px;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font-family: var(--body);
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--lamp); color: var(--night); }

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--lamp); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.01em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--lamp);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  background: var(--lamp);
  color: var(--night);
  padding: .75rem 1.25rem;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(20, 17, 15, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-right: auto;
  text-decoration: none;
}
.brand:hover { color: var(--bone); }

.brand-mark { width: 22px; height: 22px; color: var(--lamp); }

.brand-name {
  font-family: var(--display);
  font-size: 1.65rem;
  letter-spacing: .02em;
  line-height: 1;
}

.site-nav {
  display: flex;
  gap: 1.9rem;
  font-size: .88rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding-block: .3rem;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--bone); border-bottom-color: var(--lamp); }

.bag {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .38rem .45rem .38rem .95rem;
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.bag:hover { border-color: var(--lamp); color: var(--lamp); }

.bag-count {
  display: grid;
  place-items: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding-inline: .25rem;
  border-radius: 999px;
  background: var(--lamp);
  color: var(--night);
  font-size: .72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.menu-toggle {
  display: none;
  position: relative;
  width: 42px; height: 42px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.menu-bar {
  position: absolute;
  left: 50%; top: 50%;
  width: 15px; height: 1px;
  background: var(--bone);
}
.menu-bar:first-child { translate: -50% -4px; }
.menu-bar:last-child { translate: -50% 4px; }

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  padding: .25rem var(--pad) 1rem;
}
.mobile-nav a {
  display: block;
  padding: .8rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-size: 1rem;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(80% 60% at 78% 30%, #241C15 0%, transparent 60%),
    var(--night);
}

.hero-glow {
  position: absolute;
  right: -10%;
  top: -10%;
  width: 60rem;
  height: 60rem;
  background: radial-gradient(circle, rgba(232, 177, 92, .10) 0%, rgba(232, 177, 92, .04) 38%, transparent 62%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
  padding-block: clamp(3.5rem, 7vw, 6rem);
}

.status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--muted);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lamp);
  box-shadow: 0 0 0 3px rgba(232, 177, 92, .14);
}
.dot.is-closed { background: var(--dim); box-shadow: none; }

.status-sep { color: var(--dim); }
.status-note { color: var(--dim); }

.hero h1 {
  margin-top: 1.5rem;
  font-size: clamp(3rem, 7.2vw, 6rem);
  line-height: .94;
  max-width: 13ch;
}

.hero-lede {
  margin-top: 1.6rem;
  max-width: 29rem;
  color: var(--muted);
  font-size: 1.06rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .9rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.btn-lamp { background: var(--lamp); color: var(--night); }
.btn-lamp:hover { background: var(--bone); color: var(--night); }

.btn-quiet {
  background: transparent;
  color: var(--bone);
  padding-inline: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  padding-block: .3rem;
}
.btn-quiet:hover { color: var(--lamp); border-bottom-color: var(--lamp); }

.btn-block { width: 100%; }

.hero-hours {
  margin-top: 1.9rem;
  font-size: .82rem;
  color: var(--dim);
}

.hero-book {
  position: relative;
  justify-self: end;
  width: min(100%, 21rem);
}

.book-glow {
  position: absolute;
  inset: -22% -30% -18% -30%;
  background: radial-gradient(circle at 50% 45%, rgba(232, 177, 92, .22) 0%, rgba(232, 177, 92, .06) 45%, transparent 70%);
  filter: blur(12px);
  pointer-events: none;
}

.hero-cover {
  position: relative;
  padding: 1rem;
  background: var(--night-2);
  border: 1px solid rgba(237, 230, 218, .16);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9);
}

.hero-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-book-meta {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.meta-label {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--lamp);
}

.meta-title {
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.2;
  margin-top: .3rem;
}

.meta-author { font-size: .84rem; color: var(--muted); margin-top: .1rem; }

.meta-buy { text-align: right; }
.meta-price { font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.meta-buy .link-add { margin-top: .4rem; }

.link-add {
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 0 0 .12rem;
  color: var(--lamp);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
}
.link-add:hover { color: var(--bone); }

.hero-foot {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem 2rem;
  padding-block: .95rem;
  border-top: 1px solid var(--line);
  font-size: .76rem;
  color: var(--dim);
  letter-spacing: .03em;
}

/* ---------- Shelf ---------- */

.shelf {
  padding-block: clamp(3rem, 6vw, 5rem);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-head p {
  margin-top: .75rem;
  max-width: 28rem;
  color: var(--muted);
  font-size: .95rem;
}

.rail-controls { display: flex; gap: .5rem; flex: none; }

.rail-btn {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--bone);
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}
.rail-btn:hover { border-color: var(--lamp); color: var(--lamp); background: rgba(232, 177, 92, .06); }
.rail-btn svg { width: 17px; height: 17px; }

.rail {
  list-style: none;
  margin: 0;
  padding: 2rem 0 .75rem;
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #3A322B transparent;
}
.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-thumb { background: #3A322B; border-radius: 999px; }

.card {
  flex: 0 0 clamp(13.5rem, 21vw, 16.5rem);
  scroll-snap-align: start;
}

.card-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--night-2);
  border: 1px solid var(--line);
  transition: border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1.1rem;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .55));
}
.card:hover .card-cover {
  border-color: rgba(232, 177, 92, .5);
  transform: translateY(-5px);
  box-shadow: 0 24px 40px -24px rgba(232, 177, 92, .35);
}

.card-info { padding-top: 1rem; }
.card-info h3 {
  font-size: 1.15rem;
  line-height: 1.2;
}
.card-author { margin-top: .25rem; font-size: .84rem; color: var(--muted); }
.card-buy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .8rem;
  padding-top: .65rem;
  border-top: 1px solid var(--line);
}
.card-price { font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Visit ---------- */

.visit { padding-block: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--line); }

.visit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
}

.visit h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); }

.visit-lede {
  margin-top: 1.1rem;
  max-width: 27rem;
  color: var(--muted);
}

.visit-address {
  margin-top: 1.5rem;
  font-size: .9rem;
  color: var(--dim);
  line-height: 1.7;
}

.visit-facts { margin: 0; border-top: 1px solid var(--line); }
.visit-facts > div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}
.visit-facts dt { font-size: .82rem; color: var(--dim); }
.visit-facts dd { margin: 0; font-size: .95rem; }
.visit-facts a { text-decoration: none; border-bottom: 1px solid var(--line); }
.visit-facts a:hover { border-bottom-color: var(--lamp); }

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  overflow: hidden;
  background: #100E0C;
  border-top: 1px solid var(--line);
  padding-top: clamp(2.5rem, 5vw, 4rem);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-logo {
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1;
}
.footer-line {
  margin-top: .8rem;
  max-width: 21rem;
  color: var(--muted);
  font-size: .88rem;
}

.footer-col h2 {
  font-family: var(--body);
  font-size: .8rem;
  font-weight: 600;
  color: var(--bone);
  margin-bottom: .75rem;
}
.footer-col p { font-size: .88rem; color: var(--muted); margin-bottom: .35rem; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { color: var(--lamp); }

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-size: .74rem;
  color: var(--dim);
}

.footer-word {
  font-family: var(--display);
  font-size: clamp(7rem, 25vw, 22rem);
  line-height: .72;
  letter-spacing: -.02em;
  color: rgba(237, 230, 218, .05);
  text-align: center;
  margin-top: 1rem;
  margin-bottom: -.1em;
  user-select: none;
}

/* ---------- Cart ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 60;
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.overlay.is-visible { opacity: 1; }

.cart {
  position: fixed;
  top: 0; right: 0;
  z-index: 70;
  width: min(25rem, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--night-2);
  border-left: 1px solid var(--line);
  transform: translateX(101%);
  transition: transform .32s var(--ease);
  visibility: hidden;
}
.cart.is-open { transform: none; visibility: visible; }

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.cart-head h2 { font-size: 1.5rem; }

.cart-close {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.cart-close:hover { border-color: var(--lamp); color: var(--lamp); }
.cart-close svg { width: 15px; height: 15px; }

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.cart-empty { color: var(--muted); font-size: .9rem; max-width: 17rem; }

.cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.15rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: .9rem;
  align-items: start;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}
.cart-item img {
  width: 48px;
  height: 64px;
  object-fit: contain;
  background: var(--panel);
  padding: .2rem;
}
.cart-item-title { font-family: var(--display); font-size: 1.05rem; line-height: 1.2; }
.cart-item-author { font-size: .78rem; color: var(--muted); margin-top: .15rem; }
.cart-item-price { font-size: .82rem; margin-top: .25rem; }

.cart-remove {
  background: none;
  border: 0;
  padding: 0;
  font-size: .76rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.cart-remove:hover { color: var(--lamp); }

.cart-foot {
  padding: 1.35rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cart-ship { margin-top: .3rem; font-size: .8rem; color: var(--muted); }
.cart-foot .btn { margin-top: 1rem; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--lamp); }
.cart-demo {
  margin-top: .65rem;
  text-align: center;
  font-size: .72rem;
  color: var(--dim);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 80;
  translate: -50% 0;
  background: var(--bone);
  color: var(--night);
  padding: .7rem 1.2rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), translate .25s var(--ease);
}
.toast.is-visible { opacity: 1; translate: -50% -6px; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *,
  .hero-book {
    animation: rise .9s var(--ease) both;
  }
  .hero h1 { animation-delay: .08s; }
  .hero-lede { animation-delay: .16s; }
  .hero-actions { animation-delay: .24s; }
  .hero-hours { animation-delay: .3s; }
  .hero-book { animation-delay: .2s; }

  .dot { animation: lamp 3.5s ease-in-out infinite; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes lamp {
  0%, 100% { box-shadow: 0 0 0 3px rgba(232, 177, 92, .14); }
  50% { box-shadow: 0 0 0 5px rgba(232, 177, 92, .07); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-book { justify-self: start; width: min(100%, 19rem); margin-top: 1rem; }
  .hero h1 { max-width: 14ch; }
  .visit-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .site-nav { display: none; }
  .menu-toggle { display: block; }
  .mobile-nav.is-open { display: block; }
  .header-inner { min-height: 64px; gap: 1rem; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .rail-controls { display: none; }
  .hero-foot p:nth-child(2) { display: none; }
  .card { flex-basis: 72vw; }
  .visit-facts > div { grid-template-columns: 1fr; gap: .2rem; }
  .footer-top { grid-template-columns: 1fr; }
  .cart { width: 100%; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: clamp(2.7rem, 13.5vw, 3.6rem); }
  .hero-book { width: min(100%, 16.5rem); }
  .hero-book-meta { flex-direction: column; gap: .75rem; }
  .meta-buy { text-align: left; }
}

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