:root {
  --bg: #dfdedb;
  --surface: #d3d2ce;
  --ink: #26251e;
  --muted: #4b4940;
  --accent: #2456d6;
  --accent-ink: #ffffff;
  --hero-dark: #1d1c17;
  --hero-light: #2b2920;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-section: clamp(1.5rem, 1.3rem + 1vw, 1.9rem);
  --step-head: clamp(1.9rem, 1.3rem + 2.2vw, 2.6rem);

  --margin: clamp(20px, 5vw, 64px);
  --col: 560px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Literata', Georgia, 'Times New Roman', serif;
  font-size: var(--step-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol { margin: 0; }

a { color: inherit; }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

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

::selection { background: var(--accent); color: var(--accent-ink); }

button, input, textarea {
  font-family: inherit;
  font-size: var(--step-body);
  color: var(--ink);
}

/* ---------- top bar ---------- */

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--margin);
  background: var(--bg);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: clamp(1.15rem, 1.05rem + 0.35vw, 1.4rem);
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink);
}

.logo-mark { width: 38px; height: 38px; flex-shrink: 0; }

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.topbar-nav a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(38,37,30,0.3);
  font-size: var(--step-small);
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 78vh;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}

.hero-left {
  background: var(--bg);
  padding: 48px var(--margin);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero h1 {
  font-size: var(--step-head);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.12;
  max-width: 22ch;
}

.hero h1 span {
  display: block;
  opacity: 0;
  transform: translateY(0.4em);
  animation: rise 900ms cubic-bezier(.16,1,.3,1) forwards;
}
.hero h1 span:nth-child(2) { animation-delay: 110ms; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.hero-sub {
  margin-top: 24px;
  max-width: 44ch;
  color: var(--muted);
  font-size: var(--step-body);
  opacity: 0;
  animation: fadeup 700ms ease-out 480ms forwards;
}

.hero-cta {
  margin-top: 32px;
  display: inline-flex;
  opacity: 0;
  animation: fadeup 700ms ease-out 620ms forwards;
}

@keyframes fadeup {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 13px 22px;
  font-size: var(--step-small);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* hero right: illustration */

.hero-right {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px var(--margin);
}

.hero-art {
  width: 100%;
  height: auto;
  opacity: 0;
  animation: fadeup 900ms ease-out 260ms forwards;
}

/* eligibility tool, reused beside the submission form */

.tool {
  background: var(--surface);
  width: 100%;
  padding: 26px;
}

.tool-label {
  font-size: var(--step-small);
  color: var(--muted);
  margin-bottom: 16px;
}

.tool-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
}

.check-box {
  margin-top: 2px;
  width: 22px; height: 22px;
  flex-shrink: 0;
  border: 1.5px solid var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 200ms ease, border-color 200ms ease;
}
.check-box::before {
  content: '';
  width: 12px; height: 12px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.check-box.checking {
  border-color: var(--accent);
  animation: check-pulse 1.1s ease-in-out infinite;
}
@keyframes check-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(36, 86, 214, 0); }
  50% { box-shadow: 0 0 0 4px rgba(36, 86, 214, 0.2); }
}
.check-box.pass {
  background: var(--accent);
  border-color: var(--accent);
}
.check-box.pass::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8.5l4 4 8-9' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E");
}
.check-box.fail {
  background: var(--ink);
  border-color: var(--ink);
}
.check-box.fail::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 3l10 10M13 3L3 13' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E");
}
/* Skipped: the agent stopped before this rule, so it is neither passed nor failed. */
.check-box.skip {
  border-color: var(--muted);
  border-style: dashed;
}
.check-box.skip::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8' fill='none' stroke='%234b4940' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E");
}

.check-text {
  font-size: var(--step-body);
  color: var(--ink);
  line-height: 1.4;
}
.tool-row[data-state="fail"] .check-text { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(38,37,30,0.4); }
.tool-row[data-state="skip"] .check-text { color: var(--muted); }

.tool-readout {
  margin-top: 20px;
}

.tool-verdict {
  font-size: var(--step-small);
  color: var(--muted);
}
.tool-verdict.pass { color: var(--ink); font-weight: 600; }
.tool-verdict.fail { color: var(--muted); }
.tool-verdict.checking { color: var(--muted); }

.tool-confirm {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tool-confirm[hidden] { display: none; }
.tool-confirm-text { font-size: var(--step-small); color: var(--ink); }
.tool-confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn--sm { padding: 9px 16px; }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--muted);
}
.btn--ghost:hover { background: var(--bg); }

/* ---------- sections generic ---------- */

section {
  padding: 120px var(--margin);
}

.col {
  max-width: 100%;
}

.section-head {
  font-size: var(--step-section);
  font-weight: 500;
  margin-bottom: 36px;
}

/* ---------- directory ---------- */

.directory { background: var(--bg); }

.store-list { display: flex; flex-direction: column; gap: 16px; }

.store-empty { color: var(--muted); font-size: var(--step-body); }

.store-card {
  background: var(--surface);
  padding: 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "logo info actions"
    "products products products";
  gap: 16px 20px;
  align-items: start;
}

.store-logo {
  grid-area: logo;
  width: 64px; height: 64px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}
.store-logo img { width: 100%; height: 100%; object-fit: contain; }

.store-info { grid-area: info; display: flex; flex-direction: column; gap: 4px; }
.store-card .store-name { font-size: var(--step-lead); font-weight: 600; flex-grow: 0; }
.store-card .store-domain { font-size: var(--step-small); color: var(--muted); word-break: break-all; }
.store-card .store-desc { margin: 6px 0 0; max-width: 62ch; font-size: var(--step-body); }

.store-actions { grid-area: actions; align-self: start; }
.store-products { grid-area: products; }
.store-products[hidden] { display: none; }

.products-source {
  font-size: var(--step-small);
  color: var(--muted);
  margin-bottom: 14px;
  word-break: break-all;
}
.products-status { font-size: var(--step-small); color: var(--muted); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.product-cell {
  background: var(--bg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-img {
  width: 100%; height: 120px;
  object-fit: contain;
  background: var(--surface);
}
.product-name { font-size: var(--step-small); font-weight: 600; }
.product-price { font-size: var(--step-small); color: var(--accent); font-variant-numeric: tabular-nums; }
.product-desc { font-size: var(--step-small); color: var(--muted); }

.products-raw {
  background: var(--hero-dark);
  color: var(--bg);
  padding: 16px;
  margin: 0;
  overflow: auto;
  max-height: 320px;
  font-family: 'ui-monospace', 'SFMono-Regular', Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .store-card {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "logo info"
      "actions actions"
      "products products";
  }
  .store-actions .btn { width: 100%; justify-content: center; }
}

.store-row {
  background: var(--surface);
  padding: 22px 24px;
}
.store-row + .store-row { margin-top: 14px; }

.store-row summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
}
.store-row summary::-webkit-details-marker { display: none; }

.store-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.store-name {
  font-size: var(--step-body);
  font-weight: 600;
  flex-grow: 1;
}

.store-domain {
  font-size: var(--step-small);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.store-chevron {
  width: 10px; height: 10px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 180ms ease;
  flex-shrink: 0;
}
.store-row[open] .store-chevron { transform: rotate(45deg); }

.store-desc {
  margin: 10px 0 0 28px;
  color: var(--ink);
  font-size: var(--step-body);
  max-width: 46ch;
}

.store-badges {
  margin: 14px 0 0 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  font-size: var(--step-small);
  color: var(--ink);
  background: var(--bg);
  padding: 4px 10px;
}

.store-body {
  margin: 24px 0 0 28px;
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-small);
}

.product-table caption {
  text-align: left;
  color: var(--muted);
  margin-bottom: 10px;
}

.product-table th, .product-table td {
  text-align: left;
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid rgba(38,37,30,0.08);
  font-variant-numeric: tabular-nums;
}

.product-table th { color: var(--muted); font-weight: 500; }

.product-table-wrap { overflow-x: auto; }

.product-table--specs { background: var(--bg); }
.product-table--specs th {
  white-space: nowrap;
  padding: 10px 14px;
  border-bottom: 1.5px solid rgba(38,37,30,0.18);
}
.product-table--specs td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(38,37,30,0.08);
  vertical-align: top;
}
.product-table--specs tbody tr:last-child td { border-bottom: none; }
.product-table--specs th:first-child,
.product-table--specs td:first-child { padding-left: 18px; }
.product-table--specs th:last-child,
.product-table--specs td:last-child { padding-right: 18px; }
.product-table--specs td.product-price { color: var(--accent); font-weight: 600; }

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 16px;
}
.product-fact { font-size: var(--step-small); color: var(--ink); }
.product-fact-label { color: var(--muted); margin-right: 6px; }
.product-fact-label::after { content: ':'; }

.store-note {
  margin-top: 12px;
  font-size: var(--step-small);
  color: var(--muted);
}

.store-visit {
  display: inline-block;
  margin-top: 16px;
  font-size: var(--step-small);
  text-decoration: underline;
  text-decoration-color: rgba(38,37,30,0.3);
}

.api-sample {
  background: var(--hero-dark);
  color: var(--bg);
  padding: 20px 22px;
  margin-top: 18px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.api-sample--wide { margin: 0 0 16px; }

.api-sample-head {
  font-size: var(--step-small);
  color: #9c9a90;
  margin-bottom: 8px;
}

.api-sample pre {
  margin: 0;
  font-family: 'ui-monospace', 'SFMono-Regular', Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: #e3e1d8;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- list your store ---------- */

.listcta { background: var(--bg); }

.listcta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.listcta h2 {
  font-size: clamp(1.6rem, 1.3rem + 1.6vw, 2.3rem);
  font-weight: 500;
  line-height: 1.2;
  max-width: 20ch;
}

.listcta .lede {
  margin-top: 16px;
  color: var(--muted);
  max-width: 42ch;
  font-size: var(--step-body);
}

.listcta-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

form.listform { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label { font-size: var(--step-small); color: var(--muted); }

.field input {
  background: var(--surface);
  border: none;
  padding: 11px 12px;
  font-size: var(--step-small);
  color: var(--ink);
}
.field input::placeholder { color: #8a8880; }

.listform .btn { align-self: flex-start; margin-top: 4px; }

.listform .btn:disabled { opacity: 0.6; cursor: default; }

.form-note { font-size: var(--step-small); color: var(--muted); margin-top: 2px; max-width: 48ch; }

/* ---------- footer ---------- */

footer {
  padding: 56px var(--margin) 48px;
  text-align: center;
  color: var(--muted);
  font-size: var(--step-small);
}

footer .foot-wordmark {
  font-size: var(--step-section);
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 10px;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .hero h1 span, .hero-sub, .hero-cta, .hero-art { animation: none !important; opacity: 1 !important; transform: none !important; }
  * { transition: none !important; }
}

[data-animate] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms ease, transform 560ms ease;
}
[data-animate].in-view { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-left { order: 1; padding-top: 48px; }
  .hero-right { order: 2; min-height: 40svh; padding: 32px 20px; }
  .hero h1 { font-size: clamp(1.7rem, 6vw, 2.1rem); max-width: 100%; }
  .listcta-row { grid-template-columns: 1fr; gap: 36px; }
  section { padding: 80px 20px; }
}
