/* =========================================================
   MAISON BITES — luxury cookie brand
   Palette extracted from logo.jpeg
   ========================================================= */

:root {
  --cream:        #FDF4EB;   /* main background */
  --cream-deep:   #F6EADA;   /* alternating section bg */
  --ivory:        #FFFBF5;   /* cards */
  --espresso:     #3A2A1E;   /* headings / dark text */
  --espresso-deep:#241710;   /* footer */
  --gold:         #A6845F;   /* primary accent (measured) */
  --gold-deep:    #8A6843;   /* hover / depth */
  --gold-light:   #C8AE8A;   /* hairlines */
  --text:         #5C4A3B;   /* body copy */
  --text-soft:    #8a7868;   /* muted */

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans:  'Jost', 'Helvetica Neue', Arial, sans-serif;

  --maxw: 1180px;
  --radius: 14px;
  --shadow: 0 18px 50px -22px rgba(58, 42, 30, 0.45);
  --shadow-soft: 0 10px 30px -18px rgba(58, 42, 30, 0.4);
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--text);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 { font-family: var(--serif); color: var(--espresso); font-weight: 600; line-height: 1.1; }

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

section { padding: clamp(4rem, 9vw, 8rem) 1.5rem; }

/* ---------- Shared bits ---------- */
.eyebrow {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: .35em;
  text-transform: uppercase;
  font-size: .72rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

.section-head { max-width: 640px; margin: 0 auto clamp(2.5rem,5vw,4rem); text-align: center; }

.section-title {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 600;
  letter-spacing: .01em;
}
.section-title--left { text-align: left; }

.section-sub { color: var(--text-soft); font-size: 1.05rem; font-style: italic; font-family: var(--serif); margin-top: .25rem; }

.divider { display: flex; align-items: center; justify-content: center; gap: .8rem; margin: 1.1rem auto; max-width: 220px; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: linear-gradient(to right, transparent, var(--gold-light), transparent); }
.divider__heart { color: var(--gold); font-size: .8rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .8rem;
  padding: .95rem 2.1rem;
  background: var(--espresso);
  color: var(--cream);
  border: 1px solid var(--espresso);
  border-radius: 40px;
  cursor: pointer;
  transition: transform .3s var(--ease), background .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease);
}
.btn:hover { background: var(--gold-deep); border-color: var(--gold-deep); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn--ghost { background: transparent; color: var(--espresso); border-color: var(--gold); }
.btn--ghost:hover { background: var(--espresso); color: var(--cream); border-color: var(--espresso); }
.btn--small { padding: .6rem 1.3rem; font-size: .72rem; }
.btn--full { width: 100%; padding: 1.15rem; font-size: .85rem; }

/* =========================================================
   NAVBAR
   ========================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), padding .4s var(--ease);
  padding: .55rem 0;
}
.nav--scrolled {
  background: rgba(253, 244, 235, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(166,132,95,.18);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav__brand { display: flex; align-items: center; gap: .65rem; }
.nav__mark { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.nav__wordmark {
  font-family: var(--serif); font-size: 1.45rem; font-weight: 600;
  color: var(--espresso); letter-spacing: .04em;
}
.nav__wordmark span { color: var(--gold); font-weight: 500; }

.nav__links { display: flex; align-items: center; gap: 2rem; }
.nav__links a {
  font-family: var(--sans); font-size: .82rem; font-weight: 400;
  letter-spacing: .12em; text-transform: uppercase; color: var(--espresso);
  position: relative; transition: color .3s;
}
.nav__links a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0;
  background: var(--gold); transition: width .3s var(--ease);
}
.nav__links a:not(.nav__cta):hover { color: var(--gold-deep); }
.nav__links a:not(.nav__cta):hover::after { width: 100%; }
.nav__cta { color: var(--cream) !important; }

.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav__toggle span { width: 26px; height: 2px; background: var(--espresso); transition: transform .3s var(--ease), opacity .3s; }
.nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, #FFFBF5 0%, var(--cream) 55%, var(--cream-deep) 100%);
  padding-top: 6rem; overflow: hidden;
}
.hero__glow {
  position: absolute; width: 70vw; height: 70vw; max-width: 720px; max-height: 720px;
  background: radial-gradient(circle, rgba(200,174,138,.28), transparent 65%);
  top: 8%; left: 50%; transform: translateX(-50%); pointer-events: none;
}
.hero__inner { position: relative; z-index: 2; max-width: 720px; }
.hero__logo {
  width: min(420px, 78vw); margin: 0 auto 1.4rem;
  filter: drop-shadow(0 24px 40px rgba(58,42,30,.18));
  mix-blend-mode: multiply;
}
.hero__tagline {
  font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  color: var(--gold-deep); letter-spacing: .02em; margin-bottom: .6rem;
}
.hero__sub { color: var(--text); font-size: clamp(1rem,2vw,1.15rem); max-width: 30rem; margin: 0 auto 2.2rem; }
.hero__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.hero__scroll { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 2; }
.hero__scroll span {
  display: block; width: 22px; height: 36px; border: 1.5px solid var(--gold); border-radius: 14px; position: relative;
}
.hero__scroll span::after {
  content: ""; position: absolute; top: 7px; left: 50%; width: 3px; height: 7px; border-radius: 2px;
  background: var(--gold); transform: translateX(-50%); animation: scrolldot 1.8s var(--ease) infinite;
}
@keyframes scrolldot { 0%{opacity:0; transform:translate(-50%,0);} 35%{opacity:1;} 70%{opacity:0; transform:translate(-50%,12px);} 100%{opacity:0;} }

/* =========================================================
   FEATURES STRIP
   ========================================================= */
.features { background: var(--espresso); color: var(--cream); padding: clamp(3rem,6vw,4.5rem) 1.5rem; }
.features__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; text-align: center;
}
.feature__icon { color: var(--gold-light); font-size: 1.1rem; display: block; margin-bottom: .6rem; }
.feature h3 { color: var(--cream); font-size: 1.6rem; margin-bottom: .4rem; }
.feature p { color: rgba(253,244,235,.72); font-size: .95rem; max-width: 22rem; margin: 0 auto; }

/* =========================================================
   PRODUCTS
   ========================================================= */
.bites { background: var(--cream); }
.bites__grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.8rem;
}
.cookie {
  background: var(--ivory); border: 1px solid rgba(200,174,138,.3); border-radius: var(--radius);
  padding: 1.6rem 1.4rem 2rem; text-align: center;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s var(--ease);
}
.cookie:hover { transform: translateY(-10px); box-shadow: var(--shadow); border-color: var(--gold-light); }
.cookie__imgwrap {
  width: 100%; aspect-ratio: 1; margin-bottom: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(200,174,138,.18), transparent 70%);
  border-radius: 50%;
}
.cookie__imgwrap img {
  width: 86%; transition: transform .5s var(--ease);
  filter: drop-shadow(0 14px 22px rgba(58,42,30,.22));
}
.cookie:hover .cookie__imgwrap img { transform: scale(1.07) rotate(-3deg); }
.cookie__name { font-size: 1.7rem; margin-bottom: .5rem; }
.cookie__desc { font-size: .92rem; color: var(--text-soft); }

/* =========================================================
   BRAND STORY
   ========================================================= */
.story { background: var(--cream-deep); }
.story__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem,5vw,4.5rem); align-items: center;
}
.story__media img {
  border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; object-fit: cover;
}
.story__text p { margin: 1rem 0; max-width: 34rem; }
.story__text .btn { margin-top: 1rem; }

/* =========================================================
   ORDER FORM
   ========================================================= */
.order { background: var(--cream); }
.order__form {
  max-width: 880px; margin: 0 auto;
  background: var(--ivory); border: 1px solid rgba(200,174,138,.35); border-radius: 20px;
  padding: clamp(1.6rem, 4vw, 3rem); box-shadow: var(--shadow-soft);
}
.order__form fieldset { border: none; margin-bottom: 2.2rem; }
.order__form legend {
  font-family: var(--serif); font-size: 1.55rem; color: var(--espresso);
  margin-bottom: 1.3rem; width: 100%;
}

/* honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* quantity grid */
.qty-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.qty {
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  background: var(--cream); border: 1px solid rgba(200,174,138,.3); border-radius: var(--radius);
  padding: 1.1rem .8rem; transition: border-color .3s, box-shadow .3s;
}
.qty.is-active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(166,132,95,.15); }
.qty__img { width: 64px; filter: drop-shadow(0 6px 10px rgba(58,42,30,.22)); }
.qty__name { font-family: var(--serif); font-size: 1.2rem; color: var(--espresso); }

.stepper { display: flex; align-items: center; border: 1px solid var(--gold-light); border-radius: 30px; overflow: hidden; }
.stepper__btn {
  width: 34px; height: 34px; border: none; background: transparent; cursor: pointer;
  font-size: 1.2rem; color: var(--gold-deep); line-height: 1; transition: background .25s, color .25s;
}
.stepper__btn:hover { background: var(--gold); color: var(--cream); }
.stepper__val {
  width: 38px; text-align: center; border: none; background: transparent;
  font-family: var(--sans); font-size: 1rem; font-weight: 500; color: var(--espresso);
  -moz-appearance: textfield; pointer-events: none;
}
.stepper__val::-webkit-outer-spin-button, .stepper__val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.order__total {
  text-align: right; margin-top: 1.2rem; font-family: var(--serif); font-size: 1.25rem;
  color: var(--gold-deep); font-style: italic;
}

/* details fields */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.3rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field--wide { grid-column: 1 / -1; }
.field span { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); font-weight: 500; }
.field input, .field textarea {
  font-family: var(--sans); font-size: .98rem; color: var(--espresso);
  background: var(--cream); border: 1px solid rgba(200,174,138,.45); border-radius: 10px;
  padding: .8rem .9rem; transition: border-color .25s, box-shadow .25s; resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(166,132,95,.14);
}
.field input:invalid:not(:placeholder-shown) { border-color: #c47b6a; }

.order__note { text-align: center; font-size: .85rem; color: var(--text-soft); margin: 0 0 1.4rem; font-style: italic; font-family: var(--serif); }

.form-msg { text-align: center; margin-top: 1.1rem; font-weight: 400; min-height: 1.2em; }
.form-msg.ok  { color: #4f7a4d; }
.form-msg.err { color: #c0573f; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { background: var(--espresso-deep); color: var(--cream); padding: clamp(3rem,6vw,4.5rem) 1.5rem 1.5rem; }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem;
  padding-bottom: 2.5rem; border-bottom: 1px solid rgba(200,174,138,.2);
}
.footer__wordmark { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; color: var(--cream); letter-spacing: .04em; }
.footer__wordmark span { color: var(--gold-light); font-weight: 500; }
.footer__tag { font-family: var(--serif); font-style: italic; color: var(--gold-light); margin: .5rem 0 .3rem; }
.footer__loc { font-size: .88rem; color: rgba(253,244,235,.65); }
.footer h4 { color: var(--cream); font-size: 1.25rem; margin-bottom: .9rem; }
.footer__contact a, .footer__contact p { display: block; color: rgba(253,244,235,.78); font-size: .92rem; margin-bottom: .35rem; transition: color .25s; }
.footer__contact a:hover { color: var(--gold-light); }

.social { display: flex; gap: .8rem; }
.social a {
  width: 42px; height: 42px; border: 1px solid rgba(200,174,138,.4); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--cream);
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease), border-color .3s;
}
.social a svg { width: 19px; height: 19px; }
.social a:hover { background: var(--gold); border-color: var(--gold); color: var(--espresso-deep); transform: translateY(-3px); }

.footer__bottom { max-width: var(--maxw); margin: 1.5rem auto 0; text-align: center; }
.footer__bottom p { font-size: .8rem; letter-spacing: .1em; color: rgba(253,244,235,.55); text-transform: uppercase; }

/* =========================================================
   SCROLL REVEAL
   ========================================================= */
/* Reveal elements are visible by default (so content always shows even if JS fails).
   They only start hidden once JS adds the .js class to <html>. */
.reveal { transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal { opacity: 0; transform: translateY(28px); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 940px) {
  .bites__grid { grid-template-columns: repeat(2, 1fr); }
  .qty-grid { grid-template-columns: repeat(2, 1fr); }
  .story__inner { grid-template-columns: 1fr; }
  .story__media { order: -1; }
  .section-title--left { text-align: center; }
  .story__text { text-align: center; }
  .story__text p { margin-left: auto; margin-right: auto; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav__links {
    position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px);
    background: var(--cream); flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 1.6rem; padding: 2rem 2.4rem; transform: translateX(100%); transition: transform .4s var(--ease);
    box-shadow: -20px 0 50px -20px rgba(58,42,30,.4);
  }
  .nav__links.open { transform: translateX(0); }
  .nav__links a { font-size: 1rem; }
  .nav__toggle { display: flex; z-index: 110; }
  .nav--scrolled { padding: .4rem 0; }
}

@media (max-width: 560px) {
  .features__inner { grid-template-columns: 1fr; gap: 1.8rem; }
  .field-grid { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; text-align: center; }
  .social { justify-content: center; }
  .order__total { text-align: center; }
}

@media (max-width: 380px) {
  .bites__grid, .qty-grid { grid-template-columns: 1fr; }
}
