/* ============================================================
   StitchSaver — original visual identity
   Palette: warm linen, deep indigo ink, coral-thread accent
   ============================================================ */

:root {
  --linen: #faf6ef;
  --linen-deep: #f1e9db;
  --ink: #23304a;
  --ink-soft: #51617f;
  --thread: #e2593b;        /* coral thread accent */
  --thread-dark: #c34428;
  --sage: #3e7a5e;          /* savings green */
  --sage-soft: #e2efe7;
  --card: #ffffff;
  --line: #ddd2bf;
  --gold: #b98a2e;

  --radius: 14px;
  --shadow: 0 2px 6px rgba(35, 48, 74, 0.06), 0 12px 32px rgba(35, 48, 74, 0.08);
  --font: "Avenir Next", "Segoe UI", "Trebuchet MS", system-ui, -apple-system, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--linen);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 239, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 2px dashed var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark { width: 30px; height: 30px; color: var(--thread); }

.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand-name em { color: var(--thread); font-style: normal; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--thread-dark); }

.nav-cta {
  color: #fff !important;
  background: var(--thread);
  padding: 0.5rem 1rem;
  border-radius: 999px;
}
.nav-cta:hover { background: var(--thread-dark); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

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

.btn-ghost {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--thread); color: var(--thread-dark); }

/* ---------- Hero ---------- */

.hero {
  padding: 4.5rem 0 3.5rem;
  background:
    radial-gradient(60rem 24rem at 110% -10%, rgba(226, 89, 59, 0.09), transparent 60%),
    radial-gradient(50rem 22rem at -20% 110%, rgba(62, 122, 94, 0.10), transparent 60%);
}

.hero-inner { max-width: 46rem; }

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sage);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  line-height: 1.12;
  margin: 0 0 1.1rem;
}

.hero .accent {
  color: var(--thread);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-color: var(--line);
  text-underline-offset: 8px;
  text-decoration-thickness: 2px;
}

.hero-sub {
  font-size: 1.12rem;
  color: var(--ink-soft);
  margin: 0 0 1.6rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.6rem;
}

.hero-disclaimer {
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-left: 3px solid var(--gold);
  padding: 0.45rem 0 0.45rem 0.9rem;
  background: rgba(185, 138, 46, 0.07);
  border-radius: 0 8px 8px 0;
  max-width: 38rem;
}

/* ---------- Stats strip ---------- */

.stats-strip {
  background: var(--ink);
  color: var(--linen);
  padding: 1.4rem 0;
}

.stats-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
  text-align: center;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: #f4b89f;
}

.stat-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  opacity: 0.8;
}

/* ---------- Sections ---------- */

.section-head { max-width: 44rem; margin-bottom: 2rem; }

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  margin: 0 0 0.5rem;
}

.section-head p { color: var(--ink-soft); margin: 0; }

.deals-section { padding: 4rem 0 3rem; }

/* ---------- Filter bar ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.8rem;
}

.filter-chip {
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.42rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover { border-color: var(--thread); color: var(--thread-dark); }

.filter-chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* ---------- Deal cards ---------- */

.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(21.5rem, 100%), 1fr));
  gap: 1.5rem;
}

.deal-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.deal-card-top {
  padding: 1.25rem 1.4rem 1rem;
  border-bottom: 2px dashed var(--line);
}

.deal-category {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sage);
  background: var(--sage-soft);
  border-radius: 999px;
  padding: 0.18rem 0.7rem;
  margin-bottom: 0.6rem;
}

.deal-name {
  font-family: var(--font-display);
  font-size: 1.22rem;
  line-height: 1.3;
  margin: 0 0 0.35rem;
}

.deal-blurb {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0;
}

.reference-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.9rem 1.4rem;
  background: var(--linen-deep);
  font-size: 0.92rem;
}

.reference-label { color: var(--ink-soft); }
.reference-label a { color: inherit; font-weight: 700; text-decoration-color: var(--line); }
.reference-label a:hover { color: var(--thread-dark); }

.reference-price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.alt-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  flex: 1;
}

.alt-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.9rem;
  align-items: center;
  padding: 0.7rem 1.4rem;
}

.alt-row + .alt-row { border-top: 1px solid #f0ead9; }

.alt-row.best-deal { background: var(--sage-soft); }

.alt-retailer {
  font-weight: 700;
  font-size: 0.97rem;
}

.alt-retailer a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
.alt-retailer a:hover { color: var(--thread-dark); text-decoration-color: currentColor; }

.best-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--sage);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  margin-left: 0.45rem;
  vertical-align: 2px;
}

.alt-note { font-size: 0.78rem; color: var(--ink-soft); grid-column: 1; }

.alt-price {
  grid-column: 2;
  grid-row: 1;
  font-weight: 700;
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.alt-savings {
  grid-column: 2;
  grid-row: 2;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sage);
  white-space: nowrap;
}

.verified-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.4rem;
  border-top: 2px dashed var(--line);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.verified-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sage);
  flex-shrink: 0;
}

/* ---------- How it works ---------- */

.how-section {
  padding: 4rem 0;
  background: var(--linen-deep);
  border-block: 2px dashed var(--line);
}

.how-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 1.4rem;
}

.how-step {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  border: 1px solid var(--line);
}

.how-num {
  display: inline-grid;
  place-items: center;
  width: 2.1rem; height: 2.1rem;
  border-radius: 50%;
  background: var(--thread);
  color: #fff;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.how-step h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.how-step p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }

.how-note {
  margin-top: 1.6rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  max-width: 52rem;
}

/* ---------- Newsletter ---------- */

.newsletter-section { padding: 4.5rem 0; }

.newsletter-inner {
  background: var(--ink);
  color: var(--linen);
  border-radius: calc(var(--radius) * 1.4);
  padding: clamp(1.8rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.newsletter-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 0.6rem;
}

.newsletter-copy p { margin: 0; opacity: 0.85; }

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.field-row input[type="email"] {
  flex: 1 1 14rem;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  min-width: 0;
}

.field-row input[type="email"]:focus {
  outline: none;
  border-color: var(--thread);
}

.form-status {
  min-height: 1.3rem;
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.form-status.ok { color: #8fd6ae; }
.form-status.err { color: #f4a08c; }

.form-fineprint {
  font-size: 0.76rem;
  opacity: 0.65;
  margin: 0.5rem 0 0;
}

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

.site-footer {
  background: var(--linen-deep);
  border-top: 2px dashed var(--line);
  padding: 2.5rem 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) 2fr;
  gap: 2rem;
}

.footer-brand .brand-name { font-size: 1.2rem; }
.footer-brand p { font-size: 0.85rem; color: var(--ink-soft); margin: 0.4rem 0 0; }

.footer-legal p {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 0 0 0.7rem;
}

.footer-copy { font-weight: 600; }

.noscript-note { color: var(--ink-soft); }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .site-nav { gap: 0.9rem; font-size: 0.9rem; }
  .site-nav a:not(.nav-cta) { display: none; }
  .newsletter-inner { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero { padding-top: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
