/* A scroll-paced first chapter. The comparison remains draggable and keyboard-accessible. */
body:not(.business-view) .hero {
  height: 250svh;
  min-height: 0;
  position: relative;
  padding-bottom: 0;
}
body:not(.business-view) .hero .hero-main {
  position: sticky;
  top: clamp(45px, 14svh, 126px);
  flex: none;
  height: calc(100svh - 230px);
  min-height: 630px;
  padding-top: 0;
  padding-bottom: 70px;
}
.hero .visual-world .world-view { aspect-ratio: 1.65; }
.hero .world-buttons button { min-height: 72px; }
.hero #hero-title .hero-difficult {
  display: table;
  max-width: 100%;
  color: var(--hero-muted);
  font: 500 clamp(40px, 3.9vw, 70px)/1.07 VisualManrope, Arial, sans-serif;
  letter-spacing: -.065em;
  background: linear-gradient(transparent 84%, #ecad8040 84%, #ecad8040 94%, transparent 94%);
  margin: 0 0 16px;
}
[data-theme=dark] .hero #hero-title .hero-difficult {
  color: #b9c6dd;
  background-image: linear-gradient(transparent 84%, #ecad8055 84%, #ecad8055 94%, transparent 94%);
}
body:not(.business-view) .hero #hero-title span {
  color: var(--hero-muted);
  font-size: clamp(30px, 3.25vw, 58px);
  font-weight: 400;
  letter-spacing: 0;
}
body:not(.business-view) .hero #hero-title span b {
  color: #486bd2;
  font-size: 1.15em;
  font-weight: 650;
}
body:not(.business-view) .hero #hero-title span b u {
  text-decoration-color: #d78959;
  text-decoration-thickness: .055em;
  text-underline-offset: .14em;
  text-decoration-skip-ink: none;
}
[data-theme=dark] body:not(.business-view) .hero #hero-title span b { color: #a6bfff; }
[data-theme=dark] body:not(.business-view) .hero #hero-title span b u { text-decoration-color: #f2b183; }
body:not(.business-view) .hero .hero-copy,
body:not(.business-view) .hero .visual-world { opacity: var(--hero-story-opacity, 1); }

/* The finished frame becomes a camera move towards the castle. */
.hero-portal {
  position: fixed;
  z-index: 30;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  isolation: isolate;
  will-change: left, top, width, height, opacity;
}
.hero-portal img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 24% 34%;
}
.hero-portal-origin { will-change: transform, filter; }
.hero-portal-detail { opacity: 0; will-change: opacity, transform, filter, mask-image; }
.hero-portal-foreground {
  mask-image: url('assets/visual-world/portal-foreground-mask.svg');
  mask-size: cover;
  mask-position: center;
  mask-repeat: no-repeat;
  -webkit-mask-image: url('assets/visual-world/portal-foreground-mask.svg');
  -webkit-mask-size: cover;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  will-change: transform, filter;
}
.hero-portal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #dfe8f4;
  opacity: var(--portal-veil, 0);
}
body:not(.business-view) .hero.hero-zooming .hero-next {
  position: fixed;
  bottom: 23px;
  z-index: 40;
  background: #172235f0;
  color: #dce6f7;
  border-color: #ffffff50;
}
body:not(.business-view) .hero.hero-zooming .hero-next strong { color: #fff; }
body:not(.business-view) .hero.hero-complete .hero-next { opacity: 0; pointer-events: none; }

/* The full-screen landscape becomes the backdrop for the first lesson. */
.castle-handoff {
  display: none;
}
body.business-view .castle-handoff { display: none; }
body:not(.business-view) .foundation {
  --ink: #1b2d4a;
  --muted: #50647f;
  --line: #b8c8dd;
  color: var(--ink);
  background: #e3eaf7;
  border-top: 0;
}
@media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
  body:not(.business-view) .foundation {
    position: relative;
    z-index: 31;
    background: linear-gradient(to bottom, transparent 0%, #e3eaf700 48%, #e3eaf7 100%);
  }
  body:not(.business-view) .foundation .foundation-intro,
  body:not(.business-view) .foundation .foundation-bottom {
    background: #f7f9ff;
    border: 1px solid #cbd6e6;
    border-radius: 18px;
    box-shadow: 0 24px 65px #152b5030;
  }
  body:not(.business-view) .foundation .foundation-intro { padding: clamp(25px, 3vw, 42px); }
  body:not(.business-view) .foundation .foundation-bottom {
    padding: 20px 25px;
    border-top: 1px solid #cbd6e6;
  }
  body:not(.business-view) .foundation .foundation-lessons article {
    box-shadow: 0 20px 52px #152b5030;
  }
}
body:not(.business-view) .foundation .foundation-intro h2,
body:not(.business-view) .foundation .foundation-lessons h3 { color: #1b2d4a; }
body:not(.business-view) .foundation .foundation-intro h2 span { color: #4263bb; }
body:not(.business-view) .foundation .eyebrow,
body:not(.business-view) .foundation .lesson-number,
body:not(.business-view) .foundation .foundation-bottom>.micro { color: #4664ad; }
body:not(.business-view) .foundation .foundation-intro .lead { color: #304969; }
body:not(.business-view) .foundation .foundation-bottom>p { color: #405b79; }
body:not(.business-view) .foundation .text-link { color: #3153a4; }
body:not(.business-view) .foundation .foundation-lessons article {
  background: #f7f9ff;
  border-color: #cbd6e6;
  color: #1b2d4a;
}
body:not(.business-view) .hero .world-before { z-index: 0; clip-path: none; }
body:not(.business-view) .hero .world-after,
body:not(.business-view) .hero .world-tree-after {
  z-index: 1;
  clip-path: inset(0 calc(100% - var(--world-split)) 0 0);
}
body:not(.business-view) .hero .world-view { background: #8090a4; }
body:not(.business-view) .hero .world-state-before { left: auto; right: 16px; }
body:not(.business-view) .hero .world-state-after { left: 16px; right: auto; }
body:not(.business-view) .hero .world-all-before .world-state-before { left: 16px; right: auto; }
body:not(.business-view) .hero .world-all-before .world-state-after,
body:not(.business-view) .hero .world-all-after .world-state-before { opacity: 0; }
body:not(.business-view) .hero .world-buttons button[data-world-view="0"] {
  background: #e5ebf7;
  color: #23324b;
  border-color: #8697b44d;
}
body:not(.business-view) .hero .world-buttons button[data-world-view="100"] {
  background: #486bd2;
  color: #fff;
  border-color: #90acff88;
}
body:not(.business-view) .hero [data-world-view="100"] .world-button-icon { background: #ffffff20; }
body:not(.business-view) .hero [data-world-view="0"] .world-button-icon { background: #2538570d; }
[data-theme=dark] body:not(.business-view) .hero .world-buttons button[data-world-view="0"] {
  background: #263449;
  color: #f0f4fc;
  border-color: #60759680;
}
.hero-next {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 8px 15px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: #edf0f7ed;
  color: var(--hero-muted);
  box-shadow: 0 8px 30px #091c3512;
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  z-index: 6;
}
.hero-next strong { color: var(--hero-ink); font-size: 12px; font-weight: 650; }
.hero-next-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #486bd2;
  color: #fff;
  font-size: 20px;
}
.hero-next:hover .hero-next-icon { transform: translateY(2px); }
.hero-next:focus-visible { outline: 3px solid #486bd2; outline-offset: 4px; }
[data-theme=dark] .hero-next { background: #172235ed; }
[data-theme=dark] .hero .actions .text-link { color: #dce6f7; }
body.business-view .hero-next { display: none; }

/* A compact visual cue connects the four skills to a tangible outcome. */
.foundation-intro .foundation-visual {
  max-width: 480px;
  margin-top: 36px;
  padding: 18px;
  border-radius: 19px;
  background: #14253d;
  color: #f2f6ff;
  box-shadow: 0 24px 48px #1027432c;
}
.foundation-lessons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.foundation-visual-meta { display: flex; justify-content: space-between; gap: 12px; color: #b8cdec; font-size: 10px; letter-spacing: .1em; }
.foundation-visual-stage { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); gap: 12px; align-items: center; margin-top: 14px; }
.foundation-sketch,.foundation-result { position: relative; min-width: 0; height: 170px; overflow: hidden; border-radius: 10px; background: #ece9df; }
.foundation-sketch { transform: rotate(-4deg) scale(.92); box-shadow: 0 8px 16px #0003; }
.foundation-sketch img,.foundation-result img { position: absolute; top: 0; height: 100%; max-width: none; object-fit: cover; display: block; }
.foundation-sketch img { left: 0; width: 232.56%; }
.foundation-result img { right: 0; width: 175.44%; }
.foundation-sketch img { filter: saturate(.38); }
.foundation-result { border: 1px solid #d8e5ff55; box-shadow: 0 10px 22px #0005; }
.foundation-sketch>span,.foundation-result>span:last-child { position: absolute; left: 9px; bottom: 9px; padding: 6px 9px; border-radius: 20px; background: #102035cb; color: #fff; font-size: 9px; letter-spacing: .04em; }
.foundation-visual-track { display: flex; gap: 5px; margin-top: 16px; }
.foundation-visual-track i { flex: 1; height: 3px; border-radius: 3px; background: #8da9d04d; }
.foundation-visual-track i:first-child { background: #f2b183; }

@media (max-width: 900px) {
  .foundation-intro .foundation-visual { max-width: 570px; }
}
@media (max-width: 760px) {
  .castle-handoff { display: none; }
  body:not(.business-view) .hero { height: auto; min-height: 0; padding-bottom: 22px; }
  body:not(.business-view) .hero .hero-main { position: relative; top: auto; height: auto; min-height: 0; padding: 0 0 72px; }
  .hero #hero-title .hero-difficult { font-size: clamp(38px, 9.6vw, 54px); margin-bottom: 9px; }
  .hero-next { bottom: 7px; }
  .hero .visual-world .world-view { aspect-ratio: 1.25; }
  .foundation-intro .foundation-visual { margin-top: 28px; }
  .foundation-sketch,.foundation-result { height: 190px; }
}
@media (max-width: 420px) {
  .hero #hero-title .hero-difficult { font-size: clamp(35px, 10.5vw, 44px); }
  .foundation-intro .foundation-visual { padding: 14px; }
  .foundation-sketch,.foundation-result { height: 135px; }
  .foundation-visual-stage { gap: 6px; }
  .foundation-lessons { grid-template-columns: 1fr; }
}
@media (max-height: 740px) and (min-width: 761px) {
  body:not(.business-view) .hero .hero-main { min-height: 0; padding-bottom: 70px; }
  .hero #hero-title .hero-difficult { font-size: clamp(40px, 4vw, 68px); }
  .hero .visual-world figcaption { padding-top: 8px; }
  .hero .world-buttons button { min-height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .castle-handoff { display: none; }
  body:not(.business-view) .hero { height: auto; }
  body:not(.business-view) .hero .hero-main { position: relative; height: auto; min-height: 0; padding-bottom: 90px; }
}

/* The four draft cards carry readable ideas into the assembled concept. */
.story .part-meta { padding: 13px 18px 7px; }
.story .part-heading {
  display: block;
  padding: 0 18px 10px;
  color: #2b405f;
  font: 650 22px/1.08 VisualManrope, Arial, sans-serif;
  letter-spacing: -.055em;
}
.story .part-heading::after {
  content: '';
  display: inline-block;
  width: 23px;
  height: 2px;
  margin-left: 10px;
  vertical-align: middle;
  border-radius: 2px;
  background: #d79666;
}
.story .part-logic .part-heading { color: #355484; }
.story .part-logic .part-heading::after { background: #7f9ed1; }
.story .draft-questions p { font-size: 29px; margin: 6px 0; }
.story .part-image img { height: 154px; }
.story .draft-flow { height: 146px; }
.story .draft-wire { height: 138px; }
.story .browser-result-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #364351;
  font: 650 13px/1.1 VisualManrope, Arial, sans-serif;
  letter-spacing: -.025em;
}
.story .browser-result-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d58d5d;
  box-shadow: 0 0 0 3px #d58d5d26;
}
.story .browser-result-label small {
  color: #777d82;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}
