:root {
  --ink: #141414;
  --ink-2: #4a4845;
  --line: #d9d7d3;
  --ground: #ececea;
  --paper: #ffffff;
  --crust: #9a5a2c;
  --crust-deep: #7a4520;
  --crust-tint: #f3e7dc;
  --radius: 16px;
  --display: "Jost", system-ui, sans-serif;
  --accent: "Newsreader", Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.55 var(--display);
}
img { display: block; max-width: 100%; }
button { font: inherit; }

/* Header */
.top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.top-logo { width: 200px; height: auto; }
.top-note { margin: 0; max-width: 340px; font-size: 14px; color: var(--ink-2); text-align: right; }

/* Stage */
.stage {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.intro h1 {
  margin: 0 0 16px;
  font-weight: 500;
  font-size: clamp(32px, 3.4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.lede { margin: 0 0 24px; font-size: 18px; color: var(--ink-2); }
.steps { margin: 0 0 24px; padding: 0; list-style: none; counter-reset: s; }
.steps li {
  counter-increment: s;
  position: relative;
  padding: 16px 0 16px 48px;
  border-top: 1px solid var(--line);
}
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 12px;
  font-family: var(--accent);
  font-style: italic;
  font-size: 28px;
  line-height: 1;
  color: var(--crust);
}
.steps strong { font-weight: 600; display: block; }
.try { margin: 0; padding: 16px; background: var(--paper); border-radius: 12px; font-size: 15px; }
.try em { font-style: normal; font-weight: 600; }
.tabs { display: none; }

/* Phone */
.phone {
  position: relative;
  background: #0b0b0b;
  border-radius: 44px;
  padding: 16px 16px 24px;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.45);
  min-height: 680px;
  overflow: hidden;
}
.phone-bar { color: #fff; font-size: 14px; font-weight: 600; padding: 8px 16px 16px; }
.wallet-title { color: #fff; font-size: 30px; font-weight: 600; margin: 0 8px 16px; }
.pass {
  background: var(--paper);
  border-radius: 14px;
  padding: 16px;
  transition: transform 0.25s ease;
}
.pass.bump { transform: scale(1.02); }
.pass-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pass-logo { width: 132px; height: auto; }
.pass-field { display: flex; flex-direction: column; }
.pass-field.right { text-align: right; }
.label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.value { font-size: 20px; font-weight: 500; line-height: 1.25; }
.pass-row { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; }
.pass.ready .value#next { color: var(--crust); }

/* Stamps: the sketched loaf from the logo is the stamp */
.stamps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 0;
  padding: 16px 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stamp {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px dashed #c9c6c1;
  display: grid;
  place-items: center;
}
.stamp i {
  width: 64%;
  aspect-ratio: 151 / 107;
  background: #dcd9d4;
  -webkit-mask: url(assets/loaf.png) center / contain no-repeat;
  mask: url(assets/loaf.png) center / contain no-repeat;
}
.stamp.on { border: 1.5px solid var(--crust); background: var(--crust-tint); }
.stamp.on i { background: var(--crust-deep); }
.stamp.new i { animation: press 0.45s ease-out; }
@keyframes press {
  0% { transform: scale(1.6) rotate(-8deg); opacity: 0; }
  60% { transform: scale(0.94) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

.code {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.qr { width: 132px; height: 132px; }
.qr svg { width: 100%; height: 100%; display: block; }
.code-id { font-size: 12px; letter-spacing: 0.06em; color: var(--ink-2); }

.add {
  display: block;
  width: 100%;
  margin-top: 16px;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.add:hover { background: #f2f2f2; }
.add-note { color: #cfcfcf; font-size: 13px; margin: 8px 8px 0; }

/* Lock-screen style notification */
.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 48px;
  z-index: 2;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(245, 244, 242, 0.96);
  font-size: 14px;
  line-height: 1.35;
  transform: translateY(-140%);
  transition: transform 0.35s ease;
}
.toast.show { transform: translateY(0); }
.toast b { display: block; font-weight: 600; }
.toast-mark { width: 32px; height: auto; }

/* Counter */
.counter {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--line);
}
.counter-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.counter-head h2 { margin: 0; font-size: 24px; font-weight: 500; }
.counter-store { font-family: var(--accent); font-style: italic; font-size: 18px; color: var(--crust); }
.viewfinder {
  background: #1c1b1a;
  border-radius: 12px;
  padding: 24px 16px 16px;
  color: #d8d6d2;
  text-align: center;
  font-size: 14px;
}
.vf-frame {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  overflow: hidden;
}
.vf-line {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 2px;
  background: #e9a76b;
  opacity: 0;
}
.viewfinder.busy .vf-line { opacity: 1; animation: sweep 0.7s ease-in-out infinite alternate; }
@keyframes sweep { from { top: 12%; } to { top: 88%; } }
.viewfinder p { margin: 0; }

.scan, .redeem {
  display: block;
  width: 100%;
  min-height: 56px;
  margin-top: 16px;
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
}
.scan { background: var(--ink); color: #fff; }
.scan:hover { background: #2b2a28; }
.scan:disabled { opacity: 0.6; cursor: progress; }
.redeem { background: var(--crust); color: #fff; }
.redeem:hover { background: var(--crust-deep); }

.result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--ground);
  min-height: 88px;
}
.result-empty { margin: 0; color: var(--ink-2); font-size: 15px; }
.result-name { margin: 0; font-weight: 600; font-size: 18px; }
.result-line { margin: 4px 0 0; color: var(--ink-2); }
.result.free { background: var(--crust-tint); }
.result.free .result-line { color: var(--crust-deep); font-weight: 500; }

.counter-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; }
.link {
  background: none;
  border: 0;
  padding: 12px 0;
  min-height: 48px;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link:hover { color: var(--ink); }
.link:disabled { opacity: 0.4; cursor: default; text-decoration: none; }

/* Notes */
.notes {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 24px 80px;
  border-top: 1px solid var(--line);
}
.notes h2 { margin: 0 0 24px; font-size: 28px; font-weight: 500; }
.notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.notes h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.notes p { margin: 0; color: var(--ink-2); }
.contact { margin-top: 32px !important; color: var(--ink) !important; }
.contact a { color: var(--crust-deep); font-weight: 600; }

@media (max-width: 1080px) {
  .stage { grid-template-columns: 1fr 340px; }
  .intro { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .top { padding: 24px 16px 0; flex-direction: column; align-items: flex-start; gap: 8px; }
  .top-logo { width: 160px; }
  .top-note { text-align: left; }
  .stage { grid-template-columns: 1fr; padding: 32px 16px 48px; gap: 24px; }
  .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 24px;
    padding: 4px;
    background: var(--paper);
    border-radius: 12px;
  }
  .tab {
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-2);
    font-weight: 500;
    cursor: pointer;
  }
  .tab.is-on { background: var(--ink); color: #fff; }
  [data-panel][hidden] { display: none; }
  .phone { border-radius: 32px; min-height: 0; }
  .notes { padding: 48px 16px 64px; }
  .notes-grid { grid-template-columns: 1fr; gap: 24px; }
}

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

[hidden] { display: none !important; }
.contact a { display: inline-block; padding: 12px 0; }
