/* Altitude Books — ice blue, alpine modernism
   Palette: ice #E3EEF4, paper #FBFDFE, ink #0F2A38, glacier #2A7C9B */

:root {
  --ice: #E3EEF4;
  --ice-deep: #C9DEEA;
  --paper: #FBFDFE;
  --ink: #0F2A38;
  --ink-soft: #4A6270;
  --glacier: #2A7C9B;
  --line: #C9DEEA;

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Karla", "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(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.03em;
  margin: 0;
}

p { margin: 0; }

button { font: inherit; color: inherit; }

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

.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(--ink);
  color: var(--paper);
  padding: .75rem 1.25rem;
  border-radius: 4px;
  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(251, 253, 254, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -.03em;
  text-decoration: none;
  margin-right: auto;
}
.brand:hover { color: var(--ink); }

.brand-mark { width: 26px; height: 26px; color: var(--glacier); }

.site-nav {
  display: flex;
  gap: 1.75rem;
  font-size: .95rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-block: .35rem;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }

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

.bag-count {
  display: grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding-inline: .3rem;
  border-radius: 999px;
  background: var(--ice);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
}
.menu-bar {
  position: absolute;
  left: 50%; top: 50%;
  width: 16px; height: 1.5px;
  background: var(--ink);
  translate: -50% -50%;
}
.menu-bar:first-child { translate: -50% -6px; }
.menu-bar:last-child { translate: -50% 5px; }

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

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

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 78% 12%, #F4FAFD 0%, var(--ice) 58%, #D8E9F2 100%);
  border-bottom: 1px solid var(--line);
}

.contours {
  position: absolute;
  inset: -8% -18% 14% 30%;
  color: var(--glacier);
  opacity: .18;
  pointer-events: none;
}
.contours svg { width: 100%; height: 100%; }

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(2rem, 5vw, 4rem);
}

.hero-copy { max-width: 40rem; }

.hero-kicker {
  font-size: .95rem;
  color: var(--ink-soft);
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  max-width: 26rem;
}

.hero h1 {
  font-size: clamp(3rem, 8.2vw, 6.4rem);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: .92;
}

.hero-lede {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  max-width: 31rem;
  font-size: 1.125rem;
  color: var(--ink-soft);
}

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

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

.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--glacier); color: var(--paper); }

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
  padding-inline: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--ink);
  padding-block: .25rem;
}
.btn-quiet:hover { color: var(--glacier); border-bottom-color: var(--glacier); }

.btn-block { width: 100%; }

.hero-note {
  margin-top: 2.25rem;
  font-size: .9rem;
  color: var(--ink-soft);
}

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

.hero-book-frame {
  position: relative;
  padding: 1.1rem;
  background: rgba(251, 253, 254, .55);
  border: 1px solid rgba(42, 124, 155, .22);
}
.hero-book-frame::after {
  content: "";
  position: absolute;
  inset: 1.1rem;
  border: 1px solid rgba(42, 124, 155, .18);
  pointer-events: none;
}

.hero-book-frame img {
  width: 100%;
  aspect-ratio: 348 / 492;
  object-fit: cover;
  box-shadow: 0 22px 40px -18px rgba(15, 42, 56, .55);
}

.shelf-line {
  width: 108%;
  margin-left: -4%;
  height: 10px;
  margin-top: -2px;
  background: linear-gradient(to bottom, var(--ink) 0 2px, rgba(15, 42, 56, .14) 2px 100%);
}

.hero-book-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.1rem;
  font-size: .95rem;
}
.hero-book-title { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; }
.hero-book-author { color: var(--ink-soft); font-size: .9rem; }
.hero-book-buy { display: grid; justify-items: end; gap: .3rem; text-align: right; }
.hero-book-price { font-weight: 600; font-variant-numeric: tabular-nums; }

.link-add {
  background: none;
  border: 0;
  padding: .1rem 0;
  font-size: .9rem;
  font-weight: 600;
  color: var(--glacier);
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}
.link-add:hover { color: var(--ink); }

.hero-rule {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 2.5rem;
  justify-content: space-between;
  padding-block: 1rem;
  border-top: 1px solid rgba(42, 124, 155, .3);
  font-size: .82rem;
  color: var(--ink-soft);
  letter-spacing: .02em;
}

/* ---------- Sections ---------- */

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
  gap: 1rem 3rem;
  align-items: end;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}
.section-head p { color: var(--ink-soft); font-size: 1rem; }

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

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

.book-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem) clamp(1.25rem, 3vw, 2.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.book-cover {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--ice);
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.book-cover::after {
  content: "";
  position: absolute;
  left: 8%; right: 8%;
  bottom: 0;
  height: 1px;
  background: rgba(15, 42, 56, .25);
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 18px rgba(15, 42, 56, .38));
  transition: transform .45s var(--ease), filter .45s var(--ease);
}
.book:hover .book-cover img {
  transform: translateY(-6px) rotate(-.6deg);
  filter: drop-shadow(0 24px 26px rgba(15, 42, 56, .42));
}

.book-info { padding-top: 1.1rem; }

.book-info h3 {
  font-size: 1.18rem;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.book-author {
  margin-top: .3rem;
  color: var(--ink-soft);
  font-size: .93rem;
}

.book-tag {
  margin-top: .55rem;
  font-size: .82rem;
  color: var(--glacier);
}

.book-buy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: .8rem;
  border-top: 1px solid var(--ice-deep);
}

.price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Reading room ---------- */

.room {
  background: var(--ink);
  color: var(--ice);
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

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

.room h2 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  color: #F2F8FB;
}

.room-lede {
  margin-top: 1.5rem;
  max-width: 34rem;
  color: #B7CCD7;
  font-size: 1.08rem;
}

.room-facts {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid rgba(227, 238, 244, .22);
}
.room-facts > div {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1.15rem;
  border-bottom: 1px solid rgba(227, 238, 244, .22);
}
.room-facts dt {
  font-size: .85rem;
  color: #8FACBB;
  padding-top: .2rem;
}
.room-facts dd {
  margin: 0;
  font-size: 1rem;
  color: #E3EEF4;
}

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

.site-footer {
  background: var(--ice);
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 5vw, 4rem) 1.5rem;
}

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

.footer-logo {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -.03em;
}
.footer-line {
  margin-top: .75rem;
  max-width: 20rem;
  color: var(--ink-soft);
  font-size: .93rem;
}

.footer-col h2 {
  font-family: var(--body);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: .9rem;
  color: var(--ink);
}
.footer-col p {
  font-size: .93rem;
  color: var(--ink-soft);
  margin-bottom: .45rem;
}
.footer-col a { text-decoration: none; }
.footer-col a:hover { text-decoration: underline; }

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(42, 124, 155, .3);
  font-size: .82rem;
  color: var(--ink-soft);
}

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

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 42, 56, .42);
  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(26rem, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  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.5rem;
  border-bottom: 1px solid var(--line);
}
.cart-head h2 { font-size: 1.35rem; letter-spacing: -.02em; }

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

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

.cart-empty {
  color: var(--ink-soft);
  font-size: .95rem;
  max-width: 18rem;
}

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

.cart-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: .9rem;
  align-items: start;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--ice-deep);
}
.cart-item img {
  width: 54px;
  aspect-ratio: 348 / 492;
  object-fit: cover;
  background: var(--ice);
}
.cart-item-title {
  font-family: var(--display);
  font-size: .98rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.cart-item-author { font-size: .85rem; color: var(--ink-soft); margin-top: .2rem; }
.cart-item-price { font-size: .9rem; margin-top: .35rem; font-variant-numeric: tabular-nums; }

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

.cart-foot {
  padding: 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--ice);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.cart-ship {
  margin-top: .35rem;
  font-size: .85rem;
  color: var(--ink-soft);
}

.cart-foot .btn { margin-top: 1rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--ink); }

.cart-demo {
  margin-top: .75rem;
  font-size: .78rem;
  color: var(--ink-soft);
  text-align: center;
}

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

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

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

@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .hero-book { justify-self: start; margin-top: 1rem; }
  .contours { inset: 30% -30% -30% 10%; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-grid { grid-template-columns: 1fr; }
  .footer-grid { 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; }
  .bag { padding: .35rem .4rem .35rem .85rem; }
  .section-head { grid-template-columns: 1fr; align-items: start; }
  .hero-rule { gap: .35rem 1.5rem; }
  .hero-rule p:nth-child(2) { display: none; }
}

@media (max-width: 520px) {
  .book-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .book-cover { aspect-ratio: 5 / 5; }
  .book-cover img { max-height: 17rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(2.6rem, 13vw, 3.6rem); }
  .cart { width: 100%; }
  .room-facts > div { grid-template-columns: 1fr; gap: .2rem; }
}

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