/* Libre-Tip demo — warm, organic, fair-trade direction.
   Palette: warm cream paper, deep forest ink, moss accent, a touch of clay
   reserved for illustration. Zero external requests: Fraunces is vendored. */

@font-face {
  font-family: "Fraunces";
  src: url("/vendor/fonts/fraunces-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/vendor/fonts/fraunces-italic-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f2e7;
  --paper-deep: #efe7d6;
  --band: #e7ecdd;
  --card: #fdfbf5;
  --ink: #22321f;
  --ink-soft: #53614d;
  --moss: #5f7a4e;
  --moss-deep: #47613a;
  --line: rgba(34, 50, 31, 0.16);
  --shadow: 0 10px 30px rgba(34, 50, 31, 0.08), 0 2px 6px rgba(34, 50, 31, 0.05);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* grain — breaks digital flatness, barely visible */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 3;
}

a { color: var(--moss-deep); text-underline-offset: 3px; transition: color 0.2s; }
a:hover { color: var(--ink); }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden;
}

/* ---------- header ---------- */

.site-head {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.site-head nav { display: flex; gap: 1.4rem; }
.site-head nav a {
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-decoration: none;
}
.site-head nav a:hover { color: var(--ink); text-decoration: underline; }

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

.hero {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 6.5rem) 1.5rem 2.5rem;
}
.eyebrow {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--moss-deep);
  margin: 0 0 1rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.9rem, 8.5vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 1.4rem;
  text-wrap: balance;
}
.pitch {
  max-width: 34rem;
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin: 0 0 1.6rem;
  text-wrap: pretty;
}
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  margin: 0;
  box-shadow: var(--shadow);
}
.live-badge .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--moss);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(95, 122, 78, 0.45); }
  55% { box-shadow: 0 0 0 7px rgba(95, 122, 78, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-badge .dot { animation: none; }
}

.botanical {
  position: absolute;
  right: 1.5rem;
  bottom: -1rem;
  width: clamp(130px, 20vw, 220px);
  height: auto;
}

/* ---------- waves + tip band ---------- */

.wave { display: block; line-height: 0; }
.wave svg { width: 100%; height: 54px; display: block; }
.wave-flip svg { transform: scaleY(-1); }

.tip-band {
  background: var(--band);
  padding: 2.5rem 1.5rem 3.25rem;
}

.tipbox {
  max-width: 34rem;
  margin: 0 auto;
  background: var(--card);
  border-radius: 18px;
  padding: 2rem 2.1rem 2.2rem;
  box-shadow: var(--shadow);
}
.tipbox h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.65rem;
  letter-spacing: -0.015em;
  margin: 0 0 0.3rem;
}
.hint {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0 0 1.4rem;
}

.amounts { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.amounts button {
  font: 500 0.95rem var(--sans);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.amounts button:hover { border-color: var(--ink); }
.amounts button:active { transform: scale(0.97); }
.amounts button.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

#tip {
  display: block;
  width: 100%;
  margin-top: 1.15rem;
  font: 600 1.05rem var(--sans);
  color: #fdfbf5;
  background: var(--moss-deep);
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1.2rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 6px 16px rgba(71, 97, 58, 0.28);
}
#tip:hover { background: var(--ink); transform: translateY(-1px); }
#tip:active { transform: translateY(0) scale(0.99); }
#tip:disabled { opacity: 0.55; cursor: default; transform: none; }

#status {
  margin-top: 0.9rem;
  min-height: 1.4em;
  font-size: 0.97rem;
  color: var(--moss-deep);
  font-family: var(--serif);
  font-style: italic;
}

#pay { margin-top: 0.6rem; }
#paylink {
  display: inline-block;
  font-weight: 600;
  margin-bottom: 0.9rem;
}
#qr {
  width: fit-content;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
#qr img { display: block; image-rendering: pixelated; width: 176px; height: 176px; }
.qr-hint { font-size: 0.85rem; color: var(--ink-soft); margin: 0.5rem 0 0; }

/* ---------- steps ---------- */

.steps {
  max-width: 720px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2.5rem;
}
.steps h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  letter-spacing: -0.02em;
  margin: 0 0 2rem;
}
.steps ol { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 1.1rem;
  padding: 1.35rem 0;
}
.steps li + li { border-top: 1px solid var(--line); }
.num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 2.1rem;
  line-height: 1;
  color: var(--moss);
}
.steps h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0.1rem 0 0.35rem;
}
.steps p { margin: 0; color: var(--ink-soft); max-width: 52ch; }

/* ---------- ethos ---------- */

.ethos {
  background: var(--paper-deep);
  border-radius: 22px;
  max-width: 1000px;
  margin: 2rem auto 0;
  padding: 2.6rem 2rem;
  text-align: center;
}
.ethos ul {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 2rem;
}
.ethos li {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.ethos li::before { content: "· "; color: var(--moss); }
.ethos p {
  max-width: 46rem;
  margin: 0 auto;
  color: var(--ink-soft);
  text-wrap: pretty;
}

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

.site-foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2.6rem;
  text-align: center;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.8rem;
  margin: 0 0 0.7rem;
  font-size: 0.92rem;
}
.foot-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .botanical { display: none; }
  .tipbox { padding: 1.6rem 1.3rem 1.8rem; }
  .steps li { grid-template-columns: 3rem 1fr; gap: 0.8rem; }
  .ethos { margin-inline: 1rem; }
}
