:root {
  --bg: #f8f3e8;
  --surface: #fffdf7;
  --ink: #1c2a22;
  --muted: #5f6d63;
  --line: #e4dccb;
  --tomato: #c8472f;
  --tomato-dark: #a93622;
  --basil: #24513a;
  --basil-light: #e8efe6;
  --gold: #e3aa45;
  --shadow: 0 18px 50px rgba(64, 48, 25, 0.10);
  --radius: 22px;
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(227, 170, 69, 0.12), transparent 28%),
    radial-gradient(circle at 92% 18%, rgba(200, 71, 47, 0.08), transparent 26%),
    var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

img, svg { max-width: 100%; }

.container {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(248, 243, 232, 0.88);
  border-bottom: 1px solid rgba(228, 220, 203, 0.9);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.12rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tomato);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 6px 16px rgba(200, 71, 47, 0.25);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.94rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
}

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

.hero {
  padding: 72px 0 44px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 44px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--tomato-dark);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 18px 0 14px;
  font-size: clamp(2.3rem, 5vw, 4.15rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: var(--ink);
}

.hero p {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--tomato);
  color: #fff;
  box-shadow: 0 10px 22px rgba(200, 71, 47, 0.22);
}

.btn-primary:hover {
  background: var(--tomato-dark);
  color: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover { border-color: var(--tomato); color: var(--tomato); }

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 390px;
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 253, 247, 0.96), rgba(255, 248, 232, 0.92));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-art::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(200, 71, 47, 0.08);
  top: -80px;
  right: -60px;
}

.hero-art::after {
  content: "72% hydration";
  position: absolute;
  bottom: 24px;
  right: 24px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--basil);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.pizza-svg {
  width: min(92%, 430px);
  transform: rotate(-4deg);
  filter: drop-shadow(0 22px 26px rgba(64, 48, 25, 0.14));
}

.calculator {
  margin: 20px 0 60px;
  padding: 30px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.calculator-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.calculator-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.calculator-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--tomato);
  box-shadow: 0 0 0 4px rgba(200, 71, 47, 0.10);
}

.field .unit {
  position: absolute;
  right: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  pointer-events: none;
}

.field input[type="number"] { padding-right: 52px; }

.advanced {
  margin-top: 18px;
  border-top: 1px dashed var(--line);
  padding-top: 18px;
}

.advanced summary {
  cursor: pointer;
  color: var(--basil);
  font-weight: 750;
  font-size: 0.92rem;
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.result-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.result-total {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.result-total strong {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--tomato-dark);
}

.result-total span { color: var(--muted); font-weight: 650; }

.result-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.ingredient-list {
  display: grid;
  gap: 10px;
}

.ingredient {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--basil-light);
}

.ingredient span { color: var(--basil); font-weight: 650; }
.ingredient b { font-variant-numeric: tabular-nums; }

.bar {
  height: 7px;
  border-radius: 99px;
  background: #e9e1d1;
  overflow: hidden;
  margin-top: 18px;
}

.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--tomato), var(--gold));
  border-radius: inherit;
  transition: width 0.25s ease;
}

.section {
  padding: 64px 0;
}

.section-head {
  max-width: 720px;
  margin-bottom: 30px;
}

.kicker {
  color: var(--tomato-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.section h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.section-head p { margin: 0; color: var(--muted); }

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

.card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(64, 48, 25, 0.05);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(200, 71, 47, 0.10);
  color: var(--tomato-dark);
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.92rem;
}

th, td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: #f2ead8;
  color: var(--ink);
  font-weight: 750;
}

tr:last-child td { border-bottom: 0; }

.faq {
  display: grid;
  gap: 12px;
}

.faq-item {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.faq-item h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.faq-item p { margin: 0; color: var(--muted); font-size: 0.93rem; }

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

.link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.link-card:hover {
  transform: translateY(-2px);
  border-color: var(--tomato);
  color: var(--ink);
}

.link-card strong { font-size: 0.98rem; }
.link-card span { color: var(--muted); font-size: 0.84rem; }

.note {
  padding: 16px 18px;
  border-left: 4px solid var(--gold);
  background: #fff9e9;
  border-radius: 0 12px 12px 0;
  color: #69552f;
  font-size: 0.9rem;
}

.footer {
  margin-top: 30px;
  padding: 44px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 30px;
}

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

.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--tomato); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { min-height: 300px; order: -1; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .advanced-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-panel { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .link-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .container { width: min(calc(100% - 28px), var(--max)); }
  .nav-links { display: none; }
  .hero { padding: 42px 0 26px; }
  .calculator { padding: 20px; border-radius: 20px; }
  .field-grid, .advanced-grid, .cards, .link-grid { grid-template-columns: 1fr; }
  .calculator-head { flex-direction: column; align-items: flex-start; }
  .hero-art { min-height: 250px; }
  .pizza-svg { width: 86%; }
}

.prose {
  max-width: 780px;
  color: var(--ink);
}

.prose p { color: var(--muted); margin: 0 0 16px; }

.prose h2 {
  margin: 34px 0 10px;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.prose h3 {
  margin: 24px 0 8px;
  font-size: 1.12rem;
}

.prose ul, .prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--muted);
}

.prose li { margin: 6px 0; }

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 26px;
}

.recipe-meta span {
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--basil-light);
  color: var(--basil);
  font-size: 0.82rem;
  font-weight: 700;
}
