/* Shared design system for every Momo's Café page. Page-specific styles live in hero.css / pages.css. */

:root {
  --espresso: #160b06;
  --roast: #23130b;
  --mocha: #3b1f0e;
  --crema: #f6e7d2;
  --cream: #fbf3e8;
  --ink: #fbf3e8;
  --ink-soft: rgba(251, 243, 232, 0.72);
  --ink-faint: rgba(251, 243, 232, 0.45);
  --ink-dark: #24130a;
  --ink-dark-soft: rgba(36, 19, 10, 0.7);
  --accent: #f3b46b;
  --accent-deep: #c9823a;
  --line: rgba(251, 243, 232, 0.14);
  --line-dark: rgba(36, 19, 10, 0.14);

  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
  --nav-h: 72px;
}

* { box-sizing: border-box; }

html {
  background: var(--espresso);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; }
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--ink-dark); }

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

/* ---------- type ---------- */
.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.display {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6.4vw, 92px);
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.display em, .h2 em { color: var(--accent); }
.lede { font-size: clamp(16px, 1.4vw, 19px); line-height: 1.6; color: var(--ink-soft); max-width: 56ch; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--cream);
  --fg: var(--ink-dark);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), background 0.3s;
  will-change: transform;
}
.btn .arrow { transition: transform 0.4s var(--ease-out); }
.btn:hover { box-shadow: 0 16px 36px -14px rgba(0, 0, 0, 0.7); }
.btn:hover .arrow { transform: translateX(4px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn--ghost { --bg: transparent; --fg: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { --bg: rgba(251, 243, 232, 0.06); box-shadow: inset 0 0 0 1px var(--ink-faint); }
.btn--accent { --bg: var(--accent); }

/* ---------- header ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  /* backdrop-filter is deliberately not transitioned: animating a blur is expensive */
  transition: background 0.5s var(--ease-out), box-shadow 0.5s;
  view-transition-name: site-nav;
}
.nav.is-scrolled {
  background: rgba(22, 11, 6, 0.72);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 0 var(--line);
}
/* over the animated hero: near-solid instead of frosted (set by site.js) */
.nav.is-scrolled.is-over-hero {
  background: rgba(22, 11, 6, 0.9);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  view-transition-name: brand;
}
.brand span { font-weight: 400; font-style: italic; color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); }
.nav-links a {
  position: relative;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 0;
  transition: color 0.3s var(--ease-out);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease-out);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav-links .btn { padding: 10px 18px; font-size: 14px; color: var(--ink-dark); }
.nav-links .btn::after { display: none; }

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  margin-right: -10px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 22px; height: 1.5px;
  margin: 6px auto;
  background: currentColor;
  transition: transform 0.45s var(--ease-out), opacity 0.3s;
}
.nav.is-open .menu-toggle span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav.is-open .menu-toggle span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

@media (max-width: 760px) {
  .menu-toggle, .brand { display: block; position: relative; z-index: 2; }
  .nav-links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    background: var(--espresso);
    clip-path: circle(0 at calc(100% - 38px) 36px);
    transition: clip-path 0.7s var(--ease-in-out);
    visibility: hidden;
  }
  .nav.is-open .nav-links { clip-path: circle(150% at calc(100% - 38px) 36px); visibility: visible; }
  .nav-links a { font-family: var(--serif); font-size: 38px; color: var(--ink); }
  .nav-links .btn { margin-top: 12px; font-family: var(--sans); font-size: 16px; }
  .nav.is-open .nav-links > * { animation: rise 0.7s var(--ease-out) both; animation-delay: calc(0.12s + var(--i, 0) * 0.06s); }
}

/* ---------- page header (inner pages) ---------- */
.page-head {
  position: relative;
  padding: calc(var(--nav-h) + clamp(56px, 10vh, 120px)) 0 clamp(48px, 8vh, 96px);
  overflow: hidden;
}
.page-head .display { view-transition-name: page-title; }
.page-head::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto auto;
  width: 70vw; height: 70vw;
  max-width: 900px; max-height: 900px;
  background: radial-gradient(circle, rgba(243, 180, 107, 0.16), transparent 62%);
  pointer-events: none;
}

/* ---------- sections ---------- */
.section { padding: clamp(72px, 12vh, 140px) 0; position: relative; }
.section--cream { background: var(--crema); color: var(--ink-dark); }
.section--cream .eyebrow { color: var(--ink-dark-soft); }
.section--cream .lede { color: var(--ink-dark-soft); }
.section--cream .h2 em, .section--cream .display em { color: var(--accent-deep); }
.section--roast { background: var(--roast); }

/* ---------- footer ---------- */
.footer {
  background: var(--espresso);
  border-top: 1px solid var(--line);
  padding: clamp(56px, 9vh, 96px) 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
}
.footer h3 { margin: 0 0 16px; font: 500 12px var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
.footer p, .footer li { color: var(--ink-soft); font-size: 15px; line-height: 1.7; margin: 0; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer a { text-decoration: none; transition: color 0.3s; }
.footer a:hover { color: var(--accent); }
.footer .big {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 22px;
}
.signup { display: flex; gap: 8px; max-width: 420px; }
.signup input {
  flex: 1;
  min-width: 0;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(251, 243, 232, 0.04);
  color: var(--ink);
  font: 15px var(--sans);
  transition: border-color 0.3s;
}
.signup input:focus { outline: none; border-color: var(--accent); }
.signup input::placeholder { color: var(--ink-faint); }
.footer .form-note { margin-top: 10px; font-size: 13px; min-height: 1.4em; color: var(--accent); }
.footer-base {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-faint);
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

/* ---------- scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
[data-reveal="fade"] { transform: none; }
[data-reveal="scale"] { transform: scale(0.96); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* split-word headline reveal (words are wrapped by site.js) */
.words .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.words .w > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1s var(--ease-out);
  transition-delay: calc(var(--wi) * 45ms);
}
.words.is-in .w > span { transform: none; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ---------- page transitions ---------- */
/* Native cross-document View Transitions (Chrome/Edge 126+, Safari 18.2+) */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: page-out 0.38s var(--ease-in-out) both; }
::view-transition-new(root) { animation: page-in 0.7s var(--ease-out) 0.08s both; }
::view-transition-group(page-title) { animation-duration: 0.7s; animation-timing-function: var(--ease-out); }

@keyframes page-out { to { opacity: 0; transform: translateY(-14px) scale(0.99); filter: blur(6px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } }

/* Fallback for browsers without cross-document transitions: site.js toggles these classes */
html.no-vt body { animation: page-in 0.7s var(--ease-out) both; }
html.no-vt.is-leaving body { animation: page-out 0.38s var(--ease-in-out) both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal], .words .w > span { opacity: 1; transform: none; transition: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.01s; }
  html.no-vt body, html.no-vt.is-leaving body { animation: none; }
}
