/* ==========================================================
   MIEN TREATS: guided order experience (Phase 4)
   Full-screen, one question at a time. Portrait layout is keyed
   to aspect ratio, like the rest of the site.
   ========================================================== */
/* Self-contained: the overlay carries its own tokens and button styles, so it looks the same on the
   Gallery page (which has a different, darker palette). Keep these values in step with css/tokens.css. */
.ord {
  --ink: #2A0F1B; --plum: #5B1533; --plum-soft: #7A2A4B; --rose: #C0446F; --rose-text: #A2325E; --blush: #EBC3CF;
  --gold: #C99A5B; --cream: #F4EADF; --paper: #FBF6EF;
  --font-display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --font-body: "Jost", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.92rem);
  --step-0: clamp(1rem, 0.96rem + 0.20vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.50vw, 1.55rem);
  --step-2: clamp(1.6rem, 1.35rem + 1.20vw, 2.3rem);
  --space-1: 0.5rem; --space-2: 1rem; --space-3: 1.5rem; --space-4: 2.5rem;
  --gutter: clamp(1.1rem, 4vw, 3.5rem); --radius: 2px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1); --ease-soft: cubic-bezier(0.45, 0, 0.15, 1); --dur-fast: 220ms;
  font-family: var(--font-body); font-weight: 300; font-size: var(--step-0); line-height: 1.6;
  -webkit-font-smoothing: antialiased; color-scheme: light; text-align: left;
}
.ord *, .ord *::before, .ord *::after { box-sizing: border-box; }
.ord h2, .ord h3 { font-family: var(--font-display); font-weight: 400; margin: 0; letter-spacing: normal; }
.ord p { margin: 0; }
.ord img { display: block; max-width: 100%; }
.ord button, .ord input, .ord textarea { font: inherit; color: inherit; }
.ord .btn {
  display: inline-flex; align-items: center; justify-content: center; padding: .85rem 1.6rem; min-height: 2.9rem;
  border: 1px solid currentColor; border-radius: var(--radius); background: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 400; font-size: var(--step--1); letter-spacing: .06em; text-decoration: none;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.ord .btn--solid { background: var(--plum); color: var(--cream); border-color: var(--plum); }
.ord .btn--solid:hover, .ord .btn--solid:focus-visible { background: var(--ink); border-color: var(--ink); }
.ord .btn--ghost { color: var(--plum); }
.ord .btn--ghost:hover, .ord .btn--ghost:focus-visible { background: rgba(91, 21, 51, .08); }

.ord {
  position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column;
  color: var(--ink); opacity: 0; transition: opacity .38s ease;
  background:
    radial-gradient(70% 55% at 100% 0%, rgba(235, 195, 207, .55), rgba(235, 195, 207, 0) 62%),
    radial-gradient(60% 50% at 0% 100%, rgba(228, 180, 108, .26), rgba(228, 180, 108, 0) 62%),
    var(--cream);
}
.ord.is-open { opacity: 1; }
.ord[hidden], .ord [hidden] { display: none !important; }

/* top bar */
.ord__bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: calc(env(safe-area-inset-top, 0px) + .8rem) var(--gutter) .8rem; min-height: 4.2rem;
}
.ord__back, .ord__close { display: inline-flex; align-items: center; gap: .4rem; background: none; border: 0; padding: .6rem 0; cursor: pointer;
  color: var(--plum); font-size: var(--step--1); letter-spacing: .05em; }
.ord__back { min-width: 4.5rem; }
.ord__close { justify-content: flex-end; min-width: 4.5rem; }
.ord__back:hover, .ord__close:hover { color: var(--rose-text); }
.ord__count { flex: 1; text-align: center; white-space: nowrap; font-size: var(--step--1); letter-spacing: .14em; color: var(--plum-soft); }
.ord__progress { height: 2px; background: rgba(91, 21, 51, .12); }
.ord__progress i { display: block; height: 100%; background: var(--gold); transform-origin: left; transform: scaleX(.04); transition: transform .7s var(--ease-out); }

/* body */
.ord__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; padding: var(--space-4) var(--gutter) var(--space-4); }
.ord__stage { width: 100%; max-width: 50rem; margin: auto; }
.ord__stage:has(.ord__step--type) { max-width: 66rem; }
.ord__step { display: grid; gap: var(--space-3); }
.ord__q { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.9rem); line-height: 1.05; letter-spacing: -.01em; color: var(--plum); outline: none; }
.ord__hint { margin-top: var(--space-2); font-size: var(--step-0); color: var(--plum-soft); }

/* action bar */
.ord__actions {
  display: flex; justify-content: flex-end; align-items: center; gap: var(--space-2);
  padding: 1rem var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 1rem);
  border-top: 1px solid rgba(91, 21, 51, .12); background: rgba(244, 234, 223, .88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.ord__next:disabled { opacity: .35; cursor: not-allowed; }
.ord__next:disabled:hover { background: var(--plum); border-color: var(--plum); }
.ord__skip { border-color: transparent; }

/* first question: three big cards */
.tcards { display: grid; gap: var(--space-2); }
.tcard {
  position: relative; display: grid; grid-template-columns: 6.5rem 1fr; align-items: stretch; min-height: 6.5rem; cursor: pointer;
  overflow: hidden; background: var(--paper); border: 1px solid rgba(91, 21, 51, .18);
  animation: tcard-in .8s var(--ease-out) both; animation-delay: calc(var(--i) * 110ms + 120ms);
  transition: transform .5s var(--ease-out), opacity .4s ease, box-shadow .4s ease, border-color .3s ease;
}
.tcard input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tcard__img { display: block; overflow: hidden; }
.tcard__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease-out); }
.tcard__txt { display: flex; flex-direction: column; justify-content: center; gap: .2rem; padding: 1rem 1.2rem; }
.tcard__t { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.05; color: var(--plum); }
.tcard__s { font-size: var(--step--1); color: var(--plum-soft); }
.tcard:hover, .tcard:has(input:focus-visible) { border-color: var(--plum); box-shadow: 0 24px 40px -26px rgba(91, 21, 51, .5); }
.tcard:hover .tcard__img img { transform: scale(1.06); }
.tcard:has(input:focus-visible) { outline: 2px solid var(--rose); outline-offset: 3px; }
.tcards.has-pick .tcard { opacity: .2; transform: scale(.97); pointer-events: none; }
.tcards.has-pick .tcard.is-picked { opacity: 1; transform: scale(1.03); border-color: var(--plum); }
@keyframes tcard-in { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@media (min-aspect-ratio: 17/20) {
  .tcards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
  .tcard { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 0; }
  .tcard__img { aspect-ratio: 4 / 4.6; }
  .tcard__txt { padding: 1.2rem 1.3rem 1.4rem; }
  .tcard:nth-child(2) { margin-top: 2rem; }
}

/* choices */
.opts { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); }
.opts--chips { grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); }
.sizes-pick .opts--chips:last-of-type { grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.face {
  display: flex; flex-direction: column; justify-content: center; gap: .15rem; min-height: 3.6rem; padding: .8rem 1.2rem;
  border: 1px solid rgba(91, 21, 51, .28); background: rgba(251, 246, 239, .7);
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.face__t { font-size: var(--step-0); line-height: 1.25; }
.face__s { font-size: var(--step--1); color: var(--plum-soft); }
.opt:hover .face { border-color: var(--plum); }
.opt input:checked + .face { background: var(--plum); border-color: var(--plum); color: var(--cream); }
.opt input:checked + .face .face__s { color: var(--blush); }
.opt input:focus-visible + .face { outline: 2px solid var(--rose); outline-offset: 3px; }
.grp { margin: var(--space-2) 0 .6rem; font-size: var(--step--1); letter-spacing: .12em; color: var(--plum-soft); }
.grp:first-child { margin-top: 0; }
.extra { margin-top: var(--space-2); }
.extra:empty { display: none; }

/* text fields */
.fld {
  width: 100%; font: inherit; font-size: var(--step-1); color: var(--ink); background: transparent; border: 0; border-radius: 0;
  border-bottom: 1px solid rgba(91, 21, 51, .42); padding: .8rem 0; outline: none; transition: border-color var(--dur-fast) ease;
}
.fld::placeholder { color: rgba(122, 42, 75, .78); }
.fld:focus { border-bottom-color: var(--plum); box-shadow: 0 1px 0 var(--plum); }
.fld--big { font-family: var(--font-display); font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.6rem); }
.fld--area { border: 1px solid rgba(91, 21, 51, .35); padding: 1rem 1.1rem; background: rgba(251, 246, 239, .6); resize: vertical; line-height: 1.5; min-height: 7rem; }
.fld--area:focus { border-color: var(--plum); box-shadow: 0 0 0 1px var(--plum); }
input[type="date"].fld { font-family: var(--font-display); font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.2rem); max-width: 22rem; color-scheme: light; }
input[type="number"].fld { -moz-appearance: textfield; max-width: 16rem; }
input[type="number"].fld::-webkit-outer-spin-button, input[type="number"].fld::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.err { min-height: 1.4rem; margin-top: .6rem; font-size: var(--step--1); color: var(--rose-text); }

/* pastry quantities */
.items { display: grid; }
.item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: .7rem 0; border-bottom: 1px solid rgba(91, 21, 51, .14); }
.item__name { font-family: var(--font-display); font-size: var(--step-1); color: rgba(91, 21, 51, .72); transition: color var(--dur-fast) ease; }
.item.is-on .item__name { color: var(--plum); }
.item__ctl { display: inline-flex; align-items: center; gap: .3rem; }
.item__n { min-width: 2.4rem; text-align: center; font-size: var(--step-1); font-variant-numeric: tabular-nums; }
.item__b { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; padding: 0; font-size: 1.4rem; line-height: 1; cursor: pointer;
  border: 1px solid rgba(91, 21, 51, .35); border-radius: 50%; background: none; color: var(--plum); transition: background var(--dur-fast) ease, color var(--dur-fast) ease; }
.item__b:hover, .item__b:focus-visible { background: var(--plum); color: var(--cream); }
.item.is-on .item__b:last-child { border-color: var(--plum); }

/* review */
.rv { margin: 0; display: grid; border-top: 1px solid rgba(91, 21, 51, .2); }
.rv__row { display: grid; grid-template-columns: 1fr auto; gap: .2rem var(--space-2); padding: .95rem 0; border-bottom: 1px solid rgba(91, 21, 51, .14); align-items: baseline; }
.rv dt { grid-column: 1 / -1; font-size: var(--step--1); letter-spacing: .1em; color: var(--plum-soft); }
.rv dd { margin: 0; font-family: var(--font-display); font-size: var(--step-1); color: var(--plum); line-height: 1.3; overflow-wrap: anywhere; }
.rv__edit { background: none; border: 0; padding: .4rem 0; cursor: pointer; font-size: var(--step--1); letter-spacing: .05em; color: var(--rose-text); text-decoration: underline; text-underline-offset: 4px; }
@media (min-aspect-ratio: 17/20) {
  .rv__row { grid-template-columns: 11rem 1fr auto; }
  .rv dt { grid-column: auto; }
}

/* confirmation: the whisk draws across the screen */
.done { display: grid; justify-items: center; text-align: center; gap: var(--space-2); }
.done__art { width: min(100vw, 70rem); margin-inline: calc(var(--gutter) * -1); }
.done__svg { width: 100%; height: auto; overflow: visible; }
.done__svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.rib { stroke-width: 2; }
.rib--rose { stroke: var(--rose); }
.rib--gold { stroke: var(--gold); stroke-width: 1.4; }
.wh { stroke: var(--gold); stroke-width: 2.4; }
.wh.rose { stroke: var(--rose); }
.is-playing .rib--rose { animation: draw 2.4s var(--ease-soft) .1s forwards; }
.is-playing .rib--gold { animation: draw 2.6s var(--ease-soft) .35s forwards; }
.is-playing .w1 { animation: draw 1.1s var(--ease-soft) .5s forwards; }
.is-playing .w2 { animation: draw 1.0s var(--ease-soft) .8s forwards; }
.is-playing .w3 { animation: draw .6s var(--ease-soft) 1.1s forwards; }
.is-playing .w4 { animation: draw .5s var(--ease-soft) 1.3s forwards; }
.is-playing .w5 { animation: draw .9s var(--ease-soft) 1.4s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done__q, .done__p, .done__actions, .done__peek, .done__links { opacity: 0; }
.is-playing .done__q { animation: fade-up 1s var(--ease-out) 1.7s forwards; }
.is-playing .done__p { animation: fade-up 1s var(--ease-out) 2.0s forwards; }
.is-playing .done__actions { animation: fade-up 1s var(--ease-out) 2.3s forwards; }
.is-playing .done__peek, .is-playing .done__links { animation: fade-up 1s var(--ease-out) 2.6s forwards; }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.done__q { max-width: 14em; }
.done__p { max-width: 30rem; font-size: var(--step-1); line-height: 1.5; color: var(--plum-soft); }
.done__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: var(--space-2); }
.btn--lg { padding: 1rem 2rem; min-height: 3.4rem; font-size: var(--step-0); }
.done__peek { width: min(100%, 34rem); text-align: left; margin-top: var(--space-2); border: 1px solid rgba(91, 21, 51, .2); background: rgba(251, 246, 239, .6); }
.done__peek summary { cursor: pointer; padding: .9rem 1.1rem; font-size: var(--step--1); letter-spacing: .06em; color: var(--plum-soft); }
.done__peek pre { margin: 0; padding: 0 1.1rem 1.1rem; font: inherit; font-size: var(--step--1); white-space: pre-wrap; color: var(--ink); }
.done__links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); }
.done__change { background: none; border: 0; padding: .5rem 0; cursor: pointer; font-size: var(--step--1); letter-spacing: .05em; color: var(--plum-soft); text-decoration: underline; text-underline-offset: 4px; }
.done__change:hover { color: var(--rose-text); }

@media (prefers-reduced-motion: reduce) {
  .done__svg path { stroke-dashoffset: 0; }
  .done__q, .done__p, .done__actions, .done__peek, .done__links { opacity: 1; }
}

/* the smallest phones: keep the step counter on one line */
@media (max-width: 380px) {
  .ord__back, .ord__close { min-width: 3.4rem; }
  .ord__count { letter-spacing: .06em; }
}

/* pick-several choices show a tick */
.opt--multi .face { position: relative; padding-right: 2.8rem; }
.opt--multi .face::after {
  content: ""; position: absolute; right: 1.1rem; top: 50%; width: .6rem; height: 1rem;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: translateY(-64%) rotate(45deg) scale(0); transition: transform .28s var(--ease-out);
}
.opt--multi input:checked + .face::after { transform: translateY(-64%) rotate(45deg) scale(1); }
