/* Butterfat Ice Cream Co. - neapolitan system on dark chocolate */
:root {
  --choc: #33211B;
  --choc-deep: #271813;
  --cream: #FFF6E5;
  --cream-dim: #E8D9C0;
  --berry: #F2789F;
  --pistachio: #9CC49A;
  --waffle: #D9A05B;
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--choc);
  color: var(--cream);
  font-family: "Karla", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
}

html { overflow-x: clip; }

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

a { color: inherit; }

::selection { background: var(--berry); color: var(--choc-deep); }

h1, h2, h3, .disp {
  font-family: "Shrikhand", cursive;
  font-weight: 400;
  line-height: 1.05;
  text-wrap: balance;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--waffle);
  margin-bottom: 0.9rem;
}

.wrap { width: min(1080px, 92vw); margin: 0 auto; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--choc-deep) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 246, 229, 0.08);
  animation: navdrop 0.7s var(--ease) both;
}
@keyframes navdrop { from { transform: translateY(-100%); } }

.nav-in {
  width: min(1080px, 92vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.wordmark {
  font-family: "Shrikhand", cursive;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--cream);
}
.wordmark .dot { color: var(--berry); }

.nav-links { display: flex; gap: 0.4rem; list-style: none; }

.nav-links a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.42rem 1rem;
  border-radius: 99px;
  transition: background 0.25s, color 0.25s;
}
.nav-links a:hover { background: rgba(255, 246, 229, 0.12); }
.nav-links a[aria-current="page"] { background: var(--cream); color: var(--choc-deep); }

/* ---------- hero ---------- */
.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.hero-title {
  font-size: clamp(3.2rem, 9.5vw, 7.2rem);
  letter-spacing: 0.01em;
}
/* padding grows each letter's paint box so Shrikhand's italic overhang
   survives per-letter compositing during the animation; the negative
   margins cancel it out of layout so spacing is unchanged */
.hero-title span {
  display: inline-block;
  padding: 0.25em 0.22em;
  margin: -0.25em -0.22em;
  animation: bob 0.9s var(--ease) both;
}
.hero-title .c-berry { color: var(--berry); }
.hero-title .c-cream { color: var(--cream); }
.hero-title .c-pist { color: var(--pistachio); }
@keyframes bob {
  0% { transform: translateY(1.2em) rotate(6deg); opacity: 0; }
  70% { transform: translateY(-0.06em) rotate(-1deg); opacity: 1; }
  100% { transform: none; opacity: 1; }
}

.hero-sub {
  margin-top: 1.4rem;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  max-width: 30rem;
  color: var(--cream-dim);
  animation: fadeup 0.8s var(--ease) 0.7s both;
}

.hero-ctas { margin-top: 2rem; display: flex; gap: 0.9rem; flex-wrap: wrap; animation: fadeup 0.8s var(--ease) 0.9s both; }

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 800;
  padding: 0.85rem 1.7rem;
  border-radius: 99px;
  border: 2px solid transparent;
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s;
}
.btn:hover { transform: translateY(-3px); }
.btn-berry { background: var(--berry); color: var(--choc-deep); }
.btn-berry:hover { background: #F98FB1; }
.btn-ghost { border-color: rgba(255, 246, 229, 0.35); color: var(--cream); }
.btn-ghost:hover { border-color: var(--cream); }

.hero-photo {
  border-radius: var(--radius);
  overflow: hidden;
  transform: rotate(3deg) translateZ(0);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  animation: heropic 1.1s var(--ease) 0.4s both;
  /* rotated + overflow:hidden aliases the edges in Safari; the transparent
     outline gives the rasterizer a pixel to antialias against */
  outline: 1px solid transparent;
  will-change: transform;
  backface-visibility: hidden;
}
.hero-photo img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
@keyframes heropic {
  from { transform: rotate(10deg) translateY(60px) scale(0.92); opacity: 0; }
  to { transform: rotate(3deg); opacity: 1; }
}

@keyframes fadeup { from { transform: translateY(26px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- marquee ---------- */
.marquee {
  border-top: 1px solid rgba(255, 246, 229, 0.12);
  border-bottom: 1px solid rgba(255, 246, 229, 0.12);
  overflow: hidden;
  padding: 0.85rem 0;
  background: var(--choc-deep);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: slide 48s linear infinite;
  font-family: "Shrikhand", cursive;
  font-size: 1.05rem;
  white-space: nowrap;
}
.marquee-track em { font-style: normal; color: var(--berry); }
.marquee-track em:nth-of-type(3n+2) { color: var(--pistachio); }
.marquee-track em:nth-of-type(3n) { color: var(--waffle); }
/* the track holds 4 identical copies; sliding by exactly one copy (1/4)
   before looping keeps the belt seamless even on very wide windows */
@keyframes slide { to { transform: translateX(-25%); } }

/* ---------- drip divider ---------- */
.drip { display: block; width: 100%; height: 44px; margin-bottom: -1px; }

/* ---------- sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section.alt { background: var(--choc-deep); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); margin-bottom: 1.1rem; }
h2 .tint { color: var(--berry); }

.section p + p { margin-top: 1rem; }
.section .split p { color: var(--cream-dim); max-width: 34rem; }

.photo-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  /* The img inside scales on hover; without its own layer Safari drops the
     rounded mask mid-transition and the corners flash square. */
  transform: translateZ(0);
  isolation: isolate;
}
.photo-card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; transition: transform 0.8s var(--ease); }
.photo-card.tall img { aspect-ratio: 3 / 4; }
.photo-card:hover img { transform: scale(1.05); }

/* ---------- steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-top: 2.4rem;
  list-style: none;
}
.step {
  background: rgba(255, 246, 229, 0.05);
  border: 1px solid rgba(255, 246, 229, 0.1);
  border-radius: var(--radius);
  padding: 1.7rem 1.5rem;
}
.step b {
  font-family: "Shrikhand", cursive;
  font-weight: 400;
  font-size: 1.2rem;
  display: block;
  margin-bottom: 0.5rem;
}
.step:nth-child(1) b { color: var(--berry); }
.step:nth-child(2) b { color: var(--pistachio); }
.step:nth-child(3) b { color: var(--waffle); }
.step p { font-size: 0.97rem; color: var(--cream-dim); }
.step .day { font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cream-dim); display: block; margin-bottom: 0.8rem; }

/* ---------- flavor cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.3rem;
  margin-top: 2.4rem;
}
.card {
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 246, 229, 0.05);
  border: 1px solid rgba(255, 246, 229, 0.1);
  text-decoration: none;
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
  /* Tilts on hover, and it is a rounded box clipping an image: both need a
     stable composited layer or the edges staircase. */
  outline: 1px solid transparent;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.card:hover { transform: translateY(-8px) rotate(-1deg) translateZ(0); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45); }
.card img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.card figcaption { padding: 1rem 1.1rem 1.2rem; }
.card .name { font-family: "Shrikhand", cursive; font-size: 1.02rem; display: block; }
.card .note { font-size: 0.86rem; color: var(--cream-dim); }

/* ---------- menu page ---------- */
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 4vw, 3rem); text-align: center; }
.page-head h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); animation: fadeup 0.8s var(--ease) both; }
.page-head h1 .tint { color: var(--berry); }
.page-head p { margin-top: 1rem; color: var(--cream-dim); animation: fadeup 0.8s var(--ease) 0.2s both; }

.menu-band {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}
.menu-band img { width: 100%; aspect-ratio: 21 / 8; object-fit: cover; }

.menu-group { margin-top: clamp(2.5rem, 6vw, 4rem); }
.menu-group h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.menu-group .gnote { color: var(--cream-dim); font-size: 0.95rem; margin-bottom: 1.6rem; }

.menu-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 3rem; }
.menu-item { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.65rem 0; border-bottom: 1px dashed rgba(255, 246, 229, 0.18); }
.menu-item .mi-name { font-weight: 800; }
.menu-item .mi-desc { color: var(--cream-dim); font-size: 0.9rem; }
.menu-item .mi-dots { flex: 1; }
.menu-item .mi-price { font-family: "Shrikhand", cursive; color: var(--waffle); font-variant-numeric: tabular-nums; }

.tag {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.12rem 0.55rem;
  border-radius: 99px;
  vertical-align: middle;
  margin-left: 0.4rem;
}
.tag-v { background: var(--pistachio); color: var(--choc-deep); }
.tag-new { background: var(--berry); color: var(--choc-deep); }

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.hours { list-style: none; margin-top: 1.2rem; }
.hours li { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px dashed rgba(255, 246, 229, 0.18); font-variant-numeric: tabular-nums; }
.hours .today { color: var(--berry); font-weight: 800; }

.info-block { margin-top: 2rem; }
.info-block h3 { font-size: 1.15rem; margin-bottom: 0.4rem; color: var(--pistachio); }
.info-block a { color: var(--cream); }

form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 800; font-size: 0.9rem; }
.field input, .field textarea {
  font: inherit;
  color: var(--cream);
  background: rgba(255, 246, 229, 0.06);
  border: 1.5px solid rgba(255, 246, 229, 0.2);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  transition: border-color 0.25s, background 0.25s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--berry);
  background: rgba(255, 246, 229, 0.1);
}
form button { justify-self: start; font: inherit; cursor: pointer; }

.form-note { display: none; background: var(--pistachio); color: var(--choc-deep); font-weight: 800; padding: 0.9rem 1.2rem; border-radius: 14px; }
.form-note.show { display: block; animation: fadeup 0.5s var(--ease) both; }

/* ---------- footer ---------- */
footer {
  background: var(--choc-deep);
  border-top: 1px solid rgba(255, 246, 229, 0.1);
  padding: 2.4rem 0;
  margin-top: clamp(2rem, 5vw, 4rem);
}
.foot-in {
  width: min(1080px, 92vw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--cream-dim);
  font-size: 0.9rem;
}
.foot-in a { color: var(--cream-dim); }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.from-left { transform: translateX(-40px); }
.reveal.from-right { transform: translateX(40px); }
.reveal.pop { transform: scale(0.9); }
.reveal.in { opacity: 1; transform: none; }
.stagger > * { opacity: 0; transform: translateY(30px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.stagger.in > * { opacity: 1; transform: none; }
.stagger.in > *:nth-child(2) { transition-delay: 0.12s; }
.stagger.in > *:nth-child(3) { transition-delay: 0.24s; }
.stagger.in > *:nth-child(4) { transition-delay: 0.36s; }

/* ---------- demo notice modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(20, 11, 8, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay[hidden] { display: none; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--cream);
  color: var(--choc-deep);
  border-radius: var(--radius);
  padding: 1.9rem 1.8rem;
  max-width: 26rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(24px) scale(0.96);
  transition: transform 0.35s var(--ease);
}
.modal-overlay.open .modal { transform: none; }
.modal h3 { font-size: 1.3rem; color: var(--berry); margin-bottom: 0.6rem; }
.modal p { font-size: 0.97rem; margin-bottom: 1.4rem; }

a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--berry);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal, .stagger > * { opacity: 1; transform: none; }
}

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { width: min(340px, 86vw); justify-self: center; }
  .split { grid-template-columns: 1fr; }
  .split.flip .photo-card { order: -1; }
  .steps { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .menu-list { grid-template-columns: 1fr; }
  .menu-item { flex-wrap: wrap; row-gap: 0.15rem; }
  .menu-item:has(.mi-desc) .mi-dots { display: none; }
  .menu-item .mi-desc { flex-basis: 100%; text-align: left; }
  .contact-grid { grid-template-columns: 1fr; }
  .nav-in { flex-direction: column; gap: 0.5rem; padding: 0.6rem 0 0.9075rem; }
  .menu-band img { aspect-ratio: 16 / 9; }
}
