/* =============================================================================================
   Home page of the website edition (templates/pages/home.html). Dark like the whole site, in the
   app's own colours (the Folia theme: blue → violet). The pictures are the real app: a video and stills
   (site/media); the small animations are the welcome tour's (assets/js/demos).
   ============================================================================================= */

/* ---------- Home page only (the site's colours are in site.css) ---------- */
:root {
  --demo-accent: #3B82F6;
  --demo-accent2: #8B5CF6;
  --h-blue: #3b82f6;
  --h-violet: #8b5cf6;
  --h-frame-bg: #0b0c12;
  --h-r: 18px;
}
.p-home { background: var(--bg); }

/* ---------- Hero ---------- */
.h-hero {
  position: relative;
  padding: calc(var(--nav-h) + clamp(48px, 7vw, 96px)) 0 clamp(40px, 6vw, 72px);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.h-aurora { position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1; pointer-events: none; }
.h-aurora i {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  will-change: transform;
}
.h-aurora i:nth-child(1) { width: 52vw; height: 52vw; left: 6%; top: 4%; background: radial-gradient(circle, #2563eb 0%, transparent 65%); animation: h-drift-a 22s var(--ease-io) infinite alternate; }
.h-aurora i:nth-child(2) { width: 46vw; height: 46vw; right: 4%; top: 10%; background: radial-gradient(circle, #7c3aed 0%, transparent 65%); animation: h-drift-b 26s var(--ease-io) infinite alternate; }
.h-aurora i:nth-child(3) { width: 36vw; height: 36vw; left: 34%; top: 38%; background: radial-gradient(circle, #db2777 0%, transparent 68%); opacity: .28; animation: h-drift-a 30s var(--ease-io) infinite alternate-reverse; }
@keyframes h-drift-a { to { transform: translate3d(6vw, 4vw, 0) scale(1.08); } }
@keyframes h-drift-b { to { transform: translate3d(-5vw, 6vw, 0) scale(.94); } }

.h-hero-copy { position: relative; }
.h-display {
  margin: 22px auto 0;
  max-width: 14ch;
  font-size: clamp(42px, 7.2vw, 98px);
  line-height: 1.02;
  letter-spacing: -.038em;
  font-weight: 760;
  text-wrap: balance;
}
.h-display .grad, .h-title .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.h-lead {
  margin: 24px auto 0;
  max-width: 780px;
  font-size: clamp(17px, 1.55vw, 21px);
  line-height: 1.55;
  color: var(--text-2);
}
.h-hero .cta-row { margin-top: 34px; justify-content: center; }
.h-hero .fine { margin-top: 16px; }
.h-included {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px auto 0;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, .28);
  background: rgba(59, 130, 246, .1);
  color: #bfdbfe;
  font-size: 14px;
  font-weight: 560;
}
.h-included .i { width: 16px; height: 16px; color: #60a5fa; }
/* The reviews, from the top of the page: five stars and a link to them (just before the price). */
.h-rating { display: flex; width: max-content; max-width: 100%; align-items: center; gap: 10px; margin: 16px auto 0; color: var(--text-2); font-size: 14.5px; font-weight: 560; }
.h-rating:hover { color: var(--text); }
.h-rating:hover > span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.h-rating-stars { display: inline-flex; gap: 3px; color: #fbbf24; }
.h-rating-stars .i { width: 17px; height: 17px; }

.h-stage {
  position: relative;
  max-width: 1280px;
  margin: clamp(44px, 6vw, 72px) auto 0;
  padding: 0 var(--gutter);
}
/* The motion-design film on transparency (marketing/motion): no frame; behind it, the page draws the film's own
   background (home.js, film-bg.json), which shows through the window's glass; its edges melt into the page. */
.h-film {
  position: relative;
  width: min(100% - 2 * var(--gutter), 1640px);
  margin: clamp(20px, 3vw, 40px) auto clamp(40px, 8vw, 110px);
  aspect-ratio: 16 / 9;
  isolation: isolate;
}
.h-film-bg {
  position: absolute;
  inset: -6% -14% -18%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
}
/* The film's 1920 × 1080 stage, where the video is (scaled to it by home.js). */
.h-film-stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; } /* placed on the video by home.js */
.h-film-stage > * { position: absolute; left: 0; top: 0; border-radius: 50%; will-change: transform, opacity; }
.h-film-stage .fv { width: 0; height: 0; border-radius: 0; }
.h-film-stage .fv > * { position: absolute; left: 0; top: 0; border-radius: 50%; }
.h-film-box { position: absolute; inset: 0; }
.h-film-video {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  /* Close-ups fill the frame: their crop fades into the page instead of a hard box. */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-composite: intersect;
}
.h-film-play { right: 5%; bottom: 7%; }
.h-film:hover .h-film-play, .h-film.is-paused .h-film-play { opacity: 1; }
@media (max-width: 620px) { .h-film { width: 100%; } }

.h-stage-glow {
  position: absolute;
  inset: 6% 8% -6%;
  z-index: -1;
  border-radius: 40px;
  background: radial-gradient(60% 60% at 50% 45%, rgba(59, 130, 246, .5), transparent 70%),
              radial-gradient(40% 50% at 80% 70%, rgba(139, 92, 246, .45), transparent 70%);
  filter: blur(60px);
  opacity: .8;
}
.h-screen {
  position: relative;
  margin: 0;
  aspect-ratio: 2400 / 1560;
  border-radius: var(--h-r);
  overflow: hidden;
  background: var(--h-frame-bg);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 60px 160px -50px rgba(37, 99, 235, .55), 0 40px 90px -40px rgba(0, 0, 0, .95);
}
.h-screen video, .h-screen img { display: block; width: 100%; height: 100%; object-fit: cover; }
.h-play {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(10, 11, 16, .55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity .25s var(--ease), transform .2s var(--ease);
}
.h-screen:hover .h-play, .h-play:focus-visible, .h-screen.is-paused .h-play { opacity: 1; }
.h-play:hover { transform: scale(1.06); }
.h-play .i { width: 16px; height: 16px; }

.h-chapters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.h-chapters button {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 7px;
  min-width: 118px;
  padding: 9px 14px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-3);
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  text-align: left;
  cursor: pointer;
  transition: color .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
}
.h-chapters button:hover { color: var(--text-2); background: var(--surface-2); }
.h-chapters button.is-on { color: var(--text); background: rgba(59, 130, 246, .12); border-color: rgba(96, 165, 250, .35); }
.h-ch-bar { display: block; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.h-ch-bar i { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--grad); }
.h-caption { margin: 14px 0 0; font-size: 13px; color: var(--dim); }

/* ---------- Strip ---------- */
.h-strip { padding: 8px 0 0; }
.h-strip ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin: 0 auto;
  padding: 22px var(--gutter);
  list-style: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.h-strip li { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14.5px; font-weight: 520; }
.h-strip .i { width: 16px; height: 16px; color: #60a5fa; }

/* ---------- Sections ---------- */
.h-sec { position: relative; padding: clamp(64px, 8vw, 112px) 0; }
.h-head { max-width: 840px; margin: 0 auto clamp(36px, 5vw, 60px); text-align: center; }
.h-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #93c5fd;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.h-eyebrow .i { width: 16px; height: 16px; }
.h-title {
  margin: 16px 0 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -.032em;
  font-weight: 730;
  text-wrap: balance;
}
.h-title .dim { color: var(--text-3); }
.h-sub { margin: 20px auto 0; max-width: 740px; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.6; color: var(--text-2); text-wrap: pretty; }
.h-center { text-align: center; justify-content: center; }

.h-frame {
  position: relative;
  border-radius: var(--h-r);
  overflow: hidden;
  background: var(--h-frame-bg);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
}
.shot, .shot img { display: block; width: 100%; height: auto; }
/* While a picture loads, the frame's background and never its alt text (still read aloud). */
.shot img { color: transparent; }

/* A still zoomed on the part that matters. */
.h-crop { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--h-frame-bg); }
.h-crop .shot { position: absolute; inset: 0; }
.h-crop .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--zoom, 1));
  transform-origin: var(--ox, 50%) var(--oy, 50%);
  transition: transform .9s var(--ease-out);
}
.h-card:hover .h-crop .shot img { transform: scale(calc(var(--zoom, 1) * 1.04)); }
.h-crop-shot { aspect-ratio: 2400 / 1560; }

.h-points { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; margin: clamp(36px, 5vw, 56px) 0 0; padding: 0; list-style: none; }
.h-points-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.h-points h3 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.h-points p { margin: 8px 0 0; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.h-points li { padding-top: 18px; border-top: 1px solid var(--line-2); }

.h-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.h-split .h-title, .h-split .h-sub { text-align: left; margin-left: 0; }
.h-list { display: grid; gap: 14px; margin: 26px 0 0; padding: 0; list-style: none; }
.h-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; line-height: 1.55; color: var(--text-2); }
.h-list li strong { color: var(--text); font-weight: 620; }
.h-list .i { flex: none; width: 18px; height: 18px; margin-top: 3px; color: #60a5fa; }
.h-note { display: inline-flex; gap: 8px; align-items: flex-start; margin: 22px 0 0; font-size: 14px; line-height: 1.55; color: var(--text-3); }
.h-note .i { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.h-note code { font-family: var(--mono); font-size: 13px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
p.h-note.h-center { display: flex; }

.h-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 22px; }

/* ---------- Cards ---------- */
.h-card, .h-demo-card, .h-edition {
  position: relative;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.h-card-body { padding: 20px 22px 24px; }
.h-card-body h3 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.012em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.h-card-body p { margin: 8px 0 0; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.h-card-body kbd { font-size: 12px; }

/* ---------- Customization ---------- */
.h-custom-glow {
  position: absolute;
  inset: 10% 0 auto;
  height: 70%;
  z-index: -1;
  background: radial-gradient(50% 50% at 30% 40%, rgba(244, 63, 94, .16), transparent 70%),
              radial-gradient(45% 45% at 70% 50%, rgba(99, 102, 241, .22), transparent 70%),
              radial-gradient(40% 40% at 55% 80%, rgba(16, 185, 129, .12), transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}
.h-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 22px; }
.h-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px 9px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 14.5px;
  font-weight: 560;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease);
}
.h-tab:hover { background: var(--surface-2); color: var(--text); }
.h-tab[aria-selected="true"] { background: rgba(255, 255, 255, .1); color: var(--text); border-color: rgba(255, 255, 255, .3); }
.h-swatch { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, .2) inset; }
.h-sw-workspace { background: linear-gradient(135deg, #3b82f6, #8b5cf6); }
.h-sw-theme_sunset { background: linear-gradient(135deg, #f43f5e, #f59e0b); }
.h-sw-theme_midnight { background: linear-gradient(135deg, #6366f1, #22d3ee); }
.h-sw-theme_forest { background: linear-gradient(135deg, #10b981, #84cc16); }
.h-sw-theme_ocean { background: linear-gradient(135deg, #0ea5e9, #14b8a6); }
.h-sw-glass { background: linear-gradient(135deg, rgba(255, 255, 255, .75), rgba(147, 197, 253, .25) 55%, rgba(255, 255, 255, .08)); }
.h-theme-stage { aspect-ratio: 2400 / 1560; }
.h-theme-shot { position: absolute; inset: 0; opacity: 0; transition: opacity .7s var(--ease); }
.h-theme-shot.is-on { opacity: 1; }
.js .h-theme-shot[hidden] { display: block; }
.h-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 22px; }
.h-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 22px; }
.h-trio .h-card-body h3 kbd, .h-card-body h3 kbd { font-size: .78em; }

/* ---------- And also: everything else, in a compact list ---------- */
.h-more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 34px; margin: clamp(30px, 4vw, 44px) 0 0; padding: 0; list-style: none; }
.h-more li { padding: 16px 0 18px; border-top: 1px solid var(--line-2); }
.h-more h3 { margin: 0; font-size: 15.5px; font-weight: 650; letter-spacing: -.005em; }
.h-more p { margin: 5px 0 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }

/* ---------- « In detail »: each section's feature pages ---------- */
.h-learn { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 8px 22px; margin: clamp(26px, 3.4vw, 38px) 0 0; font-size: 15px; }
.h-learn > span { color: var(--text-2); }
.h-learn-start { justify-content: flex-start; margin-top: 22px; }

/* ---------- Tools ---------- */
.h-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 22px 0 0; padding: 0; list-style: none; }
.h-tools li { padding: 18px 18px 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.h-tools h3 { margin: 0; font-size: 16px; font-weight: 650; }
.h-tools p { margin: 7px 0 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }

/* ---------- Welcome tour animations ---------- */
.h-demos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.h-demo-card .demo { aspect-ratio: 320 / 140; background: var(--h-frame-bg); border-bottom: 1px solid var(--line); overflow: hidden; }
.h-demo-card .demo canvas { display: block; }
.h-demo-card:not(:has(.demo)) .h-card-body { padding-top: 24px; }

/* ---------- At a glance ---------- */
.h-title-sm { font-size: clamp(28px, 3.4vw, 42px); text-align: center; }
.h-facts { display: grid; gap: 0; margin: 28px 0 0; border-top: 1px solid var(--line-2); }
.h-facts > div { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 20px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.h-facts dt { margin: 0; font-weight: 650; color: var(--text); }
.h-facts dd { margin: 0; color: var(--text-2); line-height: 1.55; }
@media (max-width: 620px) { .h-facts > div { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

/* ---------- Privacy ---------- */
.h-privacy .h-points li { border-top-color: rgba(96, 165, 250, .3); }

/* ---------- Editions ---------- */
.h-editions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.h-edition { padding: 30px 30px 32px; display: flex; flex-direction: column; }
.h-edition h3 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.h-edition-lead { margin: 10px 0 0; color: var(--text-2); font-size: 15.5px; line-height: 1.55; }
.h-edition .h-list { margin-bottom: 26px; }
.h-edition .btn { align-self: flex-start; margin-top: auto; }
.h-edition-links { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: auto; }
.h-edition.is-site {
  border-color: rgba(96, 165, 250, .4);
  background: radial-gradient(120% 90% at 0% 0%, rgba(59, 130, 246, .16), transparent 55%), var(--card);
  box-shadow: 0 30px 80px -40px rgba(59, 130, 246, .55), var(--shadow-card);
}
.h-badge {
  align-self: flex-start;
  margin: 0 0 14px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--grad-soft);
  color: #fff;
  font-size: 12.5px;
  font-weight: 650;
}
/* The Mac App Store card until the edition is out (site.json app_store_live): a quiet date, not a highlight. */
.h-badge.is-soon { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }


/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .h-points, .h-tools, .h-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .h-split, .h-duo, .h-cards, .h-trio, .h-demos, .h-editions { grid-template-columns: minmax(0, 1fr); }
  .h-split .h-title, .h-split .h-sub { text-align: center; margin-left: auto; }
  .h-split-copy { text-align: center; }
  .h-split .h-list { text-align: left; }
  .h-points-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .h-points, .h-tools, .h-more { grid-template-columns: minmax(0, 1fr); }
  .h-chapters button { min-width: 0; flex: 1 1 40%; }
  .h-screen { border-radius: 12px; }
  .h-frame { border-radius: 14px; }
  .h-edition { padding: 24px 22px 26px; }
}

/* ---------- Japanese and Chinese: break titles between phrases, not inside words ---------- */
:lang(ja) .h-display, :lang(zh) .h-display, :lang(ja) .h-title, :lang(zh) .h-title {
  max-width: none;
  word-break: auto-phrase;
  letter-spacing: -.01em;
}
:lang(ja) .h-lead, :lang(zh) .h-lead, :lang(ja) .h-sub, :lang(zh) .h-sub { word-break: auto-phrase; }
/* auto-phrase only knows Japanese: Chinese titles break at punctuation (or, too long, anywhere). */
:lang(zh) .h-display, :lang(zh) .h-title { word-break: keep-all; overflow-wrap: break-word; }
/* Japanese: never before a small kana or ー, even inside a phrase too long for the line; the hero's first phrase
   (eleven characters) fits on one line from 330 px wide. */
:lang(ja) .h-display, :lang(ja) .h-title, :lang(ja) .h-lead, :lang(ja) .h-sub { line-break: strict; }
:lang(ja) .h-display { font-size: clamp(28px, 8vw, 98px); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .h-aurora i { animation: none; }
  .h-crop .shot img, .h-theme-shot { transition: none; }
}

.h-more { margin-top: clamp(22px, 3vw, 32px); }

/* ---- Modules: the studio. Tiles drawn like the app's new pane grid, three places, and the real window under a
   camera that frames the module (home.js, moduleStudio). ---------------------------------------------------------- */
.m-studio { display: grid; grid-template-columns: minmax(0, 410px) minmax(0, 1fr); gap: clamp(24px, 3.4vw, 48px);
  align-items: center; margin-top: clamp(36px, 5vw, 56px); }
.m-label { margin: 0 0 10px; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.m-place { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 24px; }
.m-place-b { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 12px 6px 10px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 560;
  line-height: 1.25; text-align: center; cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), opacity .25s var(--ease); }
.m-place-b:hover { background: var(--surface-2); color: var(--text); }
.m-place-b[aria-checked="true"] { color: var(--text); border-color: rgba(129, 140, 248, .75); background: rgba(129, 140, 248, .11); }
.m-place-b[aria-disabled="true"] { opacity: .38; cursor: default; }
/* The window in miniature: left sidebar, content, right sidebar; the module lit where it goes. */
.m-mini { position: relative; width: 58px; height: 38px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .035); overflow: hidden; }
.m-mini i { position: absolute; top: 0; bottom: 0; }
.m-mini-l { left: 0; width: 14px; background: rgba(255, 255, 255, .07); border-right: 1px solid rgba(255, 255, 255, .14); }
.m-mini-r { right: 0; width: 14px; background: rgba(255, 255, 255, .07); border-left: 1px solid rgba(255, 255, 255, .14); }
.m-mini-c { left: 14px; right: 14px; background: repeating-linear-gradient(180deg, transparent 0 5px, rgba(255, 255, 255, .06) 5px 6px); }
.m-mini-x { border-radius: 3px; background: linear-gradient(135deg, #60a5fa, #a78bfa); opacity: .45; transition: opacity .3s var(--ease), box-shadow .3s var(--ease); }
.m-place-b[aria-checked="true"] .m-mini-x { opacity: 1; box-shadow: 0 0 10px rgba(129, 140, 248, .8); }
.m-mini-right .m-mini-x { right: 2px; width: 10px; top: 3px; bottom: 3px; }
.m-mini-left .m-mini-x { left: 2px; width: 10px; top: 19px; bottom: 3px; }
.m-mini-pane .m-mini-r { display: none; }
.m-mini-pane .m-mini-c { right: 0; }
.m-mini-pane .m-mini-x { right: 2px; width: 19px; top: 3px; bottom: 3px; }

.m-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.m-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 11px 4px 9px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .04); color: var(--text); font: inherit; text-align: center;
  cursor: pointer; transition: transform .25s var(--ease), border-color .25s var(--ease), background-color .25s var(--ease), box-shadow .25s var(--ease); }
.m-tile:hover { background: rgba(255, 255, 255, .07); }
.m-tile[aria-selected="true"] { border-color: rgba(96, 165, 250, .9); background: rgba(255, 255, 255, .08); transform: scale(1.02);
  box-shadow: 0 12px 30px -16px rgba(96, 165, 250, .6); }
.m-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 3px 10px -3px var(--a); transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.m-ic svg { width: 19px; height: 19px; }
.m-tile[aria-selected="true"] .m-ic { box-shadow: 0 5px 20px -3px var(--a); transform: translateY(-1px); }
.m-t { font-size: 12px; font-weight: 600; letter-spacing: -.005em; line-height: 1.2; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; }
.m-d { font-size: 11.5px; line-height: 1.35; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.m-stage { position: relative; min-width: 0; }
.m-view { position: relative; aspect-ratio: 10 / 9; border-radius: var(--h-r); overflow: hidden; border: 1px solid var(--line-2);
  background: radial-gradient(70% 60% at 70% 30%, rgba(99, 102, 241, .16), transparent 70%), var(--h-frame-bg); box-shadow: var(--shadow-lg); }
.m-world { position: absolute; left: 0; top: 0; width: 100%; transform-origin: 0 0; will-change: transform; }
.m-shot { position: absolute; left: 0; top: 0; width: 100%; opacity: 0; transition: opacity .5s var(--ease); }
.m-shot img { display: block; width: 100%; height: auto; color: transparent; }
.m-shot.is-on { opacity: 1; }
/* The module's ring, in the view's own pixels (constant line); the rest of the window in the shade. */
.m-ring { position: absolute; left: 0; top: 0; border-radius: 12px; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 1.5px rgba(147, 197, 253, .95), 0 0 30px 2px rgba(96, 165, 250, .5), 0 0 0 100vmax rgba(4, 5, 9, .46);
  transition: opacity .5s var(--ease); }
.m-ring.is-on { opacity: 1; }
/* Room on the right for the tour button (absolute, bottom right): long captions wrap before it. */
.m-cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-height: 1.5em; margin: 16px 2px 0; padding-right: 210px; font-size: 15px; color: var(--text-2); }
.m-cap-t { color: var(--text); font-weight: 620; }
.m-cap-d { color: var(--text-2); }
.m-cap-p { color: var(--text-3); }
.m-auto { position: absolute; right: 2px; bottom: -2px; display: inline-flex; align-items: center; gap: 9px; padding: 6px 4px;
  border: 0; background: none; color: var(--text-3); font: inherit; font-size: 13px; cursor: pointer; }
.m-auto:hover { color: var(--text); }
.m-auto-bar { position: relative; width: 44px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.m-auto-bar i { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: var(--grad); }
.m-auto[aria-pressed="false"] .m-auto-bar { opacity: .5; }
.m-also { max-width: 760px; margin: clamp(28px, 4vw, 40px) auto 0; text-align: center; font-size: 15px; line-height: 1.6; color: var(--text-3); }

@media (max-width: 980px) {
  .m-studio { grid-template-columns: minmax(0, 1fr); }
  .m-controls { order: 2; }
  .m-view { aspect-ratio: 4 / 3.4; }
}
@media (max-width: 620px) {
  .m-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .m-tile { padding: 9px 2px 8px; }
  .m-t { font-size: 11px; }
  .m-place-b { font-size: 12px; }
  .m-auto { position: static; margin-top: 6px; }
  .m-cap { padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .m-shot, .m-ring, .m-tile, .m-ic, .m-place-b, .m-mini-x { transition: none; }
}

/* ---- Views: one pane of the real app in each of its views, a tab per view (home.js, viewStudio). The thumb slides
   under the selected tab and fills while the tour holds it; the pane header's own button is pressed in the picture
   before the view changes; « Branches » shows its cards appearing one by one over the empty canvas. -------------- */
.v-studio { margin-top: clamp(36px, 5vw, 56px); }
.v-tabs-wrap { display: flex; justify-content: center; margin-bottom: clamp(18px, 2.4vw, 26px); }
.v-tabs { position: relative; display: inline-flex; gap: 2px; max-width: 100%; padding: 5px; border-radius: 16px; overflow-x: auto;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.v-tabs::-webkit-scrollbar { display: none; }
.v-thumb { position: absolute; left: 0; top: 5px; bottom: 5px; width: 0; border-radius: 11px; pointer-events: none; overflow: hidden;
  background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(147, 197, 253, .5), 0 10px 26px -14px rgba(96, 165, 250, .8);
  transition: transform .45s var(--ease), width .45s var(--ease); }
.v-thumb i { position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--grad);
  transform-origin: 0 50%; transform: scaleX(0); }
.v-tab { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; border-radius: 11px;
  background: none; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 580; white-space: nowrap; cursor: pointer;
  transition: color .25s var(--ease); }
.v-tab:hover, .v-tab[aria-selected="true"] { color: var(--text); }
.v-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.v-ic { width: 18px; height: 18px; flex: none; }
.v-k { font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, .06); }
.v-new { font-size: 10px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px;
  color: #fff; background: var(--grad); }

.v-stage { position: relative; }
.v-view { position: relative; aspect-ratio: var(--ar, 16 / 10); border-radius: var(--h-r); overflow: hidden; border: 1px solid var(--line-2);
  background: var(--h-frame-bg); box-shadow: var(--shadow-lg); }
.v-world { position: absolute; left: 0; top: 0; width: 100%; transform-origin: 0 0; will-change: transform; }
.v-shot { position: absolute; left: 0; top: 0; width: 100%; opacity: 0; transition: opacity .45s var(--ease); }
.v-shot img { display: block; width: 100%; height: auto; color: transparent; }
.v-shot.is-on { opacity: 1; }
.v-shot.is-step { transition-duration: .3s; }
/* A card of « Branches » coming out of its parent: the picture again, clipped to it, sliding a little into place. */
.v-layer { transform: translateX(-1.1%); transition: opacity .38s var(--ease), transform .55s var(--ease); }
.v-layer.is-on { transform: none; }
/* The press on the view's button in the pane header (the picture's coordinates: it follows the camera). */
.v-press { position: absolute; left: 0; top: 0; z-index: 100000; border-radius: 6px; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 2px rgba(191, 219, 254, .95), 0 0 16px 3px rgba(96, 165, 250, .65); }
.v-press.is-on { animation: v-press .75s var(--ease) both; }
@keyframes v-press {
  0% { opacity: 0; transform: scale(1.7); }
  35% { opacity: 1; transform: scale(1); }
  70% { opacity: 1; transform: scale(.94); }
  100% { opacity: 0; transform: scale(.94); }
}
.v-cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-height: 1.5em; margin: 16px 2px 0; padding-right: 210px;
  font-size: 15px; color: var(--text-2); }
.v-cap-t { color: var(--text); font-weight: 620; }
.v-tight .v-k { display: none; }
@media (max-width: 1100px) {
  .v-k { display: none; }
}
@media (max-width: 980px) {
  .v-tabs-wrap { justify-content: flex-start; }
  .v-tab { padding: 9px 12px; }
}
@media (max-width: 620px) {
  .v-view { aspect-ratio: 4 / 3.4; }
  .v-tab { font-size: 13px; gap: 6px; padding: 8px 11px; }
  .v-ic { width: 16px; height: 16px; }
  .v-auto { position: static; margin-top: 6px; }
  .v-cap { padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .v-shot, .v-layer, .v-thumb, .v-tab { transition: none; }
  .v-press { display: none; }
}

/* ---- See-through: the real window (glass, no blur, its transparency kept) on a background; dragged, its
   transparency set by the slider (home.js, seeThrough). ---------------------------------------------------------- */
.s-demo { margin-top: clamp(36px, 5vw, 56px); }
.s-stage { position: relative; aspect-ratio: 16 / 10; border-radius: var(--h-r); overflow: hidden; border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg); background: #120c2a; touch-action: none; user-select: none; -webkit-user-select: none; }
.s-bg { position: absolute; inset: 0; opacity: 0; transition: opacity .7s var(--ease); }
.s-bg.is-on { opacity: 1; }
.s-bg img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.06); transition: transform 12s linear; }
.s-stage.is-live .s-bg.is-on img { transform: scale(1.12); }
.s-win { position: absolute; left: 11%; top: 9%; width: 78%; aspect-ratio: var(--ar, 1.6); cursor: grab; outline: none;
  border-radius: 1.1% / 1.76%; box-shadow: 0 30px 80px -10px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08); will-change: transform; }
.s-win:active { cursor: grabbing; }
.s-win:focus-visible { box-shadow: 0 30px 80px -10px rgba(0, 0, 0, .55), 0 0 0 3px var(--focus); }
.s-shot { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.s-shot img { display: block; width: 100%; height: 100%; }
.s-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px;
  margin: 0; padding: 7px 14px; border-radius: 999px; background: rgba(8, 8, 14, .58); color: #fff; font-size: 13.5px; font-weight: 560;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); pointer-events: none; transition: opacity .5s var(--ease); }
.s-hint svg { width: 16px; height: 16px; }
.s-demo.is-touched .s-hint { opacity: 0; }
.s-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 28px; margin-top: 22px; }
.s-range { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-2); }
.s-k { font-weight: 600; color: var(--text); }
.s-range input { width: min(280px, 52vw); accent-color: #818cf8; }
.s-val { min-width: 3.4em; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 620; }
.s-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.s-seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border: 0; border-radius: 999px; background: none;
  color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 560; cursor: pointer; }
.s-seg button svg { width: 15px; height: 15px; }
.s-seg button[aria-checked="true"] { background: rgba(255, 255, 255, .12); color: var(--text); }
.s-bgs { display: inline-flex; gap: 10px; }
.s-sw { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.s-sw[aria-checked="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #a5b4fc; transform: scale(1.06); }
.s-sw-dusk { background: linear-gradient(180deg, #3a1d6e 0%, #d6486e 55%, #ffb46e 70%, #3e1654 100%); }
.s-sw-aurora { background: linear-gradient(180deg, #06102a 0%, #2fe0a8 40%, #7a5cff 55%, #c8dcf0 75%, #0a1424 100%); }
.s-sw-bloom { background: conic-gradient(from 30deg, #ff468c, #ffaa28, #3c78ff, #28dcc8, #be46ff, #ff468c); }
.s-note { max-width: 760px; margin: 18px auto 0; text-align: center; font-size: 14px; line-height: 1.6; color: var(--text-3); }
@media (max-width: 620px) {
  .s-stage { aspect-ratio: 4 / 3.2; }
  .s-win { left: 4%; top: 12%; width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  .s-bg, .s-bg img, .s-hint { transition: none; }
  .s-stage.is-live .s-bg.is-on img { transform: scale(1.06); }
}
