:root {
  --reference-canvas: #666b6e;
  --reference-canvas-deep: #5b6063;
  --reference-stripe: rgba(37, 41, 43, 0.16);
  --reference-panel: #f3efe8;
  --reference-panel-bright: #faf7f1;
  --reference-panel-soft: #ebe5dd;
  --reference-ink: #2d2b2a;
  --reference-muted: #68615d;
  --reference-line: rgba(46, 42, 40, 0.16);
  --accent: #b65f45;
  --accent-dark: #88442f;
  --accent-soft: #ead9d1;
  --content-shell: #ded7ce;
  --content-shell-soft: #e7e1d9;
  --content-shell-line: rgba(46, 42, 40, 0.18);
}

body {
  color: var(--reference-ink);
  background-color: var(--reference-canvas);
  background-image:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 8px,
      var(--reference-stripe) 8px,
      var(--reference-stripe) 9px,
      rgba(255, 255, 255, 0.025) 9px,
      rgba(255, 255, 255, 0.025) 18px
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(0, 0, 0, 0.03));
  background-size: auto, 100% 100%;
  background-attachment: fixed;
}

/* Shared light surfaces */
.category-section,
.site-card,
.category-page-header,
.reviews-header,
.reviews-toolbar,
.review-directory-item,
.prose-card,
.empty-state,
.review-simple-identity,
.review-detail-panel,
.review-overview-card,
.related-visual-card,
.directory-search,
.search-result,
.method-grid section,
.ranked-list {
  background: var(--reference-panel-bright);
  border-color: var(--reference-line);
}

.category-section,
.category-page-header,
.reviews-header,
.review-simple-identity,
.review-overview-card,
.prose-card,
.ranked-list,
.directory-search {
  box-shadow: 0 18px 42px rgba(24, 27, 28, 0.14);
}

.category-heading {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--tone-soft) 52%, #f1ece5),
    #eee8e1 84%
  );
  border-bottom-color: rgba(50, 45, 43, 0.12);
}

.section-description,
.see-all-link {
  background: var(--reference-panel-soft);
}

.site-card:hover,
.search-result:hover,
.review-directory-item:hover {
  background: #f0ebe4;
}

/* One content shell system for the whole site */
.directory-browser > .shell,
.page-shell,
.not-found {
  background: var(--content-shell);
  border: 1px solid var(--content-shell-line);
  border-radius: 22px;
  box-shadow: 0 26px 68px rgba(24, 27, 28, 0.20);
}

.directory-browser > .shell {
  padding: 14px;
}

.page-shell {
  padding: 20px 22px 56px;
}

.not-found {
  padding: clamp(28px, 5vw, 64px);
  margin-block: 28px 64px;
}

.directory-sections {
  gap: 14px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* Breadcrumbs are deliberately high contrast */
.breadcrumbs {
  margin: 0 0 18px;
}

.breadcrumbs ol {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  align-items: center;
  gap: 0;
  padding: 8px 12px;
  color: #f2ece5;
  background: #3f4446;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  box-shadow: 0 7px 18px rgba(24, 27, 28, 0.15);
  font-size: 0.82rem;
  font-weight: 640;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #f2ece5;
}

.breadcrumbs a {
  color: #f2ece5;
  transition: color .18s ease;
}

.breadcrumbs a:hover {
  color: #fff;
}

.breadcrumbs li > span[aria-hidden="true"] {
  color: #d38a72;
  font-weight: 800;
}

.breadcrumbs [aria-current="page"] {
  color: #fff;
  font-weight: 720;
}

/* Headings now sit on the light shell rather than directly on the canvas */
.page-header h1,
.page-shell > .section-heading h2,
.review-visual-page > .section-heading h2,
.category-page-header h1,
.reviews-header h1,
.review-simple-identity h1,
.review-overview-card h2,
.review-detail-panel h2 {
  color: var(--reference-ink);
}

.page-header > p,
.category-page-header > div > p:last-child,
.reviews-header p {
  color: #5f5955;
}

/* Header */
.site-header {
  background: rgba(248, 245, 239, 0.985);
  border-bottom-color: rgba(50, 46, 43, 0.16);
  box-shadow: 0 10px 26px rgba(31, 34, 35, 0.13);
}

.brand-mark {
  color: #7e402f;
  background: linear-gradient(145deg, #efe0d8, #e3d0c7);
  border-color: #cbaea2;
}

.brand-copy strong {
  color: #282624;
}

.brand-tagline {
  color: #655e5a;
}

.header-search {
  background: #ece7df;
  border-color: rgba(50, 46, 43, 0.16);
}

.header-search:focus-within {
  border-color: #b56a53;
  box-shadow: 0 0 0 3px rgba(182, 95, 69, 0.12);
}

.header-search button,
.directory-search button,
.button-primary {
  background: var(--accent);
}

.header-search button:hover,
.directory-search button:hover,
.button-primary:hover {
  background: var(--accent-dark);
}

/* Global ads remain centered in the canvas gap */
.global-ad-wrap,
.global-ad-wrap-bottom {
  width: var(--shell);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
}

.global-ad-wrap {
  min-height: 132px;
  padding: 21px 0;
}

.global-ad-wrap-bottom {
  min-height: 150px;
  padding: 28px 0;
}

.global-ad-wrap .ad-slot-banner {
  width: min(970px, calc(100% - 32px));
  margin: 0 auto;
}

.ad-slot {
  color: #d8d2ca;
  background: #555b5e;
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.ad-slot strong {
  color: #f2ede6;
}

.ad-slot-square {
  background: #555b5e;
}

/* Category pages stay clean and compact */
.category-page-header {
  padding: 28px 6px 24px;
}

.category-ranked-list {
  margin-top: 4px;
}

.category-ranked-list .site-card {
  grid-template-columns: 44px 46px minmax(0, 1fr);
  padding-top: 17px;
  padding-bottom: 17px;
}

.category-ranked-list .site-card p {
  margin-bottom: 0;
}

/* Review: screenshot and right rail read as one balanced module */
.review-visual-page {
  padding-bottom: 56px;
}

.review-simple-identity {
  margin-top: 0;
}

.review-primary-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: stretch;
}

.review-screenshot-frame {
  border-color: rgba(39, 37, 35, 0.20);
  box-shadow: 0 22px 50px rgba(25, 28, 29, 0.18);
}

.review-sidebar {
  width: 300px;
  height: 100%;
  grid-template-rows: 250px minmax(0, 1fr);
  align-self: stretch;
}

.review-sidebar .ad-slot-square,
.review-detail-panel {
  width: 300px;
  max-width: 100%;
}

.review-sidebar .ad-slot-square {
  height: 250px;
  margin: 0;
}

.review-detail-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 17px 19px;
  box-shadow: 0 15px 34px rgba(28, 31, 32, 0.12);
}

.review-detail-panel h2 {
  margin: 0 0 9px;
  font-size: 1.17rem;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.review-quick-facts {
  margin: 0 0 12px;
}

.review-quick-facts div {
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  padding: 5px 0;
  border-top-color: rgba(62, 56, 53, 0.10);
}

.review-quick-facts dt {
  color: #7e746e;
  font-size: 0.66rem;
  font-weight: 700;
}

.review-quick-facts dd {
  color: #45413e;
  font-size: 0.79rem;
  font-weight: 640;
}

.review-detail-visit {
  min-height: 56px;
  padding: 12px 15px;
  margin-top: auto;
  border-radius: 11px;
  font-size: 1.03rem;
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-align: center;
  box-shadow: 0 12px 26px rgba(136, 68, 47, 0.24);
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.review-detail-visit:hover {
  box-shadow: 0 15px 30px rgba(136, 68, 47, 0.28);
  transform: translateY(-1px);
}

.review-detail-visit:active {
  box-shadow: 0 8px 18px rgba(136, 68, 47, 0.20);
  transform: translateY(0);
}

.review-overview-card {
  box-shadow: 0 16px 38px rgba(27, 30, 31, 0.12);
}

/* Related sites use one clear section title */
.related-visual-section {
  margin-top: 28px;
}

.related-visual-heading {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 10px 16px;
  margin-bottom: 13px;
  background: #d1c8bd;
  border: 1px solid rgba(55, 49, 46, 0.16);
  border-radius: 12px;
}

.related-visual-heading h2 {
  margin: 0;
  color: #302d2a;
  font-size: 1.2rem;
  font-weight: 740;
  letter-spacing: -0.025em;
}

.related-visual-card {
  box-shadow: 0 12px 28px rgba(28, 31, 32, 0.11);
}

/* Reviews index */
.reviews-list {
  gap: 12px;
}

.review-directory-item {
  box-shadow: 0 10px 26px rgba(27, 30, 31, 0.09);
}

.pagination-ellipsis {
  display: inline-grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  color: #6f6762;
  font-weight: 700;
}

/* Informational/search cards follow the same surface language */
.directory-search,
.search-result,
.method-grid section,
.prose-card,
.reviews-toolbar,
.review-directory-item {
  border-color: var(--reference-line);
}

@media (max-width: 1120px) {
  .review-primary-layout {
    grid-template-columns: 1fr;
  }

  .review-sidebar {
    width: 100%;
    height: auto;
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: stretch;
  }

  .review-detail-panel {
    width: 100%;
    min-height: 250px;
  }
}

@media (max-width: 760px) {
  body {
    background-attachment: scroll;
  }

  .directory-browser > .shell,
  .page-shell,
  .not-found {
    border-radius: 16px;
  }

  .directory-browser > .shell {
    padding: 9px;
  }

  .page-shell {
    padding: 14px 14px 42px;
  }

  .directory-sections {
    gap: 10px;
  }

  .breadcrumbs {
    margin-bottom: 14px;
  }

  .breadcrumbs ol {
    width: 100%;
    border-radius: 11px;
    font-size: 0.76rem;
  }

  .global-ad-wrap,
  .global-ad-wrap-bottom {
    min-height: 112px;
    padding: 14px 0;
  }

  .global-ad-wrap .ad-slot-banner {
    width: 100%;
  }

  .review-sidebar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .review-sidebar .ad-slot-square,
  .review-detail-panel {
    width: min(300px, 100%);
    margin-inline: auto;
  }

  .review-detail-panel {
    min-height: 0;
  }

  .review-detail-visit {
    min-height: 54px;
    font-size: 1rem;
  }

  .category-ranked-list .site-card {
    grid-template-columns: 38px 42px minmax(0, 1fr);
  }

  .related-visual-heading {
    min-height: 50px;
    padding: 9px 13px;
  }
}
