/* Recipe Bank: kitchen-table scrapbook */
:root {
  --paper: #EFE5D3; --card: #FBF6EA; --ink: #2E2620; --muted: #7C6E62; --line: #E2D6C2;
  --accent: #B8432E; --accent-ink: #fff; --herb: #5E7F5F; --blush: #F1DCCF; --sage: #E4ECE1;
  --card-paper: #FBF6EA; --card-ink: #2E2620; --rule: #BCD0E2; --margin: #E3A39A; --tape: rgba(233, 219, 178, .82);
  --serif: "Lora", ui-serif, Georgia, serif;
  --hand: "Caveat", "Bradley Hand", cursive;
  --type: "Special Elite", "American Typewriter", "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .25  0 0 0 0 .15  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #231B16; --card: #2E2520; --ink: #F1E8DC; --muted: #B3A393; --line: #43372F;
          --accent: #E0735A; --herb: #8DB08E; --blush: #4A3530; --sage: #2E3A2E; --tape: rgba(222, 205, 160, .7); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper) var(--grain); color: var(--ink); font: 17px/1.6 var(--serif); }
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(34px, 6vw, 58px); }
h2 { font-size: clamp(26px, 4vw, 36px); }
h3 { font-size: 21px; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.eyebrow { color: var(--accent); font-family: var(--type); letter-spacing: .08em; text-transform: uppercase; font-size: 13px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hand { font-family: var(--hand); font-weight: 700; letter-spacing: 0; }

/* Header and footer */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 90%, transparent);
       backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px dashed color-mix(in srgb, var(--ink) 22%, transparent); }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--hand); font-weight: 700; font-size: 30px; line-height: 1; }
.brand img { width: 34px; height: 34px; border-radius: 8px; transform: rotate(-4deg); box-shadow: 0 2px 4px rgba(0,0,0,.18); }
.top nav { margin-left: auto; display: flex; gap: 20px; font: 14px var(--type); }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { color: var(--accent); text-decoration: underline wavy; text-underline-offset: 5px; }
@media (max-width: 600px) { .top nav a.hide-sm { display: none; } }
footer { position: relative; margin-top: 70px; padding: 34px 0 44px; font: 14px var(--type); color: var(--card-ink); background: var(--card-paper) var(--grain); }
footer::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 13px; background: var(--card-paper);
  clip-path: polygon(0 60%, 3% 20%, 6% 70%, 10% 30%, 14% 80%, 18% 25%, 22% 65%, 27% 15%, 31% 70%, 36% 35%, 40% 85%, 45% 20%, 49% 60%, 54% 30%, 58% 80%, 63% 25%, 67% 70%, 72% 15%, 76% 65%, 81% 35%, 85% 80%, 90% 20%, 94% 70%, 97% 30%, 100% 60%, 100% 100%, 0 100%); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
footer a { color: #7A4A3C; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: var(--accent-ink);
       text-decoration: none; font-weight: 600; padding: 13px 20px; border-radius: 10px; border: 0; font-size: 16px; cursor: pointer; font-family: var(--sans); }
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn.soft { background: var(--blush); color: var(--accent); }
.btn.small { padding: 9px 14px; font-size: 14px; border-radius: 9px; }
.btn[disabled] { opacity: .5; cursor: default; }
.stamp-btn { display: inline-block; font: 17px var(--type); text-transform: uppercase; letter-spacing: .08em; color: #fff; background: var(--accent);
  padding: 14px 24px; border-radius: 4px; text-decoration: none; transform: rotate(-1.5deg);
  box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 0 5px rgba(255,255,255,.75), 0 3px 0 rgba(0,0,0,.18); transition: transform .15s; }
.stamp-btn:hover { transform: rotate(0) scale(1.03); }

/* Paper objects */
.tape { position: relative; }
.tape::before { content: ""; position: absolute; z-index: 2; top: -13px; left: 50%; width: 92px; height: 26px; background: var(--tape);
  transform: translateX(-50%) rotate(-4deg); box-shadow: 0 1px 2px rgba(0,0,0,.1);
  clip-path: polygon(0 8%, 4% 0, 8% 10%, 12% 0, 88% 0, 92% 12%, 96% 0, 100% 10%, 100% 92%, 96% 100%, 92% 88%, 88% 100%, 12% 100%, 8% 90%, 4% 100%, 0 90%); }
.polaroid { margin: 0; background: #FFFEFA; padding: 10px 10px 0; box-shadow: 0 1px 1px rgba(0,0,0,.08), 0 12px 26px -8px rgba(50, 30, 15, .4); }
.polaroid img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.polaroid figcaption { font: 700 23px/1 var(--hand); color: #3A302A; text-align: center; padding: 10px 4px 14px; }
.print { margin: 0; background: #FFFEFA; padding: 8px; box-shadow: 0 12px 26px -10px rgba(50, 30, 15, .45); }
.print img { border-radius: 4px; }
.print figcaption { font: 700 22px/1.1 var(--hand); color: #3A302A; text-align: center; padding: 10px 4px 4px; }
.sticky { background: #F8E27C; color: #3A302A; padding: 18px 20px 20px; font: 600 22px/1.25 var(--hand); box-shadow: 0 14px 24px -12px rgba(60, 40, 0, .45); }
.sticky b { display: block; font-weight: 700; font-size: 26px; margin-bottom: 6px; }
.sticky span { display: block; }

/* Landing */
.scrap h2.hand { font-size: clamp(40px, 6vw, 60px); line-height: 1; margin-bottom: 26px; }
.s-hero { padding: 56px 0 30px; overflow-x: clip; }
.s-hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.s-hero h1 { font-family: var(--hand); font-weight: 700; font-size: clamp(54px, 8vw, 92px); line-height: .95; margin-bottom: 20px; }
.scribble { position: relative; white-space: nowrap; color: var(--accent); }
.scribble::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: -.08em; height: .28em;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' preserveAspectRatio='none'><path d='M3 15 C 60 5, 120 20, 180 10 S 270 8, 297 13' fill='none' stroke='%23B8432E' stroke-width='4' stroke-linecap='round'/><path d='M20 20 C 90 12, 170 22, 285 16' fill='none' stroke='%23B8432E' stroke-width='2.5' stroke-linecap='round' opacity='.7'/></svg>") no-repeat center / 100% 100%; }
.s-hero .lead { font-size: 19.5px; max-width: 32em; }
.s-hero .cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 26px; }
.aside { position: relative; font: 700 24px/1.05 var(--hand); color: var(--muted); padding-left: 64px; }
.aside .arrow { position: absolute; left: -6px; top: -26px; width: 64px; transform: scaleX(-1) rotate(-20deg); color: var(--muted); }
.collage { position: relative; aspect-ratio: 1 / 1.12; width: 100%; }
.collage > * { position: absolute; }
.c1 { width: 54%; left: 0; top: 6%; transform: rotate(-6deg); z-index: 2; }
.c3 { width: 34%; right: 2%; top: 0; transform: rotate(4deg); z-index: 1; }
.c4 { width: 50%; left: 3%; top: 65%; transform: rotate(-2.5deg); z-index: 4; }
.c2 { width: 40%; right: 4%; top: 58%; transform: rotate(5deg); z-index: 3; }
@media (max-width: 900px) {
  .s-hero .wrap { grid-template-columns: 1fr; }
  .collage { max-width: 540px; margin: 20px auto 30px; }
}
@media (max-width: 520px) {
  .sticky { padding: 12px 12px 14px; font-size: 17px; } .sticky b { font-size: 20px; margin-bottom: 2px; }
  .polaroid { padding: 6px 6px 0; } .polaroid figcaption { font-size: 18px; padding: 7px 2px 9px; }
  .aside { padding-left: 0; } .aside .arrow { display: none; }
}

.s-tin { padding: 70px 0 30px; }
.icards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px 30px; }
.icard { position: relative; background-color: var(--card-paper); color: var(--card-ink); padding: 18px 24px 22px; min-height: 250px;
  background-image: var(--grain);
  box-shadow: 0 1px 1px rgba(0,0,0,.08), 0 16px 28px -14px rgba(50, 30, 15, .45); }
.icard::before { content: ""; position: absolute; left: 0; right: 0; top: 66px; height: 2px; background: var(--margin); }
.icard:nth-child(3n+1) { transform: rotate(-1.2deg); }
.icard:nth-child(3n+2) { transform: rotate(.9deg) translateY(10px); }
.icard:nth-child(3n) { transform: rotate(-.4deg); }
.icard .no { position: absolute; top: 14px; right: 18px; font: 12px var(--type); color: #9A8B7C; letter-spacing: .06em; }
.icard h3 { font: 700 32px/1 var(--hand); margin: 8px 0 22px; height: 30px; color: #2A2320; }
.icard p { font: 15px/28px var(--type); margin: 0 -24px; padding: 0 24px 28px;
  background: repeating-linear-gradient(to bottom, transparent 0 27px, var(--rule) 27px 28px); }
@media (max-width: 900px) { .icards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .icards { grid-template-columns: 1fr; } .icard { transform: none !important; } }

.s-dinner { padding: 80px 0 40px; }
.s-dinner .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.dinner-photos { position: relative; aspect-ratio: 1 / 1.26; width: 100%; }
.dinner-photos .polaroid { position: absolute; width: 50%; }
.d1 { left: 0; top: 0; transform: rotate(-5deg); }
.d2 { left: 48%; top: 4%; transform: rotate(4deg); z-index: 2; }
.d3 { left: 25%; top: 52%; transform: rotate(-1.5deg); z-index: 3; }
.dinner-card { background: var(--card-paper) var(--grain); color: var(--card-ink); padding: 28px 30px 26px; transform: rotate(1deg);
  box-shadow: 0 16px 30px -14px rgba(50, 30, 15, .45); border-top: 26px solid #D9C8A8; }
.dinner-card h2.hand { font-size: clamp(36px, 4.6vw, 50px); margin-bottom: 14px; color: #2A2320; }
.dinner-card > p { font-size: 17px; }
.plan { list-style: none; margin: 18px 0 0; padding: 0; font: 700 25px/1.2 var(--hand); }
.plan li { display: flex; gap: 16px; padding: 7px 0; border-bottom: 1px dashed #CDBFA8; }
.plan li:last-child { border-bottom: 0; color: var(--accent); }
.plan time { font: 15px/1.9 var(--type); color: #8A7B6C; min-width: 46px; }
@media (max-width: 860px) {
  .s-dinner .wrap { grid-template-columns: 1fr; }
  .dinner-photos { max-width: 460px; margin: 0 auto; }
}

.s-peek { padding: 70px 0 20px; }
.prints { display: flex; gap: 30px; overflow-x: auto; padding: 24px 10px 34px; scroll-snap-type: x mandatory; }
.prints .print { flex: 0 0 210px; scroll-snap-align: start; }
.prints .print:nth-child(odd) { transform: rotate(-1.8deg); }
.prints .print:nth-child(even) { transform: rotate(1.6deg) translateY(12px); }

.s-more { padding: 60px 0 30px; }
.s-more .wrap { display: grid; grid-template-columns: 1.4fr .6fr; gap: 40px; align-items: center; }
.notebook { position: relative; background-color: #FFFEF8; color: var(--card-ink); padding: 26px 30px 28px 70px;
  background-image: linear-gradient(to right, transparent 52px, var(--margin) 52px, var(--margin) 54px, transparent 54px);
  box-shadow: 0 16px 30px -14px rgba(50, 30, 15, .45); transform: rotate(-.6deg); }
.notebook h2.hand { font-size: 44px; margin-bottom: 8px; color: #2A2320; }
.notebook ul { list-style: none; margin: 0 -30px 0 -70px; padding: 0 30px 32px 70px;
  background: repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px); }
.notebook li { position: relative; font-size: 16.5px; line-height: 32px; margin: 0; }
.notebook li::before { content: "✓"; position: absolute; left: -38px; top: -2px; font: 700 28px/32px var(--hand); color: var(--accent); }
.m1 { transform: rotate(4deg); }
@media (max-width: 760px) { .s-more .wrap { grid-template-columns: 1fr; } .m1 { max-width: 300px; margin: 0 auto; } .notebook { padding-left: 64px; } }

.s-private { padding: 70px 0 10px; text-align: center; }
.s-private p { max-width: 34em; margin: 0 auto 26px; font-size: 18px; }
.stamps { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px 26px; margin-bottom: 34px; }
.stamps span { font: 22px var(--type); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); padding: 8px 16px;
  border: 3px solid currentColor; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 4px currentColor; opacity: .85; }
.stamps span:nth-child(1) { transform: rotate(-6deg); }
.stamps span:nth-child(2) { transform: rotate(3deg); }
.stamps span:nth-child(3) { transform: rotate(-2deg); }
@media (prefers-color-scheme: dark) {
  .s-hero .lead, .s-private p { color: var(--ink); }
}

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.check { list-style: none; padding: 0; margin: 0; }
.check li { padding-left: 30px; position: relative; margin: 10px 0; }
.check li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--herb); font-weight: 700; }

/* Document pages */
.doc { padding: 48px 0 20px; }
.doc h2 { font-size: 24px; margin-top: 1.6em; }
.doc li { margin: 6px 0; }
.note { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 18px 0; }

/* Recipe view (shared links and the web version) */
.recipe-hero { position: relative; background: var(--blush); max-width: 1100px; margin: 0 auto; overflow: hidden; }
@media (min-width: 820px) { .recipe-hero { margin-top: 20px; border-radius: 24px; } .recipe-hero img { max-height: 420px; } }
.recipe-hero img { width: 100%; max-height: 460px; object-fit: cover; }
.recipe-hero .ph { height: 180px; display: grid; place-items: center; font-size: 64px; }
.recipe-body { max-width: 760px; margin: -36px auto 0; position: relative; background: var(--paper); border-radius: 26px 26px 0 0; padding: 26px 20px 20px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 18px; }
.meta span { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 14.5px; }
.meta b { font-weight: 650; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; }
.card h2 { font-size: 26px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ings { list-style: none; padding: 0; margin: 0; }
.ings li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ings li:last-child { border-bottom: 0; }
.ings .tick { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); margin-top: 2px; }
.ings li.done { opacity: .45; text-decoration: line-through; }
.ings li.done .tick { background: var(--herb); border-color: var(--herb); }
.ings .amt { font-weight: 650; }
.ings .prep { color: var(--muted); }
.group-name { color: var(--accent); font-weight: 650; margin: 14px 0 2px; font-size: 15.5px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 4px 0 14px 42px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; font-family: var(--sans); }
.stepper button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--accent); font-size: 20px; cursor: pointer; }
.stepper button:hover { background: var(--blush); }
.stepper span { min-width: 64px; text-align: center; font-weight: 600; font-size: 15px; }
.nut { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nut div { background: var(--paper); border-radius: 12px; padding: 10px; text-align: center; }
.nut b { display: block; font-size: 19px; }
.nut small { color: var(--muted); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }

/* Cook mode */
.cook { position: fixed; inset: 0; background: var(--paper); z-index: 50; display: none; flex-direction: column; }
.cook.on { display: flex; }
.cook header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cook header .t { flex: 1; font-family: var(--serif); font-weight: 600; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook main { flex: 1; overflow: auto; padding: 28px 22px; max-width: 820px; margin: 0 auto; width: 100%; }
.cook .num { color: var(--accent); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; }
.cook .big { font-size: clamp(24px, 3.6vw, 34px); line-height: 1.4; font-family: var(--serif); font-weight: 500; }
.cook footer { display: flex; gap: 12px; padding: 14px 18px 22px; border-top: 1px solid var(--line); margin: 0; justify-content: space-between; }
.timers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.timer { background: var(--sage); color: var(--ink); border: 0; border-radius: 12px; padding: 10px 14px; font-size: 16px; font-weight: 600; cursor: pointer; font-family: var(--sans); }
.timer.running { background: var(--herb); color: #fff; }
.timer.done { background: var(--accent); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }

/* Library (web version) */
.lib-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 26px 0 14px; }
.search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; }
.search input { flex: 1; border: 0; background: transparent; font: inherit; color: var(--ink); padding: 12px 0; outline: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 14px; font-size: 14.5px; cursor: pointer; font-family: var(--sans); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; margin-top: 14px; }
.tile { text-decoration: none; color: var(--ink); cursor: pointer; }
.tile .img { aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; background: var(--blush); display: grid; place-items: center; font-size: 44px; }
.tile .img img { width: 100%; height: 100%; object-fit: cover; }
.tile h3 { font-size: 17.5px; margin: 10px 0 2px; }
.tile .muted { font-size: 13.5px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.back { background: none; border: 0; color: var(--accent); font: 600 16px var(--sans); cursor: pointer; padding: 14px 0 0; }

@media print {
  .top, footer, .actions, .stepper, .back, .cook { display: none !important; }
  body { background: #fff; color: #000; }
  .recipe-body { margin: 0; }
  .card { border: 0; padding: 0; }
}
