:root {
  --ink: #17221d;
  --muted: #66736c;
  --paper: #f4f3ed;
  --surface: #fffefa;
  --surface-soft: #ebece4;
  --sage-950: #20362d;
  --sage-800: #435d50;
  --sage-650: #718879;
  --sage-300: #c9d7ca;
  --sage-150: #e7eee7;
  --clay: #ac6c56;
  --line: rgba(32, 54, 45, 0.16);
  --line-strong: rgba(32, 54, 45, 0.32);
  --shadow: 0 24px 70px rgba(24, 38, 31, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #faf9f3 0, var(--paper) 420px),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

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

main {
  min-height: 68vh;
}

.site-header,
.site-footer,
.finder-hero,
.recipe-section,
.page-intro,
.book-grid,
.recipe-detail,
.auth-shell,
.profile-layout {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 249, 243, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  color: var(--surface);
  background: var(--sage-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 800;
}

.brand strong {
  display: block;
  color: var(--sage-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-nav,
.account-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.main-nav {
  justify-content: center;
}

.account-links {
  justify-content: flex-end;
}

.main-nav a,
.account-links a {
  border-radius: 999px;
  padding: 9px 11px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
  text-decoration: none;
}

.main-nav a:hover,
.account-links a:hover {
  color: var(--sage-950);
  background: var(--sage-150);
}

.nav-cta {
  min-height: 38px;
  padding: 0 14px !important;
  color: var(--surface) !important;
}

.finder-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: 22px;
  align-items: stretch;
  padding: 42px 0 34px;
}

.finder-copy,
.finder-card,
.profile-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.finder-copy {
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 380px;
  padding: 38px;
  background:
    linear-gradient(135deg, rgba(32, 54, 45, 0.88), rgba(67, 93, 80, 0.72)),
    url("images/fussybook-hero.png") center / cover;
}

.finder-copy h1,
.finder-copy p,
.finder-copy .eyebrow {
  color: var(--surface);
}

.finder-copy h1,
.page-intro h1,
.recipe-detail h1,
.profile-layout h1,
.auth-story h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 5.2vw, 5rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: 0;
}

.finder-copy p,
.page-intro p,
.profile-layout p,
.lead,
.auth-story p {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.72;
}

.eyebrow,
.pill,
.section-kicker,
.profile-card-tag,
.featured-label {
  margin: 0;
  color: var(--sage-650);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.finder-card {
  display: grid;
  gap: 16px;
  padding: 22px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(32, 54, 45, 0.22);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  letter-spacing: 0;
  outline: none;
  text-transform: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage-800);
  box-shadow: 0 0 0 4px rgba(113, 136, 121, 0.18);
}

.finder-search input {
  min-height: 60px;
  padding: 14px 16px;
  font-size: 1.1rem;
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-filters a,
.profile-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--sage-950);
  background: var(--sage-150);
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.finder-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding-top: 2px;
}

button,
.button-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--sage-950);
  border-radius: var(--radius);
  padding: 0 18px;
  color: var(--surface);
  background: var(--sage-950);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

button:hover,
.button-link:hover {
  border-color: var(--sage-650);
  background: var(--sage-650);
  transform: translateY(-1px);
}

.secondary {
  color: var(--sage-950);
  background: transparent;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sage-150);
  color: var(--sage-950);
}

.check-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--sage-800);
}

.profile-nudge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--sage-950);
  background: var(--sage-150);
  font-weight: 900;
  text-decoration: none;
}

.profile-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  box-shadow: none;
}

.profile-card h2 {
  margin: 0;
  color: var(--sage-950);
  font-size: 1rem;
}

.profile-card p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.recipe-section,
.page-intro,
.book-grid,
.recipe-detail,
.auth-shell,
.profile-layout {
  padding: 38px 0 56px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 5px 0 0;
  color: var(--sage-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.4vw, 3.25rem);
  font-weight: 800;
  line-height: 0.98;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
}

.recipe-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
  gap: 24px;
  align-items: start;
}

.featured-recipe,
.recipe-card,
.book-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(24, 38, 31, 0.07);
}

.featured-recipe {
  position: sticky;
  top: 86px;
}

.featured-image,
.recipe-thumb {
  display: block;
  overflow: hidden;
  background: var(--sage-150);
}

.featured-image {
  aspect-ratio: 4 / 3;
}

.recipe-thumb {
  aspect-ratio: 16 / 10;
}

.featured-image img,
.recipe-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease;
}

.featured-image img {
  object-position: 48% 50%;
}

.recipe-card:nth-child(3n + 1) .recipe-thumb img {
  object-position: 18% 42%;
}

.recipe-card:nth-child(3n + 2) .recipe-thumb img {
  object-position: 72% 45%;
}

.recipe-card:nth-child(3n + 3) .recipe-thumb img {
  object-position: 50% 72%;
}

.featured-image:hover img,
.recipe-thumb:hover img {
  transform: scale(1.035);
}

.featured-copy,
.recipe-card-body {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.featured-label {
  justify-self: start;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--surface);
  background: var(--sage-950);
  letter-spacing: 0.08em;
}

.featured-recipe h3,
.recipe-card h3,
.book-card h2 {
  margin: 0;
  color: var(--sage-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.42rem;
  font-weight: 800;
  line-height: 1.1;
}

.featured-recipe h3 {
  font-size: clamp(1.9rem, 3vw, 2.65rem);
}

.featured-recipe h3 a,
.recipe-card h3 a {
  text-decoration: none;
}

.featured-recipe h3 a:hover,
.recipe-card h3 a:hover {
  color: var(--sage-650);
}

.featured-recipe p,
.recipe-card p,
.book-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.recipe-grid,
.book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.book-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pill {
  color: var(--sage-650);
}

.meta-row,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.meta-row span,
.detail-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--surface-soft);
}

.page-intro {
  display: grid;
  gap: 18px;
}

.book-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.recipe-detail {
  max-width: 980px;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--sage-800);
  font-weight: 900;
  text-decoration: none;
}

.detail-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 20px;
  margin-top: 28px;
}

.detail-grid section,
.allergy-note,
.profile-form,
.auth-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-grid section,
.allergy-note {
  padding: 24px;
}

.allergy-note {
  margin-top: 20px;
}

.detail-grid h2,
.allergy-note h2,
.auth-card h2 {
  margin-top: 0;
  color: var(--sage-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 800;
}

.detail-grid p,
.allergy-note p {
  color: var(--muted);
  line-height: 1.75;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 450px);
  gap: 28px;
  align-items: stretch;
  min-height: 70vh;
}

.auth-story {
  display: grid;
  align-content: end;
  gap: 18px;
  min-height: 560px;
  padding: 36px;
  border-radius: var(--radius);
  color: var(--surface);
  background:
    linear-gradient(rgba(32, 54, 45, 0.7), rgba(32, 54, 45, 0.78)),
    url("images/fussybook-hero.png") center / cover;
}

.auth-story h1,
.auth-story p,
.auth-story .eyebrow {
  color: var(--surface);
}

.auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-points span {
  border: 1px solid rgba(255, 254, 250, 0.32);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--surface);
  background: rgba(255, 254, 250, 0.12);
  font-size: 0.82rem;
  font-weight: 900;
}

.auth-card,
.profile-form {
  display: grid;
  gap: 16px;
  padding: 28px;
}

.auth-card {
  align-self: center;
}

.auth-card-heading {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.auth-card form {
  display: grid;
  gap: 14px;
}

.auth-card button {
  width: 100%;
}

.auth-switch {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-switch a {
  color: var(--sage-800);
  font-weight: 900;
}

.flash,
.form-error,
.empty-state {
  width: min(1180px, calc(100% - 40px));
  margin: 14px auto;
  border-radius: var(--radius);
  padding: 14px 16px;
}

.flash {
  border: 1px solid var(--line);
  color: var(--sage-950);
  background: var(--sage-150);
}

.form-error {
  width: 100%;
  margin: 0;
  border: 1px solid rgba(172, 108, 86, 0.28);
  color: #843f2f;
  background: #fff0ea;
}

.profile-layout {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 28px;
  align-items: start;
}

.profile-layout > div {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 18px;
}

.site-footer {
  padding: 38px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  max-width: 68ch;
  margin: 0;
}

@media (max-width: 1020px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .main-nav,
  .account-links {
    justify-content: flex-start;
  }

  .finder-hero,
  .recipe-layout,
  .auth-shell,
  .profile-layout,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .finder-copy {
    min-height: 320px;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .featured-recipe,
  .profile-layout > div {
    position: static;
  }
}

@media (max-width: 720px) {
  .site-header,
  .site-footer,
  .finder-hero,
  .recipe-section,
  .page-intro,
  .book-grid,
  .recipe-detail,
  .auth-shell,
  .profile-layout,
  .flash,
  .empty-state {
    width: min(100% - 28px, 1180px);
  }

  .brand small {
    display: none;
  }

  .main-nav,
  .account-links {
    gap: 5px;
  }

  .main-nav a,
  .account-links a {
    padding: 8px 9px;
    font-size: 0.82rem;
  }

  .finder-hero {
    padding-top: 24px;
  }

  .finder-copy,
  .finder-card,
  .auth-story,
  .auth-card,
  .profile-form {
    padding: 20px;
  }

  .finder-copy h1,
  .page-intro h1,
  .recipe-detail h1,
  .profile-layout h1,
  .auth-story h1 {
    font-size: 2.45rem;
  }

  .filter-grid,
  .finder-actions,
  .recipe-grid,
  .book-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: grid;
  }

  .auth-story {
    min-height: 420px;
  }
}
