/* vibe.recipes: cool porcelain ground, blue pen ink, highlighter on measurements */
:root {
  --paper: #EDF0F3;
  --paper-2: #E2E7EC;
  --surface: #F8FAFB;
  --ink: #141821;
  --ink-2: #4A5361;
  --rule: #C8D0D9;
  --cobalt: #2446C8;
  --cobalt-ink: #FFFFFF;
  --marker: #FFD64D;
  --marker-ink: #141821;
  --burn: #B8412F;
  --burn-bg: #F7E4DF;
  --ok: #1F7A4D;
  /* The recipe card is physical paper: it stays light in both themes. */
  --card-paper: #FCFCF8;
  --card-ink: #1B1F27;
  --card-rule: #B9CBEA;
  --card-margin: #E26A7C;
  --shadow: 0 1px 0 rgba(20, 24, 33, .06), 0 18px 40px -18px rgba(20, 24, 33, .35);

  --f-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-hand: "Caveat", "Bradley Hand", "Comic Sans MS", cursive;

  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.75rem;
  --step-3: 2.5rem;
  --step-4: clamp(2.6rem, 6vw, 4.6rem);
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1116; --paper-2: #151A21; --surface: #1A2029;
    --ink: #E8EBF0; --ink-2: #A3ACB9; --rule: #2B333E;
    --cobalt: #93A9FF; --cobalt-ink: #0E1116;
    --marker: #E9C247; --marker-ink: #141821;
    --burn: #FF9A83; --burn-bg: #2A1714; --ok: #6FD39E;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -18px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  --paper: #0E1116; --paper-2: #151A21; --surface: #1A2029;
  --ink: #E8EBF0; --ink-2: #A3ACB9; --rule: #2B333E;
  --cobalt: #93A9FF; --cobalt-ink: #0E1116;
  --marker: #E9C247; --marker-ink: #141821;
  --burn: #FF9A83; --burn-bg: #2A1714; --ok: #6FD39E;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -18px rgba(0, 0, 0, .8);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--f-body);
  padding-inline: var(--gutter);
}
a { color: var(--cobalt); text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.05; text-wrap: balance; margin: 0; }
p { margin: 0; }
.wrap { max-width: var(--maxw); margin-inline: auto; }

/* Measurement: the recipe quantity, underlined with a highlighter */
.qty {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: .92em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: linear-gradient(transparent 55%, var(--marker) 55%, var(--marker) 92%, transparent 92%);
  color: inherit;
  padding-inline: .1em;
}
.hand { font-family: var(--f-hand); font-weight: 600; color: var(--cobalt); line-height: 1; }
.label {
  font: 600 .72rem/1.2 var(--f-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Navigation */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 22px; flex-wrap: wrap;
}
.wordmark {
  font: 800 1.35rem/1 var(--f-display);
  font-variation-settings: "wdth" 85;
  color: var(--ink); text-decoration: none; letter-spacing: -.01em;
  display: inline-flex; align-items: baseline;
}
.wordmark i {
  display: inline-block; width: .32em; height: .32em; margin-inline: .06em;
  background: var(--marker); border-radius: 1px; transform: translateY(-.02em);
}
.nav ul { display: flex; gap: clamp(14px, 3vw, 28px); list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav ul a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: var(--step--1); }
.nav ul a:hover { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font: 600 var(--step--1)/1 var(--f-body);
  padding: .95em 1.25em; border-radius: 999px;
  border: 1.5px solid var(--ink); color: var(--ink); background: transparent;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--cobalt); border-color: var(--cobalt); color: var(--cobalt-ink); }
.btns { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(32px, 6vw, 80px); align-items: center;
  padding-block: clamp(28px, 6vw, 72px) clamp(48px, 8vw, 96px);
}
.hero h1 {
  font-size: var(--step-4); font-weight: 800; letter-spacing: -.02em;
  font-variation-settings: "wdth" 78, "opsz" 96;
}
.hero h1 em { font-style: normal; color: var(--cobalt); }
.hero .lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink-2); max-width: 34ch; margin-block: 22px 30px; }

/* Recipe card (index card) */
.card-recipe {
  position: relative;
  background:
    linear-gradient(90deg, transparent 46px, var(--card-margin) 46px, var(--card-margin) 47.5px, transparent 47.5px),
    repeating-linear-gradient(var(--card-paper) 0 33px, var(--card-rule) 33px 34px);
  background-color: var(--card-paper);
  color: var(--card-ink);
  padding: 22px 24px 26px 64px;
  border-radius: 3px;
  box-shadow: var(--shadow);
  transform: rotate(-1.6deg);
  max-width: 460px; justify-self: end; width: 100%;
  margin: 0;
}
.card-recipe .card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; height: 34px; }
.card-recipe h2 { font-size: 1.6rem; font-weight: 800; font-variation-settings: "wdth" 85; }
.card-recipe .card-sub { font: 500 .8rem/34px var(--f-mono); color: #5A6272; }
.card-recipe ul { list-style: none; margin: 0; padding: 0; }
.card-recipe li { line-height: 34px; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-recipe li .qty { background: linear-gradient(transparent 55%, #FFD64D 55%, #FFD64D 92%, transparent 92%); display: inline-block; min-width: 4.4em; }
.card-recipe .note {
  position: absolute; right: -8px; bottom: -34px; transform: rotate(-4deg);
  font-size: 1.55rem; color: var(--cobalt);
}
.card-recipe .note::before { content: "↑ "; }

/* Home sections */
.section { padding-block: clamp(48px, 8vw, 96px); border-top: 1px solid var(--rule); }
.section-head { display: grid; gap: 12px; margin-bottom: clamp(28px, 4vw, 44px); max-width: 60ch; }
.section-head h2 { font-size: var(--step-3); font-weight: 750; letter-spacing: -.02em; font-variation-settings: "wdth" 85; }
.section-head p { color: var(--ink-2); font-size: var(--step-1); line-height: 1.45; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; gap: 10px; align-content: start; }
.steps li::before {
  content: counter(s); font: 800 3.2rem/1 var(--f-display); color: var(--cobalt);
  font-variation-settings: "wdth" 75;
}
.steps h3 { font-size: var(--step-1); font-weight: 700; }
.steps p { color: var(--ink-2); }

/* Anatomy: a recipe index */
.anatomy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 5vw, 64px); margin: 0; }
.anatomy div { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: 16px; padding-block: 16px; border-bottom: 1px dashed var(--rule); }
.anatomy dt { font-family: var(--f-display); font-weight: 700; font-size: var(--step-1); font-variation-settings: "wdth" 88; line-height: 1.2; }
.anatomy dd { margin: 0; color: var(--ink-2); }
.anatomy .burn dt { color: var(--burn); }

/* Catalog */
.shelf { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
.tile {
  display: grid; gap: 14px; align-content: start;
  padding: clamp(22px, 3vw, 32px); border-radius: 14px;
  background: var(--surface); border: 1px solid var(--rule);
  color: inherit; text-decoration: none;
}
a.tile { box-shadow: var(--shadow); transition: transform .2s ease; }
a.tile:hover { transform: translateY(-3px); }
.tile h3 { font-size: var(--step-2); font-weight: 750; font-variation-settings: "wdth" 85; letter-spacing: -.01em; }
.tile p { color: var(--ink-2); }
.tile .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 500 .75rem/1 var(--f-mono); padding: .45em .65em; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-2); background: var(--paper); }
.tile .facts { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: var(--step--1); color: var(--ink-2); }
.tile .go { font-weight: 600; color: var(--cobalt); }
.tile.empty { background: transparent; border-style: dashed; }

.authors { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: end; }
.authors h2 { font-size: var(--step-4); font-weight: 800; letter-spacing: -.02em; font-variation-settings: "wdth" 78; }
.authors p { color: var(--ink-2); font-size: var(--step-1); line-height: 1.45; }
.pill { display: inline-block; font: 600 .78rem/1 var(--f-mono); letter-spacing: .06em; padding: .6em .9em; border-radius: 999px; background: var(--marker); color: var(--marker-ink); margin-top: 18px; }

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 28px 40px; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: var(--step--1); }

/* ---------- Recipe page ---------- */
.crumbs { font-size: var(--step--1); color: var(--ink-2); }
.crumbs a { color: inherit; }
.r-head { display: grid; gap: 18px; padding-block: clamp(20px, 4vw, 48px) 28px; max-width: 30em; }
.r-head h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -.012em; line-height: 1.02; font-variation-settings: "wdth" 82, "opsz" 96; }
.r-head .by { color: var(--ink-2); font-size: var(--step-1); }
.r-head .by b { color: var(--ink); font-weight: 600; }

.r-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 0; border-block: 1.5px solid var(--ink);
}
.r-facts div { padding: 14px 16px 16px 0; display: grid; gap: 4px; align-content: start; }
.r-facts dd { margin: 0; font-weight: 500; font-size: var(--step--1); line-height: 1.4; }

.r-status {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  margin-block: 18px 0; font-size: var(--step--1); color: var(--ink-2);
}
.r-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--marker); display: inline-block; flex: none; transform: translateY(-1px); }
.r-status .dot.ok { background: var(--ok); }

.r-body { display: grid; grid-template-columns: 220px minmax(0, 1fr) 300px; gap: clamp(24px, 4vw, 48px); padding-block: 40px 80px; align-items: start; }
.toc { position: sticky; top: 24px; display: grid; gap: 4px; font-size: var(--step--1); }
.toc a { color: var(--ink-2); text-decoration: none; padding: 4px 0 4px 12px; border-left: 2px solid var(--rule); }
.toc a:hover, .toc a.on { color: var(--ink); border-left-color: var(--cobalt); }

.use {
  position: sticky; top: 24px;
  display: grid; gap: 14px; padding: 22px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow);
}
.use h2 { font-size: var(--step-1); font-weight: 750; font-variation-settings: "wdth" 88; }
.use p { font-size: var(--step--1); color: var(--ink-2); }
.use .btn { justify-content: center; }
.use .prompt {
  font: 400 .8rem/1.55 var(--f-mono); color: var(--ink);
  background: var(--paper); border: 1px dashed var(--rule); border-radius: 8px;
  padding: 12px; max-height: 12.5rem; overflow: auto;
}
.use .copied { font-size: var(--step--1); color: var(--ok); min-height: 1.4em; }

/* Rendered recipe */
.recipe { max-width: 68ch; }
.recipe > section { padding-block: 8px 36px; scroll-margin-top: 20px; }
.recipe h2 {
  font-size: var(--step-3); font-weight: 750; letter-spacing: -.02em; font-variation-settings: "wdth" 85;
  padding-top: 26px; border-top: 1.5px solid var(--ink); margin-bottom: 18px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.recipe h2 .hand { font-size: 1.5rem; font-weight: 600; letter-spacing: 0; }
.recipe h3 { font-size: var(--step-1); font-weight: 700; margin-block: 30px 10px; scroll-margin-top: 20px; font-variation-settings: "wdth" 92; }
.recipe p, .recipe ul, .recipe ol, .recipe blockquote, .recipe .table-wrap { margin-block: 0 14px; }
.recipe ul, .recipe ol { padding-left: 1.25em; }
.recipe li { margin-block: 4px; }
.recipe li::marker { color: var(--ink-2); }
.recipe strong { font-weight: 650; }
.recipe code { font: 500 .86em var(--f-mono); background: var(--paper-2); padding: .1em .35em; border-radius: 4px; }
.recipe hr { border: 0; border-top: 1px dashed var(--rule); margin-block: 28px; }
.recipe blockquote {
  margin-inline: 0; padding: 14px 18px; border-radius: 10px;
  background: var(--paper-2); color: var(--ink);
}
.recipe blockquote p:last-child { margin-bottom: 0; }
.recipe p.ready {
  display: flex; gap: 10px; align-items: baseline;
  padding: 10px 14px; border: 1.5px solid var(--ok); border-radius: 10px; color: var(--ink);
  font-size: var(--step--1);
}
.recipe p.ready strong { color: var(--ok); white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); }
.recipe table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
.recipe th, .recipe td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.recipe tr:last-child td { border-bottom: 0; }
.recipe th { font: 600 .72rem/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.recipe td:first-child { font-weight: 600; }
#recipe-parameters td:last-child { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

#dont-let-it-burn h2 { color: var(--burn); border-top-color: var(--burn); }
#dont-let-it-burn ol { padding-left: 0; list-style: none; counter-reset: b; }
#dont-let-it-burn ol > li {
  counter-increment: b; position: relative;
  padding: 14px 16px 14px 52px; margin-block: 0 10px; border-radius: 10px; background: var(--burn-bg);
}
#dont-let-it-burn ol > li::before {
  content: counter(b); position: absolute; left: 16px; top: 12px;
  font: 800 1.5rem/1 var(--f-display); color: var(--burn);
}

.recipe .contains-task-list, .recipe ul:has(> li > input[type="checkbox"]) { list-style: none; padding-left: 0; }
.recipe li:has(> input[type="checkbox"]) { display: flex; gap: 12px; align-items: baseline; padding-block: 8px; border-bottom: 1px dashed var(--rule); margin: 0; }
.recipe input[type="checkbox"] { accent-color: var(--ok); width: 1.05em; height: 1.05em; flex: none; transform: translateY(2px); cursor: pointer; }
.recipe li:has(> input:checked) { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--ok); }
.check-count { font: 600 .8rem/1 var(--f-mono); color: var(--ok); }

.loading, .failed { color: var(--ink-2); padding-block: 40px; }

/* Responsive */
@media (max-width: 1080px) {
  .r-body { grid-template-columns: minmax(0, 1fr) 280px; }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .hero, .authors, .shelf { grid-template-columns: minmax(0, 1fr); }
  .card-recipe { justify-self: start; margin-bottom: 30px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .anatomy { grid-template-columns: minmax(0, 1fr); }
  .r-body { grid-template-columns: minmax(0, 1fr); }
  .use { position: static; order: -1; }
}
@media (max-width: 480px) {
  .anatomy div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .card-recipe { padding-left: 58px; padding-right: 16px; }
  .card-recipe .card-sub { display: none; }
  .card-recipe .note { right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card-recipe { transform: none; }
}
