:root {
  --card: var(--paper);
  --accent: var(--contrast);
  --error: var(--ink);
  --gutter: 20px;
  --wrap: 1200px;
  --headline: Georgia, "Times New Roman", serif;
  --body: "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 var(--body); }
h1, h2, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(calc(100% - 2 * var(--gutter)), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; z-index: 4; top: 8px; left: 8px; padding: 10px 16px; background: var(--paper); transform: translateY(-150%); }
.skip:focus { transform: none; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--edge); }
.header-row { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--logo); font-weight: 750; text-transform: uppercase; letter-spacing: .045em; }
.brand img { display: block; width: 28px; height: auto; }
select { min-height: 44px; font: 600 1rem var(--body); padding: 0 8px; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper); color: var(--ink); }

.hero {
  min-height: calc(100svh - 65px);
  display: grid;
  align-items: center;
  padding-block: 56px;
}
.hero-copy { display: grid; align-items: end; gap: 24px; }
.hero h1, .coffee-preview h2 { font-family: var(--headline); font-weight: 400; letter-spacing: -.045em; overflow-wrap: anywhere; }
.hero h1 { max-width: 10ch; font-size: clamp(3rem, 8vw, 7rem); line-height: .95; }
.hero-action { display: grid; justify-items: start; align-content: start; gap: 16px; border-top: 1px solid var(--rule); padding-block-start: 20px; }
.hero-action p { color: var(--muted); max-width: 38ch; }
.hero-action #offer { font-size: clamp(1.05rem, 1.8vw, 1.3rem); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 52px;
  width: 100%;
  padding: 10px 18px;
  border: 1px solid var(--button-border);
  border-radius: 4px;
  background: var(--button);
  color: var(--button-text);
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: var(--button-hover); border-color: var(--accent); }
.button svg { flex-shrink: 0; }
.card-feedback:empty { display: none; }

.coffee-preview { min-height: calc(100svh - 65px); display: grid; align-content: center; border-top: 1px solid var(--edge); padding-block: 64px; }
.preview-wrap { display: grid; align-items: center; gap: 28px; }
.coffee-preview h2 { font-size: clamp(2.6rem, 5.9vw, 5rem); line-height: 1.05; max-width: 13ch; }
.stamp-card { min-width: 0; padding: 24px; background: var(--card); border: 1px solid var(--rule); border-radius: 4px; }
.stamp-card p { max-width: 38ch; }
.stamps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 320px; margin: 20px 0 0; padding: 0; list-style: none; }
.stamp {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px dashed var(--rule);
  border-radius: 50%;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.stamp.earned, .stamp.reward { border: 2px solid var(--accent); background: var(--paper); color: var(--ink); }
.error { color: var(--error); margin-top: 16px; }
footer { background: var(--paper); border-top: 1px solid var(--edge); padding-block: 20px; color: var(--muted); }

@media (min-width: 768px) {
  :root { --gutter: 32px; }
  .header-row { min-height: 72px; }
  .hero { min-height: calc(100svh - 73px); }
  .hero-copy, .preview-wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; }
  .hero-action { border-top: 0; border-inline-start: 1px solid var(--rule); padding: 4px 0 4px 40px; }
  .button { width: auto; }
  .stamp-card { padding: 40px; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero-action { animation: enter 620ms ease-out backwards; }
  .hero-action { animation-delay: 180ms; }
  .button, .button svg { transition: transform 180ms ease-out; }
  .button:active { transform: translateY(2px); }
  .button:hover svg { transform: translateX(4px); }
  .card-feedback:not(:empty) { animation: enter 190ms ease-out; }
}

@keyframes enter {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
