/* =========================================================================
   The Levain Project — styles
   Aesthetic: warm artisan bakery / editorial. Deep crust tones, flour cream,
   Fraunces display serif + Spline Sans body.
   ========================================================================= */

:root {
  --char: #1c140d;
  --crust: #2a1c10;
  --espresso: #3b2716;
  --amber: #c98a3c;
  --amber-deep: #a8662a;
  --terracotta: #b8502e;
  --flour: #f6ede0;
  --cream: #efe2cf;
  --cream-dim: #e3d3ba;
  --ink: #2c2118;
  --ink-soft: #6b5a47;
  --line: rgba(60, 40, 22, 0.16);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Spline Sans", system-ui, sans-serif;

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

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--flour);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* Grain overlay applied to dark sections for texture */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ----------------------------------------------------------------- Header */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 60px);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}
.site-header.scrolled {
  background: rgba(28, 20, 13, 0.82);
  backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}
.brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--flour);
  text-decoration: none;
}
.brand em { font-style: italic; color: var(--amber); }

/* ----------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
    color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--amber);
  color: var(--char);
  box-shadow: 0 10px 30px -10px rgba(201, 138, 60, 0.7);
}
.btn-primary:hover { background: #d99a4c; transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--flour);
  border-color: rgba(246, 237, 224, 0.4);
}
.btn-ghost:hover { background: rgba(246, 237, 224, 0.1); border-color: var(--flour); }
.btn-sm { padding: 0.6em 1.1em; font-size: 0.85rem; }

/* ----------------------------------------------------------------- Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  color: var(--flour);
  overflow: hidden;
  isolation: isolate;
}
/* Background = your sourdough photo, shown on the right. */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-color: var(--char);
  background-image: url("/assets/sourdough-bg.jpg");
  background-size: cover;
  background-position: center right;
}
/* Overlays: keep the left dark for legible text, reveal the bread on the
   right, add a warm glow + vignette so it always reads as intentional. */
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(18, 12, 7, 0.94) 0%, rgba(18, 12, 7, 0.78) 34%, rgba(18, 12, 7, 0.32) 66%, rgba(18, 12, 7, 0.42) 100%),
    radial-gradient(60% 80% at 80% 52%, rgba(201, 138, 60, 0.16), transparent 60%),
    radial-gradient(140% 130% at 50% 50%, transparent 46%, rgba(10, 7, 4, 0.6) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 120px clamp(20px, 5vw, 60px) 80px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.4rem;
}
.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--amber);
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 7rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  max-width: 14ch;
  margin-bottom: 1.5rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--amber);
}
.hero .tagline {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  font-weight: 300;
  font-style: italic;
  color: var(--cream);
  max-width: 30ch;
  margin-bottom: 1.2rem;
}
.hero .subtext {
  font-size: 1.02rem;
  color: rgba(246, 237, 224, 0.78);
  max-width: 46ch;
  margin-bottom: 2.4rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* staggered entrance */
.reveal { opacity: 0; transform: translateY(22px); animation: rise 1s var(--ease) forwards; }
.reveal.d1 { animation-delay: 0.05s; }
.reveal.d2 { animation-delay: 0.18s; }
.reveal.d3 { animation-delay: 0.31s; }
.reveal.d4 { animation-delay: 0.44s; }
.reveal.d5 { animation-delay: 0.57s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.scroll-cue {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(246, 237, 224, 0.6);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-cue span {
  width: 1px; height: 38px;
  background: linear-gradient(to bottom, var(--amber), transparent);
  animation: cue 2s ease-in-out infinite;
}
@keyframes cue { 0%,100% { opacity: 0.3; transform: scaleY(0.6); } 50% { opacity: 1; transform: scaleY(1); } }

/* ----------------------------------------------------------------- About */
.about {
  position: relative;
  background: var(--flour);
  padding: clamp(70px, 12vw, 150px) clamp(20px, 5vw, 60px);
}
.about-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(30px, 6vw, 90px);
  align-items: start;
}
.about-aside { position: sticky; top: 100px; }
.about-aside .eyebrow { color: var(--amber-deep); }
.about-aside .eyebrow::before { background: var(--amber-deep); }
.about-mark {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  color: var(--espresso);
  margin-top: 0.6rem;
}
.about-mark em { color: var(--terracotta); }

.prose { color: var(--ink); font-size: 1.06rem; }
.prose h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--crust);
  margin-bottom: 1.4rem;
}
.prose h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--crust);
  margin: 2.2rem 0 0.8rem;
}
.prose p { margin-bottom: 1.1rem; color: var(--ink-soft); }
.prose p:first-of-type { color: var(--ink); }
.prose p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3.6em;
  line-height: 0.8;
  float: left;
  padding: 0.05em 0.12em 0 0;
  color: var(--terracotta);
  font-weight: 500;
}
.prose ul { list-style: none; margin: 1.1rem 0; }
.prose li {
  position: relative;
  padding-left: 1.6em;
  margin-bottom: 0.7rem;
  color: var(--ink-soft);
}
.prose li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.62em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--amber);
}
.prose li strong { color: var(--ink); }
.prose em { color: var(--terracotta); font-style: italic; }
.prose strong { color: var(--ink); }

/* ----------------------------------------------------------------- CTA band */
.cta-band {
  position: relative;
  background: var(--crust);
  color: var(--flour);
  text-align: center;
  padding: clamp(60px, 10vw, 110px) clamp(20px, 5vw, 60px);
  overflow: hidden;
  isolation: isolate;
}
.cta-band::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(80% 120% at 50% 0%, rgba(201, 138, 60, 0.28), transparent 60%);
}
.cta-band h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 18ch;
  margin: 0 auto 1.2rem;
}
.cta-band h2 em { font-style: italic; color: var(--amber); }
.cta-band p { color: rgba(246, 237, 224, 0.72); max-width: 44ch; margin: 0 auto 2rem; }

/* ----------------------------------------------------------------- Footer */
.site-footer {
  background: var(--char);
  color: rgba(246, 237, 224, 0.65);
  padding: 50px clamp(20px, 5vw, 60px);
  font-size: 0.9rem;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 30px;
  align-items: center;
  justify-content: space-between;
}
.footer-inner .brand { font-size: 1.3rem; }
.site-footer a { color: var(--amber); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-meta { font-size: 0.8rem; opacity: 0.6; }

/* ----------------------------------------------------------------- Dialog */
dialog.signup {
  width: min(560px, 92vw);
  max-height: 92vh;
  margin: auto;
  inset: 0;
  border: none;
  border-radius: 20px;
  padding: 0;
  background: var(--flour);
  color: var(--ink);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
dialog.signup::backdrop {
  background: rgba(18, 12, 7, 0.66);
  backdrop-filter: blur(4px);
}
.dialog-head {
  position: relative;
  background: var(--crust);
  color: var(--flour);
  padding: 26px 28px 22px;
  overflow: hidden;
  isolation: isolate;
}
.dialog-head::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(90% 140% at 90% 0%, rgba(201, 138, 60, 0.4), transparent 60%);
}
.dialog-head h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.1;
}
.dialog-head h3 em { font-style: italic; color: var(--amber); }
.dialog-head p { font-size: 0.92rem; color: rgba(246, 237, 224, 0.75); margin-top: 4px; }
.dialog-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(246, 237, 224, 0.3);
  background: transparent;
  color: var(--flour);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s var(--ease);
}
.dialog-close:hover { background: rgba(246, 237, 224, 0.12); }

.signup-form {
  padding: 24px 28px 28px;
  overflow-y: auto;
  max-height: calc(92vh - 120px);
}
.field { margin-bottom: 20px; }
.field > label.lbl {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.field .hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: #a08c74; }

.input {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  padding: 0.8em 0.95em;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffaf2;
  transition: border 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(201, 138, 60, 0.18);
}
textarea.input { resize: vertical; min-height: 70px; }

/* Selectable chips for days + breads */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-block;
  padding: 0.55em 0.95em;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffaf2;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  user-select: none;
}
.chip input:checked + span {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--char);
  font-weight: 500;
}
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(201, 138, 60, 0.3); }
.chip span:hover { border-color: var(--amber); }

.form-error {
  background: rgba(184, 80, 46, 0.1);
  border: 1px solid rgba(184, 80, 46, 0.3);
  color: #8f3a1f;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.form-error ul { margin: 0; padding-left: 1.1em; }
.form-error[hidden] { display: none; }

.form-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.btn-block { width: 100%; justify-content: center; }

/* Success state */
.signup-success { padding: 40px 28px 44px; text-align: center; }
.signup-success .tick {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--amber);
  display: grid; place-items: center;
  color: var(--char);
  font-size: 1.8rem;
}
.signup-success h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.8rem;
  color: var(--crust);
  margin-bottom: 8px;
}
.signup-success h3 em { font-style: italic; color: var(--terracotta); }
.signup-success p { color: var(--ink-soft); max-width: 34ch; margin: 0 auto 22px; }
.signup-success[hidden] { display: none; }

/* ----------------------------------------------------------------- Mobile */
@media (max-width: 820px) {
  .about-inner { grid-template-columns: 1fr; }
  .about-aside { position: static; }
  .header-brand-only .btn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .scroll-cue span { animation: none; }
  html { scroll-behavior: auto; }
}
