:root {
  --bg: #f7ecdb;
  --bg-deep: #241209;
  --paper: #fffaf1;
  --ink: #2b1a0f;
  --muted: #8a6c54;
  --line: rgba(43,26,15,0.12);
  --accent: #c9872f;
  --accent-2: #8a3a1f;
  --accent-soft: rgba(201,135,47,0.14);
  --radius: 16px;
  --ease: cubic-bezier(.22,1,.36,1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Karla", -apple-system, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand { font-family: "Zilla Slab", Georgia, serif; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
a { color: inherit; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247,236,219,0.88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 22px; color: var(--ink); letter-spacing: -0.01em; }
.brand-mark {
  width: 24px; height: 24px; border-radius: 50% 50% 50% 4px;
  background: radial-gradient(circle at 35% 30%, var(--accent), var(--accent-2));
  display: inline-block;
}
.nav { display: flex; gap: 32px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 600; transition: color .2s var(--ease); }
.nav a:hover, .nav a.active { color: var(--accent-2); }
.nav-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fffaf1;
  padding: 10px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
  text-decoration: none; transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.nav-cta:hover { opacity: .9; transform: translateY(-1px); }

main { position: relative; z-index: 1; }

/* hero */
.hero { padding: 88px 0 72px; background: var(--bg); }
.hero.dark { background: var(--bg-deep); color: #f3e3cf; }
.hero.dark .muted-x { color: #c7a988; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent-2);
  background: var(--accent-soft); border: 1px solid rgba(201,135,47,0.3);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 24px;
}
.hero.dark .eyebrow { color: #f0b15e; background: rgba(240,177,94,0.14); border-color: rgba(240,177,94,0.3); }
h1 { font-size: 48px; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 20px; max-width: 680px; font-weight: 600; }
h1 .grad { color: var(--accent-2); }
.hero.dark h1 .grad { color: #f0b15e; }
.lede { font-size: 17.5px; color: var(--muted); max-width: 540px; margin: 0 0 36px; }
.hero.dark .lede { color: #c7a988; }
.hero-actions { display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-size: 14.5px; font-weight: 700;
  text-decoration: none; transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent-2); color: #fff6ea; }
.btn-primary:hover { opacity: .92; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.hero.dark .btn-ghost { color: #f3e3cf; border-color: rgba(243,227,207,0.25); }
.btn-ghost:hover { border-color: var(--accent-2); }

/* sections */
.section { padding: 68px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 560px; margin-bottom: 44px; }
.section-head h2 { font-size: 30px; letter-spacing: -0.01em; margin: 0 0 12px; font-weight: 600; }
.section-head p { color: var(--muted); margin: 0; font-size: 15px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px;
}
.card .icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-2); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; font-size: 18px; }
.card h3 { font-size: 17px; margin: 0 0 8px; font-weight: 600; }
.card p { font-size: 13.8px; color: var(--muted); margin: 0; line-height: 1.6; }
.card .origin-tag { font-size: 12px; color: var(--accent-2); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; display: block; }

.stat-row { display: flex; gap: 52px; flex-wrap: wrap; }
.stat b { display: block; font-size: 32px; font-family: "Zilla Slab", serif; color: var(--ink); font-weight: 600; }
.stat span { font-size: 13px; color: var(--muted); }

.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 22px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: none; }
.step .num { font-family: "Zilla Slab", serif; font-size: 26px; color: var(--accent-2); font-weight: 600; width: 44px; flex-shrink: 0; }
.step h3 { margin: 0 0 6px; font-size: 16.5px; font-weight: 600; }
.step p { margin: 0; color: var(--muted); font-size: 14px; max-width: 520px; }

/* shop */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
.pill { font-size: 13.5px; font-weight: 600; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--paper); }
.pill.active { background: var(--accent-2); color: #fff6ea; border-color: var(--accent-2); }

.product {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.product-art {
  height: 140px; display: flex; align-items: center; justify-content: center;
  font-size: 40px;
}
.product-body { padding: 20px 22px 22px; }
.roast-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px; display: inline-block; margin-bottom: 12px; }
.roast-light { background: rgba(201,135,47,0.16); color: #a8711f; }
.roast-medium { background: rgba(138,58,31,0.14); color: var(--accent-2); }
.roast-dark { background: rgba(43,26,15,0.12); color: var(--ink); }
.product h3 { font-size: 16px; margin: 0 0 4px; font-weight: 600; }
.product .origin { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }
.product-foot { display: flex; align-items: center; justify-content: space-between; }
.price { font-family: "Zilla Slab", serif; font-size: 18px; font-weight: 600; }
.add-btn { font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); border: 1px solid rgba(201,135,47,0.3); }

/* journal */
.post-list { display: flex; flex-direction: column; gap: 0; }
.post { padding: 28px 0; border-bottom: 1px solid var(--line); display: flex; gap: 26px; }
.post:first-child { padding-top: 0; }
.post .date { font-family: "Zilla Slab", serif; font-size: 13px; color: var(--accent-2); width: 92px; flex-shrink: 0; padding-top: 3px; font-weight: 600; }
.post h3 { font-size: 18px; margin: 0 0 8px; font-weight: 600; }
.post p { font-size: 14px; color: var(--muted); margin: 0; max-width: 560px; }
.post .tag { font-size: 11px; color: var(--accent); margin-left: 10px; font-weight: 700; text-transform: uppercase; }

.newsletter {
  background: var(--bg-deep); border-radius: var(--radius); padding: 40px 36px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  color: #f3e3cf;
}
.newsletter h3 { margin: 0 0 6px; font-size: 20px; }
.newsletter p { margin: 0; color: #c7a988; font-size: 14px; }
.newsletter form { display: flex; gap: 10px; }
.newsletter input { padding: 11px 16px; border-radius: 999px; border: 1px solid rgba(243,227,207,0.25); background: rgba(243,227,207,0.08); color: #f3e3cf; font-size: 14px; min-width: 220px; }
.newsletter input::placeholder { color: #a9896c; }

.site-footer { border-top: 1px solid var(--line); padding: 36px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent-2); }

@media (max-width: 760px) {
  .nav { display: none; }
  h1 { font-size: 34px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .post { flex-direction: column; gap: 6px; }
  .post .date { width: auto; }
  .newsletter { flex-direction: column; align-items: flex-start; }
}

/* --- decor: rising steam / warm blobs --- */
.steam-field { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.steam { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .28; will-change: transform; }
.steam-a { width: 340px; height: 340px; top: -100px; right: -60px; background: var(--accent); animation: rise1 20s ease-in-out infinite; }
.steam-b { width: 280px; height: 280px; top: 460px; left: -100px; background: var(--accent-2); opacity: .16; animation: rise2 26s ease-in-out infinite; }
@keyframes rise1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-24px,22px) scale(1.06); } }
@keyframes rise2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(20px,-18px) scale(.95); } }
body > main, body > .site-header, body > .site-footer { position: relative; z-index: 1; }

/* --- reveal-on-scroll --- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in-view { opacity: 1; transform: none; }
.reveal-stagger > * { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal-stagger.in-view > *:nth-child(1) { transition-delay: .02s; }
.reveal-stagger.in-view > *:nth-child(2) { transition-delay: .08s; }
.reveal-stagger.in-view > *:nth-child(3) { transition-delay: .14s; }
.reveal-stagger.in-view > *:nth-child(4) { transition-delay: .2s; }
.reveal-stagger.in-view > *:nth-child(5) { transition-delay: .26s; }
.reveal-stagger.in-view > *:nth-child(6) { transition-delay: .32s; }
.reveal-stagger.in-view > * { opacity: 1; transform: none; }

/* --- card / product hover --- */
.card, .product { transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.card:hover, .product:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -22px rgba(43,26,15,0.2); }

/* --- filter pills, now clickable --- */
.pill { cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); user-select: none; }
.product[hidden] { display: none; }

/* --- cart button + badge --- */
.cart-btn { position: relative; background: none; border: none; cursor: pointer; font-size: 19px; color: var(--ink); padding: 6px; display: inline-flex; align-items: center; }
.cart-badge { position: absolute; top: -2px; right: -4px; background: var(--accent-2); color: #fff6ea; font-size: 10.5px; font-weight: 700; border-radius: 999px; min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; padding: 0 3px; transform: scale(0); transition: transform .25s var(--ease); }
.cart-badge.show { transform: scale(1); }

/* --- add-to-cart button (was a span) --- */
.add-btn { border: 1px solid rgba(201,135,47,0.3); cursor: pointer; font-family: inherit; transition: background .2s var(--ease), transform .2s var(--ease); }
.add-btn:hover { background: var(--accent-2); color: #fff6ea; }
.add-btn:active { transform: scale(.95); }
.add-btn.added { background: var(--accent-2); color: #fff6ea; }

/* --- toast --- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--bg-deep); color: #f3e3cf; padding: 12px 22px; border-radius: 999px; font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease); z-index: 200; box-shadow: 0 20px 50px -20px rgba(0,0,0,.5); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- modal (warm theme) --- */
.modal-overlay { position: fixed; inset: 0; background: rgba(36,18,9,0.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-panel { background: var(--paper); border-radius: var(--radius); max-width: 440px; width: 100%; padding: 32px; position: relative; max-height: 86vh; overflow-y: auto; transform: translateY(14px) scale(.98); transition: transform .3s var(--ease); box-shadow: 0 30px 80px -30px rgba(36,18,9,.4); }
.modal-overlay.open .modal-panel { transform: translateY(0) scale(1); }
.modal-close { position: absolute; top: 18px; right: 18px; background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--ink); }
.modal-panel h3 { margin: 0 0 8px; font-size: 22px; }
.modal-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }
.modal-panel label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.modal-panel input, .modal-panel textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); padding: 10px 12px; font-size: 14px; margin-bottom: 14px; font-family: inherit; }
.modal-panel input:focus, .modal-panel textarea:focus { outline: none; border-color: var(--accent); }
.modal-panel .btn { width: 100%; justify-content: center; border: none; cursor: pointer; font-family: inherit; }
.form-step, .success-step { display: block; }
.success-step { display: none; text-align: center; }
.modal-panel.success .form-step { display: none; }
.modal-panel.success .success-step { display: block; }
.success-step .check { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 22px; }
.success-step .ticket { font-size: 13px; color: var(--muted); background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; margin-top: 14px; }

/* --- mini cart list --- */
.cart-list { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cart-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.cart-list .ci-name { font-weight: 600; }
.cart-list .ci-price { color: var(--accent-2); font-weight: 700; white-space: nowrap; }
.cart-list .ci-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.cart-empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 10px 0 18px; }
.cart-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; margin: 14px 0 18px; }

@media (prefers-reduced-motion: reduce) {
  .steam { animation: none !important; }
  .reveal, .reveal-stagger > * { transition: none !important; opacity: 1 !important; transform: none !important; }
}
