/* ============ TOKENS ============ */
:root{
  --paper: #EDEEE4;
  --paper-alt: #E2E3D6;
  --ink: #1A1A18;
  --ink-soft: #5C5C52;
  --ledger-green: #2F6844;
  --ledger-green-bg: #E1EAE2;
  --stamp-red: #B23A24;
  --stamp-red-bg: #F4E2DC;
  --line: #A8A79C;
  --highlight: #F2C14E;

  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-sans: 'IBM Plex Sans', -apple-system, sans-serif;

  --radius: 3px;
  --max-w: 1120px;
}

*{ box-sizing: border-box; margin:0; padding:0; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body{
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

a{ color: inherit; text-decoration: none; }
ul{ list-style: none; }

/* subtle paper grain */
.noise-overlay{
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ BUTTONS ============ */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-mono); font-weight: 700; font-size: 14px;
  padding: 13px 22px; border-radius: var(--radius);
  border: 1.5px solid var(--ink); cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
  letter-spacing: 0.01em;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn-primary{ background: var(--ink); color: var(--paper); }
.btn-primary:hover{ background: #2E2E28; }
.btn-ghost{ background: transparent; color: var(--ink); }
.btn-ghost:hover{ background: rgba(26,26,24,0.06); }
.btn-sm{ padding: 9px 16px; font-size: 13px; }
.btn-block{ width: 100%; }

/* ============ NAV ============ */
.nav{
  position: sticky; top: 0; z-index: 10;
  background: rgba(237,238,228,0.9); backdrop-filter: blur(6px);
  border-bottom: 1.5px solid var(--ink);
}
.nav-inner{
  max-width: var(--max-w); margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.wordmark{ font-family: var(--font-mono); font-weight: 800; font-size: 18px; }
.wordmark-dot{ color: var(--stamp-red); }
.nav-links{ display: flex; gap: 28px; font-family: var(--font-mono); font-size: 14px; }
.nav-links a{ opacity: 0.75; transition: opacity 0.12s; }
.nav-links a:hover{ opacity: 1; }
@media (max-width: 720px){ .nav-links{ display:none; } }

/* ============ HERO ============ */
.hero{ padding: 64px 24px 40px; }
.hero-inner{
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center;
}
@media (max-width: 900px){
  .hero-inner{ grid-template-columns: 1fr; gap: 40px; }
}

.eyebrow{
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
  color: var(--ink-soft); text-transform: uppercase; margin-bottom: 18px;
}
.hero-copy h1{
  font-family: var(--font-mono); font-weight: 800; font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.08; letter-spacing: -0.01em; margin-bottom: 22px;
}
.hero-sub{
  font-size: 18px; color: var(--ink-soft); max-width: 46ch; margin-bottom: 28px;
}
.hero-actions{ display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.hero-note{ font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }

/* ============ RECEIPT (signature element) ============ */
.receipt-wrap{ display: flex; justify-content: center; }
.receipt{
  position: relative;
  width: 100%; max-width: 340px;
  background: #FBFAF3;
  border: 1.5px solid var(--ink);
  padding: 24px 22px 30px;
  font-family: var(--font-mono);
  box-shadow: 6px 6px 0 rgba(26,26,24,0.08);
  clip-path: polygon(
    0% 8px, 4% 0%, 8% 8px, 12% 0%, 16% 8px, 20% 0%, 24% 8px, 28% 0%, 32% 8px, 36% 0%, 40% 8px, 44% 0%, 48% 8px, 52% 0%, 56% 8px, 60% 0%, 64% 8px, 68% 0%, 72% 8px, 76% 0%, 80% 8px, 84% 0%, 88% 8px, 92% 0%, 96% 8px, 100% 0%,
    100% calc(100% - 8px), 96% 100%, 92% calc(100% - 8px), 88% 100%, 84% calc(100% - 8px), 80% 100%, 76% calc(100% - 8px), 72% 100%, 68% calc(100% - 8px), 64% 100%, 60% calc(100% - 8px), 56% 100%, 52% calc(100% - 8px), 48% 100%, 44% calc(100% - 8px), 40% 100%, 36% calc(100% - 8px), 32% 100%, 28% calc(100% - 8px), 24% 100%, 20% calc(100% - 8px), 16% 100%, 12% calc(100% - 8px), 8% 100%, 4% calc(100% - 8px), 0% 100%
  );
}
.receipt-head{ text-align: center; margin-bottom: 14px; }
.receipt-store{ font-weight: 800; font-size: 16px; letter-spacing: 0.05em; }
.receipt-sub{ font-size: 11px; color: var(--ink-soft); margin-top: 2px; letter-spacing: 0.03em; }

.receipt-lines{ min-height: 132px; }
.receipt-line{
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12.5px; padding: 4px 0; opacity: 0;
  animation: lineIn 0.35s ease forwards;
}
.receipt-line .label{ color: var(--ink); }
.receipt-line .amount{ color: var(--stamp-red); font-weight: 700; white-space: nowrap; }

.receipt-total-row{ margin-top: 8px; }
.receipt-total{
  display: flex; justify-content: space-between; font-weight: 800; font-size: 16px;
  padding-top: 6px;
}
#receiptTotal{ color: var(--stamp-red); }

.receipt-stamp{
  position: absolute; right: 18px; bottom: 60px;
  font-family: var(--font-mono); font-weight: 800; font-size: 22px;
  color: var(--stamp-red); border: 3px solid var(--stamp-red);
  padding: 4px 10px; border-radius: 4px;
  transform: rotate(-9deg) scale(0); opacity: 0;
  animation: stampIn 0.4s cubic-bezier(.2,1.4,.4,1) forwards;
  animation-delay: 2.3s;
}

@keyframes lineIn{ from{ opacity:0; transform: translateX(-4px); } to{ opacity:1; transform: translateX(0); } }
@keyframes stampIn{ to{ opacity: 0.92; transform: rotate(-9deg) scale(1); } }
@media (prefers-reduced-motion: reduce){
  .receipt-line{ opacity: 1; animation: none; }
  .receipt-stamp{ opacity: 0.92; transform: rotate(-9deg) scale(1); animation: none; }
}

/* torn perforation divider between sections */
.tear{
  height: 14px; max-width: var(--max-w); margin: 0 auto;
  background-image: radial-gradient(circle, var(--paper) 3px, transparent 3.5px);
  background-size: 18px 18px; background-position: center;
  border-top: 1.5px dashed var(--line);
}

/* ============ SECTIONS ============ */
.section{ padding: 72px 24px; }
.section-alt{ background: var(--paper-alt); }
.section-inner{ max-width: var(--max-w); margin: 0 auto; }
.section-inner-narrow{ max-width: 620px; }
.section-eyebrow{
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 12px;
}
.section h2{
  font-family: var(--font-mono); font-weight: 800; font-size: clamp(26px, 3.2vw, 36px);
  margin-bottom: 18px; letter-spacing: -0.01em;
}
.section-lead{ font-size: 17px; color: var(--ink-soft); max-width: 62ch; margin-bottom: 36px; }
.section-footnote{ font-size: 14px; color: var(--ink-soft); margin-top: 28px; max-width: 62ch; }

/* stats */
.stat-row{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 760px){ .stat-row{ grid-template-columns: 1fr; } }
.stat-card{
  background: #FBFAF3; border: 1.5px solid var(--ink); padding: 22px 20px;
  border-radius: var(--radius);
}
.stat-num{ font-family: var(--font-mono); font-weight: 800; font-size: 30px; color: var(--stamp-red); margin-bottom: 8px; }
.stat-label{ font-size: 14px; color: var(--ink-soft); }

/* roast tool */
.roast-form{
  background: #FBFAF3; border: 1.5px solid var(--ink); border-radius: var(--radius);
  padding: 20px; max-width: 640px;
}
.roast-form textarea{
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; font-family: var(--font-sans); font-size: 14px; resize: vertical;
  background: var(--paper); color: var(--ink);
}
.roast-form textarea:focus{ outline: 2px solid var(--ledger-green); outline-offset: 1px; }
.roast-form-row{
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 14px; flex-wrap: wrap;
}
.roast-hint{ font-size: 12px; color: var(--ink-soft); }

.roast-result{
  max-width: 640px; margin-top: 20px; background: #FBFAF3;
  border: 1.5px solid var(--ledger-green); border-radius: var(--radius); padding: 20px;
}
.roast-result-head{ display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.roast-score{
  font-family: var(--font-mono); font-weight: 800; font-size: 30px; color: var(--ledger-green);
  background: var(--ledger-green-bg); border-radius: var(--radius); padding: 6px 16px;
}
.roast-result-title{ font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.roast-result-sub{ font-weight: 600; font-size: 15px; }
.roast-text{ font-size: 15px; color: var(--ink); line-height: 1.6; }

/* steps */
.steps{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 760px){ .steps{ grid-template-columns: 1fr; } }
.step-num{ font-family: var(--font-mono); font-size: 13px; color: var(--stamp-red); font-weight: 700; margin-bottom: 10px; }
.step h3{ font-family: var(--font-mono); font-size: 19px; margin-bottom: 8px; }
.step p{ font-size: 14.5px; color: var(--ink-soft); }

/* pricing */
.pricing-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px){ .pricing-grid{ grid-template-columns: 1fr; } }
.price-card{
  position: relative; background: #FBFAF3; border: 1.5px solid var(--ink);
  border-radius: var(--radius); padding: 26px 22px; display: flex; flex-direction: column;
}
.price-card-featured{ border-color: var(--stamp-red); border-width: 2px; }
.price-badge{
  position: absolute; top: -12px; left: 22px; background: var(--stamp-red); color: var(--paper);
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius);
}
.price-tear{ font-size: 12px; color: var(--line); letter-spacing: 0.05em; margin-bottom: 14px; }
.price-name{ font-family: var(--font-mono); font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin-bottom: 6px; }
.price-amount{ font-family: var(--font-mono); font-weight: 800; font-size: 36px; margin-bottom: 18px; }
.price-amount span{ font-size: 15px; font-weight: 500; color: var(--ink-soft); }
.price-features{ margin-bottom: 24px; flex: 1; }
.price-features li{
  font-size: 14px; padding: 7px 0; border-top: 1px dashed var(--line); color: var(--ink-soft);
}
.price-features li:first-child{ border-top: none; }

/* waitlist */
.waitlist{ text-align: center; }
.waitlist .section-eyebrow, .waitlist h2, .waitlist .section-lead{ margin-left: auto; margin-right: auto; }
.waitlist-form{
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  background: #FBFAF3; border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 18px;
}
.waitlist-form input, .waitlist-form select{
  font-family: var(--font-sans); font-size: 14px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink);
}
.waitlist-form input{ flex: 1; min-width: 220px; }
.waitlist-form input:focus, .waitlist-form select:focus{ outline: 2px solid var(--ledger-green); outline-offset: 1px; }
.waitlist-status{ margin-top: 14px; font-family: var(--font-mono); font-size: 13px; color: var(--ledger-green); min-height: 18px; }

/* ============ FOOTER ============ */
.footer{ background: var(--ink); color: var(--paper); padding: 40px 24px; }
.footer-inner{ max-width: var(--max-w); margin: 0 auto; text-align: center; }
.footer-brand{ font-family: var(--font-mono); font-weight: 800; font-size: 16px; margin-bottom: 10px; }
.footer-fine{ font-size: 13px; color: #B8B8AE; max-width: 52ch; margin: 0 auto 16px; }
.footer-links{ font-family: var(--font-mono); font-size: 13px; margin-bottom: 14px; display: flex; gap: 10px; justify-content: center; }
.footer-links a{ opacity: 0.85; }
.footer-links a:hover{ opacity: 1; text-decoration: underline; }
.footer-copy{ font-size: 12px; color: #8A8A80; }
