/* ============================================
   Koupa Cafe — styles
   Burgundy ground, beige / off-white type, brass accent.
   ============================================ */

:root {
  --wine: #5b1a2a;        /* main background */
  --wine-deep: #43111e;   /* alternate sections, footer */
  --wine-line: #7a3043;   /* rules, borders */
  --beige: #e9dcc6;       /* body text */
  --cream: #f7f0e4;       /* headings, wordmark */
  --brass: #c8a46a;       /* prices, buttons, accents */

  --font-display: "Fredoka", "Nunito", system-ui, sans-serif; /* closest web font to the logo lettering */
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-ml: "Manjari", "Noto Sans Malayalam", sans-serif;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-pad: clamp(72px, 10vw, 140px);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--wine);
  color: var(--beige);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* subtle paper grain over the burgundy */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cream);
  line-height: 1.05;
  margin: 0;
}

p { margin: 0 0 1em; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  background: var(--cream);
  color: var(--wine-deep);
  padding: 10px 16px;
  z-index: 200;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 26px;
  border: 1.5px solid var(--brass);
  border-radius: 999px;
  background: var(--brass);
  color: var(--wine-deep);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.btn:hover { background: var(--cream); border-color: var(--cream); }

.btn-ghost {
  background: transparent;
  color: var(--cream);
  border-color: var(--wine-line);
}
.btn-ghost:hover { background: transparent; border-color: var(--cream); color: var(--cream); }

.btn-small { min-height: 40px; padding: 8px 18px; font-size: .9375rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(91, 26, 42, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--wine-line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  display: block;
  line-height: 0;
}
.brand img {
  height: 50px;
  width: auto;
}

/* the big "Koupa" wordmark already names the page on first view, so the
   header logo waits until that wordmark has scrolled up under the header */
.js .brand {
  transition: opacity .35s, transform .35s, visibility .35s;
}
.js .site-header:not(.past-hero) .brand {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.site-nav a:not(.btn) {
  text-decoration: none;
  color: var(--beige);
  font-weight: 500;
  padding-block: 6px;
  border-bottom: 1px solid transparent;
}
.site-nav a:not(.btn):hover { color: var(--cream); border-bottom-color: var(--brass); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  position: absolute;
  left: 10px;
  width: 24px;
  height: 2px;
  background: var(--cream);
  transition: transform .25s, opacity .25s;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; left: 0; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(40px, 7vw, 96px);
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
}

.hero-place {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  color: var(--brass);
  margin-bottom: .5em;
}

.hero-lede {
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
  line-height: 1.45;
  color: var(--cream);
  max-width: 30ch;
  margin-bottom: 1.6em;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-cup {
  width: clamp(150px, 20vw, 240px);
  height: auto;
  margin-right: clamp(0px, 3vw, 48px);
}
.hero-cup .cup { stroke: var(--cream); stroke-width: 3; }
.hero-cup .cup .crema { stroke: var(--brass); stroke-width: 2; }
.hero-cup .steam { stroke: var(--brass); stroke-width: 3; }

/* the one orchestrated moment: steam draws itself, then keeps drifting */
.hero-cup .steam path {
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation:
    steam-draw 1.6s cubic-bezier(.5, 0, .2, 1) forwards,
    steam-drift 4s ease-in-out 1.8s infinite;
}
.hero-cup .steam path:nth-child(2) { animation-delay: .25s, 2.3s; }
.hero-cup .steam path:nth-child(3) { animation-delay: .5s, 2.8s; }

@keyframes steam-draw { to { stroke-dashoffset: 0; } }
@keyframes steam-drift {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: .35; transform: translateY(-6px); }
}

/* the logo's own "Koupa" lettering, stretched across the page */
.wordmark {
  position: relative;
  margin-top: clamp(32px, 5vw, 56px);
  line-height: 0;
}
.wordmark img {
  display: block;
  width: 100%;
  height: auto;
  /* baseline sits on the section edge; the "p" hangs into the menu band
     (descender is 5.7% of the wordmark's width) */
  margin-bottom: -5.7%;
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section-pad); }
section[id] { scroll-margin-top: 72px; }

.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 24px 48px;
  margin-bottom: clamp(40px, 6vw, 72px);
  padding-bottom: 28px;
  border-bottom: 1px solid var(--wine-line);
}
.section-head h2 { font-size: clamp(2.75rem, 6vw, 4.5rem); }
.section-head p { margin: 0; max-width: 42ch; justify-self: end; }

/* ---------- Menu ---------- */
.menu { background: var(--wine-deep); }

/* category tabs with a sliding brass pill */
.menu-tabs {
  position: relative;
  display: flex;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  padding: 6px;
  margin-bottom: clamp(28px, 4vw, 48px);
  border: 1px solid var(--wine-line);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
}
.menu-tabs::-webkit-scrollbar { display: none; }
html:not(.js) .menu-tabs { display: none; }

.menu-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--beige);
  font: 600 1rem/1 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  transition: color .3s;
}
.menu-tab:hover { color: var(--cream); }
.menu-tab[aria-selected="true"] { color: var(--wine-deep); }
.menu-tab:focus-visible { outline-offset: -2px; border-radius: 999px; }

.menu-tab-indicator {
  position: absolute;
  top: 6px;
  left: 0;
  width: 0;
  height: calc(100% - 12px);
  border-radius: 999px;
  background: var(--brass);
  transition:
    transform .5s cubic-bezier(.3, 1.25, .5, 1),
    width .5s cubic-bezier(.3, 1.25, .5, 1);
}
.menu-tabs.no-anim .menu-tab-indicator { transition: none; }

/* one panel per category: picture card + list */
.menu-panel {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  outline-offset: 8px;
}
.js .menu-panel { display: none; }
.js .menu-panel.is-active { display: grid; }
html:not(.js) .menu-panel + .menu-panel { margin-top: 72px; }

.menu-feature {
  position: sticky;
  top: 96px;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--wine-line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 30%, rgba(200, 164, 106, 0.14), transparent 60%),
    var(--wine);
}
.menu-art {
  width: min(100%, 240px);
  height: auto;
  margin: 0 auto 12px;
}
.menu-art .ln { stroke: var(--cream); stroke-width: 4; }
.menu-art .ac { stroke: var(--brass); stroke-width: 4; }
.menu-art .fry { stroke-width: 9; }

.menu-feature h3 { font-size: clamp(2.25rem, 4vw, 3.25rem); }
.menu-feature .ml {
  font-family: var(--font-ml);
  font-size: 1.25rem;
  color: var(--brass);
  margin: 10px 0 0;
}
.menu-meta {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--wine-line);
  font-size: .9375rem;
  color: rgba(233, 220, 198, 0.8);
}

.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li {
  display: flex;
  align-items: baseline;
  margin-inline: -16px;
  padding: 17px 16px;
  border-top: 1px solid rgba(122, 48, 67, 0.6);
  border-radius: 12px;
  transition: background-color .2s;
}
.menu-list li:first-child { border-top-color: transparent; }
.menu-list li:hover { background: rgba(233, 220, 198, 0.06); }
.menu-list li:hover .price { color: var(--cream); }

.menu-list .item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cream);
  font-size: 1.125rem;
  font-weight: 500;
}
.menu-list .dots {
  flex: 1;
  min-width: 24px;
  margin-inline: 12px;
  border-bottom: 1px dotted rgba(233, 220, 198, 0.3);
  transform: translateY(-5px);
}
.menu-list .price {
  color: var(--brass);
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color .2s;
}

.chili {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--brass);
}
/* only show the "Spicy" key when the open category has a spicy item */
.js .menu:not(:has(.menu-panel.is-active .chili)) .menu-key { visibility: hidden; }
.menu-key {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 36px 0 0;
  font-size: .9375rem;
  color: rgba(233, 220, 198, 0.75);
}

/* entrance when a category opens: the drawing sketches itself, items rise in */
.js .menu-panel.is-active .menu-art :is(path, rect) {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: art-draw 1.1s cubic-bezier(.5, 0, .2, 1) forwards;
}
.js .menu-panel.is-active .menu-art .ac { animation-delay: .25s; }
.js .menu-panel.is-active .menu-list li {
  animation: item-in .55s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms + 60ms);
}
.js .menu-panel.is-active .menu-feature { animation: card-in .5s cubic-bezier(.2, .8, .2, 1) both; }

@keyframes art-draw { to { stroke-dashoffset: 0; } }
@keyframes item-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes card-in { from { opacity: 0; transform: scale(.97); } }

/* ---------- Story ---------- */
.story-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px clamp(48px, 8vw, 120px);
  align-items: start;
}
.story-quote {
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  line-height: 1.02;
  max-width: 12ch;
}
.story-body { max-width: 62ch; padding-top: 10px; }
.story-body p { font-size: 1.125rem; line-height: 1.7; }

.storefront {
  grid-column: 1 / -1;
  margin: clamp(16px, 3vw, 32px) 0 0;
}
.storefront img {
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.storefront figcaption {
  margin-top: 14px;
  font-size: .9375rem;
  color: rgba(233, 220, 198, 0.75);
}

.ml-name {
  font-family: var(--font-ml);
  color: var(--brass);
  margin-left: 6px;
}

/* ---------- Instagram ---------- */
.insta { background: var(--wine-deep); }

/* 3 columns: newest post large (2x2), five more around it */
.insta-grid {
  list-style: none;
  margin: 0 0 clamp(32px, 4vw, 48px);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
}
.insta-grid[hidden] { display: none; }
.insta-tile:first-child { grid-column: span 2; grid-row: span 2; }

.insta-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--wine);
  animation: tile-in .6s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.insta-tile.is-loading {
  animation: tile-pulse 1.4s ease-in-out infinite;
}
@keyframes tile-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes tile-pulse { 50% { background: var(--wine-line); } }

.insta-tile a { display: block; width: 100%; height: 100%; color: var(--cream); }
.insta-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.insta-tile a:hover img { transform: scale(1.05); }
.insta-tile a:focus-visible { outline-offset: -4px; }

.insta-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(67, 17, 30, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.insta-badge svg { width: 16px; height: 16px; }

.insta-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 48px 18px 16px;
  background: linear-gradient(to top, rgba(67, 17, 30, 0.92), transparent);
  font-size: .9375rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s, transform .3s;
}
.insta-tile a:hover .insta-caption,
.insta-tile a:focus-visible .insta-caption { opacity: 1; transform: none; }

.ig-glyph { width: 20px; height: 20px; flex: none; }

/* ---------- Visit ---------- */
.visit { background: var(--wine); }

.visit-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: stretch;
}
.visit-info h2 { font-size: clamp(2.75rem, 6vw, 4.5rem); margin-bottom: 36px; }

.details { margin: 0 0 36px; display: grid; gap: 24px; }
.details div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--wine-line);
}
.details dt { color: var(--brass); font-weight: 600; }
.details dd { margin: 0; color: var(--cream); }
.details a { text-decoration-color: var(--brass); text-underline-offset: 4px; }

.visit-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.map-frame {
  min-height: 380px;
  border: 1px solid var(--wine-line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--wine);
}
.map-frame iframe {
  width: 100%;
  height: 100%;
  min-height: 380px;
  border: 0;
  filter: sepia(.25) saturate(.8);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--wine);
  border-top: 1px solid var(--wine-line);
  padding-block: 40px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
}
.footer-brand {
  height: 76px;
  width: auto;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--cream); text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: 4px; }
.footer-copy { margin: 0; font-size: .9375rem; color: rgba(233, 220, 198, 0.7); }

/* ---------- WhatsApp ---------- */
.btn-icon { gap: 10px; }
.btn-icon .wa-glyph { width: 20px; height: 20px; flex: none; }

.wa-float {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 90;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25d366;           /* WhatsApp green, so people recognise it */
  color: #fff;
  box-shadow: 0 6px 20px rgba(30, 6, 12, 0.45);
  transition: transform .2s;
}
.wa-float:hover { transform: scale(1.06); }
.wa-float:focus-visible { outline-color: var(--cream); outline-offset: 4px; }
.wa-float .wa-glyph { width: 32px; height: 32px; }

/* keep the footer text clear of the floating button */
.site-footer { padding-bottom: 104px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .section-head,
  .story-grid,
  .visit-grid { grid-template-columns: 1fr; }
  .section-head p { justify-self: start; }
  .menu-panel { grid-template-columns: 1fr; gap: 24px; }
  .menu-feature {
    position: static;
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 24px;
  }
  .menu-art { width: 120px; margin: 0; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--wine);
    border-bottom: 1px solid var(--wine-line);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) {
    padding-block: 14px;
    border-bottom: 1px solid var(--wine-line);
    font-size: 1.125rem;
  }
  .site-nav .btn { margin-top: 18px; }

  .header-inner { min-height: 64px; }
  .brand img { height: 40px; }

  .hero { padding-top: 12px; }
  .hero-grid { grid-template-columns: 1fr; gap: 16px; }
  .hero-cup { order: -1; width: 104px; margin: 0 0 0 -6px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .wordmark { margin-top: 36px; }

  /* the tab strip already draws its own rules, so drop the heading's */
  .menu .section-head { border-bottom: 0; padding-bottom: 0; margin-bottom: 28px; }

  .story-grid { row-gap: 20px; }
  .story-body { padding-top: 0; }

  .wa-float { width: 54px; height: 54px; }
  .wa-float .wa-glyph { width: 28px; height: 28px; }
  .visit-actions .btn { flex: 1 1 100%; }

  .details div { grid-template-columns: 1fr; gap: 4px; }
  .insta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* newest post full width, then a 2x2 block; the 6th would sit alone, so hide it */
  .insta-tile:first-child { grid-row: span 1; }
  .insta-tile:nth-child(6) { display: none; }
  .insta-follow { width: 100%; }

  .menu-tabs { width: auto; margin-inline: calc(var(--gutter) * -1); border-radius: 0; border-inline: 0; padding-inline: var(--gutter); }
  /* fade the edge that has more tabs past it, so it reads as scrollable */
  .menu-tabs.more-end { -webkit-mask-image: linear-gradient(to right, #000 78%, transparent); mask-image: linear-gradient(to right, #000 78%, transparent); }
  .menu-tabs.more-start { -webkit-mask-image: linear-gradient(to left, #000 78%, transparent); mask-image: linear-gradient(to left, #000 78%, transparent); }
  .menu-tabs.more-start.more-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent); }
  .menu-tab { padding: 10px 18px; }
  .menu-feature { grid-template-columns: 84px 1fr; gap: 18px; padding: 20px; border-radius: 16px; }
  .menu-art { width: 84px; }
  .menu-feature h3 { font-size: 2rem; }
  .menu-feature .ml { font-size: 1.0625rem; margin-top: 6px; }
  .menu-meta { margin-top: 12px; padding-top: 10px; }
  .menu-list li { margin-inline: 0; padding-inline: 0; }
  .menu-list .item, .menu-list .price { font-size: 1.0625rem; }
  .map-frame, .map-frame iframe { min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-cup .steam path { animation: none; stroke-dashoffset: 0; }
  .insta-tile, .insta-tile.is-loading { animation: none; }
  .js .menu-panel.is-active :is(.menu-feature, .menu-list li, .menu-art path, .menu-art rect) {
    animation: none;
    stroke-dashoffset: 0;
  }
  * { transition: none !important; }
}
