@media (max-width: 860px) {
  body::before {
    background-size: 52px 52px;
    opacity: 0.25;
  }
  .menu-button {
    display: inline-grid;
    place-items: center;
  }
  .site-nav {
    position: fixed;
    z-index: var(--z-menu);
    inset: 4.5rem 0 auto;
    display: none;
    padding: 1rem 1.125rem calc(1rem + env(safe-area-inset-bottom));
    border-bottom: 1px solid var(--line);
    background: var(--ink-950);
    box-shadow: var(--shadow);
  }
  .site-nav.open {
    display: grid;
  }
  .site-nav a {
    min-height: 52px;
    padding-inline: 0.75rem;
    border-bottom: 1px solid var(--line);
  }
  .site-nav .button {
    margin-top: 0.5rem;
  }
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 4rem;
  }
  .hero-stage {
    min-height: auto;
  }
  .hero-terminal {
    width: 100%;
    max-width: 620px;
    transform: none;
  }
  .hero-atmosphere::before {
    inset: 25% -35% auto 20%;
    opacity: 0.42;
  }
  .section-head,
  .workflow-layout,
  .traceability-note,
  .handoff-summary,
  .quick-start {
    grid-template-columns: 1fr;
  }
  .section-head h2 {
    margin-bottom: 0;
  }
  .trace {
    grid-template-columns: 1fr;
  }
  .trace article {
    min-height: auto;
    border-top: 0;
    border-left: 2px solid var(--signal);
  }
  .trace article:not(:last-child)::after {
    content: "↓";
    inset: auto auto -0.9rem 1rem;
  }
  .handoff-origin {
    grid-template-columns: 1fr;
    border: 1px solid var(--line);
  }
  .origin-node,
  .origin-transfer {
    padding: 1.2rem;
  }
  .origin-transfer {
    text-align: left;
    border-block: 1px solid var(--line);
  }
  .origin-transfer > span {
    display: inline-block;
    margin: 0 0.7rem 0 0;
    transform: rotate(90deg);
  }
  .origin-transfer strong {
    display: inline;
    margin-right: 0.35rem;
  }
  .origin-transfer small {
    display: inline;
  }
  .transfer-line::after {
    width: 1px;
    height: 2rem;
    left: 0.55rem;
    bottom: -0.35rem;
    animation-name: transfer-pulse-mobile;
  }
  @keyframes transfer-pulse-mobile {
    from {
      opacity: 0;
      transform: translateY(-1.5rem);
    }
    35%,
    65% {
      opacity: 1;
    }
    to {
      opacity: 0;
      transform: translateY(1.5rem);
    }
  }
}
@media (max-width: 600px) {
  body::before {
    background-size: 42px 42px;
    opacity: 0.2;
    animation: none;
  }
  body::after {
    opacity: 0.6;
  }
  .shell,
  .narrow {
    width: min(100% - 2.25rem, var(--content));
  }
  .section {
    padding-block: 4.8rem;
  }
  .hero h1 {
    max-width: 11ch;
    font-size: clamp(2.55rem, 12.5vw, 3.7rem);
    line-height: 1.04;
  }
  .hero-lead {
    font-size: 1.05rem;
  }
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .hero-actions .button {
    width: 100%;
  }
  .hero-stage {
    background:
      radial-gradient(
        circle at 82% 18%,
        rgb(139 124 255 / 0.11),
        transparent 17rem
      ),
      radial-gradient(
        circle at 20% 48%,
        rgb(152 245 208 / 0.055),
        transparent 18rem
      ),
      #0c0e0d;
  }
  .hero-orbit {
    opacity: 0.45;
  }
  .hero-beam {
    display: none;
  }
  .hero-terminal > pre {
    font-size: 0.72rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .run-list li {
    grid-template-columns: 1.55rem minmax(0, 1fr) 1.35rem;
    gap: 0.6rem;
    min-height: 3.8rem;
  }
  .run-list b {
    font-size: clamp(0.71rem, 3.1vw, 0.8rem);
  }
  .run-list small {
    font-size: 0.7rem;
    line-height: 1.45;
  }
  .run-list li > span:last-child {
    width: 1.35rem;
    height: 1.35rem;
  }
  .terminal-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .terminal-controls .button {
    width: 100%;
    min-width: 0;
  }
  .page-hero::before {
    inset-inline: 48% -40vw;
  }
  .page-hero::after {
    width: 20rem;
    height: 20rem;
    right: -12rem;
  }
  .reason-grid,
  .role-grid,
  .safety-grid,
  .status-grid,
  .comparison,
  .approval-demo,
  .handoff-example,
  .boundary-strip {
    grid-template-columns: 1fr;
  }
  .reason-grid article,
  .role-grid article,
  .safety-grid article,
  .status-grid article {
    border-right: 0;
    padding-inline: 0.25rem;
  }
  .comparison > article {
    padding: 1.35rem;
  }
  .workflow-layout {
    gap: 1.25rem;
  }
  .workflow-tabs {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    overflow-x: auto;
  }
  .workflow-tabs button {
    min-width: 44px;
    min-height: 44px;
    display: block;
    padding: 0;
    text-align: center;
    border-left: 0;
    border-bottom: 2px solid var(--line);
    font-size: 0;
  }
  .workflow-tabs button[aria-selected="true"] {
    transform: none;
  }
  .workflow-tabs button span {
    font-size: 0.8rem;
  }
  .workflow-panel {
    min-height: 390px;
    padding: 1.25rem;
  }
  .workflow-panel dl {
    grid-template-columns: 1fr;
  }
  .workflow-panel dt {
    padding-bottom: 0;
    border-bottom: 0;
  }
  .workflow-panel dd {
    padding-top: 0.2rem;
  }
  .traceability-note > p {
    grid-column: auto;
  }
  .trace-chain {
    grid-template-columns: 1fr 1fr;
  }
  .trace-chain span + span::before {
    content: none;
  }
  .trace-chain span:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
  .mock-diff {
    border-left: 0;
    border-top: 1px solid var(--line);
    overflow-x: auto;
  }
  .decision-list li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .boundary-strip p {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .boundary-strip p:last-child {
    border-bottom: 0;
  }
  .footer-grid {
    display: grid;
  }
}
@media (max-width: 360px) {
  .shell,
  .narrow {
    width: min(100% - 1.5rem, var(--content));
  }
  .hero {
    padding-top: 3rem;
  }
  .hero h1 {
    font-size: clamp(2.25rem, 12vw, 2.7rem);
  }
  .hero-actions,
  .terminal-controls {
    grid-template-columns: 1fr;
  }
  .workflow-panel {
    min-height: 0;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .hero {
    min-height: auto;
  }
  .site-nav {
    max-height: calc(100dvh - 4.5rem);
    overflow-y: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
  .page-hero::before {
    animation: none;
    opacity: 0.28;
    transform: none;
  }
  .hero-orbit,
  .hero-beam,
  .run-list .current::after,
  .transfer-line::after,
  .trace-chain span::after {
    animation: none;
  }
}
