* { box-sizing: border-box; }

html { overflow-x: hidden; }

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; }

a { color: var(--accent); }
a:hover { color: var(--accent-deep); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.rule { height: 1px; background: var(--line); }
.hide { display: none !important; }
.sr {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; white-space: nowrap; clip-path: inset(50%);
}

/* ---- masthead ---- */
.masthead {
  padding: 24px 0 18px;
  display: flex; flex-wrap: wrap; gap: 18px;
  align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.brand .spine {
  width: 10px; height: 48px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent-deep));
}
.brand .title {
  display: block; font-family: var(--font-script);
  font-size: 27px; line-height: 1.1; color: var(--accent);
}
.brand .sub {
  display: block; margin-top: 4px; font-family: var(--font-caps);
  font-weight: 600; font-size: 10px; letter-spacing: 0.22em; color: var(--ink-soft);
}
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---- controls ---- */
input[type="text"], input[type="search"], input[type="email"],
input[type="password"], select, textarea {
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 11px 13px; width: 100%;
}
textarea { line-height: 1.7; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.search { width: 240px; min-height: 44px; }

.btn {
  min-height: 44px; padding: 0 20px; cursor: pointer;
  font-family: var(--font-caps); font-weight: 600;
  font-size: 13px; letter-spacing: 0.14em;
  border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
}
.btn:hover { border-color: var(--ink-muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 12px; }

.chip {
  min-height: 44px; display: inline-flex; align-items: center;
  padding: 0 18px; font-size: 14px; text-decoration: none;
  color: var(--ink-soft); background: var(--surface);
  border: 1px solid rgba(46,42,38,0.2); border-radius: var(--radius-pill);
  cursor: pointer; font-family: var(--font-body);
}
.chip[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
.chip-sm {
  min-height: 34px; padding: 0 14px; font-size: 13px;
  color: var(--herb-ink); background: var(--herb-wash); border: 0;
}
.chip-sm[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.filters { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 18px; }

/* ---- cards ---- */
.grid {
  display: grid; gap: 28px; padding: 28px 0 0;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
}
.card {
  position: relative; padding: 24px 22px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--lift); text-decoration: none; color: inherit; display: block;
}
.card:nth-child(3n+1) { transform: rotate(var(--tilt-a)); }
.card:nth-child(3n+2) { transform: rotate(var(--tilt-b)); }
.card:nth-child(3n)   { transform: rotate(var(--tilt-c)); }
.card:hover { box-shadow: var(--lift-high); transform: rotate(0deg); }
.card .kitchen {
  margin: 0 0 4px; font-family: var(--font-typed);
  font-size: 9px; letter-spacing: 0.18em; color: var(--ink-muted);
}
.card h3 {
  margin: 0 0 14px; font-family: var(--font-hand); font-weight: 400;
  font-size: 18px; line-height: 1.5; color: var(--ink);
}
.card .meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-muted);
}
.card .tape {
  position: absolute; left: 26px; top: -10px; width: 72px; height: 21px;
  background: var(--tape); transform: rotate(-3deg);
  border-left: 1px solid rgba(255,255,255,0.7);
  border-right: 1px solid rgba(255,255,255,0.7);
}
.card .thumb {
  width: 100%; height: 132px; object-fit: cover; object-position: top;
  border: 1px solid var(--line); margin-bottom: 14px; background: var(--surface-soft);
}
.tag {
  display: inline-flex; align-items: center; padding: 4px 10px; font-size: 11px;
  color: var(--herb-ink); background: var(--herb-wash); border-radius: 2px;
}
.tag-draft { color: var(--accent); background: rgba(154,58,46,0.12); }

/* ---- panels ---- */
.panel {
  padding: 30px 28px 26px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift);
}
.panel h2 {
  margin: 0 0 6px; font-family: var(--font-script);
  font-weight: 400; font-size: 28px; color: var(--accent);
}
.label {
  display: block; margin-bottom: 7px; font-family: var(--font-caps);
  font-weight: 600; font-size: 12px; letter-spacing: 0.2em; color: var(--ink);
}
.field { margin-bottom: 20px; }
.help { margin: 6px 0 0; font-size: 13px; color: var(--ink-muted); line-height: 1.5; }

/* ---- recipe page ---- */
.recipe-head h1 {
  margin: 0; font-family: var(--font-script); font-weight: 400;
  font-size: 46px; line-height: 1.12; color: var(--accent);
}
.recipe-head .by {
  margin: 12px 0 0; font-family: var(--font-typed);
  font-size: 11px; letter-spacing: 0.17em; color: var(--ink-muted);
}
.two-up { display: flex; flex-wrap: wrap; gap: 36px; align-items: flex-start; padding-top: 26px; }
.two-up > * { flex: 1 1 380px; min-width: 0; }

.scan {
  position: relative; padding: 22px 18px 26px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--lift-high);
  transform: rotate(var(--tilt-a));
}
.scan img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.scan .t {
  position: absolute; width: 84px; height: 24px; background: var(--tape);
  border-left: 1px solid rgba(255,255,255,0.7);
  border-right: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 1px 3px rgba(40,36,32,0.12);
}
.scan .t1 { left: -20px; top: 14px;    transform: rotate(-38deg); }
.scan .t2 { right: -20px; top: 12px;   transform: rotate(38deg); }
.scan .t3 { left: -20px; bottom: 22px; transform: rotate(38deg); }
.scan .t4 { right: -20px; bottom: 20px; transform: rotate(-38deg); }

.typed h2 {
  margin: 0 0 14px; font-family: var(--font-caps); font-weight: 600;
  font-size: 12px; letter-spacing: 0.26em; color: var(--ink);
}
.typed ul { margin: 0 0 26px; padding: 0; list-style: none; font-size: 15px; line-height: 2; }
.typed .dirs { margin: 0; font-size: 15px; line-height: 1.9; white-space: pre-line; }
.typed .stamp {
  margin: 24px 0 0; font-family: var(--font-typed);
  font-size: 10px; letter-spacing: 0.14em; line-height: 1.8; color: var(--ink-muted);
}

.memory { display: flex; gap: 14px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.memory .dot { flex: 0 0 38px; height: 38px; border-radius: 50%; background: var(--herb-wash); }
.memory .who { margin: 0 0 5px; font-size: 14px; font-weight: 500; }
.memory .what { margin: 0; font-family: var(--font-hand); font-size: 15px; line-height: 1.9; color: var(--ink-soft); white-space: pre-line; }

/* ---- auth and messages ---- */
.gate { max-width: 460px; margin: 60px auto; }
.note {
  padding: 13px 15px; border-radius: var(--radius); font-size: 14px; line-height: 1.6;
  border: 1px solid var(--line-strong); background: var(--surface-soft); margin-bottom: 18px;
}
.note-bad { border-color: var(--accent); background: rgba(154,58,46,0.08); color: var(--accent-deep); }
.note-ok  { border-color: var(--herb); background: var(--herb-wash); color: var(--herb-ink); }

.empty { padding: 50px 24px; text-align: center; color: var(--ink-muted); font-size: 15px; }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row-between { justify-content: space-between; }
.stack-gap > * + * { margin-top: 26px; }

footer.foot { padding: 40px 0 50px; }
footer.foot p { margin: 16px 0 0; font-family: var(--font-hand); font-size: 15px; color: var(--ink-muted); }

@media (max-width: 620px) {
  .search { width: 100%; }
  .recipe-head h1 { font-size: 34px; }
  .two-up { gap: 28px; }
  .scan, .card { transform: none !important; }
}

@media print {
  .masthead, .filters, .tools, .no-print, footer.foot { display: none !important; }
  body { background: #fff; }
  .panel, .scan { box-shadow: none; border: 0; }
}

/* ---- memory threads ---- */
.memory .when { font-weight: 400; color: var(--ink-muted); font-size: 12px; margin-left: 6px; }
.memory.reply { margin-left: 34px; padding-left: 16px; border-left: 2px solid var(--line); border-bottom: 0; padding-bottom: 14px; margin-bottom: 14px; }
.memory.reply .dot { flex-basis: 28px; height: 28px; }
.memory .shots { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.memory .shot {
  width: 150px; height: 150px; object-fit: cover; background: var(--surface-soft);
  border: 1px solid var(--line); padding: 7px; box-shadow: var(--lift);
  transform: rotate(-1.2deg);
}
.memory .shot:nth-child(even) { transform: rotate(1.4deg); }
.linkish {
  background: none; border: 0; padding: 8px 0 0; cursor: pointer;
  font-family: var(--font-body); font-size: 13px; color: var(--accent);
  text-decoration: underline; min-height: 36px;
}
.replybox:not(:empty) { margin-top: 10px; }

/* the scan tape must not push the page wider than the phone */
@media (max-width: 620px) {
  .scan { padding: 18px 14px 22px; }
  .scan .t1, .scan .t3 { left: 4px; }
  .scan .t2, .scan .t4 { right: 4px; }
  .memory.reply { margin-left: 14px; }
  .memory .shot { width: 120px; height: 120px; }
  .masthead { padding: 18px 0 14px; }
  .tools { width: 100%; }
  .tools .search { flex: 1 1 100%; }
}

/* ---- sticky masthead so the way home is always on screen ---- */
.masthead-wrap {
  position: sticky; top: 0; z-index: 20;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
}

/* ---- search ---- */
.searchbar { padding: 22px 0 0; }
.searchbar input { min-height: 48px; font-size: 16px; }

/* ---- back to all recipes ---- */
.backlink {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; font-size: 14px; text-decoration: none;
}
.backlink:hover { text-decoration: underline; }

@media (max-width: 620px) {
  .brand .title { font-size: 21px; }
  .brand .spine { height: 40px; }
  .masthead { gap: 12px; }
}

@media print {
  .masthead-wrap, .backlink { display: none !important; }
}

/* ---- bulk photo upload ---- */
.uprow {
  display: flex; gap: 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.upthumb {
  width: 64px; height: 64px; object-fit: cover; flex: 0 0 64px;
  border: 1px solid var(--line); background: var(--surface-soft);
}
.upstate { font-size: 13px; color: var(--ink-muted); flex: 0 0 auto; max-width: 140px; }
.upstate.ok  { color: var(--herb-ink); }
.upstate.bad { color: var(--accent); }

/* ---- naming an unclaimed kitchen ---- */
.claimbox {
  margin-top: 16px; padding: 16px 18px;
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius);
}

/* ---- the whole book, laid out for print ---- */
.book { padding-top: 18px; }
.bpage {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 44px 40px; margin-bottom: 28px; box-shadow: var(--lift);
}
.bpage h1 { margin: 0; font-family: var(--font-script); font-weight: 400; font-size: 44px; color: var(--accent); }
.bpage h2 { margin: 0 0 8px; font-family: var(--font-script); font-weight: 400; font-size: 30px; color: var(--accent); }
.bpage h3 {
  margin: 22px 0 10px; font-family: var(--font-caps); font-weight: 600;
  font-size: 12px; letter-spacing: 0.24em; color: var(--ink);
}
.bpage ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.95; }
.bby { margin: 0 0 18px; font-family: var(--font-typed); font-size: 10px; letter-spacing: 0.16em; color: var(--ink-muted); }
.bdir { margin: 0; font-size: 14px; line-height: 1.85; white-space: pre-line; }
.bcols { display: flex; flex-wrap: wrap; gap: 30px; align-items: flex-start; }
.bcols > * { flex: 1 1 260px; min-width: 0; }
.bscan { width: 100%; height: auto; border: 1px solid var(--line); }
.btoc { columns: 2; column-gap: 32px; }
.bcover { text-align: center; padding: 110px 40px; }
.bcover h1 { font-size: 52px; line-height: 1.1; }
.bcover-sub {
  margin: 0 0 16px; font-family: var(--font-caps); font-weight: 600;
  font-size: 12px; letter-spacing: 0.3em; color: var(--ink-soft);
}
.bdiv { text-align: center; padding: 72px 40px; }

@media print {
  .book { padding: 0; }
  .bpage {
    border: 0; box-shadow: none; margin: 0; padding: 0 0 24px;
    break-after: page; page-break-after: always;
  }
  .bpage:last-child { break-after: auto; page-break-after: auto; }
  .bcols { break-inside: avoid; page-break-inside: avoid; }
  .bscan { max-height: 11cm; width: auto; }
  @page { margin: 16mm; }
}

/* ---- landing page ---- */
.land { padding-bottom: 40px; }
.land-hero { padding: 64px 0 56px; text-align: center; max-width: 660px; margin: 0 auto; }
.land-kicker {
  margin: 0 0 16px; font-family: var(--font-caps); font-weight: 600;
  font-size: 11px; letter-spacing: 0.3em; color: var(--ink-muted);
}
.land-hero h1 {
  margin: 0; font-family: var(--font-script); font-weight: 400;
  font-size: 58px; line-height: 1.08; color: var(--accent);
}
.land-lead { margin: 22px 0 0; font-size: 17px; line-height: 1.7; color: var(--ink-soft); }

.land-three {
  display: grid; gap: 30px; padding: 44px 0;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.land-three h3 {
  margin: 0 0 10px; font-family: var(--font-caps); font-weight: 600;
  font-size: 13px; letter-spacing: 0.2em; color: var(--ink);
}
.land-three p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--ink-soft); }

.land-price { padding: 48px 0 8px; }
.land-price h2 {
  margin: 0 0 28px; text-align: center; font-family: var(--font-script);
  font-weight: 400; font-size: 34px; color: var(--accent);
}
.land-tiers { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.land-tier {
  padding: 26px 24px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift);
}
.land-tier-pick { border-color: var(--accent); border-width: 2px; }
.land-tier p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--ink-soft); }
.land-tier-name {
  font-family: var(--font-caps) !important; font-weight: 600;
  font-size: 12px !important; letter-spacing: 0.22em; color: var(--ink) !important;
}
.land-tier-cost {
  margin: 8px 0 14px !important; font-family: var(--font-body);
  font-size: 30px !important; color: var(--ink) !important;
}
.land-tier-cost span { font-size: 14px; color: var(--ink-muted); }

.land-close { padding: 56px 0 20px; text-align: center; border-top: 1px solid var(--line); margin-top: 44px; }
.land-close p { margin: 0 0 22px; font-family: var(--font-hand); font-size: 20px; color: var(--ink-soft); }

@media (max-width: 620px) {
  .land-hero { padding: 40px 0 36px; }
  .land-hero h1 { font-size: 40px; }
  .land-lead { font-size: 16px; }
}

/* the landing page carries its own title, so the bar above it is redundant */
body.on-landing .masthead-wrap { display: none; }
body.on-landing .foot { display: none; }

/* ---- kitchens, drawn as a tree ---- */
.ktree { list-style: none; margin: 0; padding: 0; }
.ktree-top > li { border-top: 1px solid var(--line); }
.ktree-top > li:first-child { border-top: 0; }
.ktree .ktree { margin-left: 18px; padding-left: 16px; border-left: 2px solid var(--line); }
.kperson {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 0; font-size: 15px;
}
.kperson a { text-decoration: none; font-weight: 500; }
.kperson a:hover { text-decoration: underline; }
