:root {
  --white: #ffffff;
  --food-red: #d94b35;
  --food-red-soft: #fff0ed;
  --food-green: #376f4c;
  --food-yellow: #ffd95a;
  --fb-bg: #fbfbfc;
  --fb-line: #e5e7eb;
  --fb-text: #1f232b;
  --fb-muted: #5d6675;
  --fb-panel: #ffffff;
  --fb-shadow: 0 2px 6px rgba(0,0,0,.05);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--fb-bg);
  color: var(--fb-text);
  font-family: Arial, sans-serif;
}

body.nav-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
svg { display: block; }
button, input, textarea, select { font: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 54px);
  background: var(--white);
  border-bottom: 1px solid var(--fb-line);
}

.brand,
.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--food-red);
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(217,75,53,.18);
}

.brand svg { width: 23px; fill: currentColor; }

.brand-name {
  font-size: 15px;
  font-weight: 800;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  color: var(--fb-muted);
  font-size: 14px;
}

.main-nav a:hover { color: var(--food-red); }

.header-cta,
.primary-button,
.secondary-button,
.ghost-button,
.text-button,
.filter-chip {
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
}

.header-cta,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  color: var(--white);
  background: var(--food-red);
}

.primary-button:hover,
.header-cta:hover {
  background: var(--food-yellow);
  color: #222;
}

.secondary-button,
.ghost-button,
.text-button,
.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: #151922;
  background: #f7f7f8;
  border-color: var(--fb-line);
}

.secondary-button:hover,
.ghost-button:hover,
.text-button:hover,
.filter-chip:hover,
.filter-chip.is-active {
  background: var(--food-red-soft);
  border-color: #f1c5bd;
  color: var(--food-red);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 34px;
  color: #151922;
  background: var(--white);
  border: 1px solid var(--fb-line);
  border-radius: 5px;
  cursor: pointer;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-toggle { display: none; }
.page-view { display: none; }
.page-view.is-active { display: block; }
.app-view.is-active { display: grid; }

body.app-shell .site-header,
body.app-shell .site-footer {
  display: none;
}

.hero {
  position: relative;
  min-height: min(690px, calc(100vh - 68px));
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--white);
  border-bottom: 1px solid var(--fb-line);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.9) 38%, rgba(255,255,255,.18) 68%, rgba(255,255,255,.02) 100%),
    url("assets/hero-food-table.png") center / cover no-repeat;
}

.hero-content {
  position: relative;
  width: min(650px, calc(100% - 36px));
  margin-left: clamp(18px, 6vw, 86px);
  padding: 70px 0 96px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--food-red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }

h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 88px);
  line-height: .94;
}

h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 1.02;
}

h3 {
  margin: 0;
  font-size: 20px;
}

.hero-copy,
.section-heading p,
.auth-copy p,
.price-card p,
.recipe-note,
.form-note,
.step-grid p,
.recipe-body p,
.dashboard-item p,
.account-panel p,
.sidebar-bottom small,
.cookbook-page p {
  color: var(--fb-muted);
  line-height: 1.55;
}

.hero-copy {
  max-width: 570px;
  margin: 22px 0;
  font-size: 18px;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section {
  padding: clamp(58px, 8vw, 98px) clamp(18px, 4vw, 54px);
}

.section-heading {
  width: min(800px, 100%);
  margin-bottom: 28px;
}

.intro-strip,
.pricing-section {
  background: var(--fb-bg);
}

.step-grid,
.pricing-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.step-grid article,
.price-card,
.recipe-form,
.signup-form,
.account-panel,
.dashboard-item,
.recipe-card,
.book-page,
.metric-grid article,
.cookbook-page {
  background: var(--fb-panel);
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  box-shadow: var(--fb-shadow);
}

.step-grid article,
.price-card,
.metric-grid article {
  padding: 20px;
}

.step-grid span {
  display: block;
  margin-bottom: 18px;
  color: var(--food-red);
  font-weight: 800;
}

.cookbook-preview {
  background: #fffaf0;
}

.book-spread {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  max-width: 1120px;
  margin: 0 auto;
}

.book-page {
  min-height: 400px;
  padding: clamp(24px, 5vw, 44px);
  background:
    linear-gradient(90deg, rgba(31,35,43,.05) 0 1px, transparent 1px) 28px 0 / 34px 100%,
    var(--white);
}

.book-page-alt {
  background: #fbfbfc;
}

.sample-link {
  margin-top: 24px;
}

.recipe-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 28px 0 0;
}

.recipe-facts div {
  padding: 14px;
  background: #fffefa;
  border: 1px solid var(--fb-line);
  border-radius: 8px;
}

.recipe-facts dt {
  color: var(--fb-muted);
  font-size: 12px;
}

.recipe-facts dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.feature-list {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 24px 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  gap: 10px;
  align-items: center;
}

.feature-list svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--food-green);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.price-card {
  position: relative;
  display: grid;
  gap: 14px;
  align-content: start;
}

.price-card.is-featured {
  border-color: var(--food-red);
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

.plan-badge {
  justify-self: start;
  padding: 5px 10px;
  color: var(--food-red);
  background: var(--food-red-soft);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
}

.price {
  margin: 0;
  color: var(--fb-text);
  font-size: 34px;
  font-weight: 800;
}

.price span {
  color: var(--fb-muted);
  font-size: 16px;
}

.auth-view.is-active {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 68px);
  padding: 20px;
  background: #f5f7fb;
}

.auth-copy {
  max-width: 420px;
  margin-bottom: 18px;
  text-align: center;
}

.auth-copy h1 {
  font-size: 38px;
}

.signup-form {
  width: 100%;
  max-width: 420px;
  display: grid;
  gap: 15px;
  padding: 30px;
  color: var(--fb-text);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

.recipe-form {
  display: grid;
  gap: 20px;
  padding: 20px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--fb-text);
  font-size: 14px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 12px;
  color: var(--fb-text);
  background: #fafafa;
  outline: none;
  transition: border .2s ease, background .2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--food-red);
  background: var(--white);
}

textarea { resize: vertical; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-row input {
  width: 18px;
  aspect-ratio: 1;
}

.full-width { width: 100%; }

.app-view {
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--fb-bg);
}

.app-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  background: var(--white);
  border-right: 1px solid var(--fb-line);
}

.sidebar-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px 18px 20px;
}

.brand-row {
  padding: 0 8px 16px;
  border-bottom: 1px solid var(--fb-line);
  margin-bottom: 14px;
}

.studio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 16px;
  font-size: 12px;
  color: #111827;
}

.studio-row span:first-child {
  font-size: 15px;
  font-weight: 700;
}

.plan-tag {
  background: #f4f4f5;
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 11px;
  color: #111827;
}

.side-nav,
.app-nav {
  display: grid;
  gap: 7px;
}

.app-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
  padding: 0 14px;
  border-radius: 7px;
  color: #151922;
  font-size: 14px;
  white-space: nowrap;
}

.app-nav a span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-nav a:hover {
  background: #f5f5f6;
}

.app-nav a.is-active {
  background: var(--food-red-soft);
  color: var(--food-red);
  font-weight: 700;
}

.app-nav .icon {
  width: 18px;
  text-align: center;
  font-weight: 800;
}

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--fb-line);
  padding: 18px 8px 0;
}

.signed-in {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 12px;
}

.avatar {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--food-red-soft);
  color: var(--food-red);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}

.signed-in small,
.signed-in strong {
  display: block;
  line-height: 1.25;
}

.signed-in small {
  color: var(--fb-muted);
}

.signed-in strong {
  color: #111827;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.progress-shell {
  height: 10px;
  margin: 14px 0 10px;
  overflow: hidden;
  background: #f1f2f4;
  border-radius: 999px;
}

.progress-shell span {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--food-red);
}

.app-main {
  padding: 68px clamp(42px, 7vw, 96px);
}

.app-panel { display: none; }
.app-panel.is-active { display: block; }

.app-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.app-heading h1 {
  font-size: clamp(54px, 7vw, 86px);
  line-height: .95;
  font-weight: 400;
}

.metric-grid {
  max-width: 760px;
  margin: 54px 0 64px;
}

.metric-grid article {
  text-align: center;
  min-height: 112px;
  display: grid;
  place-items: center;
  align-content: center;
}

.metric-grid span {
  display: block;
  font-size: 58px;
  font-weight: 400;
  line-height: .85;
}

.metric-grid p {
  margin: 4px 0 0;
  color: var(--fb-muted);
}

.dashboard-list,
.cookbook-grid {
  display: grid;
  gap: 14px;
}

.dashboard-section-block {
  margin-top: 36px;
}

.section-line-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.section-line-heading h2 {
  font-size: 32px;
  font-weight: 400;
}

.section-line-heading a {
  color: var(--food-red);
  font-weight: 700;
}

.trending-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 56px);
}

.trending-card {
  display: grid;
  min-height: 290px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--fb-text);
  border-radius: 8px;
}

.trending-card .recipe-image {
  height: auto;
  min-height: 230px;
}

.trending-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  padding: 12px 18px;
  border-top: 1px solid var(--fb-text);
  font-size: 20px;
}

.dashboard-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.cookbook-page {
  min-height: 320px;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(31,35,43,.04) 0 1px, transparent 1px) 24px 0 / 30px 100%,
    var(--white);
}

.cookbook-page header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
}

.cookbook-page .recipe-meta {
  color: var(--food-red);
}

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

.recipe-page-body {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr);
  gap: 28px;
  margin-top: 32px;
}

.recipe-page-body h2 {
  margin-bottom: 12px;
  font-size: 24px;
}

.delete-form {
  margin-top: 14px;
}

.danger-button {
  color: #a30000;
  background: #ffe0e0;
  border-color: #f4b9b9;
}

.search-panel {
  display: grid;
  gap: 14px;
  max-width: 1040px;
  margin-bottom: 24px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 18px;
  background: var(--white);
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  box-shadow: var(--fb-shadow);
}

.search-field svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--food-red);
  stroke-width: 2;
}

.search-field input {
  border: 0;
  outline: 0;
  background: transparent;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.recipe-card { overflow: hidden; }

.recipe-image {
  height: 172px;
  background: linear-gradient(135deg, var(--food-yellow), var(--food-red));
}

.recipe-image[data-tone="green"] {
  background:
    radial-gradient(circle at 24% 32%, rgba(255,255,255,.72) 0 9%, transparent 10%),
    radial-gradient(circle at 74% 38%, rgba(255,217,90,.8) 0 12%, transparent 13%),
    linear-gradient(135deg, #79a86f, #2f6c49);
}

.recipe-image[data-tone="red"] {
  background:
    radial-gradient(circle at 28% 34%, rgba(255,255,255,.7) 0 10%, transparent 11%),
    radial-gradient(circle at 70% 58%, rgba(255,217,90,.74) 0 14%, transparent 15%),
    linear-gradient(135deg, #d94b35, #7b2f24);
}

.recipe-image[data-tone="gold"] {
  background:
    radial-gradient(circle at 25% 42%, rgba(255,255,255,.7) 0 11%, transparent 12%),
    radial-gradient(circle at 74% 34%, rgba(55,111,76,.72) 0 12%, transparent 13%),
    linear-gradient(135deg, #ffd95a, #b36b2c);
}

.recipe-body {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.recipe-meta {
  color: var(--food-green);
  font-size: 13px;
  font-weight: 800;
}

.recipe-body p {
  min-height: 54px;
  margin: 0;
}

.recipe-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.recipe-actions form,
.dashboard-actions form {
  margin: 0;
}

.recipe-owner {
  min-height: auto;
  font-size: 13px;
}

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

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  color: var(--fb-muted);
  background: var(--white);
  border: 1px solid var(--fb-line);
  border-radius: 8px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(18px, 4vw, 54px);
  color: rgba(255,255,255,.7);
  background: #151922;
}

.site-footer p {
  margin: 0;
  color: var(--white);
  font-weight: 800;
}

.site-footer nav {
  display: flex;
  gap: 18px;
}

@media (max-width: 1040px) {
  .app-view {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
  }

  .sidebar-inner {
    min-height: auto;
  }

  .app-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: center;
  }

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

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  .nav-toggle { display: inline-grid; }

  .main-nav,
  .header-cta { display: none; }

  .main-nav.is-open {
    position: fixed;
    inset: 67px 12px auto;
    display: grid;
    gap: 6px;
    justify-content: stretch;
    padding: 12px;
    background: var(--white);
    border: 1px solid var(--fb-line);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
  }

  .main-nav.is-open a {
    padding: 14px;
    border-radius: 8px;
  }

  .hero { min-height: auto; }

  .hero-bg {
    background:
      linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.86) 52%, rgba(255,255,255,.16) 100%),
      url("assets/hero-food-table.png") center / cover no-repeat;
  }

  .hero-content { padding: 66px 0 180px; }

  .step-grid,
  .pricing-grid,
  .book-spread {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .app-nav,
  .metric-grid,
  .recipe-grid,
  .cookbook-grid,
  .form-two,
  .dashboard-item,
  .app-heading,
  .recipe-facts,
  .recipe-page-body,
  .sidebar-bottom {
    grid-template-columns: 1fr;
  }

  .app-main {
    padding: 28px 18px;
  }

  .app-heading {
    display: grid;
    align-items: start;
  }

  .dashboard-actions {
    justify-content: flex-start;
  }

  .site-footer {
    display: grid;
  }
}
