/* Doughbry's home page. Loads after base.css and intro.css.
   Brand Guidelines v1.3: orange and white lead, cream panels, flat color, one left edge (R66, R99, R100).
   The playful parts all come from the guide's own kit: one big drawing to a screen, triangle confetti
   on white, and the flavor stickers on the menu (R88 to R93). Nothing here is tilted except drawings and stickers. */

.section-head { display: grid; gap: 1rem; max-width: 46rem; margin-bottom: clamp(2rem, 5vw, 3.4rem); justify-items: start; }

/* ---------- Hero: orange, the swirl, one big idea (R95). The pie is the hero (guide page 21), with the leaf rising
   from the corner behind it like the shop window (R115). ---------- */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: clamp(7rem, 5.5rem + 5vw, 9.5rem) 0 clamp(3.5rem, 8vw, 6.5rem); }
.hero__inner { display: grid; gap: clamp(1.1rem, 0.8rem + 1.2vw, 1.7rem); justify-items: start; }
.hero h1 { display: grid; }
.hero__brand { font-size: clamp(1.1875rem, 1.1rem + 0.5vw, 1.5rem); line-height: 1.2; letter-spacing: -0.005em; margin-bottom: 0.75em; }
.hero .lede { max-width: 30ch; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1.7rem; margin-top: 0.5rem; }
.hero__art { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero__leaf { position: absolute; right: -4vw; bottom: -20%; width: clamp(13rem, 22vw, 22rem); rotate: -10deg; }
.hero__leaf img { width: 100%; height: auto; animation-duration: 7.2s; animation-delay: -3s; }
.hero__pie { position: absolute; right: clamp(1.5rem, 6.5vw, 8rem); top: 50%; width: clamp(19rem, 34vw, 35rem); translate: 0 -50%; }
.hero__pie .float { animation-duration: 8s; }

/* The drawn pie: flat, brand yellow and amber, no seeds, no outlines. It is a stand-in for the real photo.
   What shows with scripts or motion off is the finished picture: the pie with its bite and its flakes. */
.pie { display: block; width: 100%; height: auto; overflow: visible; rotate: -8deg; }
.pie__whole { opacity: 0; }
.pie__flake { transform-box: fill-box; transform-origin: 50% 50%; }
/* The headline, acted out. The pie arrives whole with "Golden,". Flakes pop off on "Flaky,".
   On "Gone." it gets its bite, with a small chomp. */
html.is-ready .pie { --bite-time: calc(9 * 85ms + var(--enter-base, 120ms)); animation: pie-chomp 0.55s var(--spring) var(--bite-time) both; }
html.is-ready .pie__whole { animation: pie-then-hide 20ms step-start var(--bite-time) both; }     /* step-start: the switch happens the instant the wait is over */
html.is-ready .pie__bitten { animation: pie-then-show 20ms step-start var(--bite-time) both; }
html.is-ready .pie__flake {
  animation: flake-pop 0.5s var(--spring) both, flake-drift 6s ease-in-out infinite;
  animation-delay: calc(4 * 85ms + var(--enter-base, 120ms) + var(--n, 0) * 70ms), calc(var(--n, 0) * -1.1s);
}
@keyframes pie-then-hide { from { opacity: 1; } to { opacity: 0; } }
@keyframes pie-then-show { from { opacity: 0; } to { opacity: 1; } }
@keyframes pie-chomp { 0% { transform: none; } 30% { transform: scale(0.94) rotate(3deg); } 65% { transform: scale(1.03) rotate(-1deg); } 100% { transform: none; } }
@keyframes flake-pop { from { scale: 0; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes flake-drift { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }

/* ---------- The tagline band ---------- */
.marquee { overflow: hidden; padding: clamp(0.9rem, 2vw, 1.25rem) 0; border-top: 1px solid var(--line); }
.marquee__track { display: flex; width: max-content; animation: marquee 40s linear infinite; will-change: transform; }
.marquee__group { display: flex; align-items: center; gap: clamp(1.4rem, 3vw, 2.6rem); padding-right: clamp(1.4rem, 3vw, 2.6rem); flex: none; }
.marquee__group span { font-weight: 900; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); line-height: 1.1; letter-spacing: -0.01em; color: var(--orange); white-space: nowrap; }
.marquee__group i { width: 1.05rem; height: 1.05rem; background: var(--orange); clip-path: polygon(50% 6%, 96% 90%, 6% 78%); flex: none; rotate: -13deg; }
.marquee__group i:nth-of-type(even) { clip-path: polygon(46% 6%, 94% 76%, 4% 92%); rotate: 15deg; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

/* ---------- What it is: white, with a sprinkle of confetti in the open corner (R88) ---------- */
.what { isolation: isolate; }
.what .container { position: relative; }
.what .confetti { top: -2.2rem; right: 0; width: min(36%, 25rem); height: 15.5rem; }
.corners { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.2vw, 1.5rem); margin: 0; padding: 0; list-style: none; }
.corner { display: grid; gap: 0.75rem; align-content: start; transition: translate 0.35s var(--spring), rotate 0.35s var(--spring); }
.reveal-ready .corner { transition: opacity 0.4s var(--ease), transform 0.75s var(--spring), translate 0.35s var(--spring), rotate 0.35s var(--spring); }
.corner h3 { margin-top: 0.15rem; }
.corner .kicker { display: flex; align-items: center; gap: 0.7em; }
.corner .kicker::before {          /* each corner gets its own little triangle */
  content: ""; width: 1.15rem; height: 1.15rem; flex: none; background: var(--orange);
  clip-path: polygon(50% 6%, 96% 90%, 6% 78%); rotate: -13deg; transition: rotate 0.6s var(--spring);
}
.corner:nth-child(2) .kicker::before { clip-path: polygon(46% 6%, 94% 76%, 4% 92%); rotate: 14deg; }
.corner:nth-child(3) .kicker::before { rotate: -4deg; }
@media (hover: hover) {
  .corner:hover { translate: 0 -5px; rotate: -1deg; }
  .corner:nth-child(2):hover { rotate: 1deg; }
  .corner:hover .kicker::before { rotate: 107deg; }
  .corner:nth-child(2):hover .kicker::before { rotate: 134deg; }
  .corner:nth-child(3):hover .kicker::before { rotate: 116deg; }
}

/* ---------- The pies: set like the menu board in the guide (R118). Flavor stickers tell the pies apart (R93). ---------- */
.menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3.5rem); padding: clamp(1.5rem, 4vw, 3rem); }
.menu__group h3 { font-size: var(--label); letter-spacing: 0.3em; text-transform: uppercase; line-height: 1.3; margin-bottom: 0.6rem; }
.menu__list { margin: 0; padding: 0; list-style: none; }
.menu__list li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; min-height: 2.36em;
  font-weight: 900; font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.9rem); line-height: 1.12; letter-spacing: -0.01em;
  padding: 0.3em 0; border-top: 1px solid var(--line);
}
.menu__list li:last-child { border-bottom: 1px solid var(--line); }
.menu__list li > span { min-width: 0; overflow-wrap: anywhere; transition: translate 0.3s var(--spring); }     /* a long name wraps instead of pushing its sticker off the panel */
/* One sticker to a pie, same spot every time, colors unchanged (R93). They sit a little crooked, like a real sticker. */
.sticker { flex: none; display: block; width: auto; max-width: 44%; object-fit: contain; height: var(--h, 1.9em); margin-block: -0.35em; rotate: var(--tilt, -6deg); }
.sticker--original { --h: 1.72em; --tilt: -4deg; }
.sticker--veggie { --h: 1.95em; --tilt: 7deg; }
.sticker--breakfast { --h: 2.1em; --tilt: -9deg; }
.sticker--spicy { --h: 2.05em; --tilt: 8deg; }
.reveal-ready .menu .sticker { scale: 0; rotate: calc(var(--tilt) - 28deg); transition: scale 0.5s var(--spring), rotate 0.6s var(--spring); transition-delay: calc(0.35s + var(--n, 0) * 0.13s); }
.reveal-ready .menu.is-in .sticker { scale: 1; rotate: var(--tilt); }
@media (hover: hover) {
  .menu__list li:hover > span { translate: 6px 0; }
  .menu__list li:hover .sticker { animation: wiggle 0.6s var(--ease); }
}
@keyframes wiggle { 0%, 100% { rotate: var(--tilt); } 28% { rotate: calc(var(--tilt) + 11deg); } 62% { rotate: calc(var(--tilt) - 7deg); } }
.pies__notes { margin-top: clamp(1.6rem, 4vw, 2.4rem); display: grid; gap: 0.35rem; max-width: 42rem; }
.pies__notes .fine { margin-top: 0.5rem; }

/* ---------- Our story: half and half. Orange for the feeling, white for the facts (R97). ---------- */
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
/* Each half is half the page wide, so 200% is the full page: this lines both halves up with every other section (R100). */
.story__lead { --pad-b: var(--section-y); display: flex; align-items: center; padding: var(--section-y) clamp(1.5rem, 5vw, 5rem) var(--pad-b) max(var(--gutter), calc((200% - var(--max)) / 2)); }
.story__body { display: grid; gap: 1.1rem; align-content: center; padding: var(--section-y) max(var(--gutter), calc((200% - var(--max)) / 2)) var(--section-y) clamp(1.5rem, 5vw, 5rem); }
.story__body p { max-width: 34rem; }
.story__punch { font-weight: 900; font-size: var(--h3); line-height: 1.08; letter-spacing: -0.01em; color: var(--orange); transform-origin: 0 100%; }
.story__sign { font-weight: 700; }
/* The sun comes up over the bottom edge of the orange half and turns very slowly.
   Its top always stops 20 px short of the empty space under the heading (--pad-b), so it can never touch the words. */
.story__sun { --sun: clamp(14rem, 28vw, 28rem); width: var(--sun); right: clamp(-2rem, -1vw, 0rem); bottom: calc(var(--pad-b) - 1.25rem - var(--sun)); }

/* ---------- Find us ---------- */
.find__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(1.8rem, 5vw, 4.5rem); align-items: center; }
.find__copy { display: grid; gap: 1.1rem; justify-items: start; }
.place { display: grid; gap: 0.3rem; }
.place__name { font-weight: 900; font-size: var(--h3); line-height: 1.1; letter-spacing: -0.01em; }
.place .kicker { margin-bottom: 0.5rem; }
.place .btn { margin-top: 1rem; }

/* ---------- First dibs: the sprout comes up from the bottom corner ---------- */
.dibs__inner { display: grid; gap: 1.1rem; justify-items: start; }
.dibs .lede { max-width: 30ch; }
.signup { width: min(100%, 34rem); margin-top: 0.4rem; }
.signup .btn { flex: 0 0 auto; }
.form-note.is-good { animation: enter-pop 0.6s var(--ease) both; transform-origin: 0 50%; }
.dibs__follow { margin-top: 0.9rem; font-weight: 700; }
.dibs__sprout { --sprout: clamp(15rem, 27vw, 27rem); width: var(--sprout); right: max(1.5rem, 5vw); bottom: calc(var(--sprout) * -0.44); rotate: 8deg; }
.dibs__sprout img { animation-duration: 7.4s; animation-delay: -3.2s; }

/* ---------- Partners ---------- */
.partners__panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.3rem 2.2rem; padding: clamp(1.5rem, 4vw, 2.75rem); }
.partners__copy { display: grid; gap: 0.5rem; max-width: 36rem; }

/* ---------- Tablets and phones ---------- */
@media (max-width: 1180px) {
  /* The words in "3 Corners" reach further across here, so the confetti keeps to the strip beside the heading */
  .what .confetti { width: min(30%, 19rem); height: 7.4rem; }
  .what .confetti i:nth-child(n + 7) { display: none; }
}
@media (max-width: 900px) {
  .corners { grid-template-columns: minmax(0, 1fr); }
  .story, .find__grid { grid-template-columns: minmax(0, 1fr); }
  .story__lead { --pad-b: 6.8rem; padding: clamp(3.2rem, 9vw, 5rem) var(--gutter) var(--pad-b); }
  .story__body { padding: clamp(3rem, 8vw, 4.5rem) var(--gutter); }
  .story__sun { --sun: 13rem; right: -1.6rem; }
  .what .confetti { top: -3.4rem; right: -0.4rem; width: 9rem; height: 3.3rem; }     /* in the empty strip above the words */
  .what .confetti i:nth-child(n + 6) { display: none; }
  /* On small screens the sprout gets its own strip under the words, so it can never touch them */
  .dibs { --pad-b: 8.8rem; padding-bottom: var(--pad-b); }
  .dibs--plain { padding-bottom: var(--section-y); }      /* no sprout on the inner pages, so no strip to keep free */
  .dibs__sprout { --sprout: 10.5rem; right: -1.2rem; bottom: calc(var(--pad-b) - 1.9rem - var(--sprout) * 1.04); }
  .find { padding-top: clamp(1.2rem, 4vw, 2rem); }      /* the story above already ends in white space, so this section starts closer */
  /* On a phone or a small tablet the words sit at the bottom of the first screen and the pie fills the room above them.
     The leaf stays home: one drawing is plenty on a small screen. */
  .hero { flex-direction: column; align-items: stretch; justify-content: flex-end; padding-top: 5.4rem; }
  .hero__art { position: relative; inset: auto; flex: 1 1 0; min-height: 0; container-type: size; }
  .hero__leaf { display: none; }
  .hero__pie { right: -4%; top: auto; bottom: 1.1rem; translate: none; width: auto; height: min(100% - 0.4rem, 16rem); aspect-ratio: 692 / 572; }
  .hero__pie .float, .hero__pie .pie { width: 100%; height: 100%; }
  @container (max-height: 6.5rem) { .hero__pie { display: none; } }
}
@media (min-width: 621px) and (max-width: 900px) {
  .hero__pie { height: min(100% - 0.4rem, 23rem); }      /* a tablet has the room for a bigger pie */
}
@media (max-width: 420px) {
  /* On a narrow phone the confetti keeps to the empty strip above the words */
  .what .confetti { width: 6rem; }
  .what .confetti i:nth-child(n + 4) { display: none; }
}
@media (max-width: 620px) {
  .hero .lede { max-width: none; }
  .hero__cta { column-gap: 1.15rem; }
  .menu { grid-template-columns: minmax(0, 1fr); gap: 1.8rem; }
  .signup .field { flex-direction: column; }
  .signup .field input[type="email"] { flex: 1 1 auto; width: 100%; }
  .signup .btn, .partners__panel .btn, .place .btn { width: 100%; }
}

/* ---------- Less motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none !important; }
  .pie, .pie__whole, .pie__bitten, .pie__flake { animation: none !important; }
  .reveal-ready .menu .sticker { scale: 1; rotate: var(--tilt); }
}
