/* =========================================================
   Robinhood Books — editorial bookshop
   ========================================================= */
:root {
  --bg: #ececec;
  --surface: #ffffff;
  --ink: #111111;
  --ink-2: #2a2a2a;
  --muted: #6b6b6b;
  --subtle: #9a9a9a;
  --line: rgba(17, 17, 17, 0.16);
  --line-strong: rgba(17, 17, 17, 0.55);
  --primary: #2563eb;
  --accent: #0f172a;
  --hl: #b6f0c1;
  --serif: 'EB Garamond', 'Times New Roman', Times, serif;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --radius-pill: 999px;
  --ease: cubic-bezier(.32,.72,0,1);
  --max: 1480px;
  --gutter: clamp(20px, 4vw, 56px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100;
}
.skip:focus { left: 16px; }

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 28px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  font-family: var(--serif);
  font-size: 18px;
}
.nav { display: flex; align-items: center; gap: 38px; }
.nav--right { justify-content: flex-end; }
.nav a { position: relative; color: var(--ink); transition: opacity .2s var(--ease); }
.nav a:not(.icon):not(.cart):hover { opacity: .6; }
.nav a.is-current::after,
.nav a:not(.icon):not(.cart):hover::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor;
}
.nav a.is-current::after { background: currentColor; }
.nav .icon, .nav .cart {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink);
}
.nav .icon:hover, .nav .cart:hover { opacity: .6; }
.nav .cart span { font-family: var(--serif); font-size: 17px; }
.wordmark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.wordmark--sm { font-size: 22px; }

@media (max-width: 880px) {
  .site-header {
    grid-template-columns: 1fr auto 1fr;
    padding: 20px 20px;
    font-size: 16px;
  }
  .nav { gap: 18px; }
  .nav a:not(.icon):not(.cart) { display: none; }
  .nav a:first-child { display: inline; }
  .nav--right a:not(.icon):not(.cart) { display: none; }
}

/* =========================================================
   Section scaffold
   ========================================================= */
main { display: block; }
.display {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.04;
  font-size: clamp(40px, 6vw, 84px);
  margin: 0;
}
.display em { font-style: italic; font-weight: 500; }
.display--xl { font-size: clamp(56px, 9vw, 144px); line-height: 1; }

/* =========================================================
   STORY / ABOUT
   ========================================================= */
.story {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: clamp(48px, 8vw, 120px) clamp(24px, 4vw, 80px);
  padding: clamp(80px, 14vh, 180px) var(--gutter) clamp(120px, 18vh, 220px);
  max-width: var(--max);
  margin: 0 auto;
}
.story__copy {
  grid-column: 2 / 4;
  grid-row: 1;
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.35;
  color: var(--ink);
  max-width: 22ch * 2;
}
.story__copy p { margin: 0 0 1.1em; }
.story__copy em { font-style: italic; }
.story__hero {
  grid-column: 1 / 3;
  grid-row: 2;
  margin: 0;
}
.story__hero img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.story__aside {
  grid-column: 3 / 4;
  grid-row: 2;
  align-self: end;
  margin: 0;
  max-width: 360px;
  justify-self: end;
}
.story__aside img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }

@media (max-width: 880px) {
  .story { grid-template-columns: 1fr; gap: 40px; padding: 64px 20px 80px; }
  .story__copy, .story__hero, .story__aside { grid-column: 1; grid-row: auto; max-width: none; justify-self: stretch; }
  .story__aside { max-width: 240px; align-self: end; justify-self: end; }
  .story__copy { font-size: 22px; }
}

/* =========================================================
   SHOP — Exceptional Books
   ========================================================= */
.shop {
  padding: clamp(80px, 12vh, 160px) var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
}
.shop__intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 56px;
}
.shop__intro .display { font-size: clamp(36px, 4.4vw, 56px); }

.grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.4vw, 36px) clamp(20px, 2.4vw, 36px);
}
@media (max-width: 880px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 18px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
}

.card { margin: 0; }
.card__media {
  display: block;
  background: var(--bg);
  background-color: var(--bg, #eee);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
  transition: transform .6s var(--ease);
}
.card__media[style*="--bg"] { background: var(--bg); }
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease), opacity .4s var(--ease);
}
.card__media:hover img { transform: scale(1.025); }
.card__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 22px 0 6px;
}
.card__price { margin: 0; color: var(--ink); font-size: 16px; }

.card--wide { display: flex; flex-direction: column; }
.card__media--quote {
  background: var(--ink);
  color: #f4f1e8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10% 12%;
  text-align: left;
}
.card__media--quote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.3;
}
.card__media--quote blockquote p { margin: 0 0 18px; }
.card__media--quote cite { font-style: normal; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(244,241,232,0.6); font-family: var(--sans); }

/* Card 1 styling: the intro lives where the first card would */
.shop__intro { grid-column: 1; }
@media (min-width: 881px) {
  .shop { display: block; }
}

/* =========================================================
   PILL BUTTONS
   ========================================================= */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px;
  padding: 0 44px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), transform .2s var(--ease);
}
.pill:hover { background: var(--ink); color: #fff; }
.pill:active { transform: translateY(1px); }
.pill--solid { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill--solid:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* =========================================================
   LIBRARY — Build Your Home Library
   ========================================================= */
.library {
  padding: clamp(96px, 16vh, 200px) var(--gutter) clamp(80px, 12vh, 140px);
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
}
.library .display--xl { margin-bottom: clamp(80px, 14vh, 180px); }
.library__row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: clamp(24px, 3vw, 48px);
  text-align: left;
  align-items: end;
}
.library__cta {
  align-self: end;
  padding-bottom: 12px;
}
.library__cta .display { font-size: clamp(28px, 3.4vw, 44px); margin-bottom: 36px; }
.bundle { margin: 0; }
.bundle__media {
  display: block;
  background: var(--bg);
  aspect-ratio: 1/1;
  overflow: hidden;
  transition: transform .5s var(--ease);
}
.bundle__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.bundle__media:hover img { transform: scale(1.03); }
.bundle h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  margin: 22px 0 6px;
}
.bundle p { margin: 0; font-size: 16px; }

@media (max-width: 880px) {
  .library__row { grid-template-columns: 1fr; }
  .library__cta { padding-bottom: 0; }
}

/* =========================================================
   SURVEY / CONTACT FORM
   ========================================================= */
.survey {
  padding: clamp(96px, 14vh, 180px) var(--gutter) clamp(120px, 16vh, 200px);
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}
.survey .display { font-size: clamp(32px, 4vw, 56px); margin-bottom: 16px; }
.survey__lead { font-family: var(--serif); font-size: clamp(20px, 2vw, 26px); margin: 0 0 64px; }
.survey__lead .underline {
  background-image: linear-gradient(transparent 60%, var(--hl) 60%);
  padding: 0 .1em .05em;
  transition: background-image .3s var(--ease);
}
.survey__lead .underline:hover {
  background-image: linear-gradient(transparent 0%, var(--hl) 0%);
}

.form {
  text-align: left;
  display: grid;
  gap: 22px;
  background: var(--surface);
  padding: clamp(28px, 4vw, 48px);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(17,17,17,.04), 0 16px 60px rgba(17,17,17,.06);
}
.field { display: grid; gap: 8px; position: relative; }
.field span {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}
.field span em { color: var(--muted); font-style: italic; font-size: 13px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  border-radius: 0;
  font: 17px/1.4 var(--serif);
  color: var(--ink);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.field textarea { height: auto; min-height: 96px; padding: 14px 16px; resize: vertical; font-family: var(--serif); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}
.field--row { grid-template-columns: 1fr 1fr; gap: 16px; }
.field--row label { display: grid; gap: 8px; }
@media (max-width: 560px) {
  .field--row { grid-template-columns: 1fr; }
}
.form button[type="submit"] {
  justify-self: start;
  margin-top: 8px;
}
.form__legal { font-size: 13px; color: var(--muted); margin: 0; }
.form__success {
  text-align: center;
  padding: 32px 0 8px;
  color: var(--ink);
}
.form__success svg { color: #2a7d4f; margin: 0 auto 12px; }
.form__success h3 { font-family: var(--serif); font-size: 28px; margin: 0 0 8px; font-weight: 500; }
.form__success p { margin: 0; color: var(--muted); }
.form.is-submitted .field, .form.is-submitted button, .form.is-submitted .form__legal { display: none; }
.form.is-submitted .form__success { display: block; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px var(--gutter) 56px;
  max-width: var(--max);
  margin: 0 auto;
}
.foot-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 28px;
}
.foot-row nav { display: flex; gap: 28px; font-family: var(--serif); font-size: 16px; }
.foot-row nav a { color: var(--ink); }
.foot-row nav a:hover { opacity: .6; }
.foot-fine { margin: 0; font-size: 13px; color: var(--muted); }

/* =========================================================
   Reveal / motion
   ========================================================= */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
