/* ==========================================================================
   The Black Rat Cakery — Full Website
   Dark editorial luxury. Fraunces + Inter. Blush / rose-gold accents.
   ========================================================================== */

:root {
  --bg: #17120E;
  --surface: #241D17;
  --surface-2: #2b2119;
  --cream: #F5EDE3;
  --cream-dim: #CDBFAF;
  --blush: #D8A7A0;
  --rose-gold: #B76E5D;
  --rule: rgba(216, 167, 160, 0.28);
  --container: 1280px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

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

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -60px;
  background: var(--cream);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  z-index: 200;
  border-radius: 2px;
  font-weight: 600;
  transition: top 200ms var(--ease);
}
.skip-link:focus { top: 1rem; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blush);
  outline-offset: 3px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blush);
}
.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--rose-gold);
  display: inline-block;
}
.italic-accent { font-style: italic; font-weight: 500; color: var(--blush); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 48px;
  padding: 0.9rem 1.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  border-radius: 2px;
  white-space: nowrap;
}
.btn-primary { background: var(--blush); color: #201510; }
.btn-primary:hover { background: #e3bab3; }
.btn-outline { border-color: var(--rule); color: var(--cream); }
.btn-outline:hover { border-color: var(--blush); background: rgba(216,167,160,0.08); }
.btn svg { width: 1.1em; height: 1.1em; flex-shrink: 0; }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: transform 200ms var(--ease), background-color 200ms var(--ease), border-color 200ms var(--ease); }
  .btn:hover { transform: translateY(-2px); }
  .btn:active { transform: translateY(0) scale(0.98); }
}

/* ---- Header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(23, 18, 14, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  gap: 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.brand .mark { width: 32px; height: 32px; color: var(--blush); flex-shrink: 0; }
.brand .reg { font-size: 0.6em; vertical-align: super; color: var(--rose-gold); }

.main-nav { display: flex; align-items: center; gap: 2.25rem; }
.main-nav ul { display: flex; gap: 2.25rem; }
.main-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--cream-dim);
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--cream); border-color: var(--blush); }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.social-icons { display: flex; gap: 0.35rem; }
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--cream-dim);
  border-radius: 2px;
}
.icon-link svg { width: 20px; height: 20px; }
.icon-link:hover { color: var(--blush); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--cream);
}
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 860px) {
  .main-nav { position: fixed; inset: 84px 0 0 0; background: var(--bg); flex-direction: column; align-items: stretch; padding: 2rem var(--gutter); gap: 2rem; transform: translateX(100%); visibility: hidden; overflow-y: auto; }
  .main-nav ul { flex-direction: column; gap: 1.5rem; }
  .main-nav a { font-size: 1.15rem; }
  .main-nav.open { transform: translateX(0); visibility: visible; }
  @media (prefers-reduced-motion: no-preference) {
    .main-nav { transition: transform 320ms var(--ease); }
  }
  .nav-toggle { display: inline-flex; }
  .header-actions .social-icons { display: none; }
}

/* ---- Page hero banner (interior pages) ---- */
.page-hero {
  position: relative;
  min-height: 56vh;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.page-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.page-hero::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(23,18,14,0.15) 0%, rgba(23,18,14,0.85) 100%);
}
.page-hero-inner { position: relative; z-index: 2; padding: 4rem 0 3.5rem; width: 100%; }
.page-hero h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); max-width: 20ch; }
.page-hero .lede { margin-top: 1rem; max-width: 42ch; color: var(--cream-dim); font-size: 1.05rem; }

.hero-el { opacity: 1; transform: none; }
.js .hero-el { opacity: 0; transform: translateY(18px); }
.js .hero-loaded .hero-el { opacity: 1; transform: none; }
.hero-el:nth-child(1) { transition-delay: 0ms; }
.hero-el:nth-child(2) { transition-delay: 80ms; }
.hero-el:nth-child(3) { transition-delay: 160ms; }
@media (prefers-reduced-motion: no-preference) {
  .js .hero-el { transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
}

/* ---- Home hero (index) ---- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: stretch;
  min-height: 92dvh;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.hero-copy { display: flex; flex-direction: column; justify-content: center; gap: 1.75rem; padding: 6rem var(--gutter); max-width: 640px; }
.hero-copy h1 { font-size: clamp(2.6rem, 5.5vw, 4.5rem); }
.hero-copy .lede { max-width: 34ch; font-size: 1.15rem; color: var(--cream-dim); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.5rem; }
.hero-media { position: relative; overflow: hidden; background: var(--surface); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(23,18,14,0) 55%, rgba(23,18,14,0.55) 100%), linear-gradient(90deg, rgba(23,18,14,0.35), rgba(23,18,14,0) 30%);
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-media { min-height: 55vh; order: -1; }
  .hero-copy { padding: 3rem var(--gutter) 3.5rem; }
}

/* ---- Sections ---- */
section { padding: 6.5rem 0; }
.section-head { max-width: 46rem; margin-bottom: 3.5rem; display: flex; flex-direction: column; gap: 1rem; }
.section-head.center { margin-inline: auto; text-align: center; align-items: center; }
.section-head h2 { font-size: clamp(2rem, 4vw, 2.75rem); }
.section-head p { color: var(--cream-dim); font-size: 1.05rem; max-width: 42ch; }

.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { transition: opacity 480ms var(--ease), transform 480ms var(--ease); }
}

.rule { border: 0; height: 1px; background: var(--rule); margin: 0; }

/* ---- Cake cards / grids ---- */
.signature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.signature-grid > :nth-child(2) { margin-top: 3.5rem; }
.cake-card figure { overflow: hidden; background: var(--surface); aspect-ratio: 4/5; }
.cake-card img { width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) { .cake-card img { transition: transform 300ms var(--ease); } }
.cake-card:hover img { transform: scale(1.03); }
.cake-card figcaption { padding-top: 1.1rem; }
.cake-card .cake-name { font-family: var(--font-display); font-size: 1.2rem; font-style: italic; }
.cake-card .cake-desc { font-size: 0.9rem; color: var(--cream-dim); margin-top: 0.3rem; }

@media (max-width: 900px) {
  .signature-grid { grid-template-columns: 1fr; gap: 3rem; }
  .signature-grid > :nth-child(2) { margin-top: 0; }
}

/* ---- Two-column feature / about ---- */
.feature-strip { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.feature-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.feature-grid.reverse { grid-template-columns: 1.1fr 0.9fr; }
.feature-grid.reverse .feature-media { order: 2; }
.feature-media { aspect-ratio: 3/4; overflow: hidden; }
.feature-media img { width: 100%; height: 100%; object-fit: cover; }
.feature-copy p { color: var(--cream-dim); font-size: 1.05rem; max-width: 48ch; }
.feature-copy p + p { margin-top: 1.1rem; }
.stat-row { display: flex; flex-wrap: wrap; gap: clamp(2rem, 5vw, 3.5rem); margin-top: 2.5rem; }
.stat dt { font-family: var(--font-display); font-size: 2.25rem; color: var(--blush); font-style: italic; }
.stat dd { margin: 0.25rem 0 0; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cream-dim); }

@media (max-width: 900px) {
  .feature-grid, .feature-grid.reverse { grid-template-columns: 1fr; }
  .feature-grid.reverse .feature-media { order: 0; }
  .feature-media { aspect-ratio: 16/10; }
}

/* ---- Process steps (wedding-cakes.html) ---- */
.process-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); counter-reset: step; }
.process-step { position: relative; padding-top: 2rem; border-top: 1px solid var(--rule); }
.process-step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--rose-gold);
  margin-bottom: 1rem;
}
.process-step h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.process-step p { color: var(--cream-dim); font-size: 0.95rem; }
@media (max-width: 900px) {
  .process-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .process-list { grid-template-columns: 1fr; }
}

/* ---- Service list (celebration / wholesale) ---- */
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.service-card { padding: 2.25rem; background: var(--surface); border: 1px solid var(--rule); }
.service-card .icon { width: 2.25rem; height: 2.25rem; color: var(--blush); margin-bottom: 1.25rem; }
.service-card h3 { font-size: 1.3rem; margin-bottom: 0.75rem; }
.service-card p { color: var(--cream-dim); font-size: 0.95rem; }
@media (max-width: 900px) { .service-grid { grid-template-columns: 1fr; } }

/* ---- Gallery grid (home teaser) ---- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 220px; gap: 0.85rem; }
.gallery-grid a { display: block; overflow: hidden; background: var(--surface); position: relative; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) { .gallery-grid img { transition: transform 300ms var(--ease); } }
.gallery-grid a:hover img { transform: scale(1.03); }
.gallery-grid .tall { grid-row: span 2; }
.gallery-foot { margin-top: 2.5rem; display: flex; justify-content: center; }
@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; } }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 160px; } }

/* ---- Masonry gallery (gallery.html) ---- */
.masonry {
  column-count: 3;
  column-gap: 0.85rem;
}
.masonry .item {
  break-inside: avoid;
  margin-bottom: 0.85rem;
  overflow: hidden;
  background: var(--surface);
  display: block;
  position: relative;
}
.masonry .item img { width: 100%; height: auto; display: block; }
@media (prefers-reduced-motion: no-preference) { .masonry .item img { transition: transform 300ms var(--ease); } }
.masonry .item:hover img { transform: scale(1.03); }
.masonry button.item { width: 100%; padding: 0; border: 0; cursor: zoom-in; }
@media (max-width: 900px) { .masonry { column-count: 2; } }
@media (max-width: 560px) { .masonry { column-count: 1; } }

/* ---- Lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(15, 11, 8, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  opacity: 0;
}
.lightbox.open { display: flex; }
.lightbox.show { opacity: 1; }
@media (prefers-reduced-motion: no-preference) { .lightbox { transition: opacity 250ms var(--ease); } }
.lightbox img { max-width: 100%; max-height: 88vh; width: auto; height: auto; object-fit: contain; }
.lightbox-close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--cream); background: rgba(36,29,23,0.8); border-radius: 2px;
}
.lightbox-close svg { width: 22px; height: 22px; }
.lightbox-close:hover { color: var(--blush); }

/* ---- Testimonial ---- */
.testimonial { text-align: center; }
.testimonial blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 3.2vw, 2.25rem);
  max-width: 44rem;
  margin-inline: auto;
}
.testimonial .quote-mark { width: 2.5rem; height: 2.5rem; color: var(--rose-gold); margin: 0 auto 1.5rem; }
.testimonial cite { display: block; margin-top: 1.75rem; font-style: normal; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blush); }

/* ---- CTA / Enquire ---- */
.enquire { background: var(--surface); border-top: 1px solid var(--rule); }
.enquire-inner { text-align: center; max-width: 42rem; margin-inline: auto; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.enquire h2 { font-size: clamp(2.1rem, 4.5vw, 3rem); }
.enquire p { color: var(--cream-dim); font-size: 1.05rem; }
.enquire-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 0.5rem; }
.placeholder-contacts { margin-top: 2rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem 2rem; font-size: 0.9rem; color: var(--cream-dim); }
.placeholder-contacts .flag { color: var(--rose-gold); border: 1px dashed var(--rose-gold); padding: 0.35rem 0.7rem; border-radius: 2px; font-weight: 600; letter-spacing: 0.02em; }

/* ---- Contact page specific ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.contact-card { padding: 2.5rem; background: var(--surface); border: 1px solid var(--rule); display: flex; flex-direction: column; gap: 1.25rem; }
.contact-card .icon { width: 2.5rem; height: 2.5rem; color: var(--blush); }
.contact-card h3 { font-size: 1.4rem; }
.contact-card p { color: var(--cream-dim); font-size: 0.95rem; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

.info-list { display: flex; flex-direction: column; gap: 1.75rem; }
.info-list .row { display: flex; gap: 1rem; align-items: flex-start; }
.info-list .icon { width: 1.5rem; height: 1.5rem; color: var(--rose-gold); flex-shrink: 0; margin-top: 0.15rem; }
.info-list h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.info-list p { color: var(--cream-dim); font-size: 0.92rem; }

/* ---- Footer ---- */
.site-footer { padding: 3.5rem 0 2.5rem; border-top: 1px solid var(--rule); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.footer-brand { display: flex; align-items: center; gap: 0.75rem; font-family: var(--font-display); font-size: 1.1rem; }
.footer-brand .mark { width: 28px; height: 28px; color: var(--blush); }
.footer-meta { color: var(--cream-dim); font-size: 0.85rem; max-width: 28rem; line-height: 1.8; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; font-size: 0.85rem; color: var(--cream-dim); }
.footer-nav a:hover { color: var(--blush); }
.footer-social { display: flex; gap: 0.5rem; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: 0.78rem; color: var(--cream-dim); letter-spacing: 0.02em; }

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