/* longbookreviews.com
   One page, no sections: a navbar, a line of heading, a grid of modules, a footer.
   Tokens first, then the three pieces. */

:root {
  --page: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --hair: rgba(0, 0, 0, 0.08);
  --link: #0066cc;
  --control: rgba(0, 0, 0, 0.06);
  --control-on: #ffffff;
  --shadow-rest: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.05);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.05), 0 18px 40px rgba(0, 0, 0, 0.10);
  --x: #0f1419;
  --reddit: #ff4500;
  --verified: #1d9bf0;
  --radius: 18px;
  --gutter: 22px;
  --nav-h: 48px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #000000;
    --card: #1d1d1f;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #86868b;
    --hair: rgba(255, 255, 255, 0.12);
    --link: #2997ff;
    --control: rgba(255, 255, 255, 0.10);
    --control-on: #3a3a3c;
    --shadow-rest: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 18px 40px rgba(0, 0, 0, 0.6);
    --x: #f5f5f7;
  }
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---- Navbar ------------------------------------------------------------ */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--page) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hair);
}

.nav-inner {
  max-width: 1024px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.wordmark:hover { text-decoration: none; }
/* The official logo, at its own proportions (media kit: never stretched or recoloured). */
.wordmark img { display: block; height: 26px; width: auto; }
.wordmark span { padding-top: 2px; }
.foot-logo { display: inline-block; margin-bottom: 14px; }
.foot-logo img { display: block; height: 22px; width: auto; }

.sort {
  display: inline-flex;
  padding: 2px;
  background: var(--control);
  border-radius: 999px;
}
.sort button {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 5px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.sort button[aria-pressed="true"] {
  background: var(--control-on);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ---- Heading and grid -------------------------------------------------- */

.lede {
  max-width: 1024px;
  margin: 0 auto;
  padding: 72px var(--gutter) 40px;
  text-align: center;
}
.lede h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.07;
  font-weight: 600;
  letter-spacing: -0.028em;
}
.lede p {
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: clamp(17px, 2vw, 21px);
  letter-spacing: -0.015em;
}

.grid {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 var(--gutter) 96px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  align-items: start;
}

/* ---- Module ------------------------------------------------------------ */

.module {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px 18px;
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-rest);
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 220ms ease;
  will-change: transform;
}
.module:hover,
.module:focus-visible {
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}
.module:active { transform: translateY(-1px); }

.module-head {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  column-gap: 12px;
  align-items: center;
}
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #d9d9de, #b7b7c0);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-reddit { background: var(--reddit); }
.avatar-reddit svg { width: 28px; height: 28px; fill: #fff; }

.who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.name {
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge svg { width: 17px; height: 17px; fill: var(--verified); display: block; }
.handle { color: var(--ink-3); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.source-mark svg { width: 20px; height: 20px; display: block; }
.module-x .source-mark svg { fill: var(--x); }
.module-reddit .source-mark svg { fill: var(--reddit); }

.context { margin: 0; color: var(--ink-3); font-size: 14px; }
.context .mention { color: var(--link); }

.body p { margin: 0; font-size: 17px; line-height: 1.42; }
.body p + p { margin-top: 12px; }
.body .mention { color: var(--link); }

.module-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
  color: var(--ink-3);
  font-size: 13px;
}
.module-foot .open { margin-left: auto; color: var(--link); font-weight: 500; }
.score { color: var(--reddit); font-weight: 500; }

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

.foot {
  border-top: 1px solid var(--hair);
  padding: 56px var(--gutter) 48px;
}
.foot-inner { max-width: 680px; margin: 0 auto; }
.foot h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.foot .about {
  margin: 0 0 28px;
  color: var(--ink-2);
  font-size: 15px;
}

.faq details { border-bottom: 1px solid var(--hair); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 32px 16px 0;
  position: relative;
  font-size: 17px;
  font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 200ms ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq .answer { padding: 0 0 18px; color: var(--ink-2); font-size: 15px; }
.faq .answer p { margin: 0 0 6px; }

.colophon {
  margin: 36px 0 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.6;
}
.colophon p { margin: 0; }

/* ---- Small screens ----------------------------------------------------- */

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .lede { padding: 48px var(--gutter) 28px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .module { padding: 18px 18px 16px; }
  .wordmark span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .module, .sort button, .faq summary::after { transition: none; }
  .module:hover, .module:focus-visible { transform: none; }
}
