:root {
  --crust: #5b3a22;
  --crust-deep: #3d2615;
  --crust-soft: #efe2cf;
  --tomato: #c8312a;
  --tomato-dark: #a2231e;
  --tomato-soft: #f8e1dc;
  --cheese: #f2b632;
  --cheese-soft: #fdf1cf;
  --cream: #fbf5e9;
  --cream-deep: #f4ead8;
  --charcoal: #2a2320;
  --charcoal-soft: #5e5550;
  --white: #ffffff;
  --success: #3f7d4e;
  --warning: #b7791f;
  --error: #b42318;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(61, 38, 21, 0.12);
  --shadow-lg: 0 24px 60px rgba(61, 38, 21, 0.22);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--charcoal);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--tomato-dark);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--tomato);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--crust-deep);
  font-weight: 700;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  margin: 0 0 16px;
}

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

.container {
  width: min(1200px, 100% - 48px);
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--charcoal);
  color: var(--white);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tomato-dark);
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--tomato);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(200, 49, 42, 0.3);
}

.btn-primary:hover {
  background: var(--tomato-dark);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--crust-deep);
  border-color: var(--crust);
}

.btn-ghost:hover {
  background: var(--crust);
  color: var(--cream);
}

.btn-block {
  width: 100%;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--cream);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(251, 245, 233, 0.96);
  backdrop-filter: blur(10px);
  border-color: var(--crust-soft);
  box-shadow: 0 6px 20px rgba(61, 38, 21, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--crust-deep);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--tomato);
  color: var(--cheese);
  transition: transform 0.4s ease;
}

.brand:hover .brand-mark {
  transform: rotate(-12deg);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--crust-deep);
  white-space: nowrap;
}

.brand-text span {
  color: var(--tomato);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  position: relative;
  padding: 8px 12px;
  color: var(--charcoal);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.main-nav a:hover {
  color: var(--tomato-dark);
  background: var(--cheese-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search {
  position: relative;
  width: 260px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--charcoal-soft);
  pointer-events: none;
}

.search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px 10px 42px;
  border: 1.5px solid #d9c9b0;
  border-radius: 999px;
  background: var(--white);
  color: var(--charcoal);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, width 0.3s ease;
}

.search input::placeholder {
  color: #7a6f68;
}

.search input:focus {
  outline: none;
  border-color: var(--tomato);
  box-shadow: 0 0 0 4px rgba(200, 49, 42, 0.15);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 1.5px solid #d9c9b0;
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--crust-deep);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
  padding: 64px 0 80px;
  background:
    radial-gradient(circle at 90% 10%, rgba(242, 182, 50, 0.28), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(200, 49, 42, 0.1), transparent 45%),
    var(--cream);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 56px;
}

.hero .lede {
  font-size: 1.125rem;
  color: var(--charcoal-soft);
  max-width: 34em;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 24px 0 0;
  border-top: 1px solid #e3d3ba;
}

.hero-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.2;
  color: var(--tomato);
}

.hero-stats span {
  font-size: 0.9rem;
  color: var(--charcoal-soft);
}

.hero-media {
  position: relative;
  margin: 0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: rotate(1.2deg);
  transition: transform 0.6s ease;
}

.hero-media:hover {
  transform: rotate(0deg);
}

.hero-media img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.hero-media:hover img {
  transform: scale(1.04);
}

.hero-media figcaption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  right: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(42, 35, 32, 0.82);
  color: var(--white);
  font-size: 0.95rem;
}

/* Sections */
.section {
  padding: 96px 0;
}

.section-warm {
  background: var(--cream-deep);
}

.section-dark {
  background: var(--crust-deep);
  color: var(--cream);
}

.section-dark h2,
.section-dark h3 {
  color: var(--cream);
}

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-head > p:last-child {
  color: var(--charcoal-soft);
  font-size: 1.05rem;
}

.section-head-light > p:last-child {
  color: #e6d6c0;
}

.section-head-light .eyebrow {
  color: var(--cheese);
}

/* Recipe grid */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.recipe-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid #efe3cf;
  animation: card-in 0.6s ease both;
  animation-delay: var(--delay, 0ms);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recipe-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.recipe-media {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--crust-soft);
}

.recipe-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.recipe-card:hover .recipe-media img {
  transform: scale(1.06);
}

.recipe-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
}

.recipe-body h3 {
  margin-bottom: 8px;
}

.recipe-body p {
  color: var(--charcoal-soft);
  font-size: 0.95rem;
  flex: 1;
  margin-bottom: 24px;
}

.recipe-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--crust);
}

.recipe-meta > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.recipe-meta svg {
  width: 16px;
  height: 16px;
}

.badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-easy {
  background: #e3f1e6;
  color: var(--success);
}

.badge-medium {
  background: var(--cheese-soft);
  color: #7a4f08;
}

.badge-advanced {
  background: var(--tomato-soft);
  color: var(--error);
}

.empty-state {
  margin: 32px 0 0;
  text-align: center;
  color: var(--charcoal-soft);
}

/* Dough steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

.steps li {
  padding: 32px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(242, 182, 50, 0.25);
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.steps li:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-4px);
}

.step-num {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1.2;
  color: var(--cheese);
  margin-bottom: 8px;
}

.steps p {
  color: #e6d6c0;
  margin-bottom: 0;
}

/* Styles */
.style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.style-card {
  padding: 32px;
  background: var(--white);
  border-radius: var(--radius);
  border-top: 6px solid var(--tomato);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}

.style-card:nth-child(2) {
  border-top-color: var(--cheese);
}

.style-card:nth-child(3) {
  border-top-color: var(--crust);
}

.style-card:hover {
  transform: translateY(-4px);
}

.style-card p {
  color: var(--charcoal-soft);
  margin-bottom: 0;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}

.about-grid > div > p:not(.eyebrow) {
  color: var(--charcoal-soft);
  font-size: 1.05rem;
}

.pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pillars li {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--white);
  border-left: 4px solid var(--cheese);
  box-shadow: var(--shadow);
}

.pillars strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--crust-deep);
  margin-bottom: 4px;
}

.pillars span {
  color: var(--charcoal-soft);
  font-size: 0.95rem;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.contact-card,
.newsletter-card {
  padding: 40px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.newsletter-card {
  background: var(--crust-deep);
  color: var(--cream);
}

.newsletter-card h2 {
  color: var(--cream);
}

.newsletter-card p {
  color: #e6d6c0;
}

.contact-list {
  margin: 0;
  display: grid;
  gap: 20px;
}

.contact-list > div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid #efe3cf;
}

.contact-list > div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.contact-list dt {
  font-weight: 600;
  color: var(--crust);
}

.contact-list dd {
  margin: 0;
  color: var(--charcoal);
  overflow-wrap: anywhere;
}

.newsletter-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.newsletter-row {
  display: flex;
  gap: 12px;
}

.newsletter-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1.5px solid #6b5443;
  background: var(--cream);
  color: var(--charcoal);
  font: inherit;
}

.newsletter-row input:focus {
  outline: none;
  border-color: var(--cheese);
  box-shadow: 0 0 0 4px rgba(242, 182, 50, 0.3);
}

.form-message {
  min-height: 24px;
  margin: 12px 0 0;
  font-weight: 600;
}

.form-message.is-success {
  color: #9be0ae;
}

.form-message.is-error {
  color: #ffb4a8;
}

/* Footer */
.site-footer {
  background: var(--charcoal);
  color: #e9dfd2;
  padding: 56px 0 32px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px 48px;
  align-items: center;
}

.site-footer .brand-text {
  color: var(--cream);
}

.footer-brand p {
  margin: 8px 0 0;
  color: #bfb3a6;
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer-links a {
  color: #f3e7d4;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--cheese);
}

.copyright {
  grid-column: 1 / -1;
  margin: 16px 0 0;
  padding-top: 24px;
  border-top: 1px solid #4a403a;
  font-size: 0.9rem;
  color: #bfb3a6;
}

/* Recipe dialog */
.recipe-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: none;
  border-radius: 24px;
  background: var(--cream);
  color: var(--charcoal);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.recipe-dialog::backdrop {
  background: rgba(42, 35, 32, 0.6);
  backdrop-filter: blur(3px);
}

.recipe-dialog[open] {
  animation: dialog-in 0.3s ease;
}

.dialog-inner {
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.dialog-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.dialog-body {
  padding: 32px;
}

.dialog-body h2 {
  margin-top: 12px;
}

.dialog-body h3 {
  margin-top: 24px;
  font-size: 1.1rem;
}

.dialog-body p {
  color: var(--charcoal-soft);
}

.ingredients,
.method {
  padding-left: 20px;
  margin: 0;
}

.ingredients li,
.method li {
  margin-bottom: 8px;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--white);
  color: var(--charcoal);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.dialog-close:hover {
  transform: rotate(90deg);
  background: var(--tomato-soft);
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

/* Legal pages */
.legal {
  padding: 64px 0 96px;
}

.legal-card {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.legal-card h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
}

.legal-card h2 {
  font-size: 1.4rem;
  margin-top: 32px;
}

.legal-card p,
.legal-card li {
  color: var(--charcoal-soft);
}

.legal-back {
  display: inline-block;
  margin-bottom: 24px;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 1080px) {
  .search {
    width: 200px;
  }
  .main-nav a {
    padding: 8px 9px;
    font-size: 0.9rem;
  }
}

@media (max-width: 960px) {
  .menu-toggle {
    display: flex;
  }

  .header-actions {
    margin-left: auto;
  }

  .search {
    display: none;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 24px;
    background: var(--cream);
    border-bottom: 1px solid var(--crust-soft);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .main-nav.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .main-nav a {
    padding: 14px 8px;
    font-size: 1rem;
    border-radius: 0;
    border-bottom: 1px solid #efe3cf;
  }

  .hero-grid,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .steps,
  .style-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 72px 0;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(1200px, 100% - 32px);
  }

  .hero {
    padding: 40px 0 64px;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
  }

  .hero-stats {
    gap: 24px;
  }

  .pillars {
    grid-template-columns: 1fr;
  }

  .contact-card,
  .newsletter-card,
  .legal-card {
    padding: 28px 24px;
  }

  .contact-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .newsletter-row {
    flex-direction: column;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .dialog-body {
    padding: 24px;
  }

  .recipe-grid {
    grid-template-columns: 1fr;
  }
}
