/* ─────────────────────────────────────────────
   Hayat's Cookbook — Kitchen theme
   Palette: cream, sage, terracotta, warm brown
   ───────────────────────────────────────────── */

:root {
  --cream:        #faf3e7;
  --cream-soft:   #f3e9d4;
  --paper:        #fbf6ec;
  --ink:          #2d241a;
  --ink-soft:     #5a4a38;
  --muted:        #8a7a63;
  --sage:         #8aa07a;
  --sage-dark:    #5e7350;
  --terracotta:   #c56d4f;
  --terracotta-d: #a0513a;
  --butter:       #e8c66b;
  --burnt:        #7a4e2a;
  --line:         #d9c9a8;
  --shadow:       0 20px 40px -24px rgba(60, 40, 20, 0.35);
  --shadow-sm:    0 6px 18px -10px rgba(60, 40, 20, 0.25);
}

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

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

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(255,230,180,0.35), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(200,220,180,0.25), transparent 40%),
    var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ─── Navigation ──────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(251, 246, 236, 0.85);
  border-bottom: 1px solid rgba(217, 201, 168, 0.4);
  transition: all 0.3s ease;
}
.nav-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--terracotta);
  color: var(--paper);
  font-size: 19px;
  font-weight: 700;
  font-style: italic;
  box-shadow: var(--shadow-sm);
}
.brand-text { letter-spacing: 0.01em; }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 0;
  position: relative;
  transition: color 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1.5px;
  background: var(--terracotta);
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--terracotta); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: all 0.3s;
}

/* ─── Hero ────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.82) saturate(1.05);
  transform: scale(1.04);
  animation: slowZoom 20s ease-in-out infinite alternate;
}
@keyframes slowZoom {
  to { transform: scale(1.12); }
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(45, 30, 15, 0.55) 0%, rgba(70, 45, 20, 0.25) 50%, rgba(40, 25, 10, 0.5) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 32px 80px;
  color: var(--paper);
  width: 100%;
}
.eyebrow {
  font-family: 'Caveat', cursive;
  font-size: 28px;
  color: var(--butter);
  margin: 0 0 8px;
  letter-spacing: 0.02em;
  transform: rotate(-1.5deg);
  display: inline-block;
}
.hero-title {
  font-size: clamp(64px, 11vw, 140px);
  margin: 0 0 24px;
  color: var(--paper);
  font-weight: 500;
  line-height: 0.95;
  text-shadow: 0 4px 30px rgba(0,0,0,0.3);
}
.hero-title em {
  font-style: italic;
  color: var(--butter);
  font-weight: 400;
}
.hero-sub {
  font-size: clamp(16px, 1.5vw, 20px);
  max-width: 540px;
  color: rgba(251, 246, 236, 0.95);
  margin: 0 0 36px;
  line-height: 1.6;
}
.btn-primary {
  display: inline-block;
  padding: 16px 36px;
  background: var(--terracotta);
  color: var(--paper);
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.3s;
  box-shadow: 0 10px 30px -10px rgba(197, 109, 79, 0.6);
}
.btn-primary:hover {
  background: var(--terracotta-d);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -10px rgba(197, 109, 79, 0.8);
}
.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--paper);
  font-family: 'Caveat', cursive;
  font-size: 18px;
  letter-spacing: 0.3em;
  text-transform: lowercase;
  opacity: 0.7;
  z-index: 2;
  writing-mode: vertical-rl;
  animation: bounce 2.5s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ─── Category Grid ───────────────────────── */
.categories {
  padding: 120px 0 60px;
  position: relative;
}
.section-eyebrow {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  color: var(--terracotta);
  margin: 0 0 8px;
  transform: rotate(-1deg);
  display: inline-block;
}
.section-title {
  font-size: clamp(40px, 5vw, 64px);
  font-style: italic;
  margin: 0 0 56px;
  color: var(--ink);
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.category-card {
  display: block;
  background: var(--paper);
  border-radius: 16px;
  overflow: hidden;
  padding: 20px;
  text-align: center;
  transition: all 0.4s ease;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(217, 201, 168, 0.5);
}
.category-card:hover {
  transform: translateY(-8px) rotate(-0.5deg);
  box-shadow: var(--shadow);
}
.category-img {
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  margin-bottom: 16px;
  transition: transform 0.6s ease;
}
.category-card:hover .category-img {
  transform: scale(1.05);
}
.category-card h3 {
  font-size: 22px;
  font-style: italic;
  margin: 0 0 4px;
}
.category-card .count {
  font-family: 'Caveat', cursive;
  font-size: 18px;
  color: var(--terracotta);
}

/* ─── Chapters ────────────────────────────── */
.chapter {
  padding: 100px 0;
  position: relative;
}
.chapter-bread      { background: linear-gradient(180deg, var(--cream) 0%, #f5ecd7 100%); }
.chapter-cookies    { background: linear-gradient(180deg, #f5ecd7 0%, #f0e3c9 100%); }
.chapter-breakfast  { background: linear-gradient(180deg, #f0e3c9 0%, #e8eddc 100%); }
.chapter-desserts   { background: linear-gradient(180deg, #e8eddc 0%, #f4e4d4 100%); }
.chapter-dinner     { background: linear-gradient(180deg, #f4e4d4 0%, #e8d4c0 100%); }

.chapter-header {
  text-align: center;
  margin-bottom: 72px;
  position: relative;
}
.chapter-header .section-eyebrow,
.chapter-header .section-title {
  display: block;
  text-align: center;
}
.chapter-header .section-title {
  margin-bottom: 40px;
}
.chapter-image {
  max-width: 700px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 8px solid var(--paper);
  transform: rotate(-0.8deg);
}

/* Rules / Note card (bread chapter) */
.note-card {
  max-width: 720px;
  margin: 0 auto 72px;
  background: var(--paper);
  border-left: 4px solid var(--sage);
  padding: 32px 40px;
  border-radius: 4px 14px 14px 4px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.note-card::before {
  content: '✿';
  position: absolute;
  top: -18px;
  left: 28px;
  background: var(--sage);
  color: var(--paper);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.note-card h4 {
  font-size: 26px;
  font-style: italic;
  margin-bottom: 14px;
  color: var(--sage-dark);
}
.note-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 15px;
}
.note-card li {
  margin-bottom: 8px;
}
.note-card li::marker {
  color: var(--sage);
}

/* ─── Recipe Grid ─────────────────────────── */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
}
.recipe-card {
  background: var(--paper);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(217, 201, 168, 0.4);
  display: flex;
  flex-direction: column;
}
.recipe-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}
.recipe-img {
  aspect-ratio: 4/3;
  background-size: cover;
  background-position: center;
  background-color: var(--cream-soft);
  transition: transform 0.6s ease;
}
.recipe-card:hover .recipe-img {
  transform: scale(1.06);
}
.recipe-img-wrap {
  overflow: hidden;
}
.recipe-img-placeholder {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--cream-soft), var(--butter));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 60px;
  color: var(--terracotta);
  font-style: italic;
  opacity: 0.6;
}
.recipe-body {
  padding: 22px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.recipe-tag {
  font-family: 'Caveat', cursive;
  font-size: 17px;
  color: var(--terracotta);
  margin: 0 0 4px;
}
.recipe-title {
  font-size: 24px;
  font-style: italic;
  margin: 0 0 14px;
  line-height: 1.2;
}
.recipe-meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--muted);
}
.recipe-meta .view {
  color: var(--terracotta);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 12px;
}

/* ─── Modal ───────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 20, 10, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal-card {
  position: relative;
  background: var(--paper);
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.5);
  animation: slideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
}
.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 22px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.modal-close:hover {
  background: var(--terracotta);
  color: var(--paper);
  border-color: var(--terracotta);
  transform: rotate(90deg);
}
.modal-hero {
  height: 320px;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
}
.modal-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: var(--cream-soft);
}
.modal-body {
  padding: 40px 48px 48px;
}
.modal-tag {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: var(--terracotta);
  margin: 0 0 6px;
}
.modal-title {
  font-size: clamp(36px, 5vw, 52px);
  font-style: italic;
  margin: 0 0 32px;
  line-height: 1.05;
}
.modal-columns {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
}
.modal-col h4 {
  font-size: 22px;
  font-style: italic;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--butter);
  display: inline-block;
  color: var(--burnt);
}
.modal-col ul,
.modal-col ol {
  padding-left: 20px;
  margin: 0;
}
.modal-col ul { list-style: none; padding-left: 0; }
.modal-col li {
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}
#modalIngredients ul li {
  padding-left: 24px;
  position: relative;
}
#modalIngredients ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  background: var(--sage);
  border-radius: 50%;
}
#modalIngredients h5 {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  font-weight: 600;
  color: var(--terracotta);
  margin: 18px 0 8px;
}
#modalIngredients h5:first-child { margin-top: 0; }
#modalDirections li {
  margin-bottom: 16px;
  padding-left: 8px;
}
#modalDirections li::marker {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 600;
  color: var(--terracotta);
  font-size: 18px;
}

/* ─── Footer ──────────────────────────────── */
.footer {
  padding: 100px 0 50px;
  background: linear-gradient(180deg, #e8d4c0 0%, #7a4e2a 100%);
  color: var(--paper);
  text-align: center;
}
.footer-script {
  font-family: 'Caveat', cursive;
  font-size: 32px;
  margin: 0 0 8px;
  color: var(--butter);
}
.footer-sign {
  font-family: 'Cormorant Garamond', serif;
  font-size: 42px;
  font-style: italic;
  margin: 0 0 40px;
  color: var(--paper);
}
.footer-copy {
  font-size: 13px;
  opacity: 0.7;
  letter-spacing: 0.05em;
}

/* ─── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 64px;
    right: 0;
    bottom: 0;
    width: 280px;
    background: var(--paper);
    flex-direction: column;
    padding: 32px;
    gap: 20px;
    transform: translateX(100%);
    transition: transform 0.3s;
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: flex; }

  .hero-content { padding: 100px 24px 60px; }
  .container { padding: 0 20px; }
  .chapter { padding: 70px 0; }
  .categories { padding: 80px 0 40px; }

  .modal-body { padding: 28px 24px 36px; }
  .modal-columns { grid-template-columns: 1fr; gap: 28px; }
  .modal-hero { height: 220px; }

  .recipe-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
  }
  .note-card { padding: 24px 22px; }
}
