:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #122033;
  --muted: #50617a;
  --primary: #0f1e33;
  --accent: #b88b4a;
  --border: #d8dee8;
  --shadow: 0 12px 40px rgba(15, 30, 51, 0.08);
  /* Rotating pastel card surfaces — slightly richer tints so cards read clearly on --bg. */
  --card-pastel-1: #d9e5f3;
  --card-pastel-2: #efe4d6;
  --card-pastel-3: #d6ebe2;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

img {
  border-color: transparent;
  border-image: none;
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 4.2rem);
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 900;
}

p,
li,
a,
button {
  font-size: 1rem;
}

a {
  color: inherit;
}

.container {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  /* Symmetric gutters so section blocks align with the header and don’t read “shifted” on wide screens. */
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.section {
  padding: 5rem 0;
  scroll-margin-top: 96px;
}

.section.alt {
  background: #eef1f6;
}

.lead {
  color: var(--muted);
  font-size: 1.12rem;
  margin-bottom: 1.4rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.muted {
  color: var(--muted);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 247, 245, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: nowrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.1;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.nav-cta {
  white-space: nowrap;
  flex-shrink: 0;
  padding-inline: 1rem;
}

/* Keep desktop header readable before switching to mobile menu. */
@media (max-width: 1320px) {
  .brand {
    font-size: 1.25rem;
  }

  .site-nav {
    gap: 0.55rem;
  }

  .site-nav a {
    font-size: 1rem;
  }

  .nav-cta {
    display: none;
  }
}

.btn {
  border-radius: 999px;
  padding: 0.72rem 1.3rem;
  text-decoration: none;
  border: 1px solid transparent;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #1e3252;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: #e7ecf5;
}

/* Override shared section spacing for the hero block only. */
#hero {
  padding-top: 20px;
  padding-bottom: 20px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

/* Author + Comparisonator row under the title (both use circular 56px marks). */
.hero-author-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.35rem;
  margin: 0.35rem 0 0.85rem;
}

.hero-author {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  text-decoration: none;
  color: inherit;
  border-radius: 999px;
  outline-offset: 4px;
}

.hero-author:hover .hero-author-name {
  text-decoration: underline;
}

.hero-author-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(15, 30, 51, 0.14);
  flex-shrink: 0;
}

.hero-author-text {
  font-size: 1rem;
  color: var(--muted);
}

.hero-author-name {
  font-weight: 600;
  color: var(--text);
}

.hero-partner {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  text-decoration: none;
  color: inherit;
  border-radius: 999px;
  outline-offset: 4px;
}

.hero-partner:hover .hero-partner-role {
  text-decoration: underline;
}

.hero-partner-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  border: 2px solid rgba(15, 30, 51, 0.22);
  padding: 6px;
  box-sizing: border-box;
}

.hero-partner-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-partner-text {
  font-size: 1rem;
  color: var(--muted);
}

.hero-partner-role {
  font-weight: 600;
  color: var(--text);
}

.hero-subtitle {
  color: var(--muted);
  margin-bottom: 0.5rem;
}

/* Hero uses the same star strip as testimonials; slightly larger for the headline column. */
#hero .hero-stars.testimonial-stars {
  margin-top: 0;
  margin-bottom: 1.1rem;
  font-size: 1.28rem;
}

.hero-actions {
  margin-top: 1.8rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.book-cover-placeholder,
.author-placeholder {
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(160deg, #0f1e33, #223a60);
  color: #fff;
  padding: 1.5rem;
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: var(--shadow);
}

.book-cover-placeholder {
  overflow: visible;
  width: 100%;
  height: 100%;
  padding-top: 0;
  padding-bottom: 0;
  /* Hero book placeholder background uses the requested centered circular gradient. */
  background: radial-gradient(circle at 50% 50%, #007b83, #01124d);
}

.book-cover-placeholder img,
.author-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.book-cover-placeholder img {
  width: 122%;
  max-width: none;
  height: auto;
  object-fit: contain;
  transform: translateX(2%) scale(1.08);
  background: rgba(255, 255, 255, 0.04);
}

.book-cover-placeholder p:first-child {
  color: #e8c691;
  font-weight: 700;
}

.content-grid {
  display: grid;
  gap: 1rem;
}

.content-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.content-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

/* Equal-height cells: align card tops in a row and pin .btn to the bottom when copy length differs. */
.content-grid .card:not(.contributor-card) {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.content-grid .card:not(.contributor-card) .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Full-width card directly under a 2- or 3-col grid should match the grid’s vertical rhythm. */
.content-grid.two + .card,
.content-grid.three + .card {
  margin-top: 1rem;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 4px 14px rgba(15, 30, 51, 0.04);
}

/* Optional soft tints: stack with .card; cycle 1 → 2 → 3 for visual variety in dense grids. */
.card.card-pastel-1 {
  background: var(--card-pastel-1);
  border-color: #b5c6dc;
}

.card.card-pastel-2 {
  background: var(--card-pastel-2);
  border-color: #d3c4b0;
}

.card.card-pastel-3 {
  background: var(--card-pastel-3);
  border-color: #9fc7b6;
}

.card ul {
  margin: 0.7rem 0 0;
  /* Keep marker outside so body copy and bullets share the same left edge as headings. */
  padding-left: 1.15rem;
  list-style-position: outside;
}

.card li {
  margin: 0.35rem 0;
}

/* Filled star row for testimonial cards (decorative; label is for screen readers). */
.testimonial-stars {
  margin: 0.15rem 0 0.6rem;
  font-size: 1.15rem;
  line-height: 1.2;
  letter-spacing: 0.2em;
  color: #c9a227;
}

/* Face-card layout for worldwide contributors section. */
.contributor-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.contributor-photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.contributor-card p {
  margin: 0;
}

#contributors > .container > h3 {
  margin-top: 12px;
}

.quote-card blockquote {
  margin: 0;
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: #243a58;
}

.author-grid {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 1.2rem;
}

/* Keep the author section image and content visually balanced on wide screens. */
#about-author .author-grid {
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  align-items: start;
  gap: 1.4rem;
}

/* Use a framed portrait block so the image feels intentional, not stretched. */
#about-author .author-placeholder {
  min-height: 0;
  padding: 0.75rem;
  background: #102749;
  border-color: #1a3458;
  position: sticky;
  top: 6.25rem;
  align-self: start;
}

/* Lock portrait proportions and crop from upper-center for better face focus. */
#about-author .author-placeholder img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 10px;
}

#about-author .author-grid > div {
  display: grid;
  gap: 1rem;
}

#about-author .author-grid > div > p {
  margin: 0;
}

/* Full-width partner strip above the footer (dark gradient + light Comparisonator wordmark). */
.comparisonator-banner {
  background: linear-gradient(105deg, #0f2744 0%, #0a1628 42%, #050508 100%);
  color: #f2f6fc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.comparisonator-banner__inner {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 2.75rem);
  /* Stretch so the logo column can match the full height of the copy + CTA column. */
  align-items: stretch;
  padding: clamp(1.75rem, 4vw, 2.5rem) 0;
}

.comparisonator-banner__logo-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  line-height: 0;
  min-height: 0;
}

.comparisonator-banner__logo {
  display: block;
  /* Aim for visual parity with the headline + body block (~same band height as the text column). */
  height: clamp(120px, 14vw, 200px);
  width: auto;
  max-width: min(440px, 48vw);
  object-fit: contain;
  object-position: left center;
}

.comparisonator-banner__copy {
  min-width: 0;
}

/* Serif headline + sans supporting lines keep parity with the rest of the marketing site. */
.comparisonator-banner__title {
  margin: 0 0 0.35rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.comparisonator-banner__powered {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b8c9e0;
}

.comparisonator-banner__powered-label {
  font-weight: 500;
  color: #8fa6c3;
  margin-right: 0.35rem;
}

.comparisonator-banner__tagline {
  margin: 0 0 1rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #c9d6ea;
  max-width: 52ch;
}

/* Outline CTA: visible focus ring for keyboard users on dark bg. */
.comparisonator-banner__cta {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.comparisonator-banner__cta:hover,
.comparisonator-banner__cta:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 720px) {
  .comparisonator-banner__inner {
    grid-template-columns: 1fr;
    align-items: center;
    text-align: center;
  }

  .comparisonator-banner__logo-link {
    justify-content: center;
    justify-self: center;
  }

  .comparisonator-banner__logo {
    height: clamp(96px, 28vw, 160px);
    max-width: min(360px, 88vw);
    object-position: center center;
  }

  .comparisonator-banner__tagline {
    margin-left: auto;
    margin-right: auto;
  }
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 2rem 0 1rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #0f1e33;
  color: #dae3f1;
}

.footer-links,
.social-links {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.link-btn {
  border: 0;
  background: transparent;
  color: #dae3f1;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.copyright {
  margin: 0;
  text-align: center;
  padding: 0 1rem 2rem;
  color: #b6c4d9;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.4rem;
  border-radius: 8px;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--primary);
}

.policy-modal {
  max-width: 720px;
  width: min(92vw, 720px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
}

.policy-modal::backdrop {
  background: rgba(15, 30, 51, 0.55);
}

.policy-modal article {
  padding: 1.5rem;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1060px) {
  .site-nav {
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    background: #f7f7f5;
    border-bottom: 1px solid var(--border);
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 4%;
  }

  .site-nav.open {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-cta {
    display: none;
  }

  .hero-grid,
  .author-grid,
  .content-grid.two,
  .content-grid.three,
  .market-grid {
    grid-template-columns: 1fr;
  }

  .book-cover-placeholder,
  .author-placeholder {
    min-height: 250px;
  }

  /* Reduce intentional hero image overflow on smaller screens for readability. */
  .book-cover-placeholder img {
    width: 108%;
    transform: scale(1.03);
  }

  .contributor-card {
    align-items: flex-start;
  }

  .contributor-photo {
    width: 72px;
    height: 72px;
  }

  /* Remove sticky behavior and tighten portrait sizing on smaller screens. */
  #about-author .author-placeholder {
    position: static;
    top: auto;
    max-width: 420px;
    margin: 0 auto;
  }

  #about-author .author-placeholder img {
    aspect-ratio: 3 / 4;
    object-position: center 15%;
  }
}

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

  .reveal,
  .reveal.visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
