@font-face {
  font-family: "Bespoke Serif";
  src: url("/BespokeSerif-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --background: #fef9f5;
  --foreground: #121a28;
  --card: #ffffff;
  --card-tinted: #fef8f3;
  --primary: #80333c;
  --primary-foreground: #ffffff;
  --accent: #f0a3a1;
  --border: #fbd4c4;
  --sand: #f7dcb4;
  --peach: #f8b69c;
  --muted: #6f5960;
  --body-copy: #3a3a3a;
  --topbar-backdrop: rgba(254, 249, 245, 0.82);
  --topbar-surface: rgba(255, 255, 255, 0.76);
  --soft-surface: rgba(255, 255, 255, 0.72);
  --search-surface: rgba(255, 255, 255, 0.8);
  --display: "Bespoke Serif", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 0.625rem;
  color-scheme: light;
}

html.dark {
  --background: #121a28;
  --foreground: #f9f2e9;
  --card: #3a4760;
  --card-tinted: #3a4760;
  --primary: #f0a3a1;
  --primary-foreground: #121a28;
  --accent: #f0a3a1;
  --border: #56627a;
  --sand: #f7dcb4;
  --peach: #f7dcb4;
  --muted: #d4d4d4;
  --body-copy: #f1e8df;
  --topbar-backdrop: rgba(18, 26, 40, 0.86);
  --topbar-surface: rgba(58, 71, 96, 0.76);
  --soft-surface: rgba(255, 255, 255, 0.08);
  --search-surface: rgba(58, 71, 96, 0.8);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--sans);
  line-height: 1.6;
  transition: background-color 180ms ease, color 180ms ease;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.5rem;
  background: var(--topbar-backdrop);
  backdrop-filter: blur(6px);
}

.topbar-surface {
  min-height: 76px;
  padding: 0.9rem clamp(1rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-radius: var(--radius);
  background: var(--topbar-surface);
  backdrop-filter: blur(12px);
}

.brand-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
}

.brand-logo {
  display: block;
  width: min(12rem, 32vw);
  height: auto;
  flex: 0 0 auto;
}

.brand-logo-dark {
  display: none;
}

html.dark .brand-logo-light {
  display: none;
}

html.dark .brand-logo-dark {
  display: block;
}

.app-title {
  min-width: 0;
  padding-left: clamp(1rem, 3vw, 2rem);
  border-left: 1px solid var(--border);
}

.app-title h1 {
  margin: 0.15rem 0 0;
  font: 700 clamp(1.2rem, 2.2vw, 1.55rem) / 1.05 var(--display);
}

.kicker {
  width: fit-content;
  margin: 0;
  color: var(--accent);
  font-family: "parlare", sans-serif;
  font-size: 2rem;
  font-weight: 400;
  line-height: 0.9;
  text-transform: lowercase;
  transform: skewY(-4deg);
}

.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.total-statement {
  margin: 0;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.total-statement strong {
  font: 800 1.2rem var(--display);
}

.appearance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--border);
}

.appearance button {
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.appearance button.active {
  background: var(--card);
  color: var(--primary);
}

.appearance svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  width: min(90rem, 100%);
  min-height: calc(100vh - 92px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 92px;
  height: calc(100vh - 92px);
  overflow: auto;
  padding: 2.25rem 1.25rem 2rem;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem 0.8rem;
  color: var(--primary);
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
}

.category-list {
  display: grid;
  gap: 0.3rem;
}

.category-item {
  width: 100%;
  padding: 0.72rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background-color 150ms ease, color 150ms ease;
}

.category-item:hover {
  background: var(--soft-surface);
}

.category-item.active {
  background: var(--border);
  color: var(--primary);
  font-weight: 800;
}

.category-count {
  min-width: 2rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--soft-surface);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.category-item.active .category-count {
  background: var(--card);
}

.sidebar-note {
  margin: 1.4rem 0.75rem 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.mobile-close,
.filter-toggle {
  display: none;
}

.main {
  min-width: 0;
  padding: 2.25rem clamp(1.25rem, 4vw, 4.5rem) 4rem;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-box {
  min-height: 3.25rem;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--search-surface);
  transition: border-color 150ms ease, background-color 150ms ease;
}

.search-box:focus-within {
  border-color: var(--accent);
  background: var(--card);
  outline: 3px solid rgba(240, 163, 161, 0.2);
}

.search-icon {
  color: var(--primary);
  font-size: 1.45rem;
  line-height: 1;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--foreground);
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-box kbd {
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  background: var(--background);
  color: var(--muted);
  font-size: 0.7rem;
}

.results-heading {
  margin: 2.75rem 0 1.5rem;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
}

.results-heading h2 {
  max-width: 44rem;
  margin: 0.35rem 0 0;
  font: 750 clamp(2rem, 5vw, 3rem) / 0.98 var(--display);
  letter-spacing: -0.025em;
}

.result-summary {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.testimonial-list {
  display: grid;
  gap: 1.15rem;
}

.testimonial-card {
  position: relative;
  overflow: hidden;
  padding: 1.75rem 2.25rem 1.5rem 2rem;
  border: 0;
  border-left: 4px solid var(--peach);
  background: var(--card);
}

.card-header {
  position: relative;
  z-index: 1;
  padding-right: 3.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 0.9rem;
}

.author {
  margin: 0;
  color: var(--foreground);
  font: 700 1.25rem / 1.15 var(--display);
}

.category-badge {
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.035em;
}

.quote-mark {
  position: absolute;
  top: -0.6rem;
  right: 0.65rem;
  color: var(--peach);
  font: 800 5.25rem / 1 var(--display);
  pointer-events: none;
}

.body {
  position: relative;
  z-index: 1;
  max-height: 11.4rem;
  overflow: hidden;
  margin-top: 1rem;
  color: var(--body-copy);
  font-family: var(--display);
  font-size: 1.08rem;
  font-style: italic;
  line-height: 1.75;
  white-space: pre-wrap;
}

.body::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3.5rem;
  background: linear-gradient(to bottom, transparent, var(--card));
}

.testimonial-card.expanded .body {
  max-height: none;
}

.testimonial-card.expanded .body::after {
  display: none;
}

.card-footer {
  position: relative;
  z-index: 1;
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

.expand-button {
  padding: 0.35rem 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
}

.expand-button:hover {
  color: var(--accent);
}

.pagination {
  padding: 3.5rem 0 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pagination button {
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color 150ms ease, color 150ms ease;
}

.pagination button:hover:not(:disabled),
.pagination button.active {
  background: var(--accent);
  color: var(--primary-foreground);
}

.pagination button.active {
  font-weight: 800;
}

.pagination button:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.empty-state {
  padding: 4rem 2rem;
  border-left: 4px solid var(--peach);
  background: var(--card);
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  font: 700 1.5rem var(--display);
}

.empty-state span {
  margin-top: 0.35rem;
  color: var(--muted);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(18, 26, 40, 0.42);
  backdrop-filter: blur(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;
}

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

@media (max-width: 860px) {
  .topbar-surface {
    min-height: 68px;
  }

  .app-title {
    display: none;
  }

  .workspace {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(21rem, 88vw);
    height: 100vh;
    padding: 1.5rem;
    background: var(--background);
    transform: translateX(-105%);
    transition: transform 200ms ease;
  }

  .filters-open .sidebar {
    transform: translateX(0);
  }

  .mobile-close {
    width: 2.5rem;
    height: 2.5rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: var(--border);
    cursor: pointer;
    color: var(--primary);
    font-size: 1.5rem;
  }

  .main {
    padding-top: 1.5rem;
  }

  .filter-toggle {
    min-height: 3.25rem;
    padding: 0 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 0;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--primary-foreground);
    cursor: pointer;
    font-weight: 800;
  }
}

@media (max-width: 580px) {
  .topbar {
    padding: 0.4rem;
  }

  .topbar-surface {
    padding: 0.8rem 1rem;
  }

  .brand-logo {
    width: min(9.5rem, 42vw);
  }

  .header-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
  }

  .total-statement {
    font-size: 0.68rem;
  }

  .total-statement strong {
    font-size: 0.9rem;
  }

  .main {
    padding: 1.2rem 1rem 3rem;
  }

  .toolbar {
    align-items: stretch;
  }

  .filter-toggle {
    width: 3.25rem;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .filter-toggle span {
    font-size: 1rem;
  }

  .search-box {
    padding-inline: 0.8rem;
  }

  .search-box kbd {
    display: none;
  }

  .results-heading {
    margin-top: 2.2rem;
    display: block;
  }

  .results-heading h2 {
    font-size: 2.15rem;
  }

  .result-summary {
    margin-top: 0.8rem;
  }

  .testimonial-card {
    padding: 1.5rem 1.25rem 1.25rem 1.4rem;
  }

  .card-header {
    padding-right: 2.25rem;
    display: block;
  }

  .category-badge {
    width: fit-content;
    margin-top: 0.65rem;
    display: block;
  }

  .quote-mark {
    right: 0.35rem;
    font-size: 4rem;
  }

  .body {
    font-size: 1rem;
    line-height: 1.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
