/* ==========================================================
   Chocolate Mart - shared stylesheet
   Used by index.html (Home) and shop.html (Shop)
   ========================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #f7e8e4;
  --surface: #fdf5f2;
  --ink: #2a1810;
  --muted: #6d5147;
  --line: #dfc4bc;
  --ruby: #c42b60;
  --ruby-ink: #ffffff;
  --band: #2a1810;
  --band-ink: #f5e6e0;
  --band-muted: #cdb3a9;

  --display: "Gloock", Georgia, "Times New Roman", serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px;
  --radius: 8px;
}

/* Dark mode follows the visitor's device setting */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d110b;
    --surface: #2a1810;
    --ink: #f5e6e0;
    --muted: #c3a89e;
    --line: #4a2f24;
    --band: #3a2013;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.05; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ruby); outline-offset: 3px; border-radius: 3px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* ---------- Navigation ---------- */
.nav { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 4rem; gap: 1rem; }
.brand { font-family: var(--display); font-size: 1.5rem; text-decoration: none; letter-spacing: -0.01em; }
.nav ul { display: flex; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.nav a.link { display: inline-block; text-decoration: none; padding: 0.4rem 0.8rem; border-radius: 999px; font-weight: 500; color: var(--muted); }
.nav a.link:hover { color: var(--ink); }
.nav a.link[aria-current="page"] { background: var(--ink); color: var(--bg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--text); font-weight: 700; font-size: 1rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid var(--ink);
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--ruby); border-color: var(--ruby); color: var(--ruby-ink); }
.btn-primary:hover { background: transparent; color: var(--ruby); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

/* ---------- Home: hero ---------- */
.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(3rem, 7.6vw, 6rem); line-height: 0.95; }
.hero .lede { margin-top: 1.5rem; max-width: 32rem; font-size: 1.2rem; color: var(--muted); }
.hero .actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* The chocolate bar, drawn with CSS only */
.bar-wrap {
  position: relative;
  justify-self: center;
  width: min(100%, 330px);
  transform: rotate(-5deg);
  filter: drop-shadow(0 18px 18px rgba(42, 24, 16, 0.28));
  animation: tilt-in .9s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes tilt-in { from { opacity: 0; transform: rotate(-16deg) translateY(24px); } }
@media (prefers-reduced-motion: reduce) { .bar-wrap { animation: none; } }

.bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bar span {
  position: relative;
  aspect-ratio: 1;
  border-radius: 7px;
  background: linear-gradient(145deg, #5f3823, #3a2013);
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.14), inset -3px -3px 0 rgba(0,0,0,.4);
}
.bar span::after {
  content: "";
  position: absolute; inset: 22%;
  border-radius: 4px;
  background: linear-gradient(145deg, #4a2a1a, #5f3823);
  box-shadow: inset 2px 2px 0 rgba(0,0,0,.35), inset -2px -2px 0 rgba(255,255,255,.1);
}
.bar .gone { visibility: hidden; }
.foil {
  position: absolute; left: -10px; right: -10px; bottom: -10px; height: 36%;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 1.1rem;
  color: #fff; font-family: var(--display); font-size: 1.6rem;
  background: linear-gradient(160deg, #e0457b, #b02057);
  clip-path: polygon(0 14%, 6% 5%, 12% 15%, 19% 4%, 26% 14%, 33% 6%, 40% 15%, 48% 4%, 55% 13%, 63% 5%, 70% 15%, 78% 5%, 85% 14%, 92% 6%, 100% 13%, 100% 100%, 0 100%);
}

/* ---------- Home: kinds of chocolate ---------- */
.kinds { padding-block: clamp(3rem, 7vw, 5rem); }
.section-head { max-width: 36rem; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
.section-head p { margin-top: 0.9rem; color: var(--muted); }
.kinds-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 1rem; }
.kind { min-height: 300px; padding: 1.75rem; border-radius: var(--radius); display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.kind h3 { font-size: clamp(2.2rem, 4vw, 3.2rem); }
.kind p { margin-top: 0.75rem; max-width: 26rem; }
.kind a { font-weight: 700; text-underline-offset: 4px; }
.kind-dark { background: #2a1810; color: #f5e6e0; border: 1px solid var(--line); }
.kind-milk { background: #9a5f37; color: #fff; }
.kind-ruby { background: #c42b60; color: #fff; }

/* ---------- Home: tasting band ---------- */
.tasting { background: var(--band); color: var(--band-ink); padding-block: clamp(3rem, 7vw, 5rem); }
.tasting .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.tasting h2 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
.tasting p { color: var(--band-muted); font-size: 1.15rem; max-width: 30rem; }
.tasting p strong { color: var(--band-ink); }

/* ---------- Shop page ---------- */
.shop { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.shop-head { max-width: 38rem; margin-bottom: 3rem; }
.shop-head h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
.shop-head p { margin-top: 1rem; color: var(--muted); font-size: 1.15rem; }

.group + .group { margin-top: 3.5rem; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem; padding-bottom: 0.6rem; border-bottom: 2px solid var(--ink); margin-bottom: 1.5rem; }
.group-head h2 { font-size: 1.9rem; }
.group-head span { color: var(--muted); font-size: 0.98rem; }

.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: 0.9rem; }
.item .top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.item h3 { font-family: var(--text); font-weight: 700; font-size: 1.08rem; line-height: 1.25; letter-spacing: 0; }
.item .price { font-weight: 700; white-space: nowrap; }
.item p { color: var(--muted); font-size: 0.98rem; margin-top: 0.25rem; }

/* Little product pictures, made from colored blocks */
.mini { height: 92px; display: grid; gap: 5px; }
.mini i { display: block; background: var(--c, #4a2a1b); box-shadow: inset 2px 2px 0 rgba(255,255,255,.2), inset -2px -2px 0 rgba(0,0,0,.25); }
.mini-bar { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); }
.mini-bar i { border-radius: 4px; }
.mini-box { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); width: 92px; }
.mini-box i { border-radius: 50%; }
.mini-tin { display: block; width: 92px; }
.mini-tin i { width: 100%; height: 100%; border-radius: 14px; background: linear-gradient(to bottom, #c42b60 0 26%, var(--c) 26% 100%); }

.order { margin-top: 3.5rem; padding: 1.75rem; border-radius: var(--radius); background: var(--band); color: var(--band-ink); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem; }
.order h2 { font-size: 1.8rem; }
.order p { margin-top: 0.4rem; color: var(--band-muted); max-width: 32rem; }
.order .btn-ghost { color: var(--band-ink); border-color: var(--band-ink); }
.order .btn-ghost:hover { background: var(--band-ink); color: var(--band); }
.order .btn-primary:hover { color: #fff; border-color: #fff; }
.order .btns { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.allergy { margin-top: 1.5rem; font-size: 0.95rem; color: var(--muted); }

/* ---------- Footer / visit ---------- */
footer { border-top: 1px solid var(--line); background: var(--surface); padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem; scroll-margin-top: 4.5rem; }
.foot-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 2.5rem; }
footer h2 { font-size: 2rem; }
footer h3 { font-family: var(--text); font-weight: 700; font-size: 1.05rem; letter-spacing: 0; margin-bottom: 0.6rem; }
footer address { font-style: normal; margin-top: 1rem; color: var(--muted); }
footer dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1.25rem; color: var(--muted); }
footer dd { margin: 0; }
footer .contact { display: grid; gap: 0.35rem; color: var(--muted); }
footer .contact a { text-underline-offset: 3px; }
.fine { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.92rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero .wrap, .tasting .wrap, .foot-grid { grid-template-columns: 1fr; gap: 2rem; }
  .bar-wrap { order: -1; width: min(70%, 260px); margin-block: 0.5rem 1rem; }
  .kinds-grid { grid-template-columns: 1fr; }
  .kind { min-height: 0; }
}
