/* Maineblock studios section. All selectors are prefixed .mbs to avoid collisions. */
.mbs {
  --mbs-ink: #16161a;          /* section background (matches Maine Mood section) */
  --mbs-ink-deep: #0b0b0c;     /* stage background (matches hero) */
  --mbs-panel: #1e1e22;
  --mbs-fog: #f4f4f5;
  --mbs-mist: #a1a1aa;
  --mbs-line: rgba(255, 255, 255, 0.08);
  --mbs-orange: #ff8000;
  --mbs-valuation: #ff8000;
  --mbs-analysis: #ffa53d;
  --mbs-crypto: #ffc46b;
  --mbs-sae: #ff6a2b;
  --mbs-font: inherit;         /* uses the site font */
  --mbs-max: 1120px;           /* match the site's content container width */
  --mbs-radius: 6px;
  --mbs-ease: cubic-bezier(0.2, 0.8, 0.1, 1);

  padding: 60px clamp(1.25rem, 4vw, 2rem) clamp(3.5rem, 7vw, 6rem);
  background: var(--mbs-ink);
  border-bottom: 1px solid var(--mbs-line);
  color: var(--mbs-fog);
  font-family: var(--mbs-font);
}
.mbs *, .mbs *::before, .mbs *::after { box-sizing: border-box; }

.mbs [data-studio="valuation"] { --accent: var(--mbs-valuation); }
.mbs [data-studio="analysis"] { --accent: var(--mbs-analysis); }
.mbs [data-studio="crypto"] { --accent: var(--mbs-crypto); }
.mbs [data-studio="sae"] { --accent: var(--mbs-sae); }

.mbs__inner { max-width: var(--mbs-max); margin: 0 auto; }

/* Header, styled like the site's section headers */
.mbs__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-bottom: 2rem;
}
.mbs__eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mbs-orange);
}
.mbs__title {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.mbs__line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.mbs__line > span { display: block; }
.mbs__line + .mbs__line > span { color: var(--mbs-orange); }
.mbs__lede { margin: 0; max-width: 56ch; font-size: 1rem; line-height: 1.6; color: var(--mbs-mist); }

/* Console: tab row over the animated stage */
.mbs__console {
  border: 1px solid var(--mbs-line);
  border-radius: 12px;
  background: var(--mbs-panel);
  overflow: hidden;
}
.mbs__tabsbar { position: relative; border-bottom: 1px solid var(--mbs-line); }
.mbs__tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.mbs__tab {
  appearance: none;
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.3rem;
  margin: 0;
  padding: 1.1rem 1.25rem 1.2rem;
  border: 0;
  border-right: 1px solid var(--mbs-line);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.25s;
}
.mbs__tab:last-child { border-right: 0; }
.mbs__tab:hover { background: rgba(255, 255, 255, 0.025); }
.mbs__tab[aria-selected="true"] { background: rgba(255, 128, 0, 0.07); }
.mbs__tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.mbs__tab-name { display: flex; align-items: center; gap: 0.55rem; font-size: 1rem; font-weight: 700; }
.mbs__dot { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); opacity: 0.35; transition: opacity 0.25s; }
.mbs__tab[aria-selected="true"] .mbs__dot { opacity: 1; }
.mbs__tab-line { font-size: 0.85rem; line-height: 1.4; color: var(--mbs-mist); }
.mbs__tab-badge { flex: none; width: 30px; height: 30px; padding: 3px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }
.mbs__progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
}

/* Prev/next steppers: shown only under the 760px breakpoint, where
   the phone banner carries one studio's tab at a time. */
.mbs__tabnav { display: none; }
.mbs__tabnav-btn {
  appearance: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--mbs-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--mbs-fog);
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s;
}
.mbs__tabnav-btn:hover { background: rgba(255, 255, 255, 0.09); }
.mbs__tabnav-btn:focus-visible { outline: 2px solid var(--mbs-orange); outline-offset: 2px; }

.mbs__stage { min-width: 0; }
.mbs__screen {
  position: relative;
  min-height: clamp(300px, 38vw, 420px);
  background-color: var(--mbs-ink-deep);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
}
.mbs__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mbs__note { position: absolute; right: 1.25rem; top: 1rem; font-size: 0.72rem; color: var(--mbs-mist); opacity: 0.75; }

.mbs__panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding: 1.5rem 1.75rem 1.75rem;
  border-top: 1px solid var(--mbs-line);
}
.mbs__panel[hidden] { display: none; }
.mbs__copy { max-width: 56ch; }
.mbs__status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}
.mbs__status::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: mbs-pulse 2s infinite;
}
.mbs__panel h3 { margin: 0 0 0.4rem; font-size: clamp(1.4rem, 2.4vw, 1.85rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.mbs__panel-head { display: flex; align-items: center; gap: 14px; margin: 0 0 0.4rem; }
.mbs__panel-head h3 { margin: 0; }
.mbs__panel-badge { flex: none; width: 56px; height: 56px; padding: 5px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }
.mbs__panel p:not(.mbs__status) { margin: 0; line-height: 1.6; color: var(--mbs-mist); }

/* Buttons, matching the site's primary button */
.mbs__cta {
  display: inline-flex;
  align-items: center;
  padding: 0.8rem 1.25rem;
  border-radius: var(--mbs-radius);
  background: var(--mbs-orange);
  color: #0b0b0c;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s var(--mbs-ease), filter 0.2s;
}
.mbs__cta:hover { transform: translateY(-1px); filter: brightness(1.08); }
.mbs__cta:focus-visible { outline: 2px solid var(--mbs-fog); outline-offset: 3px; }
/* The build-time brand pass splits the label around the studio name
   ("Open " + a notranslate span). Inside this flex container the
   text run's trailing space is trimmed at the item boundary and the
   label renders as "OpenStock Valuation Studio"; display:contents
   merges the runs back into one — the same cure the site's own .btn
   rule carries. */
.mbs__cta .notranslate { display: contents; }

/* Motion, applied only when JS has loaded so content stays visible without it */
.mbs--js .mbs__line > span { transform: translateY(105%); transition: transform 1s var(--mbs-ease); }
.mbs--js .mbs__line + .mbs__line > span { transition-delay: 0.1s; }
.mbs--js .mbs__lede { opacity: 0; transition: opacity 0.9s 0.3s; }
.mbs--js .mbs__console { opacity: 0; transform: translateY(24px); transition: opacity 0.9s 0.35s, transform 1.1s 0.35s var(--mbs-ease); }
.mbs--js.is-in .mbs__line > span, .mbs--js.is-in .mbs__console { transform: none; }
.mbs--js.is-in .mbs__lede, .mbs--js.is-in .mbs__console { opacity: 1; }
.mbs--js .mbs__panel:not([hidden]) > * { animation: mbs-rise 0.55s var(--mbs-ease) both; }
.mbs--js .mbs__panel:not([hidden]) > * + * { animation-delay: 0.07s; }
@keyframes mbs-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes mbs-pulse { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Top gap matches the Maine Mood band's own top padding on the
   homepage (60px, 44px under 640px) — the site's section rhythm. */
@media (max-width: 640px) {
  .mbs { padding-top: 44px; }
}

@media (max-width: 760px) {
  /* Phone banner (owner ruling, 2026-11-01): one studio at a time.
     Only the active tab renders, full width, its name on one line;
     the steppers sit at the banner's lower right, beside the
     tab-line, which keeps clear of them. The old side-by-side
     scroll strip squeezed the names and cut the next tab. */
  .mbs__tabs { display: block; }
  .mbs__tab { display: none; border-right: 0; }
  .mbs__tab[aria-selected="true"] { display: grid; }
  .mbs__tab-name { white-space: nowrap; }
  .mbs__tab-line { padding-right: 6.25rem; }
  .mbs__tabnav { display: flex; gap: 0.4rem; position: absolute; right: 0.9rem; bottom: 0.85rem; }
  .mbs__panel { padding: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .mbs--js .mbs__line > span, .mbs--js .mbs__lede, .mbs--js .mbs__console { transform: none; opacity: 1; transition: none; }
  .mbs--js .mbs__panel:not([hidden]) > * { animation: none; }
  .mbs__status::before { animation: none; }
  .mbs__cta, .mbs__tab, .mbs__dot, .mbs__tabnav-btn { transition: none; }
}
