/* ==========================================================================
   PROPOSAL LAYER: motion + polish on top of styles.css (prototype, not live)
   Everything motion-related is gated by prefers-reduced-motion at the bottom.
   ========================================================================== */
:root {
  --gold-text: #8a6a3a;          /* AA on cream (4.7:1); keep --gold for rules, icons, large display */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --header-h: 72px;
}

/* ---------- accessibility basics ---------- */
html { scroll-padding-top: calc(var(--header-h) + 12px); }
.eyebrow, .card .tag { color: var(--gold-text); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.btn:focus-visible, .chip:focus-visible, .pill:focus-visible { outline-offset: 4px; border-radius: 999px; }
.swatch:focus-visible { outline-offset: 3px; border-radius: 50%; }

/* ---------- paper grain (very subtle, makes flat cream feel like card stock) ---------- */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .45 0 0 0 0 .4 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header shrinks once you scroll ---------- */
.site-header { transition: padding .35s var(--ease-soft), box-shadow .35s; }
.site-header.scrolled { padding-top: .55rem; padding-bottom: .55rem; box-shadow: 0 10px 30px -24px rgba(60, 40, 30, .45); }
.cart-btn.bump .cart-count { animation: bump .5s var(--ease-out); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.45); background: var(--gold); } 100% { transform: scale(1); } }

/* ---------- hero: looping reel in the arch ---------- */
.hero-media { position: relative; border-radius: 240px 240px var(--radius) var(--radius); overflow: hidden; box-shadow: 0 30px 60px -30px rgba(60, 40, 30, .35); aspect-ratio: 4 / 5; max-height: min(76vh, 700px); margin-left: auto; background: var(--blush); }
.hero-media video, .hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .45); pointer-events: none; }
.media-toggle { position: absolute; right: 16px; bottom: 16px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .85); color: var(--ink); cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(6px); }
.media-toggle svg { width: 14px; height: 14px; }
.hero-art .orbit { position: absolute; top: -30px; right: -34px; width: 200px; aspect-ratio: 480 / 409; z-index: 2; border-radius: 18px; overflow: hidden; background: #000; box-shadow: 0 12px 30px rgba(0,0,0,.2); }
.hero-art .orbit img { width: 100%; height: 100%; display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* hero entrance choreography (CSS only, runs once on load) */
.hero .eyebrow, .hero h1 .line, .hero .lede, .hero-ctas, .hero .trust { animation: rise .9s var(--ease-out) both; }
.hero h1 .line { display: block; }
.hero .eyebrow { animation-delay: .05s; }
.hero h1 .line:nth-child(1) { animation-delay: .15s; }
.hero h1 .line:nth-child(2) { animation-delay: .28s; }
.hero .lede { animation-delay: .42s; }
.hero-ctas { animation-delay: .54s; }
.hero .trust { animation-delay: .66s; }
.hero-media { animation: unveil 1.2s var(--ease-out) both .1s; }
.hero-art .orbit { animation: rise .9s var(--ease-out) both .7s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes unveil { from { opacity: 0; transform: scale(.96); clip-path: inset(18% 8% 0 8% round 240px 240px 18px 18px); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 240px 240px 18px 18px); } }
.hero-tag { animation: rise .8s var(--ease-out) both .9s; }

/* ---------- marquee ribbon ---------- */
.ribbon { background: var(--ink); color: #f6efe8; overflow: hidden; padding: .9rem 0; position: relative; z-index: 2; }
.ribbon-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.ribbon:hover .ribbon-track { animation-play-state: paused; }
.ribbon ul { list-style: none; display: flex; gap: 2.4rem; padding: 0 1.2rem; margin: 0; white-space: nowrap; }
.ribbon li { font: 500 1.2rem var(--serif); font-style: italic; letter-spacing: .02em; display: flex; align-items: center; gap: 2.4rem; }
.ribbon li::after { content: "✦"; font-style: normal; color: var(--gold); font-size: .8rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- scroll reveal (IntersectionObserver adds .in) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-reveal].in { opacity: 1; transform: none; }
.js [data-reveal="fade"] { transform: none; }

/* ---------- product cards ---------- */
.card { transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out); }
.card-media { overflow: hidden; }
.card img { transition: transform 1.1s var(--ease-out); }
.card .price span { position: relative; border-bottom: 0; }
.card .price span::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor; transform-origin: left; transition: transform .45s var(--ease-out); }
@media (hover: hover) {
  .card:hover { transform: translateY(-6px); box-shadow: 0 28px 50px -28px rgba(60, 40, 30, .45); }
  .card:hover img { transform: scale(1.06); }
  .card:hover .price span::after { transform: scaleX(.35); }
}
.card:active { transform: scale(.985); }
.chip { transition: background .25s, color .25s, border-color .25s; }
::view-transition-group(*) { animation-duration: .45s; animation-timing-function: var(--ease-out); }

/* ---------- gallery hover ---------- */
.masonry figure img { transition: transform 1.2s var(--ease-out), filter .6s; }
@media (hover: hover) { .masonry figure:hover img { transform: scale(1.05); } }

/* ---------- made-by-hand loop in About ---------- */
.about-media { position: relative; border-radius: var(--radius) var(--radius) 200px 200px; overflow: hidden; aspect-ratio: 4 / 5; background: var(--blush); }
.about-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-media figcaption { position: absolute; left: 16px; top: 16px; background: rgba(255, 255, 255, .88); border-radius: 999px; padding: .35rem .8rem; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- dialogs: fade + rise, bottom sheet on mobile (CSS @starting-style) ---------- */
.dialog { transition: opacity .35s var(--ease-out), transform .45s var(--ease-out), overlay .45s allow-discrete, display .45s allow-discrete; opacity: 0; transform: translateY(24px) scale(.98); }
.dialog[open] { opacity: 1; transform: none; }
@starting-style { .dialog[open] { opacity: 0; transform: translateY(24px) scale(.98); } }
.dialog::backdrop { transition: background .35s, backdrop-filter .35s, overlay .45s allow-discrete, display .45s allow-discrete; background: rgba(34, 29, 28, 0); }
.dialog[open]::backdrop { background: rgba(34, 29, 28, .5); backdrop-filter: blur(3px); }
@starting-style { .dialog[open]::backdrop { background: rgba(34, 29, 28, 0); backdrop-filter: blur(0); } }
.swatch, .pill { transition: box-shadow .2s, transform .2s var(--ease-out), background .2s, color .2s; }
.swatch[aria-pressed="true"] { transform: scale(1.12); }
.pd-price { transition: opacity .2s; }
.pd-price.tick { animation: tick .35s var(--ease-out); }
@keyframes tick { from { opacity: .2; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* fly-to-cart ghost */
.fly { position: fixed; z-index: 100; border-radius: 12px; object-fit: cover; pointer-events: none; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .5); }

/* toast */
.toast { white-space: nowrap; max-width: calc(100vw - 32px); position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--cream); padding: .75rem 1.1rem; border-radius: 999px; font-size: .9rem; display: flex; gap: .8rem; align-items: center; transition: opacity .3s, transform .4s var(--ease-out); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: none; border: 0; color: #f3dcd8; font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

/* drawer: items stagger in */
.drawer { transition: transform .5s var(--ease-out), visibility .5s; }
.drawer.open .cart-item { animation: rise .5s var(--ease-out) both; }
.drawer.open .cart-item:nth-child(2) { animation-delay: .06s; }
.drawer.open .cart-item:nth-child(3) { animation-delay: .12s; }

/* ---------- assistant launcher + panel (static mock) ---------- */
.ask-launcher { position: fixed; right: 24px; bottom: 24px; z-index: 30; display: flex; align-items: center; gap: .6rem; border: 0; border-radius: 999px; padding: .55rem 1.1rem .55rem .55rem; background: var(--paper); color: var(--ink); box-shadow: 0 18px 40px -18px rgba(60, 40, 30, .55), 0 0 0 1px var(--line); cursor: pointer; font: 400 .92rem var(--sans); transition: transform .3s var(--ease-out), box-shadow .3s; }
.ask-launcher { opacity: 0; transform: translateY(16px); pointer-events: none; }
.ask-launcher.show { opacity: 1; transform: none; pointer-events: auto; }
.ask-launcher.show:hover { transform: translateY(-2px); }
.ask-launcher { transition: opacity .4s var(--ease-out), transform .4s var(--ease-out), box-shadow .3s; }
.ask-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blush); display: grid; place-items: center; font: 400 1.35rem/1 var(--script); color: var(--ink); position: relative; flex: none; }
.ask-avatar::after { content: ""; position: absolute; right: 0; bottom: 1px; width: 9px; height: 9px; border-radius: 50%; background: #6aa77c; box-shadow: 0 0 0 2px var(--paper); }
.ask-panel { position: fixed; right: 24px; bottom: 90px; z-index: 60; width: min(380px, calc(100vw - 32px)); height: min(600px, calc(100dvh - 140px)); background: var(--paper); border-radius: 22px; box-shadow: 0 40px 80px -30px rgba(40, 25, 20, .5), 0 0 0 1px var(--line); display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right; transition: opacity .3s var(--ease-out), transform .4s var(--ease-out), visibility .4s; opacity: 0; transform: translateY(12px) scale(.96); visibility: hidden; }
.ask-panel.open { opacity: 1; transform: none; visibility: visible; }
.ask-head { padding: 1rem 1.1rem .9rem; background: linear-gradient(180deg, var(--blush), #f8e9e6); display: flex; gap: .75rem; align-items: center; position: relative; }
.ask-head h3 { font-size: 1.25rem; margin: 0; }
.ask-head p { margin: 0; font-size: .78rem; color: var(--muted); line-height: 1.35; }
.ask-head .dialog-close { top: 12px; right: 10px; width: 32px; height: 32px; font-size: 1.3rem; background: rgba(255, 255, 255, .7); }
.ask-note { margin: .8rem 1rem 0; font-size: .76rem; color: var(--muted); background: var(--cream); border-radius: 10px; padding: .55rem .7rem; line-height: 1.4; }
.ask-body { flex: 1; overflow: auto; padding: .9rem 1rem; display: flex; flex-direction: column; gap: .6rem; }
.msg { max-width: 85%; padding: .6rem .85rem; border-radius: 16px; font-size: .9rem; line-height: 1.45; }
.msg.bot { background: var(--cream); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--cream); border-bottom-right-radius: 4px; }
.msg-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: .6rem; display: grid; grid-template-columns: 52px 1fr; gap: .6rem; align-items: center; font-size: .82rem; max-width: 90%; }
.msg-card img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.msg-card b { font-family: var(--serif); font-size: 1rem; font-weight: 600; display: block; }
.msg-card .status { color: #3f7a52; font-size: .76rem; }
.quick { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .7rem; }
.quick button { border: 1px solid var(--line); background: var(--cream); border-radius: 999px; padding: .4rem .8rem; font: 400 .8rem var(--sans); color: var(--ink); cursor: pointer; }
.ask-input { display: flex; gap: .5rem; padding: .7rem .8rem calc(.7rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.ask-input input { border-radius: 999px; background: var(--cream); }
.ask-input button { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: var(--cream); cursor: pointer; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.handoff { display: flex; gap: .6rem; align-items: center; margin-top: .2rem; font-size: .85rem; color: var(--muted); }
.handoff button { border: 0; background: none; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }

/* ---------- mobile dock: assistant + cart in one thumb-reach bar ---------- */
.dock { display: none; }
@media (max-width: 900px) {
  .ask-launcher { display: none; }
  .dock { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30; display: grid; grid-template-columns: auto 1fr; gap: 8px; transform: translateY(140%); transition: transform .5s var(--ease-out); }
  .dock.show { transform: none; }
  .dock button { border: 0; border-radius: 999px; height: 54px; font: 400 .95rem var(--sans); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .55rem; box-shadow: 0 16px 34px -16px rgba(40, 25, 20, .6); }
  .dock .dock-ask { background: var(--paper); color: var(--ink); padding: 0 1rem 0 .45rem; box-shadow: 0 16px 34px -16px rgba(40, 25, 20, .6), 0 0 0 1px var(--line); }
  .dock .dock-cart { background: var(--ink); color: var(--cream); }
  .dock .dock-cart b { font-weight: 500; }
  .dock .dock-cart .cart-count { background: var(--cream); color: var(--ink); }
  .ask-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 88dvh; border-radius: 22px 22px 0 0; transform-origin: bottom center; transform: translateY(40px); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .site-footer { padding-bottom: 100px; }

  /* hero: copy first, smaller arch, CTAs above the fold */
  .preview-bar { font-size: .72rem; padding: .35rem .8rem; }
  .hero { padding-top: 20px; gap: 22px; }
  .hero-art { order: -1; }
  .hero-media { border-radius: 150px 150px var(--radius) var(--radius); max-height: 40svh; aspect-ratio: auto; height: 40svh; width: 100%; }
  .hero-media { animation-name: unveil-m; }
  @keyframes unveil-m { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
  .hero h1 { font-size: 2.45rem; margin-bottom: .25em; }
  .hero .lede { font-size: 1rem; }
  .hero-ctas { margin: 1rem 0 1rem; }
  .hero-ctas { flex-wrap: nowrap; gap: .6rem; }
  .hero-ctas .btn { flex: 1; text-align: center; padding: .85rem .6rem; white-space: nowrap; font-size: .9rem; }
  .hero .trust { display: none; }
  .hero-art .orbit { width: 140px; top: -16px; right: -6px; border-radius: 14px; }
  .hero-tag { display: none; }

  /* product dialog becomes a bottom sheet with a sticky add button */
  .dialog { margin: auto 0 0; max-width: 100vw; width: 100vw; border-radius: 22px 22px 0 0; max-height: 92dvh; transform: translateY(60px); }
  @starting-style { .dialog[open] { transform: translateY(100%); opacity: 1; } }
  .dialog.small { margin: auto; border-radius: 22px; max-width: calc(100vw - 32px); }
  #pdAdd { position: sticky; bottom: 12px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .45); }
  .dialog-inner > img { max-height: 34svh; }
}

/* ---------- reduced motion: keep everything, remove the movement ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .ribbon-track { animation: none; }
  .ribbon ul[aria-hidden] { display: none; }
  .ribbon ul { flex-wrap: wrap; justify-content: center; white-space: normal; row-gap: .4rem; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
