/* ================= Retro 3D sections (live beetleandbees.com theme) =================
   3D bead logo (js/hero3d.js), "Walk through the drop" gallery (js/gallery3d.js) and
   "Shop in 3D" models (js/models3d.js), styled to match the retro theme: Shrikhand
   headlines with stacked colour shadows, Courier Prime labels, paper, mustard, rust and teal.
   Every colour has a fallback so this also works on retro.html, which has its own styles. */

.r3d-title { margin: 0; font-family: "Shrikhand", "Cooper Black", Georgia, serif; font-weight: 400; line-height: 1; letter-spacing: 0;
  color: var(--rust, #c4501f); text-shadow: 3px 3px 0 var(--mustard, #e3a92b), 6px 6px 0 var(--brown, #6b3a1f); }
.r3d-sticker { display: inline-block; margin: 0 0 1.2rem; padding: .35rem .8rem; background: #fffaf0; border: 2px solid var(--ink, #2b1d14);
  box-shadow: 3px 3px 0 var(--ink, #2b1d14); transform: rotate(-2deg); font-family: "Courier Prime", ui-monospace, monospace; font-weight: 700;
  font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink, #2b1d14); }
.r3d-btn { display: inline-block; padding: .9rem 1.5rem; border: 2px solid var(--ink, #2b1d14); box-shadow: 4px 4px 0 var(--ink, #2b1d14);
  font-family: "Courier Prime", ui-monospace, monospace; font-weight: 700; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink, #2b1d14); background: var(--mustard, #e3a92b); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.r3d-btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink, #2b1d14); }
.r3d-btn--paper { background: #fffaf0; }

/* ---------- 3D bead logo ---------- */
.hero3d { position: relative; display: flex; align-items: center; min-height: min(84vh, 760px); overflow: hidden; color: var(--ink, #2b1d14);
  background: var(--paper, #f3e6cc); border-top: 3px solid var(--ink, #2b1d14); border-bottom: 3px solid var(--ink, #2b1d14); }
/* retro sunset stripes behind the logo */
.hero3d::before { content: ""; position: absolute; right: 6%; bottom: -24%; width: min(52vw, 640px); aspect-ratio: 1; border-radius: 50%; opacity: .5; pointer-events: none;
  background: repeating-linear-gradient(180deg, var(--mustard, #e3a92b) 0 14px, transparent 14px 20px, var(--orange, #e07b28) 20px 34px, transparent 34px 40px,
    var(--rust, #c4501f) 40px 54px, transparent 54px 60px, var(--brown, #6b3a1f) 60px 74px, transparent 74px 80px);
  -webkit-mask: linear-gradient(#000 50%, transparent 50%); mask: linear-gradient(#000 50%, transparent 50%); }
.hero3d__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1s;
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; outline: none; }
.hero3d__canvas:active { cursor: grabbing; }
.hero3d__canvas:focus-visible { outline: 3px solid var(--teal, #2f6f6a); outline-offset: -8px; }
.hero3d.is-3d .hero3d__canvas { opacity: 1; }
.hero3d__fallback { position: absolute; right: 10%; top: 50%; transform: translateY(-50%); width: min(36vw, 440px); height: auto; mix-blend-mode: multiply; }
.hero3d.is-3d .hero3d__fallback { display: none; }
.hero3d__text { position: relative; z-index: 1; width: min(50%, 620px); padding: clamp(2.5rem, 6vw, 5rem) var(--gutter, clamp(16px, 4vw, 56px)); pointer-events: none; }
.hero3d__text a { pointer-events: auto; }
.hero3d .r3d-title { font-size: clamp(2.4rem, 5.4vw, 4.8rem); }
.hero3d .r3d-title em { font-style: normal; color: var(--teal, #2f6f6a); text-shadow: 3px 3px 0 #fffaf0, 5px 5px 0 var(--ink, #2b1d14); }
.hero3d__lede { margin: 1.3rem 0 1.8rem; font-size: clamp(1rem, 1.5vw, 1.15rem); line-height: 1.6; color: var(--ink-soft, #5c4433); }
.hero3d__ctas { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero3d__hint { position: absolute; z-index: 1; right: var(--gutter, 24px); bottom: 1.4rem; display: none; padding: .45rem .8rem; background: #fffaf0;
  border: 2px solid var(--ink, #2b1d14); font-family: "Courier Prime", ui-monospace, monospace; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; pointer-events: none; }
.hero3d.is-3d .hero3d__hint { display: inline-block; }

/* ---------- walk through the drop ---------- */
.gallery3d { position: relative; background: var(--cream, #ead7b3); border-top: 3px solid var(--ink, #2b1d14); border-bottom: 3px solid var(--ink, #2b1d14); }
.gallery3d__sticky { position: relative; padding: clamp(2.6rem, 6vw, 4rem) var(--gutter, 24px); }
.gallery3d canvas { display: none; }
.gallery3d__intro { text-align: center; }
.gallery3d__intro .r3d-title { font-size: clamp(2rem, 4.6vw, 3.6rem); margin-bottom: .9rem; }
.gallery3d__hint { display: none; margin: 0; font-family: "Courier Prime", ui-monospace, monospace; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft, #5c4433); }
.gallery3d__caption { display: none; }
.gallery3d__list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 22%); gap: 1rem; overflow-x: auto; margin: 1.5rem 0 0; padding: 0 0 .8rem; list-style: none; }
.gallery3d__list img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 2px solid var(--ink, #2b1d14); filter: sepia(.6) saturate(.85); }
.gallery3d__list span { display: block; margin-top: .5rem; font-size: .85rem; }
.gallery3d.is-3d { height: calc(var(--g-count, 12) * 42vh + 100vh); }
.gallery3d.is-3d .gallery3d__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; padding: 0; overflow: hidden; }
.gallery3d.is-3d canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.gallery3d.is-3d .gallery3d__list { display: none; }
/* side progress bar for the fly-through: fills while scrolling, turns green with "Done" at the end */
.gallery3d__meter { display: none; }
.gallery3d.is-3d .gallery3d__meter { display: flex; position: absolute; z-index: 1; right: clamp(.8rem, 2.5vw, 2rem); top: 50%; transform: translateY(-50%);
  flex-direction: column; align-items: center; gap: .7rem; pointer-events: none; }
.gallery3d__meter span { position: relative; width: 10px; height: min(46vh, 360px); background: #fffaf0; border: 2px solid var(--ink, #2b1d14); box-shadow: 3px 3px 0 var(--ink, #2b1d14); }
.gallery3d__meter i { position: absolute; left: 0; right: 0; top: 0; height: 100%; background: var(--rust, #c4501f); transform-origin: top; transform: scaleY(var(--g-progress, 0)); transition: background .3s; }
.gallery3d__meter b { writing-mode: vertical-rl; font-family: "Courier Prime", ui-monospace, monospace; font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700;
  padding: .5rem .25rem; background: #fffaf0; border: 2px solid var(--ink, #2b1d14); color: var(--ink, #2b1d14); }
/* circle riding on the bar: where you are, and which way you're scrolling */
.gallery3d__meter u { position: absolute; left: 50%; top: calc(var(--g-progress, 0) * 100%); width: 28px; height: 28px; transform: translate(-50%, -50%);
  display: grid; place-items: center; border-radius: 50%; background: #fffaf0; border: 2px solid var(--ink, #2b1d14); box-shadow: 2px 2px 0 var(--ink, #2b1d14);
  font: 800 1rem/1 system-ui, sans-serif; text-decoration: none; color: var(--rust, #c4501f); transition: color .2s, background .2s; }
.gallery3d__meter u.is-up { background: var(--rust, #c4501f); color: #fffaf0; }
.gallery3d.is-done .gallery3d__meter u { border-color: var(--teal, #2f6f6a); color: var(--teal, #2f6f6a); }
.gallery3d.is-done .gallery3d__meter u.is-up { background: var(--teal, #2f6f6a); color: #fffaf0; }
.gallery3d.is-done .gallery3d__meter i { background: var(--teal, #2f6f6a); }
.gallery3d.is-done .gallery3d__meter b { background: var(--teal, #2f6f6a); color: #fffaf0; border-color: var(--teal, #2f6f6a); }
@media (prefers-reduced-motion: no-preference) { .gallery3d:not(.is-done) .gallery3d__meter b { animation: g3dnudge 1.6s ease-in-out infinite; } }
@keyframes g3dnudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
.gallery3d.is-3d .gallery3d__intro { position: absolute; z-index: 1; left: 0; right: 0; top: clamp(2rem, 8vh, 5rem); pointer-events: none; }
.gallery3d.is-3d .gallery3d__hint { display: block; }
.gallery3d.is-3d .gallery3d__caption { display: block; position: absolute; z-index: 1; left: 50%; bottom: clamp(1.4rem, 5vh, 3rem); transform: translateX(-50%); text-align: center; }
.gallery3d__caption a { display: inline-flex; flex-direction: column; align-items: center; gap: .15rem; padding: .8rem 1.4rem; background: #fffaf0; color: var(--ink, #2b1d14);
  border: 2px solid var(--ink, #2b1d14); box-shadow: 4px 4px 0 var(--ink, #2b1d14); text-decoration: none; transform: rotate(-1.5deg); }
.gallery3d__caption span { font-family: "Courier Prime", ui-monospace, monospace; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; }
.gallery3d__caption strong { font-family: "Shrikhand", Georgia, serif; font-weight: 400; font-size: 1.25rem; color: var(--rust, #c4501f); }
.gallery3d__caption em { font-style: normal; font-weight: 700; }
.gallery3d__caption.is-new a { animation: r3dcap .5s cubic-bezier(.2, .7, .2, 1); }
@keyframes r3dcap { from { opacity: 0; transform: translateY(10px) rotate(-1.5deg); } }

/* ---------- shop in 3D ---------- */
.in3d { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: clamp(1.5rem, 4vw, 3.5rem);
  margin: clamp(3rem, 7vw, 5rem) var(--gutter, 24px) 0; padding: clamp(1.5rem, 4vw, 3rem); background: #fffaf0; border: 3px solid var(--ink, #2b1d14); box-shadow: 8px 8px 0 var(--ink, #2b1d14); }
.in3d .r3d-title { font-size: clamp(2rem, 4.4vw, 3.4rem); margin-bottom: 1rem; }
.in3d__text > p:not(.r3d-sticker) { color: var(--ink-soft, #5c4433); line-height: 1.7; margin: 0 0 1.4rem; }
.in3d__picker, .in3d__variants { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .9rem; }
.in3d__picker button, .in3d__variants button { padding: .55rem 1rem; border: 2px solid var(--ink, #2b1d14); background: #fffaf0; color: var(--ink, #2b1d14); cursor: pointer;
  font-family: "Courier Prime", ui-monospace, monospace; font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; box-shadow: 3px 3px 0 var(--ink, #2b1d14); }
.in3d__picker button[aria-pressed="true"], .in3d__variants button[aria-pressed="true"] { background: var(--mustard, #e3a92b); }
.in3d__variants[hidden] { display: none; }
.in3d__stage { position: relative; aspect-ratio: 4 / 3; border: 2px solid var(--ink, #2b1d14); background: radial-gradient(80% 80% at 50% 40%, #fffaf0, var(--paper, #f3e6cc)); }
.in3d__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.in3d__status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 1rem; text-align: center; font-weight: 700; pointer-events: none; }
.in3d__status[hidden] { display: none; }
.in3d__hint { position: absolute; left: 50%; bottom: .9rem; transform: translateX(-50%); font-family: "Courier Prime", ui-monospace, monospace; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft, #5c4433); pointer-events: none; }
.in3d__credit { grid-column: 1 / -1; margin: 0; font-size: .72rem; color: var(--ink-soft, #5c4433); }
.in3d__credit a { text-decoration: underline; color: inherit; }

/* ---------- 3D bee inside a hero (retro.html: rises out of the "Good Times" sunset) ---------- */
.sunset.hero3d--inline { display: block; height: clamp(320px, 36vw, 480px); min-height: 0; border: 0; background: none; overflow: hidden; }
.sunset.hero3d--inline::before { content: none; }
.hero3d--inline .hero3d__canvas { z-index: 1; }
.hero3d--inline .hero3d__fallback { z-index: 1; right: auto; top: auto; left: 50%; bottom: 22%; transform: translateX(-50%); width: min(36vw, 240px); }
.hero3d--inline .hero3d__hint { z-index: 2; right: auto; bottom: auto; top: .4rem; left: 50%; transform: translateX(-50%); white-space: nowrap; }

@media (max-width: 860px) {
  .hero3d { align-items: flex-end; min-height: min(92svh, 760px); }
  .hero3d::before { right: 50%; transform: translateX(50%); bottom: auto; top: 24%; width: 86vw; }
  .hero3d__text { width: 100%; text-align: center; padding-bottom: 2.2rem; }
  .hero3d.is-3d .r3d-sticker { display: none; }
  .hero3d__ctas { justify-content: center; }
  .hero3d__fallback { right: auto; left: 50%; top: 8%; transform: translateX(-50%); width: min(62vw, 300px); }
  .hero3d__hint { right: auto; left: 50%; bottom: auto; top: 1rem; transform: translateX(-50%); white-space: nowrap; }
  .in3d { grid-template-columns: minmax(0, 1fr); margin-inline: var(--gutter, 16px); }
}
@media (prefers-reduced-motion: reduce) { .r3d-btn { transition: none; } }

/* ---------- retro.html top menu: just The Rack and Main Store, drawn as boxes; the selected one is bigger ---------- */
body[data-page="retro"] .header .nav { align-items: center; gap: 14px; }
body[data-page="retro"] .header .nav a { display: inline-block; padding: .5rem .9rem; border: 2px solid var(--ink, #2b1d14); background: #fffaf0;
  color: var(--ink, #2b1d14); box-shadow: 3px 3px 0 var(--ink, #2b1d14); text-decoration: none; line-height: 1.1;
  transition: transform .15s, box-shadow .15s, background .15s; }
body[data-page="retro"] .header .nav a:hover { background: var(--paper-2, #ead7b3); color: var(--ink, #2b1d14); text-decoration: none; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink, #2b1d14); }
body[data-page="retro"] .header .nav a[aria-current] { padding: .7rem 1.25rem; font-size: 1.08em; background: var(--mustard, #e3a92b); border-width: 3px;
  box-shadow: 5px 5px 0 var(--ink, #2b1d14); transform: rotate(-2deg); }
body[data-page="retro"] .header .nav a[aria-current]:hover { transform: rotate(-2deg) translate(-1px, -1px); box-shadow: 6px 6px 0 var(--ink, #2b1d14); }
body[data-page="retro"] .header .nav a:focus-visible { outline: 3px solid var(--teal, #2f6f6a); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { body[data-page="retro"] .header .nav a { transition: none; } }

/* phones: the boxes sit on a second row under the logo */
@media (max-width: 720px) {
  body[data-page="retro"] .header .wrap { flex-wrap: wrap; row-gap: 10px; }
  body[data-page="retro"] .header .nav { display: flex; order: 3; width: 100%; justify-content: center; gap: 16px; font-size: .74rem; padding-bottom: 4px; }
}

/* ---------- 3D pointing glove next to Main Store (js/hand3d.js) ---------- */
body[data-page="retro"] .header .nav .hand3d { position: relative; display: inline-block; width: 74px; height: 50px; margin-left: -6px; cursor: pointer; flex: none; }
.hand3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hand3d__fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; line-height: 1; color: var(--ink, #2b1d14);
  animation: r3dpoke 1.2s ease-in-out infinite; }
.hand3d.is-3d .hand3d__fallback { display: none; }
@keyframes r3dpoke { 0%, 60%, 100% { transform: translateX(0); } 30% { transform: translateX(-6px); } }
@media (prefers-reduced-motion: reduce) { .hand3d__fallback { animation: none; } }
@media (max-width: 720px) { body[data-page="retro"] .header .nav .hand3d { width: 60px; height: 42px; margin-left: -8px; } }
