/* ============================================================
   Рецептатор — design tokens + landing styles
   Type:  Spectral (display serif) + Manrope (UI/body)
   Color: warm cream bg, ink text, terracotta + herb accents
   ============================================================ */

:root {
  /* palette — light (default) */
  --bg:        #f6f1e7;
  --bg-2:      #efe7d7;
  --surface:   #fffdf8;
  --surface-2: #faf5ec;
  --ink:       #2a241c;
  --ink-soft:  #6f6557;
  --ink-faint: #a59a87;
  --line:      rgba(42, 36, 28, 0.12);
  --line-soft: rgba(42, 36, 28, 0.07);

  /* accents — terracotta + herb green */
  --accent:    #c1542f;   /* terracotta */
  --accent-ink:#fffdf8;
  --accent-2:  #5c7f3f;   /* herb green */
  --accent-soft: color-mix(in oklch, var(--accent) 12%, var(--surface));

  /* type */
  --font-display: "Spectral", Georgia, serif;
  --font-ui: "Manrope", -apple-system, system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* shape */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --shadow: 0 1px 2px rgba(42,36,28,.04), 0 12px 32px -12px rgba(42,36,28,.18);
  --shadow-lg: 0 2px 4px rgba(42,36,28,.05), 0 40px 80px -24px rgba(42,36,28,.32);

  --maxw: 1200px;
}

[data-theme="dark"] {
  --bg:        #18140f;
  --bg-2:      #211c15;
  --surface:   #221d16;
  --surface-2: #2a241b;
  --ink:       #f3ecdf;
  --ink-soft:  #b6ab97;
  --ink-faint: #7d735f;
  --line:      rgba(243, 236, 223, 0.13);
  --line-soft: rgba(243, 236, 223, 0.07);
  --accent-ink:#1a150f;
  --accent-soft: color-mix(in oklch, var(--accent) 20%, var(--surface));
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 40px 80px -24px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .4s ease, color .4s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--accent);
  display: inline-block;
}

/* ---------------- buttons ---------------- */
.btn {
  font-family: var(--font-ui);
  font-weight: 650;
  font-size: 16px;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px -8px color-mix(in oklch, var(--accent) 70%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px color-mix(in oklch, var(--accent) 70%, transparent); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-faint); }

/* ---------------- nav ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 22px;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent);
  display: grid; place-items: center;
  color: var(--accent-ink);
  flex: none;
  box-shadow: 0 6px 14px -6px color-mix(in oklch, var(--accent) 70%, transparent);
}
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a {
  font-size: 15px; font-weight: 550; color: var(--ink-soft);
  transition: color .2s ease; white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); }
@media (max-width: 860px) { .nav-links { display: none; } }

/* ---------------- hero ---------------- */
.hero { padding: 64px 0 40px; position: relative; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  margin: 22px 0 0;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero-sub {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--ink-soft);
  margin-top: 22px;
  max-width: 30em;
}

/* link input */
.linkbar {
  margin-top: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 8px 8px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.linkbar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow);
}
.linkbar svg { flex: none; color: var(--ink-faint); }
.linkbar input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-family: var(--font-ui);
  font-size: 16px; color: var(--ink);
}
.linkbar input::placeholder { color: var(--ink-faint); }
@media (max-width: 480px) {
  .linkbar { flex-wrap: wrap; padding: 12px; }
  .linkbar .btn { width: 100%; justify-content: center; }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.chips-label { font-size: 13px; color: var(--ink-faint); margin-right: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 550;
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .18s ease;
}
.chip:hover { color: var(--ink); border-color: var(--ink-faint); transform: translateY(-1px); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }

/* trust row */
.trust { display: flex; gap: 26px; margin-top: 28px; flex-wrap: wrap; }
.trust-item { display: flex; flex-direction: column; }
.trust-num { font-family: var(--font-display); font-size: 26px; font-weight: 600; }
.trust-lbl { font-size: 13px; color: var(--ink-soft); }

/* ---------------- recipe card (hero demo) ---------------- */
.demo-stage { position: relative; }

.rcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

.rcard-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
}
.ph {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    color-mix(in oklch, var(--accent) 9%, var(--surface-2)) 0 14px,
    var(--surface-2) 14px 28px);
}
.ph-label {
  position: absolute; bottom: 12px; left: 12px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .04em; white-space: nowrap;
  color: var(--ink-soft);
  background: color-mix(in oklch, var(--surface) 80%, transparent);
  backdrop-filter: blur(4px);
  padding: 5px 9px; border-radius: 7px;
  border: 1px solid var(--line-soft);
}
.rcard-media .badge-src {
  position: absolute; top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600;
  background: color-mix(in oklch, var(--surface) 86%, transparent);
  backdrop-filter: blur(6px);
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line-soft);
}

.rcard-body { padding: 20px 22px 22px; }
.rcard-title { font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: -0.01em; margin: 0; font-size: 24px; }
.rcard-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-top: 10px; padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}
.rmeta { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink-soft); }
.rmeta b { color: var(--ink); font-weight: 600; }

.rsec-h {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint);
  margin: 14px 0 8px;
}
.ingredients { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.ing {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 14px; padding: 4px 0;
  border-bottom: 1px dotted var(--line);
}
.ing .q { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .ingredients { grid-template-columns: 1fr; } }

.steps { display: flex; flex-direction: column; gap: 11px; }
.step { display: flex; gap: 13px; }
.step-n {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
}
.step-tx { font-size: 14px; line-height: 1.45; color: var(--ink); padding-top: 3px; }

/* processing overlay */
.proc {
  position: absolute; inset: 0;
  background: color-mix(in oklch, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; padding: 32px; text-align: center;
  z-index: 4;
}
.proc-ring {
  width: 56px; height: 56px; border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.proc-step { font-size: 15px; font-weight: 600; line-height: 1.3; max-width: 220px; margin: 0 auto; }
.proc-sub { font-size: 13px; color: var(--ink-soft); font-family: var(--font-mono); margin-top: 5px; }
.proc-track { width: 200px; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.proc-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }

/* reveal animation */
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.reveal { animation: pop .5s cubic-bezier(.2,.7,.2,1) both; }
@keyframes shimmer {
  0% { opacity: .55; } 50% { opacity: 1; } 100% { opacity: .55; }
}
.generating .ph { animation: shimmer 1.1s ease-in-out infinite; }

/* floating tag on demo */
.demo-tag {
  position: absolute; z-index: 6;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 13px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600;
  animation: pop .6s both;
}
.demo-tag.t1 { top: -16px; right: 22px; }
.demo-tag.t2 { bottom: 28px; left: -22px; }
.demo-tag .ic { color: var(--accent-2); display: grid; place-items: center; }
@media (max-width: 980px) { .demo-tag { display: none; } }

/* ---------------- section frame ---------------- */
section.block { padding: 88px 0; position: relative; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(30px, 4vw, 46px); margin-top: 16px; }
.section-head p { color: var(--ink-soft); font-size: 18px; margin-top: 16px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }

.alt { background: var(--bg-2); }

/* ---------------- how it works ---------------- */
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) { .steps3 { grid-template-columns: 1fr; } }
.howcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  position: relative;
  transition: transform .25s ease, box-shadow .25s ease;
}
.howcard:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.howcard .num {
  font-family: var(--font-display); font-style: italic;
  font-size: 44px; color: var(--accent);
  line-height: 1; margin-bottom: 18px;
}
.howcard h3 { font-size: 22px; margin-bottom: 10px; }
.howcard p { color: var(--ink-soft); font-size: 15.5px; }
.howcard .ic-box {
  position: absolute; top: 28px; right: 28px;
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}

/* ---------------- platforms ---------------- */
.platforms { display: flex; flex-wrap: wrap; gap: 14px; }
.pf {
  flex: 1 1 180px;
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px 20px;
  transition: transform .2s ease, border-color .2s ease;
}
.pf:hover { transform: translateY(-3px); border-color: var(--ink-faint); }
.pf-ic {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff;
}
.pf-name { font-weight: 650; font-size: 16px; }
.pf-meta { font-size: 13px; color: var(--ink-soft); }

/* ---------------- features ---------------- */
.feat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 760px) { .feat-grid { grid-template-columns: 1fr; } }
.feat {
  display: flex; gap: 18px;
  padding: 26px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.feat-ic {
  flex: none; width: 46px; height: 46px; border-radius: 13px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.feat h3 { font-size: 19px; margin-bottom: 7px; }
.feat p { color: var(--ink-soft); font-size: 15px; }

/* ---------------- examples gallery ---------------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 860px) { .gallery { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; } }
.gcard {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  cursor: pointer;
}
.gcard:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.gcard-media { position: relative; aspect-ratio: 5/4; }
.gcard-body { padding: 16px 18px 20px; }
.gcard h3 { font-size: 18px; }
.gcard .gmeta { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.gcard .gsrc {
  position: absolute; top: 11px; left: 11px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  background: color-mix(in oklch, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px);
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line-soft);
}

/* ---------------- FAQ ---------------- */
.faq { max-width: 800px; margin: 0 auto; }
.qa {
  border-bottom: 1px solid var(--line);
}
.qa-q {
  width: 100%; text-align: left; background: none; border: none;
  cursor: pointer; padding: 24px 0;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--ink);
}
.qa-toggle { flex: none; color: var(--accent); transition: transform .25s ease; }
.qa.open .qa-toggle { transform: rotate(45deg); }
.qa-a {
  overflow: hidden; max-height: 0;
  transition: max-height .35s ease, padding .35s ease;
  color: var(--ink-soft); font-size: 16px; line-height: 1.6;
}
.qa.open .qa-a { padding-bottom: 24px; }

/* ---------------- CTA ---------------- */
.cta {
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-lg);
  padding: 72px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .cta { background: var(--surface-2); border: 1px solid var(--line); }
.cta h2 { font-size: clamp(32px, 5vw, 52px); color: inherit; }
.cta p { color: color-mix(in oklch, var(--bg) 75%, var(--ink-soft)); font-size: 19px; margin: 18px auto 0; max-width: 32em; }
.cta .linkbar { max-width: 540px; margin-left: auto; margin-right: auto; }
.cta-glow {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklch, var(--accent) 55%, transparent), transparent 65%);
  filter: blur(40px); opacity: .5;
  top: -200px; right: -120px; pointer-events: none;
}

/* ---------------- footer ---------------- */
.foot { padding: 56px 0 40px; border-top: 1px solid var(--line); }
.foot-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.foot-col h3 { font-family: var(--font-ui); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin: 0 0 14px; font-weight: 700; }
.foot-col a { display: block; color: var(--ink-soft); font-size: 15px; padding: 5px 0; transition: color .2s; }
.foot-col a:hover { color: var(--accent); }
.foot-bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--ink-faint); }

/* fade-in on scroll */
.fade-up { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.fade-up.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .fade-up { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .001ms !important; }
}

/* generated dish photos — sit above the striped .ph fallback, below the badges */
.gcard-media .media-img,
.rcard-media .media-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
/* hero demo: the generated photo fades in once the recipe is "ready" */
.rcard-media .media-img { animation: fade-in .55s ease both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
