:root {
  color-scheme: light;
  --ink: #18221c;
  --muted: #617066;
  --paper: #fbfbf7;
  --soft: #edf4e9;
  --line: #dbe5d7;
  --green: #2f704d;
  --green-dark: #173e2b;
  --tomato: #c94e3f;
  --gold: #d99a2b;
  --blue: #315d86;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(23, 32, 26, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  border-radius: 8px;
}

.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: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  min-height: 76px;
  padding: 0 5vw;
  background: rgba(251, 251, 247, 0.92);
  border-bottom: 1px solid rgba(217, 227, 214, 0.86);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  letter-spacing: 0;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--white);
  background: var(--green);
  border-radius: 8px;
  font-size: 0.84rem;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 3vw, 34px);
  color: var(--muted);
  font-weight: 760;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--green-dark);
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
}

.google-button,
.primary-action,
.secondary-action,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  font-weight: 820;
  cursor: pointer;
}

.google-button,
.secondary-action {
  color: var(--green-dark);
  background: var(--white);
  border: 1px solid var(--line);
}

.primary-action,
button {
  color: var(--white);
  background: var(--green);
}

.primary-action:hover,
button:hover {
  background: var(--green-dark);
}

.hero {
  position: relative;
  min-height: calc(94svh - 76px);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(14, 24, 17, 0.82), rgba(14, 24, 17, 0.38) 56%, rgba(14, 24, 17, 0.08)),
    linear-gradient(0deg, rgba(14, 24, 17, 0.5), rgba(14, 24, 17, 0));
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content {
  width: min(830px, 90vw);
  padding: 0 0 clamp(56px, 11vh, 116px) 5vw;
  color: var(--white);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--tomato);
  font-size: 0.77rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffd37a;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3.2rem, 8vw, 7.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4.5vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.hero-content > p:not(.eyebrow) {
  max-width: 690px;
  color: rgba(255, 255, 255, 0.91);
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  line-height: 1.58;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 5vw;
  color: var(--green-dark);
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  font-weight: 760;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  background: var(--gold);
  border-radius: 50%;
}

.status-bar.signed-in .status-dot {
  background: var(--green);
}

.workspace,
.section,
.share-section {
  padding: clamp(54px, 7vw, 92px) 5vw;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr);
  gap: 22px;
}

.panel,
.summary-panel,
.recipe-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(23, 32, 26, 0.08);
}

.panel,
.summary-panel {
  padding: clamp(22px, 4vw, 34px);
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.panel-chip {
  flex: 0 0 auto;
  padding: 9px 11px;
  color: var(--blue);
  background: #eaf2f9;
  border-radius: 8px;
  font-weight: 830;
}

.food-form,
.recipe-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffefb;
  border: 1px solid var(--line);
  outline: 0;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 112, 77, 0.15);
}

.wide-field {
  grid-column: 1 / -1;
}

.food-form button,
.recipe-form button {
  align-self: end;
}

.log-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.log-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.log-entry p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.log-entry span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.summary-grid {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.summary-grid div {
  display: grid;
  gap: 4px;
  padding: 18px;
  background: var(--soft);
  border-radius: 8px;
}

.summary-grid strong {
  color: var(--green-dark);
  font-size: 2rem;
}

.summary-grid span,
.summary-note {
  color: var(--muted);
  line-height: 1.6;
}

.section-heading {
  align-items: center;
}

.recipe-search {
  width: min(390px, 100%);
}

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

.recipe-card {
  display: grid;
  grid-template-rows: 220px 1fr;
  overflow: hidden;
}

.recipe-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.recipe-body p {
  color: var(--muted);
  line-height: 1.55;
}

.recipe-meta,
.nutrition-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 790;
}

.recipe-meta strong {
  color: var(--tomato);
}

.nutrition-row span {
  padding: 7px 9px;
  color: var(--green-dark);
  background: var(--soft);
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 830;
}

.share-section {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 36px;
  background: var(--green-dark);
  color: var(--white);
}

.share-section p {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
}

.share-section .recipe-form {
  padding: clamp(20px, 3vw, 30px);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.share-section label {
  color: var(--white);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 5vw;
  color: var(--muted);
  background: var(--white);
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.empty-state {
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 1050px) {
  .workspace,
  .share-section,
  .recipe-grid {
    grid-template-columns: 1fr 1fr;
  }

  .summary-panel,
  .share-section > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
    font-size: 0.92rem;
  }

  .auth-actions {
    width: 100%;
  }

  .google-button {
    width: 100%;
  }

  .hero {
    min-height: calc(100svh - 170px);
  }

  .hero::after {
    background:
      linear-gradient(90deg, rgba(14, 24, 17, 0.84), rgba(14, 24, 17, 0.48)),
      linear-gradient(0deg, rgba(14, 24, 17, 0.5), rgba(14, 24, 17, 0));
  }

  .hero-content {
    padding-right: 5vw;
  }

  .workspace,
  .share-section,
  .recipe-grid,
  .food-form,
  .recipe-form {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .section-heading,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
