/* ============================================================
   Sunday Flour — warm neighborhood bakery
   Palette: "Cream, Cocoa & Dusty Rose"
   Type:    Fraunces (display) + Nunito Sans (body)
   ============================================================ */

:root {
  /* surfaces */
  --cream:       #FDF7F0;  /* page background          */
  --sand:        #F7EADC;  /* alternating band         */
  --rose:        #F2DAD4;  /* dusty rose pastel band   */
  --card:        #FFFCF7;  /* card surface             */

  /* ink — all verified AA+ on the surfaces above */
  --cocoa:       #33241C;  /* headings / darkest ink   */
  --brown:       #6B4A38;  /* body copy                */
  --terracotta:  #A0442A;  /* accent text, links       */
  --sage:        #5F7355;  /* secondary accent text    */

  /* decorative only (never carries text) */
  --rose-soft:   #E8C6BD;
  --sage-soft:   #CBD6C2;
  --butter:      #F6D9A0;

  --shadow-sm: 0 2px 8px rgba(76, 48, 32, .07);
  --shadow-md: 0 10px 28px rgba(76, 48, 32, .10);
  --shadow-lg: 0 20px 48px rgba(76, 48, 32, .14);

  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 32px;
  --r-pill: 999px;

  --wrap: 1160px;
  --header-h: 74px;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font-family: var(--font-body);
  font-size: 1.0625rem;         /* 17px */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--cocoa);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.015em;
  margin: 0 0 .5em;
  font-variation-settings: "SOFT" 40, "WONK" 1;
}

h1 { font-size: clamp(2.6rem, 6.2vw, 4.3rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
h3 { font-size: 1.3rem; letter-spacing: -.01em; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--terracotta); }

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

/* ── Focus & skip link ───────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  background: var(--cocoa);
  color: var(--cream);
  padding: .85rem 1.25rem;
  border-radius: var(--r-sm);
  font-weight: 700;
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: .8rem 1.6rem;
  border: 2px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .22s ease, background-color .22s ease,
              box-shadow .22s ease, color .22s ease;
}

.btn-primary {
  background: var(--brown);
  color: var(--cream);           /* 7.0:1 */
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--cocoa);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--cocoa);
  border-color: rgba(107, 74, 56, .35);
}
.btn-ghost:hover {
  background: rgba(232, 198, 189, .38);
  border-color: var(--terracotta);
  transform: translateY(-2px);
}

.btn-block { width: 100%; }

/* ── Header / nav ────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 247, 240, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .25s ease, border-color .25s ease,
              background-color .25s ease;
}
.site-header.is-stuck {
  border-color: rgba(107, 74, 56, .14);
  box-shadow: 0 4px 20px rgba(76, 48, 32, .07);
  background: rgba(253, 247, 240, .96);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--cocoa);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.02em;
  padding: .35rem 0;
}
.brand-mark { color: var(--terracotta); display: flex; }
.brand-mark svg { transition: transform .35s ease; }
.brand:hover .brand-mark svg { transform: rotate(-8deg) scale(1.06); }

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: .35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.primary-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .5rem 1rem;
  border-radius: var(--r-pill);
  color: var(--cocoa);
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.primary-nav a:hover {
  background: var(--rose);
  color: var(--cocoa);
}
.primary-nav .nav-cta {
  background: var(--brown);
  color: var(--cream);
  padding-inline: 1.35rem;
  margin-left: .4rem;
}
.primary-nav .nav-cta:hover {
  background: var(--cocoa);
  color: var(--cream);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  min-width: 44px;
  padding: .5rem .9rem;
  background: var(--card);
  color: var(--cocoa);
  border: 1.5px solid rgba(107, 74, 56, .25);
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
}
.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
}
.nav-toggle-bars span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
  transition: transform .28s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(4.5rem, 9vw, 7rem);
  background:
    radial-gradient(60rem 30rem at 12% -10%, rgba(242, 218, 212, .75), transparent 62%),
    radial-gradient(45rem 28rem at 92% 8%, rgba(246, 217, 160, .40), transparent 60%),
    var(--cream);
  overflow: hidden;
}

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

.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: .35rem .9rem;
  background: var(--card);
  border: 1px solid rgba(160, 68, 42, .22);
  border-radius: var(--r-pill);
  color: var(--terracotta);        /* 5.9:1 on cream */
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.hero h1 em {
  font-style: italic;
  color: var(--terracotta);
  font-variation-settings: "SOFT" 60, "WONK" 1;
}

.lede {
  font-size: clamp(1.08rem, 1.6vw, 1.22rem);
  max-width: 34rem;
  margin-top: 1.2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin: 1.8rem 0 1.4rem;
}

.hero-note {
  font-size: .97rem;
  color: var(--brown);
}
.hero-note span { margin-right: .35rem; }

.hero-art { position: relative; }

.hero-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

.hero-img-inset {
  position: absolute;
  left: -2.2rem;
  bottom: -2.4rem;
  width: 42%;
  max-width: 200px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 7px solid var(--cream);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}

.hero-badge {
  position: absolute;
  top: -1.1rem;
  right: -.6rem;
  margin: 0;
  padding: .7rem 1.1rem;
  background: var(--butter);
  color: var(--cocoa);            /* 14:1 on butter */
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
  line-height: 1.25;
  transform: rotate(4deg);
}
.hero-badge strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.hero-badge span { font-size: .82rem; }

.hero-scallop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 34px;
  background: radial-gradient(circle at 20px -6px, var(--cream) 22px, transparent 23px) repeat-x;
  background-size: 40px 34px;
  pointer-events: none;
}

/* ── Sections ────────────────────────────────────────────── */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }

.menu-section { background: var(--cream); }
.story-section { background: var(--sand); }
.visit-section { background: var(--rose); }
.order-section { background: var(--cream); }

.section-head {
  max-width: 42rem;
  margin: 0 auto clamp(2.2rem, 4vw, 3.2rem);
  text-align: center;
}
.section-sub { font-size: 1.08rem; }

/* ── Menu grid ───────────────────────────────────────────── */
.menu-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.2rem, 2.5vw, 2rem);
}

.card {
  background: var(--card);
  border: 1px solid rgba(107, 74, 56, .10);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(160, 68, 42, .28);
}
.card:hover .card-media img { transform: scale(1.05); }

.card-media {
  overflow: hidden;
  background: var(--sand);
}
.card-media img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform .5s ease;
}

.card-body { padding: 1.35rem 1.5rem 1.6rem; }

.card-body h3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  margin-bottom: .5rem;
}
.price {
  flex: none;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--terracotta);
}
.card-body p { font-size: 1rem; margin-bottom: .85rem; }

.tag {
  display: inline-block;
  margin: 0;
  padding: .25rem .7rem;
  background: var(--sage-soft);
  border-radius: var(--r-pill);
  color: #3F4E38;              /* deep sage on soft sage — 7.4:1 */
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.menu-foot {
  margin-top: 2.2rem;
  text-align: center;
  font-size: 1.02rem;
  color: var(--brown);
}

/* ── Story ───────────────────────────────────────────────── */
.story-grid {
  display: grid;
  grid-template-columns: .85fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.story-art { position: relative; }
.story-art img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.story-caption {
  margin: .9rem 0 0;
  font-size: .92rem;
  font-style: italic;
  color: var(--brown);
  text-align: center;
}

.story-copy p { max-width: 38rem; }

.story-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 2.4rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 1.6rem 0 0;
  border-top: 2px dashed rgba(107, 74, 56, .25);
}
.story-facts li { display: flex; flex-direction: column; }
.story-facts strong {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--terracotta);
  line-height: 1.1;
}
.story-facts span { font-size: .93rem; }

/* ── Visit ───────────────────────────────────────────────── */
.visit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.2rem, 2.5vw, 2rem);
  align-items: start;
}

.info-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 1.9rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: transform .3s ease, box-shadow .3s ease;
}
.info-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.info-card h3 { margin-bottom: 1rem; }

.hours { margin: 0 0 1.2rem; }
.hours > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 0;
  border-bottom: 1px solid rgba(107, 74, 56, .12);
}
.hours > div:last-child { border-bottom: 0; }
.hours dt { font-weight: 700; color: var(--cocoa); }
.hours dd { margin: 0; text-align: right; }
.hours .closed dd { color: var(--terracotta); font-style: italic; }

address { font-style: normal; }
.contact-lines a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.contact-lines a:hover { color: var(--cocoa); }

.info-note {
  margin: 0;
  font-size: .93rem;
  color: var(--brown);
}

.info-card-media { padding: 1rem 1rem 1.3rem; }
.info-card-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
}
.info-card-media .info-note { padding-inline: .6rem; }

/* ── Order form ──────────────────────────────────────────── */
.order-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.order-aside {
  margin-top: 1.5rem;
  padding: 1.1rem 1.3rem;
  background: var(--sand);
  border-left: 4px solid var(--rose-soft);
  border-radius: var(--r-sm);
  font-size: .97rem;
}

.order-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  background: var(--card);
  border: 1px solid rgba(107, 74, 56, .12);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 3vw, 2.4rem);
  box-shadow: var(--shadow-md);
}

.field { display: flex; flex-direction: column; gap: .4rem; }
.field-full { grid-column: 1 / -1; }

.field label {
  font-weight: 700;
  font-size: .95rem;
  color: var(--cocoa);
}
.optional { font-weight: 400; color: var(--brown); }

.field input,
.field select,
.field textarea {
  min-height: 50px;
  padding: .75rem .95rem;
  background: var(--cream);
  border: 1.5px solid rgba(107, 74, 56, .28);
  border-radius: var(--r-sm);
  color: var(--cocoa);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.6; }

.field input::placeholder,
.field textarea::placeholder { color: #8A6B58; opacity: 1; }  /* 4.6:1 on cream */

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: rgba(160, 68, 42, .5); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  background: var(--card);
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(160, 68, 42, .18);
}

.field-check {
  flex-direction: row;
  align-items: flex-start;
  gap: .7rem;
  padding: .3rem 0;
}
.field-check input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin-top: .28rem;
  flex: none;
  accent-color: var(--terracotta);
  cursor: pointer;
}
.field-check label {
  font-weight: 400;
  font-size: .95rem;
  color: var(--brown);
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.form-note {
  margin: .9rem 0 0;
  text-align: center;
  font-size: .9rem;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--cocoa);
  color: #E4D3C4;                 /* 10.2:1 on cocoa */
  padding: clamp(2.8rem, 6vw, 4rem) 0 2rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem 2rem;
  align-items: start;
}
.footer-name {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--cream);
  margin-bottom: .35rem;
}
.footer-brand p { font-size: .97rem; }

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: #F1E2D4;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.footer-nav a:hover { border-bottom-color: var(--rose-soft); }
.footer-nav :focus-visible { outline-color: var(--butter); }

.footer-fine {
  grid-column: 1 / -1;
  margin: 1rem 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(253, 247, 240, .18);
  font-size: .87rem;
  color: #D9C6B6;                 /* 8.7:1 on cocoa */
}

/* ── Scroll reveal ───────────────────────────────────────── */
/* Only hide pre-reveal when JS is running — no JS, no hidden content. */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-inner,
  .story-grid,
  .order-grid { grid-template-columns: 1fr; }

  .hero-art { order: -1; max-width: 34rem; margin-inline: auto; }
  .hero-img-inset { left: -1rem; bottom: -1.6rem; width: 34%; }
  .story-art { max-width: 26rem; margin-inline: auto; }
  .section-head { text-align: left; margin-inline: 0; }
}

@media (max-width: 760px) {
  :root { --header-h: 66px; }

  .nav-toggle { display: inline-flex; }

  .primary-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--cream);
    border-bottom: 1px solid rgba(107, 74, 56, .16);
    box-shadow: var(--shadow-md);
    padding: .5rem 1.25rem 1.25rem;
    display: none;
  }
  .primary-nav.is-open { display: block; }

  .primary-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
  }
  .primary-nav a {
    min-height: 52px;
    border-radius: var(--r-md);
    font-size: 1.05rem;
  }
  .primary-nav .nav-cta {
    justify-content: center;
    margin: .5rem 0 0;
  }

  .order-form { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero-badge { top: -.8rem; right: -.2rem; padding: .55rem .9rem; }
}

@media (max-width: 420px) {
  .hero-actions .btn { width: 100%; }
  .card-body h3 { flex-direction: column; gap: .1rem; }
}

/* ── Motion preferences ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal { opacity: 1; transform: none; }
  .card:hover,
  .info-card:hover,
  .btn:hover { transform: none; }
  .card:hover .card-media img { transform: none; }
}
