/* ============================================================
   FOUNDRY / FORGE SCENES — «Кузница» homepage layer, v2 (2026-09)
   Hero loop, the 7-bit forging belt, the shared fire, the
   builder wall (with per-tool tier selects) and the workshop
   shelf. Scoped under body.foundry.
   Fail-safe contract (same as foundry.css): real content is
   visible with no JS; scene DECORATION (.fg-decor: ingot, hammer,
   sparks, flash, steam, embers, pulse) only appears once
   body.fdry-anim is armed. transform/opacity only.
   v2 feedback fixes: glows fade inside their boxes (no hard
   cuts), pinned bits center in the viewport, ingot/tool sit ON
   the anvil face, dots rail is fixed, fire scene is alive.
   ============================================================ */

body.foundry {
  --fg-iron:   #232A4D;
  --fg-iron-2: #2E3663;
  --fg-ember:  #FF8A3D;
  --fg-heat-0: #2B0E0C;
  --fg-heat-1: #7F1D1D;
  --fg-heat-2: #C2410C;
  --fg-heat-3: #F59E0B;
  --fg-heat-4: #FDE68A;
  --fg-heat-5: #FFF7E6;
  --fg-chalk:  #E8EAF4;
  --fg-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --fg-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

/* ---------- shared: sparks / flash / steam / decor gate ------ */
.fg-spark {
  position: absolute; left: 0; top: 0; width: 8px; height: 8px;
  border-radius: 50%; background: var(--fg-acc, var(--fg-ember));
  box-shadow: 0 0 12px 2px color-mix(in srgb, var(--fg-acc, var(--fg-ember)) 65%, transparent);
  opacity: 0; pointer-events: none; will-change: transform, opacity;
}
.fg-flash {
  position: absolute; width: 150px; height: 150px; border-radius: 50%;
  pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(255,247,230,.95) 0%, rgba(255,138,61,.35) 42%, transparent 68%);
  will-change: transform, opacity;
}
.fg-steam {
  position: absolute; width: 16px; height: 40px; border-radius: 999px;
  background: rgba(230,236,255,.45); filter: blur(7px);
  opacity: 0; pointer-events: none; will-change: transform, opacity;
}
.fg-decor { display: none; }
body.fdry-anim .fg-decor { display: block; }

/* Impact shockwave — expands and dies from the strike point */
.fg-ring {
  position: absolute; width: 90px; height: 90px; border-radius: 50%;
  border: 2px solid rgba(255,214,150,.85);
  opacity: 0; pointer-events: none; will-change: transform, opacity;
}
/* Heat haze — warm blurred wisps that climb off the hot blank */
.fg-haze {
  position: absolute; width: 22px; height: 52px; border-radius: 999px;
  background: rgba(255,166,90,.35); filter: blur(9px);
  opacity: 0; pointer-events: none; will-change: transform, opacity;
}
/* Ground shadow — the scene sits on something */
.fg-ground {
  position: absolute; left: 50%; bottom: -6px; width: 320px; height: 46px;
  margin-left: -160px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(3,5,14,.55) 0%, transparent 68%);
}

/* ============================================================
   1 · HERO SCENE — looping forge (right column)
   ============================================================ */
.fg-hero { position: relative; display: flex; flex-direction: column; gap: 30px; }
.fg-hero__stage {
  position: relative; height: 320px;
  display: flex; align-items: flex-end; justify-content: center;
}
/* The glow element extends past the stage bottom (nothing clips it)
   and its gradient dies before the element edge — no hard cuts. */
.fg-hero__glow {
  position: absolute; left: -12%; right: -12%; top: 6%; bottom: -140px; pointer-events: none;
  background: radial-gradient(ellipse 42% 34% at 50% 62%,
              rgba(255,138,61,.16) 0%, rgba(124,92,252,.09) 42%, transparent 66%);
}
/* Heat aura behind the ingot — brightness driven by JS with the ramp */
.fg-hero__aura, .fg-bit__aura {
  position: absolute; width: 200px; height: 120px; border-radius: 50%;
  left: 50%; transform: translateX(-50%); pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255,150,60,.5) 0%, rgba(255,90,30,.18) 45%, transparent 70%);
  filter: blur(10px); will-change: opacity;
}
.fg-hero__aura { bottom: 120px; }
.fg-hero__ember {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: var(--fg-heat-3); box-shadow: 0 0 6px var(--fg-ember);
  opacity: 0; pointer-events: none; will-change: transform, opacity;
  left: 50%; bottom: 150px;
}
.fg-hero__ember:nth-of-type(2) { width: 3px; height: 3px; margin-left: -26px; }
.fg-hero__ember:nth-of-type(3) { width: 5px; height: 5px; margin-left: 24px; }
/* Centered via margin (not transform) so GSAP can own the transform
   without the icon drifting half its width right between cycles. */
.fg-hero__tool {
  position: absolute; bottom: 160px; left: 50%; width: 132px; height: 132px;
  margin-left: -66px; color: var(--fg-heat-5); z-index: 2;
  filter: drop-shadow(0 0 14px rgba(255,180,90,.3));
}
.fg-hero__anvil { width: 250px; height: 250px; color: var(--fg-iron-2); position: relative; z-index: 1;
  filter: drop-shadow(0 16px 26px rgba(0,0,0,.4)); }
.fg-hero__ingot {
  position: absolute; bottom: 134px; left: 50%; width: 124px; height: 124px;
  transform: translateX(-50%); color: var(--fg-heat-0); z-index: 2;
}
.fg-hero__hammer {
  position: absolute; bottom: 196px; left: 50%; width: 170px; height: 170px;
  transform: translateX(-6%) rotate(30deg); transform-origin: 84% 90%;
  color: var(--fg-iron); z-index: 3;
}
.fg-hero__flash { bottom: 150px; left: 50%; margin-left: -75px; z-index: 4; }

/* Chips — always visible, hero loop just pulses them */
.fg-chips {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px;
  position: relative; z-index: 5;
}
.fg-chip {
  display: flex; align-items: center; gap: 11px; text-align: left;
  padding: 11px 14px; border-radius: 13px; cursor: pointer;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.09);
  color: var(--fdry-ink, #ECEEF7); font: inherit; text-decoration: none;
  transition: transform 180ms var(--fg-ease-out), border-color 260ms ease,
              background 180ms ease, box-shadow 320ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .fg-chip:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--fg-acc) 55%, transparent); background: rgba(255,255,255,.07); }
}
.fg-chip:focus-visible { outline: 2px solid var(--fg-acc); outline-offset: 2px; }
.fg-chip.is-forged {
  border-color: color-mix(in srgb, var(--fg-acc) 65%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--fg-acc) 24%, transparent);
}
.fg-chip__ic { width: 30px; height: 30px; flex: none; color: var(--fg-acc); }
.fg-chip__ic svg, .fg-chip__ic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fg-chip__name { display: block; font-weight: 600; font-size: .86rem; line-height: 1.2; }
.fg-chip__tag  { display: block; font-size: .72rem; color: var(--fdry-ink-faint, #6B7299); line-height: 1.25; margin-top: 2px; }
.fg-chip--wide { grid-column: 1 / -1; justify-content: center; background: transparent; border-style: dashed; }
.fg-chip--wide .fg-chip__name { color: var(--fdry-ink-soft, #A7AEC8); font-weight: 500; }

@media (max-width: 1023px) {
  .fg-hero__stage { height: 240px; }
  .fg-hero__anvil { width: 190px; height: 190px; }
  .fg-hero__ingot { width: 96px; height: 96px; bottom: 101px; }
  .fg-hero__hammer { width: 128px; height: 128px; bottom: 148px; }
  .fg-hero__flash { bottom: 110px; }
}

/* ============================================================
   2 · THE BELT — seven forging bits (#products)
   Each bit is one screen tall and centers its stage. The passport shows on
   approach; the forging plays itself once the stage enters the frame and
   never touches the scroll (no scrub, no hold — feedback #2, #3).
   ============================================================ */
.fg-belt-head { margin-bottom: clamp(20px, 3vw, 40px); }

.fg-bit { position: relative; }
.fg-bit__inner {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: 100vh; padding: 0;
}
.fg-bit__scene {
  position: relative; height: 440px;
  display: flex; align-items: flex-end; justify-content: center;
}
.fg-bit__scene-glow {
  position: absolute; left: -10%; right: -10%; top: 30%; bottom: -140px; pointer-events: none;
  background: radial-gradient(ellipse 46% 36% at 50% 58%,
              color-mix(in srgb, var(--fg-acc) 15%, transparent) 0%, transparent 66%);
}
.fg-bit__aura { bottom: 128px; z-index: 1; }
/* Art finale: the product UI rises into the scene after the quench */
.fg-bit__art {
  position: absolute; inset: auto 4% -10px 4%; z-index: 5; opacity: 0;
  border-radius: 14px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--fg-acc) 35%, rgba(255,255,255,.12));
  box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 30px color-mix(in srgb, var(--fg-acc) 18%, transparent);
  background: #0B0E20; will-change: transform, opacity;
}
.fg-bit__art img { display: block; width: 100%; height: auto; }
.fg-bit__anvil { width: 260px; height: 260px; color: var(--fg-iron-2);
  filter: drop-shadow(0 16px 26px rgba(0,0,0,.4)); }
/* Tool rests ON the anvil face (feedback: pieces floated) */
.fg-bit__tool {
  position: absolute; bottom: 168px; left: 50%; width: 168px; height: 168px;
  transform: translateX(-50%); color: var(--fg-acc); z-index: 2;
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--fg-acc) 34%, transparent));
}
.fg-bit__ingot {
  position: absolute; bottom: 139px; left: 50%; width: 130px; height: 130px;
  transform: translateX(-50%); color: var(--fg-heat-0); z-index: 2;
}
.fg-bit__hammer {
  position: absolute; bottom: 206px; left: 50%; width: 180px; height: 180px;
  transform: translateX(-4%) rotate(30deg); transform-origin: 84% 90%;
  color: var(--fg-iron); z-index: 3;
}
.fg-bit__flash { bottom: 155px; left: 50%; margin-left: -75px; z-index: 4; }
.fg-bit__bitline {
  position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%);
  width: max-content; max-width: 92%;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .8rem;
  color: var(--fdry-ink-soft, #A7AEC8); letter-spacing: .02em; text-align: center;
}
body.fdry-anim .fg-bit__bitline { opacity: 0; }

/* Passport */
.fg-bit__pass { max-width: 480px; }
.fg-bit__n {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--fg-acc); font-size: .82rem; letter-spacing: .14em;
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.fg-bit__n::after { content: ""; width: 44px; height: 1px; background: color-mix(in srgb, var(--fg-acc) 55%, transparent); }
.fg-bit__title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fg-bit__tool-label {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--fg-acc); border: 1px solid color-mix(in srgb, var(--fg-acc) 45%, transparent);
  border-radius: 999px; padding: 3px 11px; white-space: nowrap;
}
.fg-bit__tag { color: var(--fdry-ink, #ECEEF7); font-size: 1.02rem; font-weight: 500; line-height: 1.5; margin: 14px 0 10px; }
.fg-bit__desc { color: var(--fdry-ink-soft, #A7AEC8); font-size: .97rem; line-height: 1.65; margin: 0 0 18px; }
.fg-bit__desc p { margin: 0 0 10px; }
.fg-bit__feats { display: grid; gap: 10px; margin: 0 0 22px; }
.fg-bit__feat { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem;
  color: var(--fdry-ink-soft, #A7AEC8); }
.fg-bit__feat svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--fg-acc); }
.fg-bit__meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.fg-bit__price { font-variant-numeric: tabular-nums; color: var(--fdry-ink, #ECEEF7); font-weight: 600; }
.fg-bit__price small { color: var(--fdry-ink-faint, #6B7299); font-weight: 400; }
.fg-bit__price .is-draft { color: var(--fdry-ink-faint, #6B7299); font-size: .72rem; margin-left: 6px; }
/* Not sellable yet (registry status=prelaunch): no price to promise. */
.fg-bit__price--soon { color: var(--fdry-ink-faint, #6B7299); font-weight: 500; }

/* Dots rail — FIXED to the viewport, shown only while the belt is
   on screen (feedback #8: dots scrolled away with the section). */
.fg-belt__dots {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px; z-index: 60;
  opacity: 0; pointer-events: none;
  transition: opacity 260ms ease;
}
.fg-belt__dots.is-shown { opacity: 1; }
.fg-belt__dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.16);
  transition: background 200ms ease, transform 200ms var(--fg-ease-out); }
.fg-belt__dot.is-on { background: var(--fg-acc, #fff); transform: scale(1.35); }

@media (max-width: 899px) {
  .fg-bit__inner { grid-template-columns: 1fr; min-height: 0; gap: 16px; padding: 44px 0; align-items: start; }
  .fg-bit__scene { height: 300px; order: -1; }
  .fg-bit__anvil { width: 195px; height: 195px; }
  .fg-bit__tool { width: 126px; height: 126px; bottom: 126px; }
  .fg-bit__ingot { width: 98px; height: 98px; bottom: 104px; }
  .fg-bit__hammer { width: 132px; height: 132px; bottom: 152px; }
  .fg-belt__dots { display: none; }
}

/* ============================================================
   3 · ONE FIRE — a living hearth (feedback #5)
   ============================================================ */
.fg-fire { position: relative; }
.fg-fire__stage {
  position: relative; margin: 0 auto; max-width: 760px; height: 300px;
  display: flex; align-items: flex-end; justify-content: center;
}
.fg-fire__stage-glow {
  position: absolute; left: -14%; right: -14%; top: 4%; bottom: -130px; pointer-events: none;
  background: radial-gradient(ellipse 38% 32% at 50% 60%, rgba(255,138,61,.20) 0%, transparent 64%);
}
.fg-fire__hearth { position: absolute; bottom: -2px; left: 50%; width: 300px;
  margin-left: -150px; z-index: 1; }
.fg-fire__hearth svg { display: block; width: 100%; height: auto; }
.fg-hearth__embers circle { opacity: .55; filter: drop-shadow(0 0 5px #FF8A3D); }
body.fdry-anim .fg-hearth__embers circle { animation: fg-ember-glow 2.4s ease-in-out infinite; }
.fg-hearth__embers circle:nth-child(1) { animation-delay: 0s; }
.fg-hearth__embers circle:nth-child(2) { animation-delay: .9s; animation-duration: 1.9s; }
.fg-hearth__embers circle:nth-child(3) { animation-delay: .4s; }
.fg-hearth__embers circle:nth-child(4) { animation-delay: 1.3s; animation-duration: 2.9s; }
.fg-hearth__embers circle:nth-child(5) { animation-delay: .7s; animation-duration: 2s; }
.fg-hearth__embers circle:nth-child(6) { animation-delay: 1.7s; }
.fg-hearth__embers circle:nth-child(7) { animation-delay: .2s; animation-duration: 2.7s; }
.fg-hearth__embers circle:nth-child(8) { animation-delay: 1.1s; }
@keyframes fg-ember-glow { 0% { opacity: .18; } 50% { opacity: .95; } 100% { opacity: .3; } }

.fg-fire__flame { position: relative; width: 200px; height: 200px; bottom: 34px;
  color: var(--fg-ember); z-index: 2;
  filter: drop-shadow(0 0 30px rgba(255,138,61,.38));
  transform-origin: 50% 92%; }
body.fdry-anim .fg-fire__flame.is-lit { animation: fg-flicker 2.6s var(--fg-ease-in-out) infinite alternate; }
@keyframes fg-flicker {
  from { transform: scaleY(1) scaleX(1) rotate(-1deg); }
  to   { transform: scaleY(1.07) scaleX(0.97) rotate(1.2deg); }
}
.fg-fire__ember-p {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: var(--fg-heat-3); box-shadow: 0 0 8px var(--fg-ember);
  opacity: 0; pointer-events: none; will-change: transform, opacity; z-index: 3;
  left: 50%; bottom: 120px;
}
.fg-fire__pulse {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: var(--fg-heat-4); box-shadow: 0 0 12px var(--fg-ember);
  opacity: 0; pointer-events: none; will-change: transform, opacity; z-index: 4;
  left: 50%; bottom: 90px;
}
.fg-fire__coal-drop {
  position: absolute; width: 72px; height: 72px; bottom: 180px;
  left: 50%; margin-left: -36px; color: #0F1226; z-index: 3;
}

.fg-fire__ring {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  margin-top: 6px; position: relative; z-index: 5;
}
.fg-fire__tool {
  width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09);
  color: var(--fg-acc);
  transition: box-shadow 420ms ease, border-color 420ms ease, transform 320ms var(--fg-ease-out);
}
.fg-fire__tool svg, .fg-fire__tool img { width: 34px; height: 34px; object-fit: contain; display: block; }
.fg-fire__tool.is-hot {
  border-color: color-mix(in srgb, var(--fg-acc) 55%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--fg-acc) 30%, transparent);
}
.fg-fire__tool.is-fed { transform: translateY(-4px); }
.fg-fire__note {
  margin-top: 26px; text-align: center; font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .8rem; color: var(--fdry-ink-faint, #6B7299);
}

/* ============================================================
   4 · THE WALL — builder preview with per-tool tiers (feedback #7)
   ============================================================ */
.fg-wall__grid {
  display: grid; grid-template-columns: 1.22fr .95fr; gap: clamp(22px, 4vw, 48px);
  align-items: start;
}
.fg-wall__board {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px;
  padding: clamp(16px, 2.4vw, 26px); border-radius: 20px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(124,92,252,.07) 0%, transparent 60%),
    rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
}
.fg-plaque {
  position: relative; display: flex; align-items: center; gap: 13px; text-align: left;
  padding: 14px 15px; border-radius: 14px; cursor: pointer; font: inherit;
  color: var(--fdry-ink, #ECEEF7);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  transition: transform 200ms var(--fg-ease-out), border-color 200ms ease,
              background 200ms ease, box-shadow 200ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .fg-plaque:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--fg-acc) 45%, transparent); }
}
.fg-plaque:focus-visible { outline: 2px solid var(--fg-acc); outline-offset: 2px; }
.fg-plaque__ic { width: 38px; height: 38px; flex: none; color: var(--fg-acc);
  transition: transform 200ms var(--fg-ease-out); }
.fg-plaque__ic svg, .fg-plaque__ic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fg-plaque__name { display: block; font-weight: 600; font-size: .93rem; }
.fg-plaque__price { display: block; font-size: .78rem; color: var(--fdry-ink-faint, #6B7299);
  font-variant-numeric: tabular-nums; margin-top: 2px; }
.fg-plaque__tick {
  position: absolute; top: 10px; right: 12px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; line-height: 1;
  color: #0C1A3A; background: var(--fg-acc);
  opacity: 0; transform: scale(.6);
  transition: opacity 160ms ease, transform 200ms var(--fg-ease-out);
}
.fg-plaque[aria-pressed="true"] {
  background: color-mix(in srgb, var(--fg-acc) 13%, rgba(255,255,255,.04));
  border-color: color-mix(in srgb, var(--fg-acc) 60%, transparent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--fg-acc) 22%, transparent);
}
.fg-plaque[aria-pressed="true"] .fg-plaque__tick { opacity: 1; transform: scale(1); }
.fg-plaque[aria-pressed="true"] .fg-plaque__ic { transform: rotate(-8deg); }
/* Not sellable yet (registry status=prelaunch): still shown on the wall (the
   suite is one anvil, not just what's on sale today) but not pickable. */
.fg-plaque--soon { cursor: default; opacity: .58; }
@media (hover: hover) and (pointer: fine) {
  .fg-plaque--soon:hover { transform: none; border-color: rgba(255,255,255,.09); }
}
.fg-plaque__price--soon { text-transform: uppercase; font-size: .68rem; letter-spacing: .08em; }
.fg-wall__msg { font-size: .82rem; color: var(--fdry-ink-soft, #A7AEC8);
  background: rgba(255,255,255,.05); border: 1px dashed rgba(255,255,255,.16);
  border-radius: 10px; padding: 8px 12px; margin: 0 0 14px; }
.fg-wall__msg[hidden] { display: none; }

/* Chalkboard */
.fg-chalk {
  border-radius: 20px; padding: clamp(18px, 2.6vw, 28px);
  background: linear-gradient(160deg, #10142B 0%, #0B0E20 100%);
  border: 1px solid rgba(255,255,255,.09);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--fg-chalk);
  position: sticky; top: 90px;
}
.fg-chalk__title { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--fdry-ink-faint, #6B7299); margin-bottom: 16px; }
.fg-chalk__rows { display: grid; gap: 10px; min-height: 64px; }
.fg-chalk__row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center; font-size: .84rem; }
.fg-chalk__row .n { color: var(--fdry-ink-soft, #A7AEC8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-chalk__row .v { font-variant-numeric: tabular-nums; text-align: right; min-width: 46px; }
/* Custom tier dropdown — the native popup can't be themed, this one can */
.fg-select { position: relative; }
.fg-select__btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: rgba(255,255,255,.05); color: var(--fdry-ink, #ECEEF7);
  border: 1px solid rgba(255,255,255,.12); border-radius: 9px;
  font-family: Inter, sans-serif; font-size: .76rem; line-height: 1.2;
  padding: 6px 10px; max-width: 190px; white-space: nowrap;
  transition: border-color 180ms ease, background-color 180ms ease;
}
.fg-select__btn::after {
  content: ""; width: 10px; height: 6px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23A7AEC8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
  transition: transform 200ms var(--fg-ease-out);
}
.fg-select__btn:hover { border-color: rgba(255,255,255,.24); }
.fg-select__btn:focus-visible { outline: 2px solid #7C5CFC; outline-offset: 1px; }
.fg-select.is-open .fg-select__btn { border-color: rgba(124,92,252,.55); }
.fg-select.is-open .fg-select__btn::after { transform: rotate(180deg); }
.fg-select__list {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 80;
  min-width: 100%; margin: 0; padding: 6px; list-style: none;
  background: rgba(16, 20, 43, .97);
  border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0,0,0,.5);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top right;
  pointer-events: none;
  transition: opacity 160ms ease, transform 200ms var(--fg-ease-out);
}
.fg-select.is-open .fg-select__list { opacity: 1; transform: none; pointer-events: auto; }
.fg-select__opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  font-family: Inter, sans-serif; font-size: .78rem; color: var(--fdry-ink-soft, #A7AEC8);
}
.fg-select__opt:hover, .fg-select__opt.is-active { background: rgba(124,92,252,.14); color: var(--fdry-ink, #ECEEF7); }
.fg-select__opt[aria-selected="true"] { color: var(--fdry-ink, #ECEEF7); }
.fg-select__opt[aria-selected="true"]::after { content: "✓"; font-size: .72rem; color: #A78BFA; }
.fg-select__price { color: var(--fdry-ink-faint, #6B7299); font-variant-numeric: tabular-nums; }
.fg-chalk__empty { color: var(--fdry-ink-faint, #6B7299); font-size: .85rem; }
.fg-chalk__rule { border: 0; border-top: 1px dashed rgba(255,255,255,.18); margin: 14px 0; }
.fg-chalk__line { display: flex; justify-content: space-between; font-size: .9rem; margin-top: 7px; }
.fg-chalk__line .v { font-variant-numeric: tabular-nums; }
.fg-chalk__line--off .v { color: var(--fg-ember); }
.fg-chalk__total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; }
.fg-chalk__total .v { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fg-chalk__total .v small { font-size: .85rem; font-weight: 400; color: var(--fdry-ink-faint, #6B7299); }
.fg-chalk__save { margin-top: 4px; font-size: .8rem; color: #34D9B4; min-height: 1.2em; }
.fg-chalk__note { margin: 6px 0 0; font-size: .78rem; line-height: 1.45; color: rgba(255,255,255,.62); }
.fg-chalk__note[hidden] { display: none; }
.fg-chalk__promo { display: inline; margin-left: 4px; padding: 0; border: 0; background: none; font: inherit; color: #34D9B4; text-decoration: underline; cursor: pointer; }
.fg-chalk__cta { margin-top: 18px; }
.fg-chalk__note { margin-top: 12px; font-size: .72rem; color: var(--fdry-ink-faint, #6B7299); line-height: 1.5; }

@media (max-width: 900px) {
  .fg-wall__grid { grid-template-columns: 1fr; }
  .fg-chalk { position: static; }
  .fg-wall__board { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* ============================================================
   5 · WORKSHOP SHELF — standalone services
   ============================================================ */
.fg-shop { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.fg-shop__card {
  position: relative; display: block; padding: 30px 30px 26px; border-radius: 22px;
  background:
    radial-gradient(110% 80% at 88% -4%, color-mix(in srgb, var(--fg-acc) 20%, transparent) 0%, transparent 58%),
    radial-gradient(90% 70% at 0% 110%, color-mix(in srgb, var(--fg-acc) 8%, transparent) 0%, transparent 55%),
    rgba(255,255,255,.045);
  border: 1px solid color-mix(in srgb, var(--fg-acc) 22%, rgba(255,255,255,.1));
  color: inherit; text-decoration: none; overflow: hidden;
  transition: transform 220ms var(--fg-ease-out), border-color 220ms ease, box-shadow 260ms ease;
}
.fg-shop__card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--fg-acc), transparent); opacity: .8; }
@media (hover: hover) and (pointer: fine) {
  .fg-shop__card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--fg-acc) 55%, rgba(255,255,255,.14));
    box-shadow: 0 18px 44px rgba(0,0,0,.35), 0 0 30px color-mix(in srgb, var(--fg-acc) 20%, transparent);
  }
  .fg-shop__card:hover .fg-shop__go svg { transform: translateX(3px); }
  .fg-shop__card:hover .fg-shop__ic { transform: rotate(-6deg) scale(1.04); }
}
.fg-shop__head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.fg-shop__ic { width: 62px; height: 62px; flex: none; border-radius: 16px; display: grid; place-items: center;
  color: var(--fg-acc);
  background: linear-gradient(150deg, color-mix(in srgb, var(--fg-acc) 26%, transparent) 0%, color-mix(in srgb, var(--fg-acc) 9%, transparent) 100%);
  border: 1px solid color-mix(in srgb, var(--fg-acc) 45%, transparent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--fg-acc) 22%, transparent);
  transition: transform 220ms var(--fg-ease-out);
}
.fg-shop__ic svg { width: 36px; height: 36px; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--fg-acc) 45%, transparent)); }
.fg-shop__kind { display: inline-block; font-family: "JetBrains Mono", monospace; font-size: .64rem;
  text-transform: uppercase; letter-spacing: .16em; color: var(--fg-acc);
  background: color-mix(in srgb, var(--fg-acc) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--fg-acc) 35%, transparent);
  border-radius: 999px; padding: 3px 10px; }
.fg-shop__name { display: block; color: var(--fdry-ink, #ECEEF7); font-weight: 700; font-size: 1.32rem; margin-top: 7px; letter-spacing: -.01em; }
.fg-shop__tag { display: block; color: var(--fdry-ink, #ECEEF7); font-weight: 500; font-size: .98rem; line-height: 1.5; }
.fg-shop__blurb { display: block; color: var(--fdry-ink-soft, #A7AEC8); font-size: .92rem; line-height: 1.62; margin-top: 9px; }
.fg-shop__feats { display: grid; gap: 9px; margin-top: 16px; }
.fg-shop__feat { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; color: #C9CDDE; }
.fg-shop__feat svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--fg-acc); }
.fg-shop__go { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px;
  font-size: .84rem; font-weight: 600; color: var(--fg-acc); }
.fg-shop__go svg { transition: transform 200ms var(--fg-ease-out); }

/* ---------- reduced motion ----------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .fg-chip, .fg-plaque, .fg-shop__card, .fg-plaque__ic, .fg-belt__dot, .fg-fire__tool { transition: none; }
  body.fdry-anim .fg-fire__flame.is-lit,
  body.fdry-anim .fg-fire__mound i { animation: none; }
}

/* Mobile: the decorative glows (hero, fire stage, bit scenes) spill past the
   viewport edge and widen the document to ~420px on a 390px phone, which
   drags the fixed nav along. Clip horizontally at the section — `clip` does
   not create a scroll container, so pinned/sticky behaviour is untouched. */
@media (max-width: 767px) {
  .fg-hero, .fg-fire__stage, .fg-bit__scene, .fg-fire { overflow-x: clip; }
}

/* Dashboard checkout feedback under the chalkboard CTA. */
.fg-chalk__status { margin: 10px 0 0; font-size: .84rem; line-height: 1.4; color: #FCA5A5; }
.fg-chalk__status:empty { display: none; }
.fg-chalk__cta[aria-busy="true"] { opacity: .7; pointer-events: none; }
