:root {
  --ink: #111113;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --paper: #f5f5f7;
  --surface: #ffffff;
  --blue: #0066cc;
  --blue-dark: #004c99;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.35;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(245, 245, 247, 0.82);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 48px;
  padding: 8px clamp(18px, 5vw, 72px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 9px;
  font-size: 0.94rem;
  font-weight: 600;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 700;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.topnav {
  display: flex;
  gap: clamp(14px, 3vw, 28px);
  font-size: 0.82rem;
  color: #424245;
}

.hero {
  background:
    radial-gradient(circle at 78% 4%, rgba(0, 102, 204, 0.16), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f5f5f7 100%);
  padding: clamp(44px, 8vw, 76px) clamp(18px, 5vw, 72px) 26px;
}

.hero-content {
  margin: 0 auto;
  max-width: 920px;
  text-align: center;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(3rem, 8vw, 5.8rem);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 0.98;
  margin-bottom: 14px;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 620;
  letter-spacing: 0;
  line-height: 1.06;
  margin-bottom: 10px;
}

.hero-copy {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  margin: 0 auto 24px;
  max-width: 720px;
}

.search-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  margin: 0 auto;
  max-width: 680px;
  padding: 10px 10px 10px 18px;
  text-align: left;
}

.search-panel label {
  align-self: center;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
}

.search-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

input,
button {
  font: inherit;
}

input {
  background: var(--paper);
  border: 1px solid transparent;
  border-radius: 12px;
  min-width: 0;
  padding: 13px 14px;
}

input:focus {
  border-color: rgba(0, 102, 204, 0.35);
  outline: 3px solid rgba(0, 102, 204, 0.12);
}

button {
  border: 0;
  cursor: pointer;
}

.search-row button {
  background: var(--blue);
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  padding: 13px 18px;
}

.deal-shell {
  padding: 30px clamp(18px, 5vw, 72px) clamp(48px, 7vw, 84px);
}

.section-heading {
  margin: 0 auto 18px;
  max-width: 1160px;
}

.section-heading p {
  color: var(--muted);
  font-size: 0.96rem;
  margin-bottom: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 auto 18px;
  max-width: 1160px;
}

.filter-button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #515154;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
}

.filter-button.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.results-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 1160px;
}

.deal-card {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  min-height: 166px;
  padding: 16px;
}

.deal-card.is-muted {
  opacity: 0.58;
}

.merchant {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.merchant-logo {
  align-items: center;
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 34px;
  font-size: 0.72rem;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.merchant strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.deal-savings {
  font-size: 1.45rem;
  font-weight: 620;
  letter-spacing: 0;
  margin-bottom: 4px;
}

.deal-terms {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0;
}

.code-button {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: auto;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.code-button span {
  font-size: 0.95rem;
  font-weight: 650;
}

.code-button small {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 600;
}

.code-button:disabled {
  cursor: not-allowed;
}

.code-button:disabled small {
  color: var(--muted);
}

.footer {
  align-items: center;
  background: #fff;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  gap: 16px;
  grid-template-columns: auto minmax(0, 760px);
  justify-content: space-between;
  padding: 22px clamp(18px, 5vw, 72px);
}

.footer span {
  color: var(--ink);
  font-weight: 600;
}

.footer p {
  font-size: 0.82rem;
  margin-bottom: 0;
}

.empty-state {
  color: var(--muted);
  grid-column: 1 / -1;
  margin: 0;
}

@media (max-width: 920px) {
  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    padding-inline: 16px;
  }

  .topnav {
    gap: 14px;
  }

  .hero {
    padding: 38px 16px 22px;
  }

  h1 {
    font-size: 3rem;
  }

  .search-panel,
  .search-row,
  .results-grid,
  .footer {
    grid-template-columns: 1fr;
  }

  .search-panel {
    padding: 12px;
  }

  .search-panel label {
    padding-left: 2px;
  }

  .search-row button {
    width: 100%;
  }

  .deal-shell {
    padding-inline: 16px;
  }
}
