:root {
  --ink: #10233a;
  --ink-soft: #4a5a6b;
  --bg: #f2f5f3;
  --surface: #ffffff;
  --line: #d5ded9;
  --save: #0a6b48;
  --save-tint: #ddf3e8;
  --cta: #f26b1d;
  --cta-hover: #ff8a45;
  --focus: #1f4fa3;

  --font-display: "Rubik", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, sans-serif;

  --radius-sm: 8px;
  --radius-lg: 16px;
  --wrap: 1180px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
}

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

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 12px;
}

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

.site-header {
  background: var(--ink);
  color: #fff;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
}
.main-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.main-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  color: #d9e2ea;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.header-search {
  margin-left: auto;
  flex: 0 1 300px;
}

.search {
  position: relative;
  display: block;
}
.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  color: var(--ink-soft);
}
.search input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
}
.site-header .search input {
  border-color: transparent;
}

@media (max-width: 760px) {
  .header-search { flex: 1 1 100%; margin-left: 0; }
  .main-nav { order: 3; width: 100%; }
  .main-nav ul { gap: 0; }
  .main-nav a { padding: 10px 8px; font-size: 0.9375rem; }
}

/* ---------- Page intro ---------- */

.hero {
  padding: 56px 0 40px;
}
.hero h1,
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 16px;
}
.hero h1 {
  font-size: clamp(2.25rem, 6vw, 4rem);
  max-width: 14ch;
}
.hero p,
.page-head p {
  font-size: 1.125rem;
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 0 24px;
}
.hero .search {
  max-width: 560px;
}
.hero .search input {
  min-height: 58px;
  font-size: 1.0625rem;
  border-width: 2px;
  border-color: var(--ink);
}

.page-head {
  padding: 48px 0 32px;
}
.page-head h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
}
.page-head p { margin-bottom: 0; }

.crumbs {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.crumbs a { color: var(--ink-soft); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}
.chips a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none;
  font-weight: 600;
}
.chips a:hover { border-color: var(--ink); }
.chips a[aria-current="page"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.section { padding: 8px 0 64px; }
.section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
.result-note {
  color: var(--ink-soft);
  margin: -8px 0 20px;
}

/* ---------- Store grid: tear-off coupon cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.store-card {
  --notch: 10px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  height: 100%;
  background: var(--surface);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: transform 160ms ease-out, box-shadow 160ms ease-out;
}
.store-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 35, 58, 0.12);
}
.store-card .body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.store-card .who {
  display: flex;
  align-items: center;
  gap: 12px;
}
.store-card .name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.store-card .offer {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.125rem;
  line-height: 1.3;
  margin: 0;
}

/* The perforated stub on the right of each card */
.stub {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 92px;
  padding: 16px 8px;
  border-left: 2px dashed var(--line);
  background: var(--save-tint);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  color: var(--save);
  text-align: center;
}
.stub::before,
.stub::after {
  content: "";
  position: absolute;
  left: calc(var(--notch) * -1 - 1px);
  width: calc(var(--notch) * 2);
  height: calc(var(--notch) * 2);
  border-radius: 50%;
  background: var(--bg);
}
.stub::before { top: calc(var(--notch) * -1); }
.stub::after { bottom: calc(var(--notch) * -1); }
.stub .amt {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.625rem;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stub .amt.long { font-size: 1.0625rem; }
.stub .unit {
  font-weight: 700;
  font-size: 0.875rem;
  margin-top: 4px;
}

.logo {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
}
.logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo.lg {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  font-size: 2.25rem;
}

/* ---------- Store page ---------- */

.store-head {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 40px 0 32px;
  flex-wrap: wrap;
}
.store-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 6px;
}
.store-head p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 60ch;
}

.store-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
  padding-bottom: 64px;
}
@media (max-width: 900px) {
  .store-layout { grid-template-columns: 1fr; }
}

.coupons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.coupon {
  --notch: 12px;
  display: grid;
  grid-template-columns: 120px 1fr;
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.coupon .stub {
  order: -1;
  width: auto;
  border-left: 0;
  border-right: 2px dashed var(--line);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.coupon .stub::before,
.coupon .stub::after {
  left: auto;
  right: calc(var(--notch) * -1 - 1px);
}
.coupon .stub .amt { font-size: 2rem; }
.coupon .stub .amt.long { font-size: 1.25rem; }
.coupon .main {
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.coupon h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0 0 6px;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.meta .ok {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--save);
  font-weight: 700;
}
.meta .ok svg { width: 16px; height: 16px; }

@media (max-width: 560px) {
  .coupon { grid-template-columns: 88px 1fr; }
  .coupon .stub .amt { font-size: 1.5rem; }
  .coupon .main { padding: 16px; }
  .coupon .action { width: 100%; }
  .coupon .btn, .code-box { width: 100%; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--cta);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease-out;
}
.btn:hover { background: var(--cta-hover); }
.btn.secondary {
  background: var(--ink);
  color: #fff;
}
.btn.secondary:hover { background: #1f3a58; }

/* Revealed code */
.code-box {
  display: flex;
  align-items: stretch;
  min-height: 48px;
  border: 2px dashed var(--save);
  border-radius: 999px;
  overflow: hidden;
  background: var(--save-tint);
  animation: reveal 220ms ease-out;
}
.code-box .code {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.06em;
  color: var(--save);
  user-select: all;
}
.code-box button {
  border: 0;
  padding: 0 18px;
  background: var(--save);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  min-width: 88px;
}
@keyframes reveal {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.panel h2 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  margin: 0 0 10px;
}
.panel p { margin: 0 0 16px; color: var(--ink-soft); }
.panel ol { margin: 0; padding-left: 20px; color: var(--ink-soft); }
.panel ol li + li { margin-top: 6px; }
.panel + .panel { margin-top: 16px; }

/* ---------- Prose pages ---------- */

/* Cap line length on the children so the column stays left-aligned with the page heading. */
.prose {
  padding-bottom: 72px;
}
.prose > * { max-width: 68ch; }
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  margin: 32px 0 8px;
}
.prose p, .prose li { color: var(--ink-soft); }
.prose a { color: var(--focus); }

.empty {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 560px;
}
.empty h2 { margin-top: 0; }

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 40px;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  justify-content: space-between;
}
.site-footer p { margin: 0; max-width: 60ch; }
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out, transform 180ms ease-out;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
