/* ============================================================
   CRUMB — styles.css  (bento / masonry layout)
   ============================================================ */

/* ---------- Brand constants ---------- */
:root {
  --cocoa: #1A120B;
  --cocoa-2: #241A10;
  --cocoa-3: #2E2214;
  --cream: #F5EDDF;

  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Karla", "Helvetica Neue", Arial, sans-serif;

  --radius: 20px;
  --container: 1180px;
  --header-h: 68px;
  --gap: 16px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Light theme ---------- */
:root,
[data-theme="light"] {
  --bg: #F7F0E3;
  --surface: #FFFDF8;
  --surface-2: #EFE5D2;
  --text: #241A10;
  --text-muted: rgba(36, 26, 16, 0.62);
  --accent: #A96A2E;
  --accent-soft: #C98A4B;
  --line: rgba(36, 26, 16, 0.12);
  --line-strong: rgba(36, 26, 16, 0.22);
  --nav-bg: rgba(247, 240, 227, 0.85);
  --steam: rgba(150, 110, 70, 0.16);
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg: var(--cocoa);
  --surface: var(--cocoa-2);
  --surface-2: var(--cocoa-3);
  --text: var(--cream);
  --text-muted: rgba(245, 237, 223, 0.6);
  --accent: #D29A5F;
  --accent-soft: #E2B27A;
  --line: rgba(245, 237, 223, 0.12);
  --line-strong: rgba(245, 237, 223, 0.24);
  --nav-bg: rgba(26, 18, 11, 0.82);
  --steam: rgba(245, 237, 223, 0.26);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, figure, blockquote { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  background: var(--accent);
  color: var(--cocoa);
  padding: 10px 18px;
  border-radius: 0 0 10px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
              color 0.25s var(--ease), border-color 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-accent { background: var(--accent); color: #1A120B; }
.btn-accent:hover { box-shadow: 0 16px 34px -16px var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand-dot { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.icon-btn .icon { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; fill: none; }

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.icon-steam-off { display: none; }
[data-steam="off"] .icon-steam { display: none; }
[data-steam="off"] .icon-steam-off { display: block; }

/* Hamburger */
.menu-toggle { position: relative; }
.menu-toggle span {
  position: absolute;
  width: 18px;
  height: 1.6px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s var(--ease), top 0.25s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 17px; }
.menu-toggle span:nth-child(2) { top: 24px; }
.menu-toggle.open span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-toggle.open span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

/* ---------- Menu overlay ---------- */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}
.menu-overlay.open { opacity: 1; visibility: visible; }

.menu-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.menu-overlay-inner a:not(.btn) {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 7vw, 3.4rem);
  font-weight: 500;
  color: var(--text);
  padding: 4px 12px;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.menu-overlay-inner a:not(.btn):hover { color: var(--accent); transform: translateX(-4px); }
.menu-overlay-inner .btn { margin-top: 20px; }

/* ---------- Bento grid ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(250px, auto);
  gap: var(--gap);
  padding-top: var(--gap);
  padding-bottom: var(--gap);
}

.tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.tile:hover { border-color: var(--line-strong); }

.tile-tag {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

/* Spans */
.tile-hero { grid-column: span 2; grid-row: span 2; }
.tile-cake { grid-column: span 1; grid-row: span 1; }
.tile-story { grid-column: span 2; }
.tile-services { grid-column: span 2; }
.tile-quote { grid-column: span 2; }
.tile-contact { grid-column: span 2; }

/* ---------- Hero tile ---------- */
.tile-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 4vw, 52px);
  background:
    radial-gradient(80% 80% at 85% 15%, var(--accent) 0%, transparent 55%),
    var(--surface);
}
[data-theme="dark"] .tile-hero { background:
    radial-gradient(80% 80% at 85% 15%, rgba(210, 154, 95, 0.18) 0%, transparent 55%),
    var(--surface); }

.hero-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 4.6vw, 3.9rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
}
.hero-title em { font-style: italic; color: var(--accent); }

.hero-lede {
  font-size: 1.06rem;
  font-weight: 300;
  color: var(--text-muted);
  max-width: 40ch;
  margin-bottom: 26px;
}

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

.hero-cake {
  align-self: flex-end;
  color: var(--accent);
  margin-top: 20px;
  width: min(170px, 42%);
}
.hero-cake svg { width: 100%; height: auto; }
.hero-cake .dot { fill: currentColor; stroke: none; }

/* ---------- Cake tiles ---------- */
.tile-cake {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 24px 18px;
}
.cake-art { color: var(--accent); width: 96px; }
.cake-art svg { width: 100%; height: auto; }
.cake-art .dot { fill: currentColor; stroke: none; }
.cake-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}
.cake-price {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---------- Story tile ---------- */
.tile-story h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
  line-height: 1.12;
  margin-bottom: 16px;
}
.tile-story p { color: var(--text-muted); font-size: 1.02rem; margin-bottom: 22px; }
.tile-story blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.3;
  color: var(--text);
  padding-left: 18px;
  border-left: 2px solid var(--accent);
}

/* ---------- Services tile ---------- */
.services-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 4px;
}
.service-mini {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 18px;
}
.service-mini h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.service-mini p { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Quote tile ---------- */
.tile-quote { display: flex; flex-direction: column; }
.quote-rotator { position: relative; flex: 1; min-height: 170px; }
.quote {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.7s var(--ease);
}
.quote.active { opacity: 1; }
.quote blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  line-height: 1.3;
  margin-bottom: 14px;
}
.quote figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ---------- Contact tile ---------- */
.tile-contact h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
  margin-bottom: 10px;
}
.contact-lede { color: var(--text-muted); margin-bottom: 22px; }

.contact-form { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.82rem; font-weight: 500; color: var(--text-muted); }
.field input,
.field textarea {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  resize: vertical;
  transition: border-color 0.2s var(--ease);
}
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--accent); }

.form-note { font-size: 0.9rem; min-height: 1.2em; }
.form-note.success { color: var(--accent); }
.form-note.error { color: #d4695c; }

/* ---------- Steam overlay ---------- */
.steam {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.wisp {
  position: absolute;
  bottom: -12%;
  width: var(--w, 70px);
  height: var(--h, 160px);
  border-radius: 50%;
  background: var(--steam);
  filter: blur(12px);
  opacity: 0;
  animation: rise var(--dur, 9s) linear infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0) scale(0.5); opacity: 0; }
  12%  { opacity: 0.55; }
  60%  { opacity: 0.3; }
  100% { transform: translateY(-115vh) translateX(28px) scale(1.35); opacity: 0; }
}
[data-steam="off"] .steam { display: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 40px;
  background: var(--surface);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.brand-lg { font-size: 2.4rem; }
.footer-tag { color: var(--text-muted); font-size: 0.95rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { font-size: 0.9rem; color: var(--text-muted); transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 0.82rem; color: var(--text-muted); opacity: 0.7; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

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

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile-hero,
  .tile-story,
  .tile-services,
  .tile-quote,
  .tile-contact { grid-column: span 2; }
  .tile-hero { grid-row: span 1; }
  .tile-cake { grid-column: span 1; }
  .services-mini { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .bento { grid-template-columns: 1fr; }
  .tile-hero,
  .tile-story,
  .tile-services,
  .tile-quote,
  .tile-contact,
  .tile-cake { grid-column: span 1; }
  .tile-hero { grid-row: span 1; }
  .hero-cake { align-self: center; }
  .hero-cta .btn { width: 100%; }
}
