:root,
.sw-root {
  --sw-bg: #f2efe6;
  --sw-ink: #151515;
  --sw-ink-soft: #5d5a54;
  --sw-accent: #ff5a1f;
  --sw-font-display: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --sw-font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body { margin: 0; background: var(--sw-bg); color: var(--sw-ink); }

.skip-link {
  position: fixed;
  z-index: 999;
  top: .75rem;
  left: .75rem;
  transform: translateY(-180%);
  padding: .75rem 1rem;
  border-radius: 999px;
  background: #151515;
  color: #fff;
  font: 700 .9rem/1 system-ui, sans-serif;
}

.skip-link:focus { transform: none; }

.after-world {
  min-height: 78svh;
  display: grid;
  place-content: center;
  gap: 1.25rem;
  padding: clamp(4rem, 10vw, 9rem) max(1.25rem, env(safe-area-inset-left));
  background: #151515;
  color: #f2efe6;
  text-align: center;
}

.after-world > * { width: min(760px, 100%); margin: 0 auto; }

.after-world__kicker {
  color: #d8ff45;
  font: 800 .78rem/1.2 var(--sw-font-body);
  letter-spacing: .18em;
  text-transform: uppercase;
}

.after-world h1 {
  font: 900 clamp(2.5rem, 7vw, 6rem)/.92 var(--sw-font-display);
  letter-spacing: -.055em;
}

.after-world > p:not(.after-world__kicker) {
  max-width: 58ch;
  color: #c9c4b8;
  font: 500 clamp(1rem, 1.8vw, 1.2rem)/1.6 var(--sw-font-body);
}

.after-world__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .75rem; padding-top: .75rem; }

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: .85rem 1.25rem;
  border: 1px solid #5b5851;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  font: 800 .92rem/1 var(--sw-font-body);
}

.button--primary { border-color: #d8ff45; background: #d8ff45; color: #151515; }
.button:hover { border-color: #f2efe6; }
.button--primary:hover { border-color: #fff; background: #fff; }

.creator-card {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: clamp(2.5rem, 6vw, 4.5rem) !important;
  padding-top: 1.25rem;
  border-top: 1px solid #393834;
  text-align: left;
  font-family: var(--sw-font-body);
}

.creator-card__intro { display: grid; gap: .3rem; }
.creator-card__intro span { color: #8f8b82; font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.creator-card__intro strong { color: #f2efe6; font-size: 1.05rem; }
.creator-card__links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem 1.25rem; }
.creator-card__links a { color: #d8ff45; font-size: .82rem; font-weight: 800; text-decoration: none; }
.creator-card__links a:hover,
.creator-card__links a:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: .28rem; }

.noscript { padding: 1rem; font-family: system-ui, sans-serif; }

.bg-chapters {
  position: fixed;
  z-index: 205;
  inset: 0;
  pointer-events: none;
}

.bg-chapter {
  position: absolute;
  left: clamp(1.25rem, 6vw, 6.5rem);
  bottom: clamp(2rem, 9vh, 7rem);
  width: min(39rem, calc(100vw - 2.5rem));
  padding: clamp(1.1rem, 2.4vw, 2rem);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 1.5rem;
  background: rgba(21,21,21,.74);
  color: #f2efe6;
  box-shadow: 0 1.5rem 5rem rgba(0,0,0,.2);
  backdrop-filter: blur(16px) saturate(130%);
  opacity: 0;
  transform: translateY(1.4rem);
  transition: opacity .35s ease, transform .55s cubic-bezier(.2,.8,.2,1);
}

.bg-chapter.is-active { opacity: 1; transform: none; }
.bg-chapters.is-complete { opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s linear .35s; }
.bg-chapter__count { float: right; color: #d8ff45; font: 800 .75rem/1 var(--sw-font-body); letter-spacing: .12em; }
.bg-chapter__eyebrow { display: block; color: #ff8a61; font: 800 .75rem/1.2 var(--sw-font-body); letter-spacing: .16em; text-transform: uppercase; }
.bg-chapter h2 { max-width: 12ch; margin: .75rem 0; font: 900 clamp(2rem, 4.8vw, 4.7rem)/.92 var(--sw-font-display); letter-spacing: -.055em; }
.bg-chapter p { max-width: 42ch; margin: 0; color: #d5d1c7; font: 500 clamp(.95rem, 1.35vw, 1.1rem)/1.5 var(--sw-font-body); }
.bg-chapter ul { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.bg-chapter li { padding: .45rem .72rem; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; font: 700 .72rem/1 var(--sw-font-body); }

.bg-app-reveal {
  --app-progress: 0;
  position: fixed;
  z-index: 204;
  top: 50%;
  right: clamp(1.5rem, 7vw, 7.5rem);
  width: clamp(286px, 23vw, 342px);
  pointer-events: none;
  background: transparent;
  opacity: 0;
  transform: translateY(-46%) scale(calc(.76 + var(--app-progress) * .24));
  filter: blur(calc((1 - var(--app-progress)) * 7px));
  transition: opacity .4s ease;
}

.bg-app-reveal.is-visible { opacity: 1; }
.bg-app-reveal.is-complete { opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s linear .35s; }

.bg-app-reveal::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle at 76% 50%, rgba(238,242,248,.96) 0 17%, rgba(228,235,246,.72) 35%, transparent 66%);
  opacity: var(--app-progress);
}

.bg-phone {
  display: grid;
  grid-template-rows: 15px minmax(0,1fr);
  width: 100%;
  aspect-ratio: 9 / 19.5;
  padding: 9px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 42px;
  background: #07162b;
  box-shadow: 0 2.5rem 7rem rgba(0,0,0,.42), inset 0 0 0 1px rgba(255,255,255,.1);
  isolation: isolate;
}

.bg-phone__speaker { align-self: start; width: 30%; height: 5px; margin: 1px auto 0; border-radius: 999px; background: #26364d; }

.bg-phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 30px 30px 32px 32px;
  background: #f4f5f7;
  color: #172033;
  font-family: Inter, system-ui, sans-serif;
}

.bg-appbar { display: flex; align-items: center; gap: 7px; min-height: 54px; padding: 9px 11px; border-bottom: 1px solid #e3e6eb; background: #fff; }
.bg-appbar img { width: 25px; height: 31px; object-fit: contain; }
.bg-online { display: inline-flex; align-items: center; gap: 4px; color: #11835d; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.bg-online i { width: 6px; height: 6px; border-radius: 50%; background: #16a36f; box-shadow: 0 0 0 4px #e8f8f1; }
.bg-role { margin-left: auto; padding: 6px 8px; border: 1px solid #dfe4ec; border-radius: 7px; color: #49418f; background: #fff; font-size: 8px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }

.bg-appmain { padding: 18px 14px 76px; }
.bg-appheading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 13px; }
.bg-appheading span { color: #8a919e; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.bg-appheading h3 { margin: 3px 0 0; font-size: 24px; line-height: 1; letter-spacing: -.04em; }
.bg-appheading b { color: #7c8491; font-size: 10px; font-weight: 600; }

.bg-project-card { position: relative; display: grid; gap: 10px; margin-bottom: 9px; padding: 13px; border: 1px solid #e0e4ea; border-radius: 14px; background: #fff; box-shadow: 0 3px 10px rgba(27,39,59,.04); }
.bg-project-card strong { display: block; padding-right: 90px; color: #2766ce; font-size: 12px; line-height: 1.25; }
.bg-project-card span { display: block; margin-top: 3px; color: #777f8d; font-size: 9px; }
.bg-project-card em { position: absolute; top: 12px; right: 10px; padding: 5px 7px; border-radius: 999px; font-size: 7px; font-style: normal; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.bg-project-card em.is-neutral { color: #6d7480; background: #f0f1f3; }
.bg-project-card em.is-live { color: #12855f; background: #e9f9f2; }
.bg-project-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding-top: 9px; border-top: 1px solid #edf0f3; }
.bg-project-card dt { color: #a0a6b0; font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.bg-project-card dd { margin: 2px 0 0; color: #303746; font-size: 9px; font-weight: 650; }

.bg-appnav { position: absolute; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(3,1fr); padding: 9px 8px 12px; border-top: 1px solid #e1e5ea; background: rgba(255,255,255,.96); }
.bg-appnav span { display: grid; place-items: center; gap: 3px; color: #8c94a1; font-size: 13px; }
.bg-appnav small { font-size: 8px; font-weight: 700; }
.bg-appnav span.is-current { color: #2766ce; }

/* Keep the final desktop narration beside the phone, never over it. */
.bg-chapters.has-app .bg-chapter[data-chapter="2"] {
  top: 50%;
  bottom: auto;
  width: min(30vw, 390px);
  transform: translateY(-50%);
}

/* The engine's generic single-section copy is intentionally hidden; the three
   timed BuildGo chapters above narrate one unbroken video timeline. */
#world .sw-copylayer,
#world .sw-route { display: none; }

@media (max-width: 640px) {
  .after-world { text-align: left; place-content: center start; }
  .after-world__actions { justify-content: flex-start; }
  .creator-card { align-items: start; flex-direction: column; }
  .creator-card__links { justify-content: flex-start; }
  .bg-chapter {
    left: .75rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: calc(100vw - 1.5rem);
    padding: 1rem;
    border-radius: 1.15rem;
  }
  .bg-chapter h2 { font-size: clamp(1.8rem, 9vw, 3rem); }
  .bg-chapter p { max-width: 33ch; }
  .bg-app-reveal {
    top: 51%;
    right: 50%;
    width: min(76vw, 318px);
    transform: translate(50%,-49%) scale(calc(.76 + var(--app-progress) * .24));
  }
  .bg-chapters.has-app .bg-chapter[data-chapter="2"] { opacity: 0; pointer-events: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
