/* Buy the Croissant a coffee - a storyboard sheet you can pay on.
   Paper, pencil, one yellow marker, and the brand's deep red for the card at the end. Phone first. */
:root {
  --paper: #F8F1E3;
  --paper-hi: #FDF9F0;
  --ink: #211B1A;
  --pencil: #5C5451;
  --soft: #8D837D;
  --gold: #F7B61B;
  --butter: #FFE08A;
  --red: #A51D28;
  --red-deep: #4E0810;
  --night: #CDD6E1;
  --brick: #D9775C;
  --blue: #5B8BD0;
  --display: "Marker Felt", "Gochi Hand", "Chalkboard SE", cursive;
  --body: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --type: "Courier New", ui-monospace, monospace;
  --gutter: 20px;
  --maxw: 1120px;
  --hand: 255px 18px 225px 18px / 18px 225px 18px 255px;      /* a border drawn by hand */
}

* { box-sizing: border-box; }
html { font-size: 112.5%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  line-height: 1.5;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36  0 0 0 0 .27  0 0 0 0 .18  0 0 0 .075 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
img { height: auto; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.defs { position: absolute; width: 0; height: 0; }

/* drawn lines shimmer: the filter is swapped by a counter on <html> */
html[data-boil="0"] .rough { filter: url(#rough0); }
html[data-boil="1"] .rough { filter: url(#rough1); }
html[data-boil="2"] .rough { filter: url(#rough2); }

h1, h2, h3, .says, .count, .cup-price, .btn, legend, summary { font-family: var(--display); font-weight: 400; }
h1 { font-size: clamp(2.5rem, 11vw, 4.5rem); line-height: 1.02; margin: 0.12em 0 0; letter-spacing: 0.005em; }
h2 { font-size: clamp(1.9rem, 7.4vw, 2.9rem); line-height: 1.08; margin: 0 0 0.45em; }
h3 { font-size: 1.45rem; line-height: 1.15; margin: 0.5em 0 0.2em; }
p { margin: 0 0 1em; }
.hl { background: var(--gold); padding: 0 0.16em 0.04em; margin: 0 -0.06em; border-radius: 0.18em 0.5em 0.22em 0.6em; display: inline-block; transform: rotate(-1.2deg); }
em { font-style: normal; font-family: var(--display); font-size: 1.08em; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  padding: 0.62em 1.15em 0.7em; font-size: 1.3rem; line-height: 1.1; text-align: center; text-decoration: none; cursor: pointer;
  color: var(--ink); background: var(--gold); border: 3px solid var(--ink); border-radius: var(--hand);
  box-shadow: 3px 4px 0 var(--ink); transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s;
}
.btn:hover { transform: translate(-1px, -2px) rotate(-0.6deg); box-shadow: 5px 7px 0 var(--ink); }
.btn:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible, summary:focus-visible, .cup input:focus-visible + .cup-in, .link:focus-visible, .strip:focus-visible { outline: 4px solid var(--blue); outline-offset: 4px; }
.btn.big { font-size: 1.62rem; padding: 0.66em 1.2em 0.76em; width: 100%; }
.btn.small { font-size: 1.05rem; padding: 0.42em 0.9em 0.5em; border-width: 2.5px; box-shadow: 2px 3px 0 var(--ink); }
.btn[aria-disabled="true"] { background: var(--paper-hi); color: var(--pencil); border-style: dashed; box-shadow: none; cursor: default; }
.btn[aria-disabled="true"]:hover { transform: none; box-shadow: none; }
.link { background: none; border: 0; padding: 0.5em; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }

/* ---------------------------------------------------------------- top bar (appears once the first button has scrolled away) */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px var(--gutter); background: rgba(248, 241, 227, 0.94); backdrop-filter: blur(6px); border-bottom: 2px solid var(--ink);
  transform: translateY(-110%); transition: transform 0.25s ease;
}
.topbar.on { transform: none; }
.brand { color: var(--red); display: block; width: 132px; }
.dots svg { width: 100%; height: auto; }

/* ---------------------------------------------------------------- sheets of paper (pictures and the video sit on these) */
.sheet {
  position: relative; background: var(--paper-hi); padding: 10px 10px 4px; border-radius: 3px;
  box-shadow: 0 1px 0 rgba(60, 40, 20, 0.10), 0 18px 34px -16px rgba(60, 40, 20, 0.45);
}
.sheet::before, .sheet::after {               /* two bits of tape */
  content: ""; position: absolute; top: -12px; width: 84px; height: 26px; background: rgba(255, 236, 170, 0.78);
  box-shadow: 0 1px 2px rgba(60, 40, 20, 0.18); z-index: 2;
}
.sheet::before { left: 9%; transform: rotate(-5deg); }
.sheet::after { right: 9%; transform: rotate(4deg); }
.tilt-l { transform: rotate(-0.9deg); }
.tilt-r { transform: rotate(0.8deg); }

/* ---------------------------------------------------------------- 1. the ask */
main { padding-bottom: 0; }
section { padding: 56px var(--gutter); }
.hero { max-width: var(--maxw); margin: 0 auto; padding-top: 22px; display: grid; gap: 20px;
  grid-template-areas: "head" "art" "choose" "lead"; }
.hero .head { grid-area: head; }
.hero .sheet { grid-area: art; width: 100%; max-width: 540px; justify-self: center; }      /* on a tablet-width window the picture must not push the cups off the screen */
.hero .choose { grid-area: choose; }
.hero .lead { grid-area: lead; margin: 6px 0 0; }
.art { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--paper); border-radius: 2px; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.45s ease; pointer-events: none; }
.art[data-state="empty"] .s-empty, .art[data-state="half"] .s-half, .art[data-state="full"] .s-full, .art[data-state="joy"] .s-joy { opacity: 1; }
.doodles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.steam { opacity: 0; transition: opacity 0.6s ease 0.25s; }
.steam path { fill: none; stroke: #FFFDF6; stroke-width: 8; stroke-linecap: round; stroke-dasharray: 36 22; animation: rise 1.5s linear infinite; paint-order: stroke; filter: drop-shadow(0 0 1.2px rgba(33, 27, 26, 0.55)); }
.steam path:nth-child(2) { animation-duration: 1.2s; }
.art:not([data-state="empty"]) .steam { opacity: 0.85; }
@keyframes rise { to { stroke-dashoffset: 116; } }
.coin { opacity: 0; }
.coin-face { fill: var(--gold); stroke: var(--ink); stroke-width: 6; }
.coin-ring { fill: none; stroke: rgba(33, 27, 26, 0.55); stroke-width: 3; }
.coin text { font-family: var(--display); font-size: 44px; fill: var(--ink); }
.clink { font-family: var(--display); font-size: 84px; fill: var(--red); stroke: var(--paper-hi); stroke-width: 10; paint-order: stroke; opacity: 0; }
.clink.go { animation: clink 0.9s ease-out both; transform-box: fill-box; transform-origin: center; }
@keyframes clink { 0% { opacity: 0; transform: scale(0.3) rotate(-10deg); } 18% { opacity: 1; transform: scale(1.15) rotate(-10deg); } 30% { transform: scale(1) rotate(-10deg); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(1) rotate(-10deg) translateY(-18px); } }
.says { font-size: clamp(1.35rem, 5.6vw, 1.75rem); line-height: 1.15; text-align: center; margin: 0; padding: 0.55em 0.4em 0.5em; min-height: 2.3em; }
.says mark { background: var(--gold); color: inherit; padding: 0 0.16em; border-radius: 0.2em 0.5em 0.2em 0.5em; }

.kicker { display: flex; align-items: center; gap: 12px; margin: 0; font-family: var(--type); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pencil); }
.kicker .dots { width: 112px; color: var(--red); flex: none; }
.lead { font-size: 1.2rem; line-height: 1.45; max-width: 31em; }

.cups { border: 0; padding: 0; margin: 0.5em 0 1em; min-width: 0; }
legend { font-size: 1.45rem; padding: 0; margin-bottom: 0.5em; }
.cup-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cup { position: relative; display: block; cursor: pointer; }
.cup input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cup-in {
  display: flex; flex-direction: column; align-items: center; text-align: center; height: 100%;
  padding: 10px 6px 12px; background: var(--paper-hi); border: 2.5px solid var(--ink); border-radius: var(--hand);
  transition: transform 0.14s ease, background 0.2s, box-shadow 0.14s;
}
.cup:nth-child(2) .cup-in { border-radius: 18px 225px 18px 255px / 255px 18px 225px 18px; }
.cup:hover .cup-in { transform: translateY(-3px) rotate(-1deg); box-shadow: 3px 4px 0 var(--ink); }
.cup input:checked + .cup-in { background: var(--butter); box-shadow: 3px 4px 0 var(--ink); transform: translateY(-3px) rotate(-1.5deg); }
.cup svg { width: 54px; height: 52px; margin-bottom: 2px; overflow: visible; }
.cup svg .glass { fill: rgba(255, 255, 255, 0.6); stroke: var(--ink); stroke-width: 3.2; stroke-linejoin: round; }
.cup svg .pour { fill: #6B3A1E; }
.cup svg .foam { fill: #E9B45C; }
.cup svg .spark { fill: var(--gold); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.cup-price { font-size: 1.55rem; line-height: 1.05; }
.cup:nth-child(3) .cup-price { font-size: 1.22rem; padding: 0.16em 0; }
.cup-name { font-weight: 800; font-size: 0.86rem; line-height: 1.2; margin-top: 3px; }
.cup-note { font-size: 0.8rem; line-height: 1.25; color: var(--pencil); margin-top: 2px; }
.thanks h2 { margin-bottom: 0.4em; }
.thanks p { font-size: 1.1rem; }
[hidden] { display: none !important; }
.other-ways { margin: 0.9em 0 0; text-align: center; font-size: 1rem; }
.other-ways a { font-family: var(--display); font-size: 1.15rem; color: var(--ink); text-underline-offset: 0.2em; text-decoration-thickness: 2px; padding: 0.3em 0.2em; }
.fine { font-size: 0.9rem; color: var(--pencil); margin: 0.8em 0 0; text-align: center; }
.fine + .fine { margin-top: 0.4em; }

/* ---------------------------------------------------------------- 2 and 3. two bands: words on one side, a picture on the other */
.band { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 28px; align-items: center; }
.copy p { font-size: 1.1rem; max-width: 30em; }
.screen video { width: 100%; aspect-ratio: 16 / 9; background: #EFE7D6; border-radius: 2px; }
.screen { padding-bottom: 10px; }
.film { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin: 1.1em 0 0.4em; max-width: 430px; }
.film i { display: block; aspect-ratio: 4 / 3; border: 2px solid var(--ink); border-radius: 3px; background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(92, 84, 81, 0.28) 5px 6.5px); }
.film i.done { background: var(--gold); }
.film-note { font-family: var(--type); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.04em; color: var(--pencil); }

.plan { position: relative; }
#house { width: 100%; height: auto; overflow: visible; }
#house .line { fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
#house .thin { stroke-width: 2.2; stroke: var(--pencil); }
#house .roof { fill: var(--paper-hi); }
#house .sky { fill: #CFE5F4; }
#house .door { fill: #EFA77A; }
#house .b { stroke: var(--pencil); stroke-width: 1.6; fill: transparent; stroke-dasharray: 5 5; transition: fill 0.5s ease, stroke 0.3s; }
#house .b.laid { fill: var(--brick); stroke: var(--ink); stroke-dasharray: none; stroke-width: 2; }
#house .b.laid.alt { fill: #E38E6F; }
#house .b.mine { fill: var(--gold); stroke: var(--ink); stroke-dasharray: none; stroke-width: 3; animation: mine 1.1s ease-in-out infinite; }
#house .wait .b.laid { fill: transparent; stroke: var(--pencil); stroke-dasharray: 5 5; stroke-width: 1.6; }
@keyframes mine { 50% { fill: #FFE7A3; } }
#house .yours { font-family: var(--display); font-size: 30px; fill: var(--ink); }
#house .smoke { fill: none; stroke: var(--pencil); stroke-width: 2.6; stroke-linecap: round; }
.count { font-size: clamp(1.5rem, 6vw, 2rem); line-height: 1.15; margin: 0.2em 0 0.3em; }
.count b { font-weight: 400; background: var(--gold); padding: 0 0.16em; border-radius: 0.2em 0.5em 0.2em 0.5em; }
.brick-note { font-size: 0.9rem; color: var(--pencil); }
.tag { position: absolute; top: 4%; right: 2%; z-index: 2; font-family: var(--type); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; background: rgba(255, 236, 170, 0.92); padding: 5px 10px; transform: rotate(5deg); box-shadow: 0 1px 2px rgba(60, 40, 20, 0.2); }

/* ---------------------------------------------------------------- 4. what you get */
.gifts, .story, .ask { max-width: var(--maxw); margin: 0 auto; }
.gift-row { display: grid; gap: 16px; }
.gift { background: var(--paper-hi); border: 2.5px solid var(--ink); border-radius: var(--hand); padding: 18px 20px 12px; }
.gift:nth-child(2) { border-radius: 18px 225px 18px 255px / 255px 18px 225px 18px; }
.gift svg { width: 92px; height: 69px; overflow: visible; fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.gift svg .fill { fill: var(--butter); }
.gift p { margin-bottom: 0.6em; }

/* ---------------------------------------------------------------- 5. story strip */
.story { padding-right: 0; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: min(90vw, 560px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 18px var(--gutter) 22px 4px; margin-left: -4px; scrollbar-width: thin; }
.strip figure { margin: 0; scroll-snap-align: start; background: var(--paper-hi); padding: 8px; box-shadow: 0 12px 22px -14px rgba(60, 40, 20, 0.5); border-radius: 3px; }
.strip figure:nth-child(odd) { transform: rotate(-0.7deg); }
.strip figure:nth-child(even) { transform: rotate(0.6deg); }
.strip img { width: 100%; pointer-events: none; }

/* ---------------------------------------------------------------- 6. questions */
.ask { max-width: 760px; }
details { border-bottom: 2.5px solid var(--ink); }
summary { font-size: 1.4rem; line-height: 1.2; padding: 0.7em 2em 0.7em 0; cursor: pointer; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0.2em; top: 50%; transform: translateY(-54%); font-size: 1.7rem; transition: transform 0.2s; }
details[open] summary::after { transform: translateY(-54%) rotate(45deg); }
details p { max-width: 34em; }

/* ---------------------------------------------------------------- 7. the card: the film's own ending */
.card { position: relative; overflow: hidden; margin-top: 30px; padding: 84px var(--gutter) 78px; text-align: center; color: #FBE9EA;
  background: radial-gradient(ellipse at 50% 46%, #B01F2B 0%, #8B1420 38%, var(--red-deep) 100%); }
.rings { position: absolute; left: 50%; top: 46%; width: 1500px; height: 1170px; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(ellipse at center, transparent 0 72px, rgba(255, 86, 104, 0.34) 72px 74px); -webkit-mask-image: radial-gradient(ellipse at center, transparent 0 260px, #000 262px); mask-image: radial-gradient(ellipse at center, transparent 0 260px, #000 262px); }
.card-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.dots.big { width: min(78vw, 440px); color: #FBE3E6; }
.card-line { font-family: var(--type); font-weight: 700; font-size: clamp(1.15rem, 5.4vw, 1.7rem); letter-spacing: 0.3em; text-transform: uppercase; line-height: 1.5; margin: 0 0 8px; text-shadow: 0 0 14px rgba(255, 180, 190, 0.35); }
.card .btn.big { width: auto; min-width: min(100%, 320px); border-color: #2A0508; box-shadow: 3px 4px 0 #2A0508; }

footer { padding: 26px var(--gutter) 40px; text-align: center; font-size: 0.82rem; color: var(--pencil); max-width: 44em; margin: 0 auto; }

dialog { border: 3px solid var(--ink); border-radius: var(--hand); background: var(--paper-hi); color: var(--ink); padding: 26px 26px 22px; max-width: min(92vw, 440px); box-shadow: 6px 8px 0 var(--ink); }
dialog::backdrop { background: rgba(33, 27, 26, 0.45); }
dialog h3 { margin-top: 0; font-size: 1.6rem; }

/* ---------------------------------------------------------------- wider screens */
@media (min-width: 860px) {
  section { padding: 84px 32px; }
  .hero { grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); column-gap: 56px; row-gap: 18px; padding-top: 56px;
    grid-template-areas: "art head" "art lead" "art choose"; grid-template-rows: auto auto 1fr; align-items: start; }
  .hero .sheet { align-self: center; max-width: none; }
  .hero .lead { margin: 0; }
  .band { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 60px; }
  .band.flip .copy { order: 2; }
  .gift-row { grid-template-columns: 1fr 1fr; gap: 26px; }
  .cup-in { padding: 14px 10px 16px; }
  .cup svg { width: 64px; height: 62px; }
  .cup-name { font-size: 0.92rem; }
  .story { padding-right: 32px; }
  .strip { grid-auto-flow: row; grid-template-columns: 1fr 1fr; grid-auto-columns: auto; overflow: visible; gap: 30px; padding: 18px 4px 6px; }
  .fine, .other-ways { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .steam path, #house .b.mine { animation: none; }
  .art img, .btn, .cup-in { transition: none; }
}
