.case-study-page {
  --case-panel: #111512;
  --case-panel-raised: #171c18;
  --case-blue: #8edcf6;
}

.case-study-page a:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: 4px;
}

.case-main {
  overflow: hidden;
}

.case-main section[id] {
  scroll-margin-top: 88px;
}

.case-hero {
  align-items: center;
  display: grid;
  gap: clamp(44px, 6vw, 86px);
  grid-template-columns: minmax(0, .93fr) minmax(470px, .87fr);
  min-height: 780px;
  padding: 96px 0 84px;
}

.case-hero h1 {
  font-size: clamp(4rem, 7vw, 7rem);
}

.case-lede {
  color: #bdc1b9;
  font-size: clamp(1.05rem, 1.45vw, 1.28rem);
  line-height: 1.7;
  margin: 34px 0 0;
  max-width: 670px;
}

.case-facts {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  margin: 44px 0 0;
  padding: 24px 0 0;
}

.case-facts li {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.case-facts strong {
  color: var(--ink);
  font-size: .78rem;
}

.case-facts span {
  color: #939a92;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .62rem;
  letter-spacing: .04em;
  line-height: 1.5;
  text-transform: uppercase;
}

.private-entry {
  background: linear-gradient(155deg, #171c18, #0d100e 72%);
  border: 1px solid #353c35;
  border-radius: 24px;
  box-shadow: 0 44px 90px rgba(0, 0, 0, .38);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 540px;
  overflow: hidden;
  padding: clamp(34px, 5vw, 58px);
  position: relative;
  transform: rotate(.7deg);
}

.private-entry::before {
  background-image: linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.private-entry::after {
  background: radial-gradient(circle, rgba(201, 255, 74, .12), transparent 68%);
  content: "";
  height: 380px;
  pointer-events: none;
  position: absolute;
  right: -160px;
  top: -180px;
  width: 380px;
}

.private-entry > * {
  position: relative;
  z-index: 1;
}

.private-entry-mark {
  align-items: center;
  background: var(--acid);
  border-radius: 14px;
  color: #10130d;
  display: flex;
  font-size: 1.55rem;
  font-weight: 800;
  height: 54px;
  justify-content: center;
  margin-bottom: 28px;
  width: 54px;
}

.private-entry-eyebrow {
  color: var(--acid);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .66rem;
  letter-spacing: .13em;
}

.private-entry h2 {
  font-size: clamp(2.25rem, 4vw, 3.7rem);
  letter-spacing: -.055em;
  line-height: .98;
  margin: 16px 0 14px;
}

.private-entry > p {
  color: #aeb4ac;
  line-height: 1.6;
  margin: 0;
  max-width: 420px;
}

.private-entry-field {
  margin-top: 36px;
}

.private-entry-field > span {
  color: #c6cbc3;
  display: block;
  font-size: .72rem;
  margin-bottom: 9px;
}

.private-entry-field > div {
  align-items: center;
  background: rgba(6, 8, 7, .68);
  border: 1px solid #383f38;
  border-radius: 10px;
  color: #7f877e;
  display: flex;
  font-size: .78rem;
  gap: 12px;
  padding: 14px 15px;
}

.entry-lock {
  border: 1.5px solid #8f978d;
  border-radius: 2px;
  display: block;
  height: 9px;
  margin-top: 4px;
  position: relative;
  width: 11px;
}

.entry-lock::before {
  border: 1.5px solid #8f978d;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  content: "";
  height: 6px;
  left: 1px;
  position: absolute;
  top: -7px;
  width: 6px;
}

.private-entry-button {
  align-items: center;
  background: var(--acid);
  border-radius: 10px;
  color: #10130d;
  display: flex;
  font-size: .8rem;
  font-weight: 760;
  justify-content: space-between;
  margin-top: 12px;
  padding: 14px 15px;
}

.private-entry-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: #939a92;
  display: flex;
  font-size: .66rem;
  gap: 9px;
  line-height: 1.45;
  margin-top: 26px;
  padding-top: 18px;
}

.private-entry-footer i {
  background: var(--acid);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(201, 255, 74, .1);
  flex: 0 0 auto;
  height: 6px;
  width: 6px;
}

.fleet-board {
  background: linear-gradient(155deg, #151a16, #0d100e 68%);
  border: 1px solid #353c35;
  border-radius: 24px;
  box-shadow: 0 44px 90px rgba(0, 0, 0, .38);
  min-width: 0;
  overflow: hidden;
  position: relative;
  transform: rotate(.7deg);
}

.fleet-board::after {
  background: radial-gradient(circle, rgba(201, 255, 74, .11), transparent 68%);
  content: "";
  height: 360px;
  pointer-events: none;
  position: absolute;
  right: -170px;
  top: -190px;
  width: 360px;
}

.fleet-board-bar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: #a0a79f;
  display: flex;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .68rem;
  justify-content: space-between;
  letter-spacing: .1em;
  padding: 16px 18px;
}

.board-private {
  align-items: center;
  color: var(--acid);
  display: inline-flex;
  gap: 7px;
}

.board-private i,
.machine-dot {
  background: var(--acid);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(201, 255, 74, .1);
  display: inline-block;
  height: 6px;
  width: 6px;
}

.board-summary {
  background: var(--line);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, 1fr);
}

.board-summary div {
  background: rgba(18, 22, 19, .96);
  display: flex;
  flex-direction: column;
  min-height: 100px;
  padding: 18px;
}

.board-summary span {
  color: #9ba29a;
  font-size: .68rem;
}

.board-summary strong {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem;
  margin-top: auto;
}

.board-summary div:last-child strong {
  color: var(--acid);
  font-size: .75rem;
  letter-spacing: .08em;
}

.board-machines {
  display: grid;
  gap: 9px;
  padding: 16px;
}

.board-machines article {
  background: rgba(255, 255, 255, .025);
  border: 1px solid #2b312c;
  border-radius: 12px;
  padding: 14px;
}

.machine-heading {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: auto 1fr auto;
}

.machine-heading strong {
  font-size: .73rem;
}

.machine-heading small {
  color: var(--acid);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .58rem;
  letter-spacing: .08em;
}

.meter {
  background: #242a25;
  border-radius: 999px;
  height: 3px;
  margin: 13px 0 9px 14px;
  overflow: hidden;
}

.meter i {
  background: linear-gradient(90deg, var(--acid), var(--cyan));
  display: block;
  height: 100%;
}

.board-machines p {
  color: #949b93;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .6rem;
  margin: 0 0 0 14px;
}

.board-session {
  align-items: center;
  background: rgba(201, 255, 74, .07);
  border: 1px solid rgba(201, 255, 74, .22);
  border-radius: 13px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr auto;
  margin: 0 16px 16px;
  padding: 14px;
}

.session-icon {
  align-items: center;
  background: var(--acid);
  border-radius: 8px;
  color: #11150d;
  display: flex;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .75rem;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.board-session div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.board-session small {
  color: #9ba29a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .56rem;
  letter-spacing: .1em;
}

.board-session strong {
  font-size: .7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reattach {
  border: 1px solid #394039;
  border-radius: 999px;
  color: #b8bdb6;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .56rem;
  letter-spacing: .07em;
  padding: 6px 8px;
}

.concept-note {
  color: #969d95;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .58rem;
  letter-spacing: .05em;
  margin: -2px 16px 15px;
  text-align: right;
  text-transform: uppercase;
}

.plain-english {
  background: var(--acid);
  border-radius: var(--radius);
  color: #10130d;
  display: grid;
  gap: 34px 70px;
  grid-template-columns: minmax(280px, .8fr) 1.2fr;
  margin: 34px 0 110px;
  padding: clamp(36px, 6vw, 72px);
}

.plain-english .eyebrow {
  color: #394326;
  grid-column: 1 / -1;
  margin: 0;
}

.plain-english h2 {
  font-size: clamp(2.4rem, 4.4vw, 4.4rem);
  letter-spacing: -.055em;
  line-height: .98;
  margin: 0;
}

.plain-english > p:last-child {
  align-self: end;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.75;
  margin: 0;
}

.dashboard-preview-section {
  border-top: 1px solid var(--line);
  padding: 100px 0;
}

.dashboard-preview-section .fleet-board {
  margin: 0 auto;
  max-width: 820px;
  transform: none;
}

.story-split,
.workflow-section,
.architecture-section,
.not-section,
.decisions-section,
.build-section,
.status-section {
  border-top: 1px solid var(--line);
  padding: 100px 0;
}

.story-split,
.not-section {
  display: grid;
  gap: clamp(50px, 8vw, 110px);
  grid-template-columns: .78fr 1.22fr;
}

.story-heading h2,
.build-copy h2,
.status-section h2 {
  font-size: clamp(2.5rem, 5vw, 4.9rem);
  letter-spacing: -.06em;
  line-height: .98;
  margin: 0;
}

.problem-answer {
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 1px;
  grid-template-columns: 1fr;
  overflow: hidden;
}

.problem-answer article {
  background: var(--case-panel);
  padding: 34px;
}

.problem-answer span,
.distinction-grid > article > span,
.next-panel > span {
  color: var(--acid);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .6rem;
  letter-spacing: .11em;
}

.problem-answer h3 {
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  letter-spacing: -.04em;
  margin: 34px 0 12px;
}

.problem-answer p,
.distinction-grid p,
.decision-grid p,
.build-copy > p:last-child,
.status-section > div > p:last-child,
.next-panel p {
  color: var(--muted);
  margin: 0;
}

.workflow-list {
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
  margin: 0;
  overflow: hidden;
  padding: 0;
}

.workflow-list li {
  background: var(--case-panel);
  display: flex;
  flex-direction: column;
  min-height: 330px;
  padding: 30px;
}

.workflow-list > li > span,
.decision-grid > article > span {
  color: var(--acid);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .65rem;
}

.workflow-list div {
  margin-top: auto;
}

.workflow-list h3 {
  font-size: 1.45rem;
  letter-spacing: -.035em;
  margin: 0 0 12px;
}

.workflow-list p {
  color: var(--muted);
  font-size: .86rem;
  margin: 0;
}

.architecture-map {
  align-items: center;
  background: linear-gradient(145deg, #111512, #0e110f);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(28px, 5vw, 60px);
  position: relative;
}

.architecture-map::before {
  background-image: linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.architecture-node {
  background: #171c18;
  border: 1px solid #343b34;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  padding: 18px 22px;
  position: relative;
  text-align: center;
  z-index: 1;
}

.architecture-node > span {
  color: var(--acid);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .6rem;
  letter-spacing: .1em;
  margin-bottom: 8px;
}

.architecture-node strong {
  font-size: 1rem;
}

.architecture-node small {
  color: #969d95;
  font-size: .72rem;
  margin-top: 3px;
}

.browser-node {
  width: min(330px, 100%);
}

.controller-node {
  border-color: rgba(201, 255, 74, .48);
  box-shadow: 0 0 50px rgba(201, 255, 74, .06);
  padding: 24px;
  width: min(450px, 100%);
}

.controller-node strong {
  font-size: 1.25rem;
}

.architecture-link {
  align-items: center;
  display: flex;
  justify-content: center;
  position: relative;
  width: 100%;
}

.architecture-link span {
  background: #0f120f;
  color: #939a92;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .56rem;
  letter-spacing: .1em;
  padding: 5px 9px;
  position: relative;
  z-index: 1;
}

.link-down {
  height: 78px;
}

.link-down::before,
.link-fan::before {
  background: #394039;
  content: "";
  height: 100%;
  left: 50%;
  position: absolute;
  top: 0;
  width: 1px;
}

.link-fan {
  height: 90px;
}

.link-fan::after {
  background: #394039;
  bottom: 0;
  content: "";
  height: 1px;
  left: 16.66%;
  position: absolute;
  width: 66.68%;
}

.agent-row {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, 1fr);
  position: relative;
  width: 100%;
  z-index: 1;
}

.agent-node::before {
  background: #394039;
  content: "";
  height: 18px;
  position: absolute;
  top: -18px;
  width: 1px;
}

.agent-node::before { left: 50%; }

.agent-node {
  min-width: 0;
}

.distinction-grid {
  display: grid;
  gap: 12px;
}

.distinction-grid article {
  background: var(--case-panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
}

.distinction-grid article:nth-child(n+2) > span {
  color: #828880;
}

.distinction-grid h3 {
  font-size: 1.35rem;
  letter-spacing: -.03em;
  margin: 22px 0 9px;
}

.decision-grid {
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
}

.decision-grid article {
  background: var(--case-panel);
  min-height: 270px;
  padding: 32px;
}

.decision-grid h3 {
  font-size: 1.5rem;
  letter-spacing: -.035em;
  margin: 64px 0 12px;
}

.build-section {
  display: grid;
  gap: clamp(50px, 8vw, 110px);
  grid-template-columns: .9fr 1.1fr;
}

.build-copy > p:last-child {
  line-height: 1.75;
  margin-top: 28px;
  max-width: 580px;
}

.stack-list {
  border-top: 1px solid var(--line);
  margin: 0;
}

.stack-list div {
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 25px;
  grid-template-columns: .8fr 1.2fr;
  padding: 25px 0;
}

.stack-list dt {
  color: #7e847d;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.stack-list dd {
  color: var(--ink);
  font-size: .92rem;
  margin: 0;
}

.status-section {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.status-section > div {
  background: var(--case-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(32px, 5vw, 56px);
}

.status-section > div:first-child > p:last-child {
  line-height: 1.7;
  margin-top: 28px;
}

.next-panel {
  display: flex;
  flex-direction: column;
}

.next-panel h3 {
  font-size: clamp(2rem, 3.8vw, 3.6rem);
  letter-spacing: -.05em;
  line-height: 1;
  margin: auto 0 20px;
  padding-top: 80px;
}

.case-contact {
  margin-top: 30px;
}

@media (max-width: 1040px) {
  .case-hero {
    grid-template-columns: 1fr;
    padding-top: 84px;
  }

  .private-entry,
  .fleet-board {
    max-width: 700px;
    transform: none;
  }

  .workflow-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .case-hero {
    gap: 56px;
    min-height: 0;
    padding: 66px 0 74px;
  }

  .case-hero h1 {
    font-size: clamp(3.4rem, 15vw, 5.1rem);
  }

  .case-facts {
    grid-template-columns: 1fr;
  }

  .private-entry {
    border-radius: 18px;
    min-height: 0;
    padding: 34px 26px;
  }

  .fleet-board {
    border-radius: 18px;
  }

  .board-summary {
    grid-template-columns: 1fr;
  }

  .board-summary div {
    min-height: 76px;
  }

  .board-session {
    grid-template-columns: auto 1fr;
  }

  .reattach {
    display: none;
  }

  .plain-english {
    gap: 26px;
    grid-template-columns: 1fr;
    margin-bottom: 80px;
    padding: 34px 26px;
  }

  .plain-english .eyebrow {
    grid-column: auto;
  }

  .story-split,
  .not-section,
  .build-section,
  .status-section {
    grid-template-columns: 1fr;
  }

  .story-split,
  .dashboard-preview-section,
  .workflow-section,
  .architecture-section,
  .not-section,
  .decisions-section,
  .build-section,
  .status-section {
    padding: 78px 0;
  }

  .workflow-list,
  .decision-grid {
    grid-template-columns: 1fr;
  }

  .workflow-list li {
    min-height: 250px;
  }

  .architecture-map {
    padding: 28px 16px;
  }

  .link-fan::after,
  .agent-node::before {
    display: none;
  }

  .agent-row {
    grid-template-columns: 1fr;
  }

  .agent-node::after {
    background: #394039;
    content: "";
    height: 18px;
    left: 50%;
    position: absolute;
    top: -19px;
    width: 1px;
  }

  .agent-node + .agent-node {
    margin-top: 18px;
  }

  .link-fan {
    height: 60px;
  }

  .decision-grid article {
    min-height: 235px;
  }

  .stack-list div {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.activity-window-section {
  padding: 112px 0;
}

.activity-window {
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid rgba(129, 255, 196, .18);
  border-radius: 24px;
  background: radial-gradient(circle at 85% 0, rgba(55, 171, 122, .12), transparent 35%), #090d0c;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .32), inset 0 1px rgba(255, 255, 255, .03);
}

.activity-window__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  color: #a9b5af;
  font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .1em;
}

.activity-window__bar span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.activity-window__bar i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #7c8b84;
  box-shadow: 0 0 0 5px rgba(124, 139, 132, .1);
}

.activity-window[data-state="making"] .activity-window__bar i,
.activity-window[data-state="ready"] .activity-window__bar i {
  background: #72f2ae;
  box-shadow: 0 0 0 5px rgba(114, 242, 174, .1), 0 0 18px rgba(114, 242, 174, .55);
}

.activity-window__bar strong { color: #72f2ae; }

.activity-window__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.activity-window__metrics article {
  min-height: 170px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-right: 1px solid rgba(255, 255, 255, .07);
}

.activity-window__metrics article:last-child { border-right: 0; }

.activity-window__metrics span,
.activity-window__engines > div > span {
  color: #7e8d86;
  font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.activity-window__metrics strong {
  margin: 20px 0 6px;
  color: #f2f7f4;
  font-size: clamp(34px, 5vw, 62px);
  line-height: .9;
  letter-spacing: -.06em;
  text-transform: uppercase;
}

.activity-window__metrics small,
.activity-window__engines small {
  color: #6f7c76;
  font-size: 12px;
}

.activity-window__engines {
  padding: 26px 28px;
  display: grid;
  grid-template-columns: minmax(180px, .7fr) 1.3fr;
  gap: 34px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.activity-window__engines > div {
  display: grid;
  align-content: start;
  gap: 8px;
}

.activity-window__engines ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.activity-window__engines li {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
  color: #aab5b0;
  font-size: 12px;
}

.activity-window__engines li strong {
  color: #72f2ae;
  font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.activity-window__privacy {
  margin: 0;
  padding: 14px 28px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  color: #66746d;
  font-size: 11px;
}

.activity-window__privacy span { color: #72f2ae; }

@media (max-width: 720px) {
  .activity-window-section { padding: 80px 0; }
  .activity-window__metrics { grid-template-columns: 1fr; }
  .activity-window__metrics article {
    min-height: 132px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
  }
  .activity-window__metrics article:last-child { border-bottom: 0; }
  .activity-window__engines { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 460px) {
  .activity-window__bar { align-items: flex-start; flex-direction: column; }
  .activity-window__metrics article,
  .activity-window__engines,
  .activity-window__privacy { padding-left: 20px; padding-right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .private-entry,
  .fleet-board {
    transform: none;
  }
}
