/* Magma Labs Studio landing page — light "Creator Studio" layout.
   Built on the shared tokens from site-data/styles.css (fonts, --accent-* ramp,
   --container, --radius, --ease). Only landing-specific rules live here. */

:root {
  /* Per-app theme palettes, referenced via [data-theme] below. */
  --rainbow: linear-gradient(90deg, #ff2121, #ff8400, #fee840, #4fea47, #3590ff, #8a65d6);
  --section-gap: clamp(64px, 9vw, 128px);
}

body.studio {
  /* Softer top-down brand wash than the default radial gradients. */
  background:
    radial-gradient(1100px 600px at 50% -8%, var(--accent-50), transparent 60%),
    var(--bg);
}

/* Hide every scrollbar (page + horizontal carousels) while keeping scroll. */
html,
body.studio,
.studio * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar,
body.studio::-webkit-scrollbar,
.studio *::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
}

.section-sub {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  margin: 12px 0 0;
}

/* ---------- Header ---------- */
.studio-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.75);
}
.brand b { font-weight: 800; }
.brand span { letter-spacing: -0.02em; }

.studio-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.4vw, 28px);
  font-weight: 650;
}
.studio-nav a { color: var(--text-muted); transition: color 140ms var(--ease); }
.studio-nav a:hover { color: var(--accent-700); }
.studio-nav-cta { color: var(--accent-700) !important; font-weight: 750; }

@media (max-width: 620px) {
  .studio-nav a:not(.studio-nav-cta) { display: none; }
}

/* ---------- Hero + icon focus-carousel ---------- */
.studio-hero {
  padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 72px);
  text-align: center;
  overflow: hidden;
}
.studio-hero-inner { max-width: 880px; margin: 0 auto; }
.hero-eyebrow {
  font-family: 'Space Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.82rem;
  color: var(--accent-600);
  margin: 0 0 14px;
}
.hero-title {
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 0;
}
.hero-intro {
  color: var(--text-muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  margin: 22px auto 0;
  max-width: 620px;
}

/* Hero icon focus-carousel: one centered icon in focus at a time, auto-cycling
   like the summary section below. Side padding lets the first/last icon center. */
.icon-track {
  --icon-size: clamp(92px, 13vw, 160px);
  margin-top: clamp(40px, 6vw, 72px);
  display: flex;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 28px calc(50% - (var(--icon-size) / 2)) 56px;
}
.icon-cell {
  position: relative;
  flex: 0 0 auto;
  scroll-snap-align: center;
  width: var(--icon-size);
  height: var(--icon-size);
  cursor: pointer;
  opacity: 0.4;
  transform: scale(0.74);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.icon-cell.is-focused {
  opacity: 1;
  transform: scale(1.12);
}
.icon-item {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: clamp(20px, 3vw, 34px);
  box-shadow: 0 18px 50px -18px rgba(15, 23, 42, 0.45);
}
.icon-name {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 0.95rem;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.icon-cell.is-focused .icon-name {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .icon-cell { opacity: 1; transform: none; }
  .icon-cell.is-focused { transform: scale(1.06); }
}

/* ---------- Scrolling app summaries ---------- */
.summaries { padding: var(--section-gap) 0; }
.summaries .section-title,
.summaries .section-sub { text-align: center; }
.summaries .container { margin-bottom: clamp(28px, 4vw, 48px); }

.summary-track {
  display: flex;
  gap: clamp(16px, 2.4vw, 28px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px clamp(20px, calc((100vw - var(--container)) / 2 + 20px), 12vw) 28px;
}

.summary-panel {
  scroll-snap-align: center;
  flex: 0 0 min(86vw, 760px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(18px, 3vw, 36px);
  align-items: center;
  padding: clamp(22px, 3vw, 40px);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  /* Out-of-focus panels recede; the active one is brought forward by .is-focused. */
  cursor: pointer;
  opacity: 0.4;
  transform: scale(0.94);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease),
    box-shadow 0.45s var(--ease);
}
.summary-panel.is-focused {
  cursor: default;
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 28px 70px -32px rgba(15, 23, 42, 0.5);
}
@media (prefers-reduced-motion: reduce) {
  .summary-panel { opacity: 1; transform: none; }
}
.summary-name { margin: 0 0 16px; line-height: 0; }
.summary-banner {
  height: clamp(30px, 3.4vw, 46px);
  width: auto;
  max-width: 100%;
}
/* Themed text fallback when an app has no banner image. */
.summary-banner.app-name {
  display: inline-block;
  height: auto;
  line-height: 1.1;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.summary-copy p { color: var(--text-muted); margin: 0 0 18px; }
.summary-shot {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-muted);
  display: grid;
  place-items: center;
}
.summary-shot img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 640px) {
  .summary-panel { grid-template-columns: 1fr; }
  .summary-shot { order: -1; }
}

/* Theme accents (shared by summaries + use-reference). */
[data-theme] { --app-accent: var(--accent-700); }
[data-theme="purple"] { --app-accent: #4d2386; }
[data-theme="red"]    { --app-accent: #e01f1f; }
[data-theme="rainbow"] { --app-accent: #ff6a00; }

.app-name { color: var(--app-accent); }
[data-theme="rainbow"] .app-name {
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Why Studio cards ---------- */
.why { padding: var(--section-gap) 0; background: var(--bg-muted); }
.why .section-title { text-align: center; }
.why-grid {
  margin-top: clamp(28px, 4vw, 48px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 24px);
}
.why-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(22px, 2.6vw, 32px);
}
.why-card .why-mark {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent-700);
  margin-bottom: 18px;
}
.why-card svg { width: 24px; height: 24px; }
.why-card h3 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; }
.why-card p { color: var(--text-muted); margin: 0; }
.why-card a {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px; font-weight: 700; color: var(--accent-700);
}
.why-card a:hover { text-decoration: underline; }

@media (max-width: 800px) { .why-grid { grid-template-columns: 1fr; } }

/* ---------- Per-app use reference ---------- */
.use-ref { padding: var(--section-gap) 0; }
.use-ref:nth-of-type(even) { background: var(--bg-muted); }
.use-ref .ur-head { max-width: 760px; }
.use-ref .ur-banner {
  height: clamp(38px, 4.4vw, 60px);
  width: auto;
  max-width: 100%;
  margin: 0 0 18px;
}
/* Themed text fallback when an app has no banner image. */
.use-ref .ur-banner.app-name {
  display: inline-block;
  height: auto;
  font-weight: 800; font-size: clamp(1.1rem, 2vw, 1.4rem); letter-spacing: -0.01em;
}
.use-ref h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.9rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; margin: 0;
}
.use-ref .ur-desc { color: var(--text-muted); font-size: 1.12rem; margin: 16px 0 0; max-width: 620px; }
.use-ref .ur-links { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.use-ref .ur-links .btn {
  border-color: var(--app-accent);
}
.use-ref .ur-links .btn.themed {
  background: var(--app-accent); color: #fff;
}

/* Carousel */
.carousel { margin-top: clamp(28px, 4vw, 44px); }
.carousel-track {
  display: flex;
  gap: clamp(14px, 2vw, 24px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 18px;
}
.carousel-card {
  scroll-snap-align: start;
  flex: 0 0 min(82vw, 460px);
}
.carousel-card .shot {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  position: relative;
}
.carousel-card .shot img { width: 100%; height: 100%; object-fit: cover; }
.carousel-card figcaption {
  margin: 12px 2px 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}
.shot-placeholder {
  color: var(--text-muted);
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.8rem;
  text-align: center;
  padding: 16px;
}

.carousel-controls {
  display: flex; align-items: center; gap: 12px;
  margin-top: 8px;
}
.carousel-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform 140ms var(--ease), border-color 140ms var(--ease);
}
.carousel-btn:hover { border-color: var(--app-accent); transform: translateY(-1px); }
.carousel-btn svg { width: 18px; height: 18px; }
.carousel-btn[disabled] { opacity: 0.4; cursor: default; }

/* ---------- Footer ---------- */
.studio-footer {
  border-top: 1px solid var(--border);
  padding: clamp(36px, 5vw, 56px) 0;
}
.studio-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.footer-apps { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-apps a { color: var(--text-muted); font-weight: 650; }
.footer-apps a:hover { color: var(--accent-700); }
.footer-fine { color: var(--text-muted); font-size: 0.92rem; margin: 0; flex-basis: 100%; }
