/* The Allotment Cookbook — a classic recipe-book look in the spirit of
   Giorgio Locatelli's books: Bodoni titles, ingredients column on the left
   page, method alongside, the dish photographed on the facing page. */

:root{
  --paper:#fbfaf6; --paper-edge:#f1efe8; --ink:#2b2622; --soft:#766e62;
  --rule:#e4dfd4; --accent:#9c3b22; --accent-soft:#b6603f;
  --serif:'Bodoni Moda',"Didot",Georgia,'Times New Roman',serif;
  --shadow:0 24px 60px rgba(48,38,22,.18);
  --fs:1; /* reader text-size multiplier, set by the A−/A+ controls */
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
html{scroll-behavior:smooth;}
body{font-family:var(--serif);color:var(--ink);line-height:1.5;
  background:#d7cdb8 radial-gradient(1200px 600px at 50% -10%,#ece4d4,#d7cdb8 70%);
  min-height:100vh;-webkit-font-smoothing:antialiased;
  display:flex;flex-direction:column;}

/* ── top bar ── */
.bar{display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:14px 22px;background:rgba(43,38,34,.92);color:#f4ecdc;}
.bar a{color:#f4ecdc;text-decoration:none;}
.bar .home{font-size:14px;letter-spacing:.04em;opacity:.85;}
.bar .home:hover{opacity:1;}
.bar .bar-title{font-size:15px;letter-spacing:.32em;text-transform:uppercase;font-weight:500;}
/* on the landing page the big masthead already says it — avoid repeating it */
body[data-view="home"] .bar .bar-title{display:none;}
/* and you're already at the contents, so hide that link there */
body[data-view="home"] .to-contents{display:none;}
.bar .to-contents{font-size:13px;letter-spacing:.12em;text-transform:uppercase;
  border:1px solid rgba(244,236,220,.5);height:32px;padding:0 14px;border-radius:2px;
  display:inline-flex;align-items:center;}
.bar .to-contents:hover{background:rgba(244,236,220,.12);}
.bar .opts{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.opt{font-family:var(--serif);font-size:13px;letter-spacing:.06em;color:#f4ecdc;
  background:transparent;border:1px solid rgba(244,236,220,.5);border-radius:2px;
  height:32px;padding:0 12px;cursor:pointer;line-height:1;display:inline-flex;align-items:center;}
.opt:hover{background:rgba(244,236,220,.12);}
.opt-toggle{padding:0 11px;}
.ic-glasses{width:23px;height:23px;display:block;color:inherit;}
.ic-glasses circle,.ic-glasses path{fill:none;stroke:currentColor;stroke-width:1.5;
  stroke-linecap:round;stroke-linejoin:round;}
.opt-toggle[aria-pressed="true"]{background:#f4ecdc;border-color:#f4ecdc;color:#2b2622;}

/* ── book stage (fills the whole page) ── */
.stage{flex:1;display:flex;flex-direction:column;padding:0;}
.book{width:100%;flex:1;display:flex;flex-direction:column;}

/* a sheet of the book */
.sheet{background:var(--paper);position:relative;overflow:hidden;flex:1;
  animation:turn .5s ease both;}
@keyframes turn{from{opacity:0;transform:translateY(10px) rotateX(2deg);}to{opacity:1;transform:none;}}

/* ── cover ── */
.cover{min-height:min(78vh,720px);display:flex;flex-direction:column;
  align-items:center;justify-content:center;text-align:center;gap:18px;
  padding:8vw 8vw;background:
    radial-gradient(120% 90% at 50% 0%,#fbf6ec,var(--paper) 60%);
  border:1px solid var(--paper-edge);}
.cover .crest{font-size:13px;letter-spacing:.4em;text-transform:uppercase;color:var(--accent);}
.crest-link{color:inherit;text-decoration:none;}
.crest-link:hover{text-decoration:underline;}
.cover h1{font-size:clamp(40px,8vw,92px);font-weight:900;line-height:1.02;
  letter-spacing:.01em;}
.cover .sub{font-style:italic;font-size:clamp(16px,2.4vw,22px);color:var(--soft);}
.cover .hr{width:120px;height:1px;background:var(--rule);margin:8px 0;}
.cover .blurb{max-width:30em;color:var(--soft);font-size:16px;}
.btn{font-family:var(--serif);font-size:14px;letter-spacing:.18em;text-transform:uppercase;
  color:var(--paper);background:var(--accent);border:0;border-radius:2px;
  padding:13px 26px;cursor:pointer;text-decoration:none;display:inline-block;
  transition:background .15s;}
.btn:hover{background:var(--accent-soft);}
.btn-ghost{background:transparent;color:var(--accent);border:1px solid var(--accent);}
.btn-ghost:hover{background:rgba(156,59,34,.08);}
.cover-btns{display:flex;gap:12px;flex-wrap:wrap;justify-content:center;margin-top:6px;}

/* ── introduction / ethos ── */
.intro-page{padding:clamp(34px,6vw,80px) 22px;}
.intro-wrap{max-width:880px;margin:0 auto;text-align:center;}
.intro-wrap h2{font-size:clamp(30px,5vw,52px);font-weight:900;margin-bottom:8px;}
.intro-lead{font-size:calc(17px * var(--fs));font-style:italic;color:var(--soft);
  line-height:1.6;max-width:44em;margin:0 auto 30px;}
.eth{text-align:left;max-width:46em;margin:0 auto 22px;
  border-top:1px solid var(--rule);padding-top:18px;}
.eth h3{font-size:calc(13px * var(--fs));letter-spacing:.18em;text-transform:uppercase;
  color:var(--accent);margin-bottom:7px;}
.eth p{font-size:calc(16px * var(--fs));line-height:1.66;color:#3a342c;}
.eth-list{list-style:none;margin-top:2px;display:flex;flex-direction:column;gap:9px;}
.eth-list li{font-size:calc(16px * var(--fs));line-height:1.55;color:#3a342c;}
.eth-list strong{color:var(--ink);}
.donate{margin:34px auto 4px;text-align:center;max-width:46em;}
.donate-cap{font-size:calc(14px * var(--fs));font-style:italic;color:var(--soft);margin-bottom:14px;}
#donate-slot{display:flex;justify-content:center;}
.intro-wrap .cover-btns{margin-top:30px;}
.intro-link{text-align:center;margin-bottom:24px;}
.intro-link a{font-style:italic;}

/* ── contents ── */
.contents{padding:clamp(28px,5vw,64px) clamp(24px,7vw,96px);min-height:min(70vh,680px);}
.contents h2{font-size:clamp(30px,5vw,54px);font-weight:900;text-align:center;}
.contents .lead{text-align:center;font-style:italic;color:var(--soft);margin:6px 0 26px;}
.sortbar{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-bottom:30px;}
.sortbar span{align-self:center;font-size:12px;letter-spacing:.16em;text-transform:uppercase;color:var(--soft);margin-right:4px;}
.sortbar button{font-family:var(--serif);font-size:13px;letter-spacing:.08em;
  background:transparent;border:1px solid var(--rule);color:var(--ink);
  padding:7px 15px;border-radius:2px;cursor:pointer;transition:.15s;}
.sortbar button:hover{border-color:var(--accent-soft);}
.sortbar button[aria-current="true"]{background:var(--ink);color:var(--paper);border-color:var(--ink);}

.toc-group{margin:0 auto 30px;max-width:680px;}
.toc-group > h3{font-size:14px;letter-spacing:.22em;text-transform:uppercase;
  color:var(--accent);border-bottom:1px solid var(--rule);
  padding-bottom:8px;margin-bottom:6px;display:flex;align-items:center;gap:12px;}
.toc-ph{display:flex;align-items:center;gap:12px;}
.toc-ph img,.ph-dot{width:34px;height:34px;border-radius:50%;object-fit:cover;
  background:var(--paper-edge);border:1px solid var(--rule);display:grid;place-items:center;
  font-size:13px;color:var(--soft);letter-spacing:0;}
.toc-item{display:flex;align-items:baseline;gap:8px;width:100%;background:transparent;
  border:0;cursor:pointer;font-family:var(--serif);text-align:left;
  padding:11px 2px;color:var(--ink);}
.toc-item:hover .toc-name{color:var(--accent);}
.toc-name{font-size:calc(18px * var(--fs));}
.toc-dots{flex:1;border-bottom:1.5px dotted var(--rule);transform:translateY(-4px);}
.toc-meta{font-size:12.5px;font-style:italic;color:var(--soft);white-space:nowrap;}

/* merged cover masthead, atop the contents */
.masthead{text-align:center;max-width:48em;margin:0 auto 26px;padding-bottom:24px;
  border-bottom:1px solid var(--rule);}
.cover-title{font-size:clamp(36px,7vw,78px);font-weight:900;line-height:1.02;
  letter-spacing:.01em;margin:0 0 10px;}
.masthead .crest{font-size:13px;letter-spacing:.3em;text-transform:uppercase;
  color:var(--accent);margin-bottom:16px;}
.masthead .sub{font-style:italic;color:var(--soft);font-size:clamp(15px,2.2vw,20px);margin-bottom:14px;}
.masthead .blurb{max-width:42em;margin:0 auto 14px;color:var(--soft);font-size:16px;line-height:1.62;}
.ethos-link a{font-style:italic;}

/* ── recipe page: single flow, photo floated so the text wraps around it ── */
.recipe-page{padding:clamp(28px,4vw,64px) clamp(26px,4vw,72px) 56px;position:relative;}
.r-photo{float:right;width:clamp(220px,42%,400px);margin:6px 0 22px 32px;}
.r-photo img{width:100%;height:auto;max-height:64vh;object-fit:cover;border-radius:2px;
  box-shadow:0 16px 40px rgba(48,38,22,.16);display:block;}
.ingredients{margin-top:18px;}
.method{margin-top:20px;}

/* centred page number (folio), no circle */
.folio{position:absolute;left:0;right:0;bottom:18px;text-align:center;
  font-size:calc(12px * var(--fs));letter-spacing:.18em;color:var(--soft);}
.photo-ph{aspect-ratio:4/5;display:grid;place-items:center;border-radius:2px;
  text-align:center;color:var(--soft);font-style:italic;padding:30px;
  background:repeating-linear-gradient(45deg,#f1ede3,#f1ede3 14px,#e9e3d4 14px,#e9e3d4 28px);}

.runhead{display:flex;justify-content:space-between;font-size:11.5px;
  letter-spacing:.22em;text-transform:uppercase;color:var(--soft);margin-bottom:30px;}
.kicker{font-style:italic;color:var(--accent-soft);font-size:16px;}
.r-title{font-size:calc(clamp(22px,3vw,38px) * var(--fs));font-weight:900;line-height:1.06;margin:4px 0 14px;}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:18px;}
.chip{font-size:11px;letter-spacing:.12em;text-transform:uppercase;
  border:1px solid var(--rule);border-radius:999px;padding:5px 12px;color:var(--soft);}
.chip-month{border-color:var(--accent-soft);color:var(--accent);}
.chip-plot{background:var(--ink);color:var(--paper);border-color:var(--ink);}
.r-intro{font-size:calc(14px * var(--fs));line-height:1.64;text-align:justify;hyphens:auto;
  color:#3a342c;margin:4px 0 6px;}
.r-yield{font-style:italic;color:var(--soft);font-size:calc(13px * var(--fs));margin-bottom:18px;}

/* "cut to the recipe" — hide the opening history */
.intro-block{margin-bottom:6px;}

/* the cook's bio (sits within the story) */
.bio{display:flex;gap:14px;align-items:flex-start;margin:14px 0 4px;}
.bio img,.bio-ph{width:54px;height:54px;border-radius:50%;object-fit:cover;flex:none;
  background:var(--paper-edge);border:1px solid var(--rule);display:grid;place-items:center;
  font-family:var(--serif);font-size:21px;color:var(--soft);}
.bio-name{font-size:calc(11.5px * var(--fs));letter-spacing:.08em;text-transform:uppercase;
  color:var(--accent);margin-bottom:4px;}
.bio-line{font-size:calc(13.5px * var(--fs));line-height:1.55;color:#3a342c;font-style:italic;}
.cut-btn{font-family:var(--serif);font-size:calc(11.5px * var(--fs));letter-spacing:.04em;
  background:transparent;border:0;color:var(--accent);cursor:pointer;padding:2px 0;}
.cut-btn:hover{color:var(--accent-soft);text-decoration:underline;}

/* ingredients sit in a narrow left column; the method is indented alongside */
.r-cols{display:grid;grid-template-columns:minmax(140px,0.72fr) 1.7fr;
  gap:clamp(28px,4.5vw,64px);margin-top:26px;}
.col-h{font-size:calc(11px * var(--fs));letter-spacing:.2em;text-transform:uppercase;
  color:var(--accent);margin-bottom:14px;}
.ingredients ul{list-style:none;}
.ingredients li{font-size:calc(13.5px * var(--fs));line-height:1.5;padding:5px 0;}

/* recipe scaling: change any quantity and the rest follow */
.scale-hint{font-size:calc(11.5px * var(--fs));font-style:italic;color:var(--soft);
  line-height:1.5;margin:0 0 22px;}
.scale-reset{font-family:var(--serif);font-style:normal;font-size:calc(11.5px * var(--fs));
  background:transparent;border:0;border-bottom:1px solid var(--accent-soft);
  color:var(--accent);cursor:pointer;padding:0 0 1px;}
.scale-reset:hover{border-bottom-color:var(--accent);}
.qty{font-family:var(--serif);font-size:calc(13.5px * var(--fs));color:var(--accent);
  vertical-align:baseline;border:0;border-bottom:1px dashed var(--accent-soft);
  background:transparent;padding:0 1px 1px;text-align:right;}
.qty:focus{outline:none;border-bottom-style:solid;border-bottom-color:var(--accent);
  background:rgba(156,59,34,.07);}
.r-yield .qty{font-style:normal;}

/* plain-text instructions, each tickable (strikes through when done) */
.steps{display:block;}
.step{display:flex;gap:12px;align-items:flex-start;margin-bottom:13px;}
.tick{flex:none;width:17px;height:17px;margin-top:4px;padding:0;background:transparent;
  border:1.5px solid var(--accent-soft);border-radius:3px;display:grid;place-items:center;
  cursor:pointer;transition:background .15s,border-color .15s;}
.tick .chk{font-size:12px;line-height:1;color:var(--paper);opacity:0;}
.step-txt{font-size:calc(14px * var(--fs));line-height:1.64;text-align:justify;hyphens:auto;cursor:pointer;}
.step:hover .tick{border-color:var(--accent);}
.step.done .tick{background:var(--accent);border-color:var(--accent);}
.step.done .tick .chk{opacity:1;}
.step.done .step-txt{text-decoration:line-through;color:var(--soft);}
.tick:focus-visible{outline:2px solid var(--accent-soft);outline-offset:3px;}

/* inline "set timer" button */
.timer-btn{display:inline-block;margin-left:6px;font-family:var(--serif);
  font-size:calc(11px * var(--fs));line-height:1.2;background:transparent;
  border:1px solid var(--accent-soft);color:var(--accent);border-radius:999px;
  padding:1px 9px;cursor:pointer;white-space:nowrap;vertical-align:baseline;}
.timer-btn:hover{background:rgba(156,59,34,.09);}
.ic-timer{width:13px;height:13px;vertical-align:-2px;}
.ic-timer line,.ic-timer circle{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;}

/* ── running timers (corner stack) ── */
.timers{position:fixed;right:16px;bottom:16px;z-index:50;display:flex;flex-direction:column;
  gap:10px;width:min(320px,92vw);}
.timer-card{display:flex;align-items:center;gap:12px;background:var(--paper);
  border:1px solid var(--rule);border-radius:12px;box-shadow:0 14px 34px rgba(48,38,22,.22);
  padding:10px 12px;animation:t-in .25s ease;}
@keyframes t-in{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:none;}}
.timer-card.done{border-color:var(--accent);animation:t-done 2.2s ease;}
@keyframes t-done{0%,100%{transform:scale(1);box-shadow:0 14px 34px rgba(48,38,22,.22);}
  15%{transform:scale(1.05);box-shadow:0 0 0 4px rgba(156,59,34,.25),0 14px 34px rgba(48,38,22,.22);}
  30%{transform:scale(1);}45%{transform:scale(1.03);}60%{transform:scale(1);}}
.ring-wrap{position:relative;flex:none;width:52px;height:52px;}
.ring{width:52px;height:52px;transform:rotate(-90deg);}
.ring-track{fill:none;stroke:var(--rule);stroke-width:5;}
.ring-prog{fill:none;stroke:var(--accent);stroke-width:5;stroke-linecap:round;
  transition:stroke-dashoffset 1s linear;}
.ring-min{position:absolute;inset:0;display:grid;place-items:center;
  font-family:var(--serif);font-size:14px;color:var(--ink);}
.timer-card.done .ring-min{color:var(--accent);}
.timer-body{flex:1;min-width:0;font-family:var(--serif);}
.timer-state{font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--soft);display:block;}
.timer-card.done .timer-state{color:var(--accent);font-weight:700;}
.timer-label{font-size:12.5px;line-height:1.35;color:var(--ink);margin-top:2px;
  display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.timer-x{flex:none;align-self:flex-start;background:transparent;border:0;font-size:20px;
  line-height:1;color:var(--soft);cursor:pointer;padding:0 2px;}
.timer-x:hover{color:var(--accent);}

/* ── completion flourish (auto-hides; the timer card stays) ── */
.timer-pop{position:fixed;inset:0;z-index:60;display:grid;place-items:center;
  pointer-events:none;padding:20px;}
.pop-inner{background:var(--paper);border:1px solid var(--accent);border-radius:18px;
  box-shadow:0 28px 70px rgba(48,38,22,.34);padding:26px 30px;text-align:center;
  max-width:min(420px,88vw);font-family:var(--serif);animation:t-pop 4s ease forwards;}
.pop-check{color:var(--accent);}
.pop-check .ic-timer{width:42px;height:42px;}
.pop-check .ic-timer line,.pop-check .ic-timer circle{stroke-width:1.5;}
.pop-title{font-size:24px;font-weight:900;margin:4px 0 8px;}
.pop-text{font-size:14px;color:#3a342c;line-height:1.55;}
@keyframes t-pop{0%{opacity:0;transform:scale(.85);}7%{opacity:1;transform:scale(1.05);}
  13%{transform:scale(1);}82%{opacity:1;}100%{opacity:0;transform:scale(.97);}}

@media (prefers-reduced-motion:reduce){
  .timer-card,.timer-card.done,.pop-inner{animation:none;}
}
.reset-btn{margin:0 0 16px;font-family:var(--serif);font-size:calc(12px * var(--fs));
  background:transparent;border:1px solid var(--rule);border-radius:2px;
  padding:6px 14px;cursor:pointer;color:var(--soft);}
.reset-btn:hover{border-color:var(--accent-soft);color:var(--accent);}

.credit{margin-top:auto;padding-top:22px;display:flex;align-items:center;gap:12px;
  border-top:1px solid var(--rule);color:var(--soft);font-size:13.5px;}
.credit img,.credit .ph-dot{width:42px;height:42px;}
.credit .by{font-style:italic;}
.credit strong{font-style:normal;color:var(--ink);}

/* ── next link, bottom-right of the recipe page ── */
.page-nav{clear:both;display:flex;justify-content:flex-end;margin-top:30px;}
.next-link{font-family:var(--serif);font-size:calc(13px * var(--fs));letter-spacing:.04em;
  color:var(--accent);border:1px solid var(--accent-soft);border-radius:2px;
  padding:8px 16px;text-decoration:none;}
.next-link:hover{background:rgba(156,59,34,.08);}

/* ── accessible view: same page, adapted — larger text (via --fs), no photo ── */
[data-access] .r-photo{display:none;}

/* the book title sits centre-stage in the bar on tablet / desktop */
@media (min-width:761px){
  .bar{position:relative;}
  .bar .bar-title{position:absolute;left:50%;transform:translateX(-50%);
    white-space:nowrap;pointer-events:none;}
}

/* ── responsive: photo full-width above the text ── */
@media (max-width:760px){
  .r-photo{float:none;width:100%;margin:0 0 18px;}
  .r-photo img,.photo-ph{max-height:46vh;}
  .bar .bar-title{display:none;}
}
