.story-section {
  padding-bottom: 0;
}
.story-heading {
  font: 700 clamp(55px, 7vw, 100px)/0.93 var(--display);
  letter-spacing: -0.02em;
  margin-bottom: 70px;
}
.story-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 9%;
  align-items: start;
}
.story-stage {
  position: sticky;
  top: 35px;
  border: 1px solid #656553;
  background: #131314;
  margin-bottom: 75px;
}
.story-stage-top,
.story-stage-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 17px 20px;
  font-size: 7px;
  color: #afafa4;
}
.story-stage-top {
  border-bottom: 1px solid var(--line);
}
.story-stage-top .status-dot {
  height: 4px;
  width: 4px;
}
.story-stage-top > span:last-child {
  color: var(--yellow);
}
.story-stage-bottom {
  border-top: 1px solid var(--line);
  font-size: 6px;
  color: var(--muted);
}
.story-board {
  height: 430px;
  position: relative;
  overflow: hidden;
}
.story-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(#ffffff06 1px, transparent 1px),
    linear-gradient(90deg, #ffffff06 1px, transparent 1px);
  background-size: 28px 28px;
}
.story-connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.7s;
}
.story-connections path {
  stroke: #ffd40066;
  stroke-width: 1;
  stroke-dasharray: 4 5;
}
.story-connections circle {
  fill: var(--yellow);
}
.operator-window {
  position: absolute;
  left: 13%;
  top: 24%;
  width: 74%;
  border: 1px solid #9a9a8055;
  background: #1d1d1f;
  box-shadow: 0 20px 40px #0005;
  transition:
    width 0.65s,
    left 0.65s,
    top 0.65s,
    transform 0.65s;
  z-index: 3;
  transform: rotate(-3deg);
}
.operator-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.operator-title .mono {
  font-size: 8px;
  color: var(--yellow);
}
.window-dots {
  font: 22px/10px var(--mono);
  color: var(--muted);
  letter-spacing: 2px;
}
.operator-content {
  padding: 22px 16px;
  font: 10px/2.1 var(--mono);
  overflow: hidden;
  white-space: nowrap;
}
.code-line {
  display: block;
  color: #a8a89c;
}
.code-line b {
  color: #b3a6db;
  font-weight: 400;
}
.code-line em {
  color: #d9c978;
  font-style: normal;
}
.code-line.indent {
  padding-left: 15px;
}
.code-cursor {
  display: inline-block;
  width: 6px;
  height: 12px;
  background: var(--yellow);
  vertical-align: middle;
  margin-left: 5px;
}
.operator-bottom {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 11px 16px;
  font-size: 7px;
  color: var(--muted);
}
.operator-bottom > span:last-child {
  color: var(--yellow);
}
.story-agent {
  position: absolute;
  display: flex;
  gap: 10px;
  align-items: center;
  background: #212122;
  border: 1px solid #717163;
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.6s,
    transform 0.6s,
    box-shadow 0.6s;
  z-index: 4;
  min-width: 160px;
}
.story-agent-icon {
  color: var(--yellow);
  font: 26px/1 var(--body);
}
.story-agent strong {
  display: block;
  font-size: 11px;
  font-weight: 500;
}
.story-agent .mono {
  font-size: 5px;
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.agent-led {
  width: 4px;
  height: 4px;
  background: #79796c;
  border-radius: 50%;
  margin-left: auto;
}
.story-curator {
  top: 12%;
  right: 15%;
}
.story-researcher {
  top: 43%;
  right: 4%;
  transition-delay: 0.1s;
}
.story-builder {
  top: 72%;
  right: 11%;
  transition-delay: 0.2s;
}
.story-corner-label {
  position: absolute;
  left: 21px;
  bottom: 20px;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.9;
}
.story-corner-label > span {
  color: var(--yellow);
}
.story-task {
  position: absolute;
  z-index: 5;
  font-size: 6px;
  background: #2c3425;
  color: #bfdca4;
  border: 1px solid #8fac6355;
  padding: 6px 8px;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.5s,
    transform 0.5s;
}
.task-one {
  top: 31%;
  right: 18%;
}
.task-two {
  top: 62%;
  right: 7%;
}
.story-approval {
  position: absolute;
  z-index: 6;
  left: 12%;
  right: 12%;
  top: 30%;
  padding: 23px;
  background: #ffd400;
  color: #0b0b0c;
  box-shadow:
    0 0 0 10px #ffd4000c,
    0 30px 80px #0008;
  opacity: 0;
  transform: translateY(20px) rotate(2deg);
  transition:
    opacity 0.6s,
    transform 0.6s;
}
.story-approval > .mono {
  font-size: 7px;
}
.story-approval strong {
  display: block;
  font: 700 32px/1.1 var(--display);
  margin: 14px 0 10px;
}
.story-approval p {
  font-size: 11px;
}
.story-approval-stamp {
  display: block;
  font-size: 7px;
  border-top: 1px solid #0004;
  padding-top: 14px;
  margin-top: 19px;
}
.chapter-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.chapter-nav a {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 12px;
  color: var(--muted);
  font-size: 8px;
  border-right: 1px solid var(--line);
  transition:
    background 0.3s,
    color 0.3s;
}
.chapter-nav a:last-child {
  border: 0;
}
.chapter-nav a > span:first-child {
  font-family: var(--mono);
  font-size: 7px;
}
.chapter-nav a[aria-current] {
  background: var(--yellow);
  color: var(--black);
}
.chapter-nav a:focus-visible {
  outline-offset: -3px;
  outline-color: var(--ink);
}
.story-beat {
  min-height: 570px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 50px 0;
  scroll-margin-top: 20vh;
}
.story-beat:first-child {
  padding-top: 0;
  min-height: 490px;
}
.beat-number {
  font-size: 8px;
  color: var(--yellow);
  margin-bottom: 25px;
}
.story-beat h3 {
  font: 700 clamp(40px, 4.6vw, 65px)/1 var(--display);
  letter-spacing: -0.015em;
}
.story-beat p {
  color: #aaa99f;
  font-size: 13px;
  line-height: 1.9;
  max-width: 340px;
  margin-top: 23px;
}
.story-beat .beat-punchline {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.8;
  margin-top: 24px;
}
.story-beat .text-link {
  color: var(--yellow);
  margin-top: 27px;
}
.story-section:not([data-chapter="0"]) .story-connections {
  opacity: 1;
}
.story-section:not([data-chapter="0"]) .operator-window {
  left: 5%;
  top: 36%;
  width: 47%;
  transform: rotate(0);
}
.story-section:not([data-chapter="0"]) .operator-content {
  font-size: 7px;
  padding: 15px 10px;
}
.story-section:not([data-chapter="0"]) .operator-title,
.story-section:not([data-chapter="0"]) .operator-bottom {
  padding: 10px;
}
.story-section:not([data-chapter="0"]) .operator-title .mono {
  font-size: 6px;
}
.story-section:not([data-chapter="0"]) .operator-bottom {
  font-size: 5px;
}
.story-section:not([data-chapter="0"]) .story-agent {
  opacity: 1;
  transform: translateY(0);
}
.story-section[data-chapter="2"] .story-task {
  opacity: 1;
  transform: translateY(0);
}
.story-section[data-chapter="2"] .agent-led {
  background: #bde789;
  box-shadow: 0 0 8px #bde78999;
}
.story-section[data-chapter="2"] .story-agent {
  box-shadow: 0 0 22px #bde7890c;
}
.story-section[data-chapter="3"] .story-approval {
  opacity: 1;
  transform: translateY(0) rotate(-2deg);
}
.story-section[data-chapter="3"] .story-agent,
.story-section[data-chapter="3"] .operator-window {
  opacity: 0.24;
}
@media (min-width: 1400px) {
  .story-board {
    height: 490px;
  }
  .story-beat {
    min-height: 650px;
  }
}
@media (max-width: 1100px) {
  .story-layout {
    gap: 6%;
    grid-template-columns: 1.2fr 1fr;
  }
  .story-board {
    height: 380px;
  }
  .story-agent {
    min-width: 135px;
    padding: 10px;
    gap: 8px;
  }
  .story-agent strong {
    font-size: 10px;
  }
  .story-agent-icon {
    font-size: 22px;
  }
  .operator-content {
    font-size: 8px;
  }
  .story-stage-top {
    font-size: 6px;
    padding: 15px 12px;
  }
  .story-stage-bottom {
    padding: 13px 12px;
    font-size: 5px;
  }
  .story-beat p {
    font-size: 12px;
  }
  .story-curator {
    right: 13%;
  }
  .story-approval {
    padding: 20px;
  }
  .story-approval strong {
    font-size: 28px;
  }
  .chapter-nav a {
    padding: 13px 9px;
    font-size: 7px;
  }
}
@media (max-width: 760px) {
  .story-section {
    padding-bottom: 0;
  }
  .story-heading {
    font-size: 11vw;
    margin-bottom: 30px;
  }
  .story-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .story-stage {
    width: 100%;
    top: 0;
    z-index: 5;
    margin: 0;
    background: #131314;
    box-shadow: 0 16px 24px #0b0b0c;
  }
  .story-stage-top {
    padding: 11px 13px;
    font-size: 6px;
  }
  .story-board {
    height: 240px;
  }
  .story-stage-bottom {
    padding: 8px 12px;
    font-size: 5px;
  }
  .chapter-nav a {
    padding: 10px;
    font-size: 7px;
    gap: 3px;
  }
  .chapter-nav a > span:first-child {
    font-size: 6px;
  }
  .operator-window {
    top: 16%;
    left: 18%;
    width: 64%;
  }
  .operator-title {
    padding: 8px 12px;
  }
  .operator-title .mono {
    font-size: 6px;
  }
  .operator-content {
    padding: 13px 12px;
    font-size: 7px;
    line-height: 1.8;
  }
  .operator-bottom {
    padding: 8px 12px;
    font-size: 5px;
  }
  .story-agent {
    min-width: 125px;
    padding: 8px 10px;
    gap: 7px;
  }
  .story-agent strong {
    font-size: 9px;
  }
  .story-agent .mono {
    font-size: 4px;
  }
  .story-agent-icon {
    font-size: 20px;
  }
  .story-curator {
    top: 8%;
    right: 18%;
  }
  .story-researcher {
    top: 39%;
    right: 4%;
  }
  .story-builder {
    top: 73%;
    right: 10%;
  }
  .story-section:not([data-chapter="0"]) .operator-window {
    left: 5%;
    top: 31%;
    width: 43%;
  }
  .story-section:not([data-chapter="0"]) .operator-content {
    font-size: 5px;
    padding: 11px 7px;
  }
  .story-section:not([data-chapter="0"]) .operator-title,
  .story-section:not([data-chapter="0"]) .operator-bottom {
    padding: 7px;
  }
  .story-section:not([data-chapter="0"]) .operator-title .mono {
    font-size: 5px;
  }
  .story-section:not([data-chapter="0"]) .operator-bottom {
    font-size: 4px;
  }
  .story-corner-label {
    left: 15px;
    bottom: 12px;
    font-size: 5px;
  }
  .story-task {
    font-size: 4px;
    padding: 4px 6px;
  }
  .task-one {
    top: 30%;
    right: 18%;
  }
  .task-two {
    top: 61%;
    right: 7%;
  }
  .story-approval {
    left: 14%;
    right: 14%;
    top: 16%;
    padding: 17px;
  }
  .story-approval > .mono {
    font-size: 6px;
  }
  .story-approval strong {
    font-size: 27px;
    margin: 12px 0 8px;
  }
  .story-approval p {
    font-size: 9px;
  }
  .story-approval-stamp {
    font-size: 5px;
    padding-top: 11px;
    margin-top: 14px;
  }
  .story-beats {
    width: 100%;
    position: relative;
    z-index: 1;
  }
  .story-beat,
  .story-beat:first-child {
    min-height: 480px;
    padding: 75px 8px 60px;
    scroll-margin-top: 360px;
  }
  .story-beat h3 {
    font-size: 53px;
  }
  .story-beat p {
    font-size: 13px;
    max-width: 100%;
  }
  .beat-number {
    font-size: 8px;
    margin-bottom: 20px;
  }
  .story-beat .beat-punchline {
    font-size: 13px;
  }
  .story-stage:has(~ .story-beats .story-beat:target) {
    border-color: #ffd40080;
  }
}
@media (max-width: 390px) {
  .story-board {
    height: 218px;
  }
  .story-stage-top {
    font-size: 5px;
    padding: 10px;
  }
  .story-agent {
    min-width: 110px;
    padding: 8px;
  }
  .story-agent strong {
    font-size: 8px;
  }
  .story-agent-icon {
    font-size: 17px;
  }
  .story-beat,
  .story-beat:first-child {
    scroll-margin-top: 330px;
    min-height: 480px;
  }
  .story-beat h3 {
    font-size: 47px;
  }
  .story-approval strong {
    font-size: 24px;
  }
  .story-approval-stamp {
    font-size: 4px;
  }
}
@media (max-height: 600px) {
  .story-stage {
    position: relative;
    top: auto;
  }
  .story-beat,
  .story-beat:first-child {
    scroll-margin-top: 40px;
  }
}
