/* ============================================================
   PriceCheckMD design system
   Friendly/approachable — warm cream + sage + terracotta
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT@9..144,400..700,30..100&family=DM+Sans:opsz,wght@9..40,400..600&display=swap');

:root {
  /* Backgrounds */
  --cream: #FAF6EE;
  --cream-deep: #F2EBDB;
  --cream-shadow: #EBE2CB;
  --paper: #FFFCF6;

  /* Text */
  --ink: #1F2419;
  --ink-soft: #4A4A40;
  --ink-muted: #8B8780;

  /* Accents */
  --sage: #4A6D55;
  --sage-deep: #3D5A47;
  --sage-light: #B5C4B7;
  --sage-tint: #E8EFE9;

  --terracotta: #C56B49;
  --terracotta-deep: #A85838;
  --terracotta-tint: #F5E2D6;

  --butter: #F4D9A6;
  --butter-tint: #FBEED1;

  /* Lines & shadows */
  --line: #E8DFC8;
  --line-soft: #EFE8D5;
  --shadow-soft: 0 1px 2px rgba(74, 109, 85, 0.04), 0 4px 12px rgba(74, 109, 85, 0.06);
  --shadow-card: 0 2px 4px rgba(74, 109, 85, 0.05), 0 8px 24px rgba(74, 109, 85, 0.08);

  /* Type scale */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================================
   Reset / Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  background-image:
    radial-gradient(ellipse 1200px 600px at 70% -100px, rgba(244, 217, 166, 0.25), transparent 70%),
    radial-gradient(ellipse 800px 400px at 10% 110%, rgba(181, 196, 183, 0.18), transparent 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--sage-deep); text-decoration: none; }
a:hover { color: var(--terracotta-deep); }

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: 'SOFT' 50, 'opsz' 144;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 5vw + 0.5rem, 4.2rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.7rem, 2.5vw + 0.5rem, 2.5rem);
  font-weight: 500;
}

h3 {
  font-size: 1.4rem;
  font-weight: 500;
  font-variation-settings: 'SOFT' 30, 'opsz' 60;
}

h4 {
  font-size: 1.15rem;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sage-deep);
  margin-bottom: 1.25rem;
}

p { margin: 0 0 1rem 0; }
p.lede {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 38em;
}

/* Hand-drawn underline for emphasis */
.underlined {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.underlined::after {
  content: '';
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -0.08em;
  height: 0.45em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'><path d='M2,8 Q40,3 80,7 T160,5 T198,8' stroke='%23C56B49' stroke-width='2.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  opacity: 0.85;
  z-index: -1;
}

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: 4rem 0; }
section.compact { padding: 2.5rem 0; }
section.spacious { padding: 6rem 0; }

@media (min-width: 768px) {
  .container, .container-narrow { padding: 0 2rem; }
}

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  background: rgba(250, 246, 238, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  font-variation-settings: 'SOFT' 50;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--ink); }

.brand-mark {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--sage);
  display: grid;
  place-items: center;
  color: var(--cream);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  font-variation-settings: 'SOFT' 30;
}
.brand-mark::before {
  content: '$';
  transform: translateY(-1px);
}

.brand-name strong { color: var(--terracotta); font-weight: 500; }

.nav-links {
  display: none;
  gap: 2rem;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}
@media (min-width: 800px) {
  .nav-links { display: flex; }
}

.nav-links a {
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active {
  color: var(--ink);
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--terracotta);
  border-radius: 2px;
}

.nav-toggle {
  display: block;
  background: none;
  border: 0;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--ink);
}
@media (min-width: 800px) {
  .nav-toggle { display: none; }
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0 1.25rem 0;
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 1rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 0.6rem 0.25rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.mobile-menu a.active { color: var(--terracotta); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}

.btn-primary {
  background: var(--sage);
  color: var(--cream);
}
.btn-primary:hover {
  background: var(--sage-deep);
  color: var(--cream);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 109, 85, 0.25);
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover {
  background: var(--cream-deep);
  color: var(--ink);
  border-color: var(--ink-muted);
}

.btn-text {
  background: transparent;
  color: var(--sage-deep);
  padding: 0.5rem 0.75rem;
}
.btn-text:hover {
  color: var(--terracotta-deep);
  background: var(--terracotta-tint);
}

.btn-large { padding: 1rem 2rem; font-size: 1.05rem; }

/* ============================================================
   Cards & callouts
   ============================================================ */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: var(--shadow-soft);
}

.callout {
  background: var(--cream-deep);
  border-left: 3px solid var(--terracotta);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
}
.callout h4 { margin-bottom: 0.4rem; }

.note {
  background: var(--sage-tint);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ============================================================
   Hero (homepage)
   ============================================================ */
.hero {
  padding: 4rem 0 3rem 0;
  position: relative;
}
@media (min-width: 768px) {
  .hero { padding: 6rem 0 4rem 0; }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (min-width: 980px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4rem;
    align-items: center;
  }
}

.hero h1 { margin-bottom: 1.25rem; }
.hero .lede { margin-bottom: 1.75rem; }

/* Decorative SVG container */
.hero-art {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 380px;
  margin-left: auto;
  display: none;
}
@media (min-width: 980px) {
  .hero-art { display: block; }
}

/* ============================================================
   Search panel
   ============================================================ */
.search-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  position: relative;
}

.search-panel-label {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sage-deep);
  margin-bottom: 0.75rem;
}

.search-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
@media (min-width: 600px) {
  .search-input-wrap { flex-direction: row; align-items: stretch; }
}

.search-input {
  flex: 1;
  border: 1.5px solid var(--line);
  background: var(--cream);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink);
  transition: border-color 0.18s ease, background 0.18s ease;
}
.search-input::placeholder { color: var(--ink-muted); }
.search-input:focus {
  outline: 0;
  border-color: var(--sage);
  background: var(--paper);
}

.search-button {
  flex-shrink: 0;
  font-size: 1.05rem;
  padding: 1rem 2rem;
}

.search-suggestions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--ink-muted);
}
.search-suggestion-chip {
  padding: 0.3rem 0.75rem;
  background: var(--cream-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-soft);
  transition: all 0.18s ease;
}
.search-suggestion-chip:hover {
  background: var(--terracotta-tint);
  border-color: var(--terracotta);
  color: var(--terracotta-deep);
}

/* ============================================================
   Search states (loading, empty, error, results)
   ============================================================ */
.search-state {
  margin-top: 2rem;
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.search-state svg, .search-state .icon {
  width: 48px; height: 48px;
  margin: 0 auto 1rem;
  color: var(--sage-light);
}
.search-state h3 { margin-bottom: 0.5rem; }
.search-state p { color: var(--ink-muted); margin: 0; }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--sage-tint);
  border-top-color: var(--sage);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2.5rem 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.results-count {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  font-variation-settings: 'SOFT' 30;
}
.results-count em {
  color: var(--terracotta);
  font-style: normal;
}

.sort-select {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
}

/* ============================================================
   Result cards
   ============================================================ */
.result-list { display: flex; flex-direction: column; gap: 0.85rem; }

.result-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
@media (min-width: 700px) {
  .result-card {
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: start;
  }
}
.result-card:hover {
  border-color: var(--sage-light);
  box-shadow: var(--shadow-soft);
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.tag {
  display: inline-block;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-body);
  letter-spacing: 0.01em;
}
.tag-code { background: var(--sage-tint); color: var(--sage-deep); }
.tag-class { background: var(--butter-tint); color: #8a6e29; }
.tag-state { background: var(--terracotta-tint); color: var(--terracotta-deep); }

.result-description {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  font-variation-settings: 'SOFT' 30;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.result-meta {
  font-size: 0.88rem;
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.4rem;
}
.result-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }

.result-price {
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
@media (min-width: 700px) {
  .result-price { text-align: right; align-items: flex-end; }
}
.result-price-value {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: 'SOFT' 30;
  font-size: 2rem;
  color: var(--ink);
  line-height: 1;
}
.result-price-label {
  font-size: 0.78rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.35rem;
}

/* ============================================================
   Generic content / prose pages
   ============================================================ */
.prose { max-width: 38em; }
.prose p { font-size: 1.05rem; line-height: 1.75; color: var(--ink-soft); }
.prose h2 { margin: 2.5rem 0 1rem; }
.prose h3 { margin: 2rem 0 0.75rem; }
.prose ul { margin: 0 0 1.25rem 0; padding-left: 1.25rem; }
.prose ul li { margin-bottom: 0.5rem; color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 600; }

/* Step list (used on how-it-works) */
.steps {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
}
.step-number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--cream-deep);
  border: 2px solid var(--terracotta);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--terracotta-deep);
  font-variation-settings: 'SOFT' 30;
  flex-shrink: 0;
}
.step-content h3 { margin-bottom: 0.5rem; }
.step-content p { color: var(--ink-soft); margin: 0; }

/* FAQ accordions / list */
.faq-section { margin-bottom: 2.5rem; }
.faq-section h3 {
  color: var(--sage-deep);
  margin-bottom: 1.25rem;
  font-size: 1.25rem;
}
.faq-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.faq-item:last-child { border-bottom: 0; }
.faq-item h4 { margin-bottom: 0.6rem; }
.faq-item p { color: var(--ink-soft); margin: 0; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  margin-top: 5rem;
  padding: 3rem 0 2rem;
  background: linear-gradient(180deg, transparent, var(--cream-shadow));
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (min-width: 700px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  font-variation-settings: 'SOFT' 50;
  color: var(--ink);
  margin-bottom: 0.75rem;
}
.footer-brand strong { color: var(--terracotta); font-weight: 500; }

.footer-tagline {
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 24em;
}

.footer-heading {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a {
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.footer-links a:hover { color: var(--ink); }

.footer-meta {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-align: center;
}

/* ============================================================
   Utility helpers
   ============================================================ */
.text-center { text-align: center; }
.flex { display: flex; }
.gap-md { gap: 1rem; }
.mt-md { margin-top: 1.5rem; }
.mt-lg { margin-top: 2.5rem; }
.mb-md { margin-bottom: 1.5rem; }

.hidden { display: none !important; }

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0;
  color: var(--ink-muted);
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.divider svg { width: 24px; height: 24px; color: var(--sage-light); }
