/* =========================================================
   JAWAIN — Design Tokens
   Palet: coffee dark, coffee mid, latte, cream
   ========================================================= */
:root {
  --coffee-dark: #3C2A21;
  --coffee: #6F4E37;
  --coffee-soft: #8A6A52;
  --latte: #C8A27D;
  --latte-light: #E4C9A6;
  --cream: #F5EBDD;
  --cream-light: #FFF8F0;
  --text-dark: #2B1B12;
  --text-muted: #6b5644;
  --white: #ffffff;

  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-hand: 'Caveat', cursive;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shadow-soft: 0 12px 30px rgba(60, 42, 33, 0.12);
  --shadow-hover: 0 18px 40px rgba(60, 42, 33, 0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.italic { font-style: italic; font-weight: 500; }

a { text-decoration: none; color: inherit; }

img, svg { display: block; max-width: 100%; }

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--latte);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn--primary {
  background: var(--coffee-dark);
  color: var(--cream-light);
  box-shadow: var(--shadow-soft);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); background: var(--coffee); }
.btn--ghost {
  background: transparent;
  color: var(--coffee-dark);
  border-color: var(--coffee-dark);
}
.btn--ghost:hover { background: var(--coffee-dark); color: var(--cream-light); }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* =========================================================
   Navbar
   ========================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 235, 221, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(60, 42, 33, 0.08);
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand__mark { font-size: 1.4rem; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  color: var(--coffee-dark);
}
.nav__links { display: flex; gap: 28px; }
.nav__links a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.nav__links a:hover { color: var(--coffee-dark); }

.cart__btn {
  background: var(--coffee-dark);
  color: var(--cream-light);
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}
.burger { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--coffee-dark); }

@media (max-width: 800px) {
  .nav__links { display: none; }
  .burger { display: block; }
}

/* =========================================================
   Hero + Signature steam animation
   ========================================================= */
.hero { padding: 72px 0 40px; overflow: hidden; }
.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  font-family: var(--font-hand);
  font-size: 1.4rem;
  color: var(--coffee);
  margin-bottom: 6px;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  line-height: 1.12;
  color: var(--coffee-dark);
  margin-bottom: 20px;
}
.hero__desc { max-width: 46ch; color: var(--text-muted); margin-bottom: 32px; font-size: 1.05rem; }
.hero__cta { display: flex; gap: 16px; flex-wrap: wrap; }

.hero__visual { position: relative; display: flex; justify-content: center; }
.cup-illustration { width: 260px; height: auto; }

.steam {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-6px);
  display: flex;
  gap: 14px;
  z-index: 2;
}
.steam span {
  width: 8px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(to top, rgba(200,162,125,0), rgba(200,162,125,0.55));
  animation: rise 2.6s ease-in-out infinite;
}
.steam span:nth-child(2) { animation-delay: 0.5s; height: 56px; }
.steam span:nth-child(3) { animation-delay: 1s; }

@keyframes rise {
  0%   { transform: translateY(10px) scaleY(0.8); opacity: 0; }
  30%  { opacity: 0.9; }
  100% { transform: translateY(-46px) scaleY(1.3); opacity: 0; }
}

@media (max-width: 800px) {
  .hero__inner { grid-template-columns: 1fr; text-align: left; }
  .hero__visual { order: -1; margin-bottom: 12px; }
}

/* =========================================================
   Shared section styling
   ========================================================= */
.story__badge {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coffee);
  background: var(--latte-light);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  color: var(--coffee-dark);
  line-height: 1.2;
  margin-bottom: 20px;
}

/* =========================================================
   Story section
   ========================================================= */
.story { padding: 64px 0; }
.story__inner { max-width: 760px; }
.story__text { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 40px; }
.story__stats { display: flex; gap: 40px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat strong {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--coffee-dark);
}
.stat span { color: var(--text-muted); font-size: 0.9rem; }

/* =========================================================
   Menu section
   ========================================================= */
.menu { padding: 64px 0 80px; background: var(--cream-light); }
.menu__head { max-width: 640px; margin-bottom: 32px; }
.menu__sub { color: var(--text-muted); }

.menu__filter { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 32px; }
.chip {
  border: 2px solid var(--latte);
  background: transparent;
  color: var(--coffee-dark);
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip:hover { background: var(--latte-light); }
.chip.is-active { background: var(--coffee-dark); border-color: var(--coffee-dark); color: var(--cream-light); }

.menu__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}
.menu__loading { color: var(--text-muted); font-style: italic; }

.menu__card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.menu__card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.menu__card__icon { font-size: 2rem; }
.menu__card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--coffee-dark);
}
.menu__card p { color: var(--text-muted); font-size: 0.92rem; flex: 1; }
.menu__card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.menu__card__price {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--coffee);
  font-size: 1.05rem;
}
.menu__add {
  background: var(--coffee-dark);
  color: var(--cream-light);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.menu__add:hover { background: var(--coffee); }
.menu__error { color: #a8462f; }

/* =========================================================
   How to order
   ========================================================= */
.how { padding: 64px 0 88px; }
.how__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 8px;
}
.how__card {
  background: var(--cream-light);
  border: 1px solid rgba(60,42,33,0.08);
  border-radius: var(--radius-md);
  padding: 26px;
}
.how__num {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  color: var(--coffee);
}
.how__card h3 { font-family: var(--font-display); margin: 8px 0 10px; color: var(--coffee-dark); }
.how__card p { color: var(--text-muted); font-size: 0.94rem; }

/* =========================================================
   Footer
   ========================================================= */
.footer { background: var(--coffee-dark); color: var(--cream-light); padding: 56px 0 0; }
.footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 40px;
}
.footer__brand .brand__name { color: var(--cream-light); }
.footer__brand p { color: var(--latte-light); margin-top: 10px; font-size: 0.92rem; }
.footer__col h4 { font-family: var(--font-display); margin-bottom: 12px; font-size: 1.05rem; }
.footer__col p { color: var(--latte-light); font-size: 0.92rem; margin-bottom: 4px; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  text-align: center;
  padding: 18px 0;
  font-size: 0.82rem;
  color: var(--latte-light);
}
@media (max-width: 700px) {
  .footer__inner { grid-template-columns: 1fr; }
}

/* =========================================================
   Cart Drawer
   ========================================================= */
.overlay {
  position: fixed; inset: 0;
  background: rgba(43, 27, 18, 0.4);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 60;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

.cart {
  position: fixed;
  top: 0; right: -420px;
  width: min(400px, 92vw);
  height: 100%;
  background: var(--cream-light);
  box-shadow: -12px 0 40px rgba(0,0,0,0.2);
  z-index: 70;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}
.cart.is-open { right: 0; }

.cart__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(60,42,33,0.1);
}
.cart__head h3 { font-family: var(--font-display); color: var(--coffee-dark); }
.cart__close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--coffee-dark); }

.cart__items { padding: 16px 22px; overflow-y: auto; flex: 1; }
.cart__empty { color: var(--text-muted); font-style: italic; }

.cart__item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(60,42,33,0.15);
}
.cart__item__name { font-weight: 600; color: var(--coffee-dark); font-size: 0.92rem; }
.cart__item__meta { color: var(--text-muted); font-size: 0.82rem; }
.cart__item__actions { display: flex; align-items: center; gap: 8px; }
.qty__btn {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--latte); background: var(--white);
  cursor: pointer; font-weight: 700; color: var(--coffee-dark);
}

.cart__form {
  padding: 18px 22px 22px;
  border-top: 1px solid rgba(60,42,33,0.1);
  display: flex; flex-direction: column; gap: 12px;
}
.cart__total {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-display);
  color: var(--coffee-dark);
  font-size: 1.1rem;
  margin-bottom: 4px;
}
.cart__form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
}
.cart__form input, .cart__form textarea {
  font-family: var(--font-body);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--latte);
  background: var(--white);
  font-size: 0.92rem;
  resize: vertical;
}
.cart__status { font-size: 0.85rem; min-height: 1.2em; }
.cart__status.is-success { color: #3f7a3f; }
.cart__status.is-error { color: #a8462f; }
