/* =========================================
   Chocolate Bakery Landing — style.css
   ========================================= */
:root {
  --cocoa-950: #140b07;
  --cocoa-900: #1a0f0a;
  --cocoa-800: #24150f;
  --cocoa-700: #34201a;
  --cocoa-600: #4a3024;
  --cocoa-500: #6b4430;
  --cream-100: #fbf1e4;
  --cream-200: #f3e6d6;
  --cream-300: #d9c4ae;
  --cream-400: #cdb59d;
  --muted: #a88c73;
  --caramel: #d9a066;
  --caramel-hi: #f3c892;

  --display: 'Bodoni Moda', Georgia, serif;
  --body: 'Manrope', system-ui, sans-serif;

  --radius-lg: 28px;
  --radius-md: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cocoa-900);
  color: var(--cream-200);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--caramel); }
a:hover { color: var(--caramel-hi); }

/* ---------- 3D canvas ---------- */
#webgl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

main, .nav, .footer { position: relative; z-index: 2; }

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  background: var(--cocoa-950);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  transition: opacity .8s var(--ease), visibility .8s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader p { margin: 0; }
.loader__drop {
  width: 46px; height: 46px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: radial-gradient(circle at 35% 30%, #9a6040, #3b2014 60%);
  animation: drop 1.2s ease-in-out infinite;
}
@keyframes drop {
  0%, 100% { transform: rotate(-45deg) translate(0, 0); }
  50% { transform: rotate(-45deg) translate(6px, -6px); }
}

/* ---------- Scroll progress ---------- */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 60;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--caramel), var(--caramel-hi));
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}
.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px max(24px, calc((100vw - 1240px) / 2 + 24px));
  transition: background .4s var(--ease), backdrop-filter .4s;
}
.nav.is-scrolled {
  background: rgba(20, 11, 7, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--cream-100);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
}
.brand__dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8a5434, #3b2014 60%, #1e100a);
  box-shadow: inset -3px -4px 6px rgba(0,0,0,.5);
}
.nav__links { display: flex; gap: 32px; }
.nav__links a {
  color: var(--cream-300);
  text-decoration: none;
  font-size: 15px;
  position: relative;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1.5px;
  background: var(--caramel);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav__links a:hover { color: var(--cream-100); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Type ---------- */
.eyebrow {
  margin: 0 0 18px;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--caramel);
}
.display {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(48px, 7.4vw, 104px);
  line-height: 1.0;
  color: var(--cream-100);
}
.display em { color: var(--caramel); }
.title {
  margin: 0 0 28px;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(36px, 4.6vw, 62px);
  line-height: 1.06;
  color: var(--cream-100);
}
.lead {
  margin: 26px 0 0;
  max-width: 470px;
  font-size: 18px;
  color: var(--cream-300);
}
.muted { margin: 0; max-width: 380px; color: var(--cream-400); }

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--body);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .35s var(--ease), background .35s, color .35s, border-color .35s;
}
.btn:hover { transform: translateY(-2px); }
.btn--solid { background: var(--caramel); color: var(--cocoa-900); }
.btn--solid:hover { background: var(--caramel-hi); color: var(--cocoa-900); }
.btn--ghost { border: 1.5px solid var(--cocoa-500); color: var(--cream-200); }
.btn--ghost:hover { border-color: var(--caramel); color: var(--cream-100); }
.btn--sm { min-height: 44px; padding: 10px 20px; font-size: 15px; }
.btn--block { width: 100%; margin-top: auto; }

/* ---------- Hero ---------- */
.hero { position: relative; }
.hero__inner { display: flex; align-items: center; }
.hero__copy { max-width: 600px; }
.scroll-hint {
  position: absolute;
  left: 50%; bottom: 32px;
  transform: translateX(-50%);
  margin: 0;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  animation: hint 2.4s ease-in-out infinite;
}
@keyframes hint {
  0%, 100% { transform: translate(-50%, 0); opacity: .6; }
  50% { transform: translate(-50%, 8px); opacity: 1; }
}

/* ---------- Craft ---------- */
.craft__inner { display: flex; justify-content: flex-end; }
.craft__copy { max-width: 520px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px; }
.step { display: flex; gap: 20px; align-items: flex-start; }
.step__num {
  flex: none;
  font-family: var(--display);
  font-size: 30px;
  color: var(--caramel);
  line-height: 1;
}
.step h3 { margin: 0 0 4px; font-size: 19px; color: var(--cream-100); }
.step p { margin: 0; color: var(--cream-400); }

/* ---------- Shop ---------- */
.shop { align-items: flex-start; }
.shop__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 56px;
}
.shop__head .title { margin: 0; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  perspective: 1400px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border-radius: var(--radius-md);
  background: linear-gradient(170deg, rgba(52,32,26,.92), rgba(36,21,15,.92));
  border: 1px solid var(--cocoa-600);
  backdrop-filter: blur(6px);
  transform-style: preserve-3d;
  transition: transform .5s var(--ease), border-color .4s, box-shadow .5s;
  will-change: transform;
}
.card:hover {
  border-color: var(--cocoa-500);
  box-shadow: 0 30px 60px rgba(0,0,0,.45);
}
.card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  color: var(--cream-100);
}
.card p { margin: 0; font-size: 15px; color: var(--cream-400); }
.card__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.price { font-weight: 700; color: var(--caramel); white-space: nowrap; }
.card__media {
  height: 200px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #4a2c1e, #1e110b 75%);
  transform: translateZ(30px);
}
.shape {
  display: block;
  box-shadow: 0 22px 30px rgba(0,0,0,.55),
              inset 6px 6px 14px rgba(255,220,180,.18),
              inset -8px -10px 16px rgba(0,0,0,.45);
  transition: transform .6s var(--ease);
}
.card:hover .shape { transform: translateZ(40px) rotate(-6deg) scale(1.06); }
.shape--bar {
  width: 150px; height: 84px; border-radius: 8px;
  transform: rotate(-12deg);
  background:
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(0,0,0,.35) 34px 37px),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(0,0,0,.35) 39px 42px),
    linear-gradient(145deg, #6e3e26, #3e2115 55%, #24120a);
}
.shape--truffle {
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #9a6040, #4a2817 45%, #1c0e08);
}
.shape--praline {
  width: 120px; height: 96px; border-radius: 50% 50% 18px 18px;
  background: radial-gradient(circle at 35% 25%, #c98b55, #7a4526 55%, #3a1e10);
}
.shape--brownie {
  width: 118px; height: 118px; border-radius: 14px;
  transform: rotate(8deg);
  background: linear-gradient(160deg, #5a3220, #3a1f13 50%, #22120a);
}

/* ---------- Order ---------- */
.order__box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(40px, 6vw, 80px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--cocoa-600);
  background: radial-gradient(circle at 85% 20%, rgba(90,52,32,.92), rgba(43,24,16,.92) 55%);
  backdrop-filter: blur(8px);
}
.order__box .title { margin: 0; }
.order__box .lead { margin-top: 18px; }
.order__box .btn-row { margin-top: 0; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid #3a251b;
  padding: 28px 0;
  background: var(--cocoa-900);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Reveal on scroll (3D fold-in) ---------- */
.reveal {
  opacity: 0;
  transform: perspective(900px) translateY(60px) rotateX(28deg);
  transform-origin: 50% 100%;
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: perspective(900px) translateY(0) rotateX(0);
}
.card.reveal.is-in { transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav__links { display: none; }
  .section { padding: 110px 0 80px; }
  .hero { align-items: flex-end; }
  .hero__copy { padding-bottom: 40px; }
  .craft__inner { justify-content: flex-start; }
  .craft__copy, .hero__copy {
    background: linear-gradient(180deg, rgba(26,15,10,0), rgba(26,15,10,.85) 30%);
    padding-top: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint, .loader__drop { animation: none; }
}
