/* ===========================================================
   LOAVES & GRACE — Cottage-core sourdough bakery
   Pure CSS. No frameworks.
   =========================================================== */

/* ---------- TOKENS ---------- */
:root {
  --cream:      #FAF5E9;
  --warm-white: #FDF9F0;
  --wheat:      #D4A853;
  --crust:      #8B5E3C;
  --bark:       #4A2E1A;
  --sage:       #7A8C6E;
  --blush:      #E8C9A0;
  --ink:        #2C1A0E;

  --shadow-soft: 0 8px 28px rgba(74, 46, 26, 0.10);
  --shadow-glow: 0 14px 36px rgba(212, 168, 83, 0.32);

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Lora', Georgia, serif;
  --font-script:  'Dancing Script', cursive;

  --max-width: 1180px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--cream);
  /* subtle linen / paper grain via SVG noise */
  background-image:
    radial-gradient(rgba(139, 94, 60, 0.04) 1px, transparent 1px),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.37 0 0 0 0 0.21 0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 22px 22px, 240px 240px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--crust); text-decoration: none; transition: color .2s; }
a:hover { color: var(--bark); }

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--bark);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); letter-spacing: .5px; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
h4 { font-size: 1.2rem; }
p  { margin: 0 0 1em; }

.script-label {
  display: inline-block;
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--wheat);
  margin-bottom: .4rem;
  transform: rotate(-1.5deg);
}

/* ---------- LAYOUT ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 96px 0; position: relative; }
.section-head { text-align: center; margin-bottom: 56px; }
.section-sub  { max-width: 620px; margin: 0 auto; color: var(--crust); }

.two-col {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 820px) {
  .two-col { grid-template-columns: 1fr; gap: 40px; }
  .section { padding: 72px 0; }
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease, color .25s ease;
  letter-spacing: .3px;
}
.btn-primary {
  background: var(--crust);
  color: var(--warm-white);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover {
  background: var(--bark);
  color: var(--warm-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.btn-ghost {
  background: transparent;
  color: var(--bark);
  border-color: var(--crust);
}
.btn-ghost:hover {
  background: var(--crust);
  color: var(--warm-white);
  transform: translateY(-2px);
}
.btn-large { padding: 16px 36px; font-size: 1.05rem; }

/* ---------- ANNOUNCEMENT BANNER ---------- */
.announce {
  background: var(--wheat);
  color: var(--bark);
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.4;
  padding: 8px 44px 8px 20px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid rgba(74, 46, 26, 0.12);
}
.announce.is-hidden { display: none; }

/* Intro: float in the middle as a card for 5 seconds, then fly to top */
.announce.is-intro {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(90vw, 600px);
  max-width: 600px;
  transform: translate(-50%, -50%);
  z-index: 9999;
  font-size: 1.05rem;
  padding: 24px 56px 24px 28px;
  border-radius: 20px;
  border-bottom: none;
  box-shadow: 0 20px 60px rgba(74, 46, 26, 0.4);
  animation:
    announceAppear 0.55s cubic-bezier(.2,.9,.3,1.2) both,
    announceFloat 2.6s ease-in-out 0.55s infinite;
  transition:
    top 0.85s cubic-bezier(.4, 0, .2, 1),
    left 0.85s cubic-bezier(.4, 0, .2, 1),
    width 0.85s cubic-bezier(.4, 0, .2, 1),
    transform 0.85s cubic-bezier(.4, 0, .2, 1),
    padding 0.85s ease,
    border-radius 0.85s ease,
    font-size 0.85s ease,
    box-shadow 0.85s ease;
}
.announce.is-intro.is-flying {
  top: 0;
  left: 0;
  width: 100vw;
  max-width: none;
  transform: translate(0, 0);
  border-radius: 0;
  font-size: 0.9rem;
  padding: 8px 44px 8px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  animation: none;
}
@keyframes announceAppear {
  0%   { opacity: 0; transform: translate(-50%, -40%) scale(.9); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes announceFloat {
  0%, 100% { box-shadow: 0 20px 60px rgba(74, 46, 26, 0.40); transform: translate(-50%, -50%); }
  50%      { box-shadow: 0 28px 70px rgba(74, 46, 26, 0.50); transform: translate(-50%, calc(-50% - 6px)); }
}
@media (max-width: 600px) {
  .announce.is-intro {
    width: 92vw;
    font-size: 0.95rem;
    padding: 20px 50px 20px 20px;
  }
}
.announce-text {
  margin: 0;
  font-weight: 500;
}
.announce-close {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--bark);
  font-size: 1.4rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.announce-close:hover { background: rgba(74, 46, 26, 0.15); }
@media (max-width: 600px) {
  .announce { font-size: 0.82rem; padding: 8px 40px 8px 14px; }
}

/* ---------- NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 249, 240, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(139, 94, 60, 0.10);
  transition: padding .25s ease, background .25s ease;
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding .25s ease;
}
.nav.shrink .nav-inner { padding: 8px 24px; }
.nav.shrink .nav-logo { width: 36px; height: 36px; }
.nav.shrink .nav-brand-text { font-size: 1.1rem; }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--bark);
}
.nav-logo {
  width: 46px; height: 46px;
  transition: width .25s, height .25s;
}
.nav-brand-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  transition: font-size .25s;
}

.nav-links {
  display: flex;
  gap: 32px;
}
.nav-links a {
  color: var(--bark);
  font-weight: 500;
  font-size: 1rem;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: var(--wheat);
  transition: width .3s ease;
}
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 26px; height: 2px;
  background: var(--bark);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--warm-white);
    flex-direction: column;
    gap: 0;
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, padding .35s ease;
    border-bottom: 1px solid rgba(139, 94, 60, 0.10);
  }
  .nav-links.open {
    max-height: 400px;
    padding: 16px 24px 24px;
  }
  .nav-links a {
    padding: 14px 0;
    border-bottom: 1px dashed rgba(139, 94, 60, 0.18);
  }
  .nav-links a:last-child { border-bottom: none; }
  .nav-toggle { display: flex; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  background: radial-gradient(ellipse at center top, var(--warm-white), var(--cream) 70%);
  overflow: hidden;
}
.hero-inner {
  position: relative;
  max-width: 760px;
  z-index: 2;
}
.hero-logo {
  width: 140px; height: 140px;
  margin: 0 auto 16px;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(74, 46, 26, 0.18));
  animation: gentleFloat 6s ease-in-out infinite;
}
@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.hero-title { margin-bottom: .2em; }
.hero-tagline {
  font-family: var(--font-script);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--wheat);
  margin: .2em 0 1em;
}
.hero-sub {
  color: var(--crust);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 2em;
}
.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-wheat {
  position: absolute;
  top: 0;
  height: 100%;
  width: 110px;
  pointer-events: none;
  z-index: 1;
}
.hero-wheat-left  { left: 4%; transform: rotate(-8deg); }
.hero-wheat-right { right: 4%; transform: rotate(8deg) scaleX(-1); }
@media (max-width: 720px) {
  .hero-wheat { width: 70px; opacity: .55; }
}

/* ---------- STORY ---------- */
.story { background: var(--warm-white); }
.story-text h2 { margin-top: .25em; }
.faith-note {
  border-left: 3px solid var(--wheat);
  padding: 8px 0 8px 18px;
  margin: 28px 0 0;
  font-family: var(--font-script);
  font-size: 1.4rem;
  color: var(--crust);
}
.story-image {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transform: rotate(.6deg);
}
.story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-caption {
  position: absolute;
  bottom: 14px; left: 14px;
  background: var(--warm-white);
  color: var(--bark);
  font-family: var(--font-script);
  font-size: 1.1rem;
  padding: 4px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

/* ---------- PRODUCTS ---------- */
.products { background: var(--cream); }
.category-heading {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 2rem;
  color: var(--crust);
  text-align: center;
  margin: 56px 0 28px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 920px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
  background: var(--warm-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform .35s ease, box-shadow .35s ease;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
}
.product-img {
  aspect-ratio: 5 / 4;
  overflow: hidden;
}
.product-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.product-card:hover .product-img img { transform: scale(1.05); }

.product-body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.product-body h4 { margin: 0 0 .4em; }
.product-body p {
  color: var(--crust);
  font-size: .95rem;
  flex-grow: 1;
}
.price {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 14px;
  background: var(--blush);
  color: var(--bark);
  border-radius: 999px;
  font-weight: 600;
  font-size: .9rem;
  align-self: flex-start;
}

/* ---------- DRIVEWAY STAND ---------- */
.stand {
  background: linear-gradient(160deg, var(--crust), var(--wheat));
  color: var(--warm-white);
  padding: 96px 24px;
  text-align: center;
  position: relative;
}
.stand h2 { color: var(--warm-white); margin-top: 8px; }
.stand p { max-width: 620px; margin: 0 auto 28px; color: rgba(253, 249, 240, 0.92); font-size: 1.05rem; }
.stand-svg {
  width: 180px; height: 144px;
  margin: 0 auto;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.18));
}
.stand-photo {
  display: block;
  width: 100%;
  max-width: 540px;
  margin: 0 auto 28px;
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 36px rgba(0,0,0,0.22);
  border: 6px solid var(--warm-white);
}
.notify-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 0 auto;
  max-width: 520px;
}
.notify-form input {
  flex: 1 1 240px;
  padding: 14px 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--warm-white);
  color: var(--bark);
  outline: none;
}
.notify-form input:focus { border-color: var(--bark); }
.notify-confirm {
  margin-top: 18px;
  font-family: var(--font-script);
  font-size: 1.4rem;
  color: var(--warm-white);
}

/* ---------- ORDER FORM ---------- */
.order { background: var(--warm-white); }
.order-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  max-width: 820px;
  margin: 0 auto;
  background: var(--cream);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
@media (max-width: 640px) {
  .order-form { grid-template-columns: 1fr; padding: 28px; }
}
.field { display: flex; flex-direction: column; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--bark);
  font-size: .95rem;
}
.field label span { color: var(--wheat); }
.field input,
.field select,
.field textarea {
  padding: 12px 16px;
  border: 1.5px solid rgba(139, 94, 60, 0.25);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--warm-white);
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--wheat);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.18);
}
.submit-row { align-items: center; text-align: center; margin-top: 8px; }
.order-confirm {
  text-align: center;
  margin-top: 24px;
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--crust);
}

/* ---------- FOOTER ---------- */
.footer {
  background: var(--bark);
  color: var(--cream);
  padding: 64px 24px 32px;
  text-align: center;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; }
.footer-logo {
  width: 70px; height: 70px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.25));
}
.footer-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 6px;
  color: var(--warm-white);
}
.footer-email a { color: var(--wheat); font-weight: 500; }
.footer-email a:hover { color: var(--blush); }
.footer-tag {
  font-family: var(--font-script);
  color: var(--blush);
  font-size: 1.3rem;
  margin: 12px 0 20px;
}
.socials {
  display: flex; gap: 16px;
  margin: 8px 0 24px;
  color: var(--cream);
}
.socials a {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center; justify-content: center;
  border: 1.5px solid rgba(250, 245, 233, 0.3);
  color: var(--cream);
  transition: background .25s, color .25s, border-color .25s;
}
.socials a:hover {
  background: var(--wheat);
  color: var(--bark);
  border-color: var(--wheat);
}
.copyright {
  font-size: .85rem;
  color: rgba(250, 245, 233, 0.6);
  margin: 0;
}

/* ---------- REVEAL ANIMATION ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s ease, transform .8s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
