/* Bun in the Oven: a baking day on a pastry-marble counter. Every section (the invitation too) sits in an old-school
   enamel baking sheet with a cocoa rim, the name ideas go up on a felt letter board, and the wishes are recipe cards
   held to their sheet by little kitchen magnets. Cinnamon, sprinkles, baker's twine and a swipe of icing are left
   on the counter between the sheets. All of it is Gemini's (tools/theme-art/bun_kitchen.py), kept whole:
   border-images keep every corner as drawn. Colors and fonts come from vars.css. */

body{background-size:760px}
@media (min-width:900px){body{background-size:1000px}}

/* the header: the far wall of the kitchen behind, the island with the oven in front (bun_hero.py sets its counter just
   under the title, with nothing on it standing in front of the title). Gemini made both twice: the wide pair for
   laptops and every screen that isn't tall, the tall pair for a phone held upright (a tall, narrow screen: a tablet
   held upright gets a header nearly square, capped at 700 px, which the wide pair fills better). The fade at the foot
   is kept short so the oven's glowing window stays clear of it. */
.hero-title{width:min(54vw, 262px)}
@media (min-width:900px){.hero-title{width:min(21vw, 290px)}}
.hero.painted::after{height:7%}
/* On a phone the header is as short as 460 px (a browser's bars take the rest), so the title shrinks with it and both
   tall layers sit a little under their middle: the counter's things clear the title and the glowing window clears
   the fade at any phone height. */
@media (max-aspect-ratio:3/4) and (max-width:700px){
  .hero-title{width:min(54vw, 262px, calc(clamp(460px, 72svh, 700px) * .4))}
  .hero.painted .layer{background-position:center 47%}
  .hero.painted .back{background-image:url(../art/hero-back-phone.webp)}
  .hero.painted .front{background-image:url(../art/hero-front-phone.webp)}
}

/* no side borders: the counter frames the page, so the sheets get the phone's width */
main{padding-left:max(12px, env(safe-area-inset-left,0px) + 8px); padding-right:max(12px, env(safe-area-inset-right,0px) + 8px)}

/* ---------- every section is a baking sheet, one picture: its rim, walls and rounded corners kept by a border-image
   (sliced past the corners' 111 px curve, drawn at 44 px) and its flat bottom stretched to the section (the build
   softens the bottom's speckle away so it never smears). One soft shadow on the counter. ---------- */
.card, .invite{position:relative; isolation:isolate; background:none}
.card{padding:32px max(26px, min(6vw, 42px)) 34px}
.invite{padding:34px max(26px, min(6vw, 42px)) 36px; margin-top:24px}
.card::before, .invite::before{content:""; display:block; position:absolute; inset:0; z-index:-1; pointer-events:none;
  border:44px solid transparent; border-radius:0; background:none;
  border-image:url(../art/sheet-1.webp) 120 fill / 44px stretch;
  filter:drop-shadow(0 1px 1px rgba(var(--shadow-rgb),.18)) drop-shadow(0 12px 14px rgba(var(--shadow-rgb),.16))}
/* the sheet as it came and turned over (its chips move, the light stays from the same side), by turns */
.col > section:nth-of-type(even) .card::before{border-image-source:url(../art/sheet-2.webp)}
section{padding-block:40px 6px}
.card > .piece:first-child{margin-top:-4px; margin-bottom:6px}
.count span{letter-spacing:.06em}

/* ---------- name ideas: up on the felt letter board in its oak frame (its corners as drawn), the felt laid as Gemini's
   own grooves, one every --g, a crease on the board's first row. Every line is a whole number of grooves tall and
   starts on a crease, and each push-in letter (pegs.js, its picture and width in pegs.css) is sized and set so both
   pegs on its back, a share .149 and .791 down its capital, sit in a crease: a name's letters span two grooves
   between pegs, the headings' and who suggested it one. Until the script runs, or for a character with no letter of
   its own, the same words show in white Barlow Condensed capitals on the same lines. ---------- */
.name-lists{--g:8px; --peg:var(--card); border:30px solid transparent; border-image:url(../art/board.webp) 46 / 30px stretch;
  background:#61392f url(../art/felt.jpg) 0 0 / 189.5px calc(var(--g) * 8) repeat; background-clip:padding-box;
  box-shadow:inset 0 3px 7px rgba(20,8,4,.55), inset 0 0 0 1px rgba(20,8,4,.3);
  padding:var(--g) 10px var(--g); row-gap:calc(var(--g) * 2); color:var(--peg); filter:drop-shadow(0 8px 10px rgba(var(--shadow-rgb),.25))}
.name-lists h3, .name-list .why, .name-lists .empty{--l:calc(var(--g) * 3); --cap:calc(var(--g) / .642)}
.name-list .nm, .name-list .nm.top{--l:calc(var(--g) * 4); --cap:calc(var(--g) * 2 / .642)}
.name-lists h3, .name-list .nm, .name-list .why, .name-lists .empty{--peg-h:calc(var(--cap) * 1.22); line-height:var(--l);
  color:var(--peg); text-transform:uppercase; text-shadow:0 1px 1px rgba(var(--shadow-rgb),.55); margin:0}
.name-lists h3{border-bottom:0; padding:0; font:600 15px/var(--l) "Barlow Condensed", var(--f-caps); letter-spacing:.2em}
.name-lists .empty{font:500 15px/var(--l) "Barlow Condensed", var(--f-body); letter-spacing:.05em}
.name-list li{border-bottom:0; padding:0 0 var(--g); row-gap:0; align-items:start}
.name-list .nm, .name-list .nm.top{font:600 27px/var(--l) "Barlow Condensed", var(--f-caps); letter-spacing:.1em; overflow-wrap:break-word}
.name-list .why{opacity:.95; font:500 15px/var(--l) "Barlow Condensed", var(--f-body); font-style:normal; letter-spacing:.05em}
.name-list .why b{font-weight:600}
.name-lists .del{height:calc(var(--g) * 3); padding:0; line-height:calc(var(--g) * 3)}
/* the letters: a word kept whole, a letter's gap between words; each letter hung from its line's top so its top peg
   lands on the crease one groove down */
.peg-line{display:inline; letter-spacing:0; text-shadow:none}
.peg-word{display:inline-block; white-space:nowrap; margin-right:calc(var(--peg-h) * .28); vertical-align:top}
.peg-word:last-child{margin-right:0}
.peg{display:inline-block; height:var(--peg-h); margin-right:calc(var(--peg-h) * .015); background:no-repeat center / 100% 100%;
  vertical-align:top; position:relative; top:calc(var(--g) - var(--cap) * .209); background-image:var(--pi)}
/* the names themselves in the theme's soft colors: blush for the girls, pistachio for the boys (pegs.css) */
#names-girl .nm .peg{background-image:var(--pi-girl)}
#names-boy .nm .peg{background-image:var(--pi-boy)}
/* the girl percent and the vote count a shade deeper, so they read on the baking sheet */
.lane.girl .pct{color:color-mix(in srgb, var(--girl) 85%, var(--ink-deep))}
#vote-count{color:var(--ink)}
#names-girl .nm{color:color-mix(in srgb, var(--card) 45%, var(--girl-soft))}
#names-boy .nm{color:color-mix(in srgb, var(--card) 65%, var(--leaf))}
.peg-type{display:inline-block; vertical-align:top; position:relative; top:var(--g); height:var(--cap); line-height:var(--cap);
  font-size:calc(var(--cap) / .7)}
.peg-said{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}
.name-list .del{color:var(--peg); opacity:.8}
/* the heart counter: Gemini's cream pill pushed into the felt, its body four grooves tall with its tabs in the creases
   above and below, the empty heart or the peach one when this phone hearted it, the count in cocoa digits */
.name-lists .heart{--ph:calc(var(--g) * 4); position:relative; isolation:isolate; width:calc(var(--ph) * var(--pill-w));
  height:var(--ph); margin-top:var(--g); padding:0 calc(var(--ph) * .16) 0 calc(var(--ph) * .62); border:0; border-radius:0;
  background:none; justify-content:center; gap:0; color:var(--ink-deep); font:600 17px/1 "Barlow Condensed", var(--f-caps)}
.name-lists .heart::before{content:""; position:absolute; z-index:-1; left:calc(var(--ph) * var(--pill-side) * -1);
  right:calc(var(--ph) * var(--pill-side) * -1); top:calc(var(--ph) * var(--pill-top) * -1);
  bottom:calc(var(--ph) * var(--pill-bottom) * -1); background:url(../art/heart-off.webp) center / 100% 100% no-repeat}
.name-lists .heart[aria-pressed=true]{background:none; color:var(--ink-deep)}
.name-lists .heart[aria-pressed=true]::before{background-image:url(../art/heart-on.webp)}
.name-lists .heart svg{display:none}
.name-lists .heart > span{--peg-h:calc(var(--ph) * .56); --cap:var(--peg-h); line-height:var(--peg-h); display:inline-flex}
.name-lists .heart .peg, .name-lists .heart .peg-word{top:0; vertical-align:middle}
.name-lists .heart .peg-said + .peg-line{display:inline-flex}
.name-lists :focus-visible{outline-color:var(--card)}

/* ---------- wishes: blank recipe cards (the worn corners and the peach rule kept in the top slice, the plain middle
   stretched), each held to the sheet by a kitchen magnet pressed on near its top edge ---------- */
.note{border:30px solid transparent; border-width:30px 12px 12px; border-image:url(../art/card.webp) 74 26 26 fill / 30px 12px 12px stretch;
  background:none; box-shadow:none; border-radius:0; padding:12px 10px 8px;
  filter:drop-shadow(0 1px 1px rgba(var(--shadow-rgb),.14)) drop-shadow(0 6px 7px rgba(var(--shadow-rgb),.12))}
.note .by{color:var(--accent)}
.note .del{top:-22px; right:-4px}
/* the magnet sits on the card's top edge, mostly on the card */
html[data-note-attach="art"] .notes{--note-room:calc(var(--note-attach-h) * .3)}
html[data-note-attach="art"] .note[data-v]::after{top:calc(-30px - var(--note-attach-h) * .3)}
html[data-note-attach="art"] .note{padding-top:12px}

/* ---------- the footer, on the counter ---------- */
.foot-line{color:var(--ink-deep)}

/* ---------- what's left on the counter between the sheets: one touch tucked under a sheet's top corner, at most one
   a section, set by hand and never in a grid. On a laptop's wide counter they sit out beside the sheets. ---------- */
main{overflow-x:clip}
.col > section{position:relative}
.col > section:not(.invite)::after{content:""; position:absolute; z-index:-1; pointer-events:none; width:150px; height:150px;
  background:no-repeat center / contain; opacity:.92}
.col > section:nth-of-type(8n+2)::after{background-image:url(../art/touch-cinnamon.webp); top:-34px; right:4%; transform:rotate(12deg)}
.col > section:nth-of-type(8n+4)::after{background-image:url(../art/touch-twine.webp); top:-46px; left:2%; transform:rotate(-18deg)}
.col > section:nth-of-type(8n+6)::after{background-image:url(../art/touch-sprinkles.webp); top:-40px; right:10%; transform:rotate(30deg)}
.col > section:nth-of-type(8n+8)::after{background-image:url(../art/touch-icing.webp); top:-30px; left:8%; transform:rotate(-8deg)}
.col > section:not(.invite):not(:nth-of-type(2n))::after{display:none}
@media (min-width:900px){
  .col > section:not(.invite)::after{width:260px; height:260px}
  .col > section:nth-of-type(8n+2)::after{top:16%; right:-300px}
  .col > section:nth-of-type(8n+4)::after{top:34%; left:-300px}
  .col > section:nth-of-type(8n+6)::after{top:12%; right:-290px}
  .col > section:nth-of-type(8n+8)::after{top:40%; left:-290px}
}
