/* ═══════════════════════════════════════════════════════════════════════════
   HOUSE POUR — Lucian Labs look B
   Letterpressed card on ivory stock. Warm, quiet, expensive. Shipped in DrinkTix.

   Spec:  https://lucianlabs.ca/branding/house-pour.md
   Rules: https://lucianlabs.ca/branding/AGENT.md

   Fonts (add to <head>):
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Kaushan+Script&family=Inconsolata:wght@400;600&display=swap">
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* papers */
  --bg: #f7f5ef;
  --bg-2: #f1eee6;
  --panel: #fffefa;

  /* inks */
  --ink: #262319;
  --muted: #71695a;
  --faint: #a79f8d;

  /* boundaries */
  --line: rgba(38, 35, 25, 0.11);
  --line-2: rgba(38, 35, 25, 0.2);

  /* accents — champagne gold carries value; violet is the wordmark only */
  --accent: #a4813b;
  --accent-2: #c9a961;
  --accent-soft: rgba(164, 129, 59, 0.14);
  --violet: #8f6fc7;
  --good: #3c7a52;
  --bad: #a03d38;

  /* form */
  --radius: 16px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(38, 35, 25, 0.04), 0 14px 34px -18px rgba(38, 35, 25, 0.18);

  /* type */
  --font-display: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --font-body: 'Avenir Next', Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Inconsolata', 'IBM Plex Mono', monospace;
  --font-brand: 'Kaushan Script', cursive;
}

* { box-sizing: border-box; }

html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body { margin: 0; min-height: 100%; overscroll-behavior: none; }
* { -webkit-tap-highlight-color: transparent; }

body {
  background:
    radial-gradient(circle at 20% -10%, rgba(201, 169, 97, 0.10) 0%, transparent 45%),
    radial-gradient(circle at 90% 8%, rgba(143, 111, 199, 0.05) 0%, transparent 35%),
    linear-gradient(165deg, #faf8f3 0%, #f5f2ea 55%, #f2eee4 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── layout ──────────────────────────────────────────────────────────────── */

/* Single-column and narrow by default — this look is for one pair of hands. */
.app {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 14px 96px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -14px 18px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 248, 243, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ── type ────────────────────────────────────────────────────────────────── */

h1, h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.12;
  color: var(--ink);
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }

/* Section marks are small caps trailing a hairline — not big bold headings. */
h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}

/* Inline links take the gold. They're self-limiting, so they don't count
   against the one-primary-action accent budget. */
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 150ms ease;
}
a:hover { color: var(--ink); }

.muted { color: var(--muted); line-height: 1.5; }
.faint { color: var(--faint); }
.center { text-align: center; }

.wordmark {
  font-family: var(--font-brand);
  font-weight: 400;
  font-size: 3rem;
  line-height: 1.05;
  margin: 4px 0 10px;
  color: var(--ink);
}
.brand {
  font-family: var(--font-brand);
  font-size: 1.7rem;
  line-height: 1;
  color: var(--ink);
}

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--muted);
}

/* ── cards ───────────────────────────────────────────────────────────────── */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 16px;
  box-shadow: var(--shadow);
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: none; }

/* ── buttons ─────────────────────────────────────────────────────────────── */

/* Full-width pills by default — this look assumes thumbs, not cursors. */
.btn {
  appearance: none;
  display: inline-block;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter 150ms ease, background 150ms ease, transform 50ms ease;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; }

/* One gold button per view. It is the thing that moves money or commits. */
.btn.primary {
  color: #fffdf6;
  background: linear-gradient(135deg, #b3903f, #97742f);
  border-color: transparent;
  box-shadow: 0 10px 22px -12px rgba(164, 129, 59, 0.65);
}

/* Charcoal — heavy secondary (scan, open camera, switch mode). */
.btn.accent {
  color: #f6f2e8;
  background: linear-gradient(150deg, #35311f, #23211a);
  border-color: transparent;
  box-shadow: 0 10px 22px -14px rgba(38, 35, 25, 0.55);
}

.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); }

.btn.danger {
  color: var(--bad);
  border-color: rgba(160, 61, 56, 0.4);
  background: rgba(160, 61, 56, 0.05);
}

.btn.sm { width: auto; padding: 9px 16px; font-size: 0.66rem; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ── forms ───────────────────────────────────────────────────────────────── */

input, select, textarea {
  width: 100%;
  background: #fffef9;
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: 13px 15px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1rem; /* ≥16px keeps iOS from zooming on focus */
  margin-bottom: 12px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
::placeholder { color: var(--faint); }

label.field {
  display: block;
  margin-bottom: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── numerals ────────────────────────────────────────────────────────────── */

/* Money and totals are set in the serif. That is the whole trick of this look. */
.figure {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 3.6rem;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: lining-nums;
  color: var(--ink);
}

.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
}
.amount.pos { color: var(--good); }
.amount.zero { color: var(--faint); }
.amount.bad { color: var(--bad); }

.totals {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}
.totals .amount {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--accent);
}

/* ── pills & tabs ────────────────────────────────────────────────────────── */

.pill {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-2);
  color: var(--muted);
  background: var(--bg-2);
}
.pill.gold {
  color: var(--accent);
  border-color: rgba(164, 129, 59, 0.35);
  background: var(--accent-soft);
}
.pill.bad {
  color: var(--bad);
  border-color: rgba(160, 61, 56, 0.45);
  background: rgba(160, 61, 56, 0.06);
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg-2);
}
.tabs button {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.tabs button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(38, 35, 25, 0.12), inset 0 0 0 1px var(--line);
}

/* ── steppers ────────────────────────────────────────────────────────────── */

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.stepper button:active { background: var(--accent-soft); border-color: var(--accent); }
.stepper button:disabled { opacity: 0.35; }
.stepper .qty {
  min-width: 24px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
}

/* ── toast ───────────────────────────────────────────────────────────────── */

/* Inverted ink panel. This look has no other dark surface. */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: 90%;
  padding: 13px 22px;
  border-radius: var(--radius-pill);
  background: #26231a;
  color: #f6f2e8;
  border: 1px solid rgba(255, 253, 246, 0.12);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 16px 36px -12px rgba(38, 35, 25, 0.5);
  opacity: 0;
  transition: opacity 200ms ease;
}
.toast.show { opacity: 1; }
.toast.good { border-color: rgba(122, 190, 150, 0.55); }
.toast.bad { border-color: rgba(224, 122, 116, 0.6); }

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