/**
 * [INPUT]: 依赖 base.css 与 sections.css 已定义的组件和设计令牌
 * [OUTPUT]: 提供动效降级以及 1020px、820px、600px 三档响应式适配
 * [POS]: css 模块的跨设备适配层，保证桌面、平板与移动端布局连续
 * [PROTOCOL]: 变更时更新此头部，然后检查 AGENTS.md
 */

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

  .motion-ready .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1020px) {
  .hero-layout {
    grid-template-columns: 1fr 390px;
    gap: 42px;
  }

  .hero h1 {
    font-size: clamp(60px, 8vw, 92px);
  }

  .section-heading {
    grid-template-columns: 0.4fr 1.6fr;
  }

  .process-layout,
  .faq-layout {
    gap: 54px;
  }

  .diagram-canvas {
    grid-template-columns: 1fr 0.35fr 68px 0.35fr 1fr;
    padding: 20px;
  }

  .diagram-processor {
    width: 68px;
    height: 68px;
  }

  .boundary-grid {
    gap: 50px;
  }
}

@media (max-width: 820px) {
  :root {
    --shell: min(100% - 32px, 720px);
  }

  .menu-toggle {
    position: relative;
    display: block;
    width: 40px;
    height: 40px;
    border: 1px solid var(--ink);
    background: transparent;
  }

  .menu-toggle span:not(.sr-only) {
    position: absolute;
    right: 9px;
    left: 9px;
    height: 1px;
    background: var(--ink);
    transition: transform var(--transition);
  }

  .menu-toggle span:first-child {
    top: 15px;
  }

  .menu-toggle span:nth-child(2) {
    bottom: 15px;
  }

  .menu-toggle[aria-expanded="true"] span:first-child {
    top: 19px;
    transform: rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    bottom: 20px;
    transform: rotate(-45deg);
  }

  .site-nav {
    position: absolute;
    z-index: 150;
    top: 100%;
    right: 0;
    left: 0;
    display: flex;
    min-height: calc(100vh - 72px);
    visibility: hidden;
    flex-direction: column;
    align-items: stretch;
    padding: 34px 24px;
    background: var(--paper);
    opacity: 0;
    transform: translateY(-12px);
    transition:
      opacity var(--transition),
      transform var(--transition),
      visibility var(--transition);
  }

  .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .site-nav > a {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    font-size: 18px;
  }

  .site-nav .nav-cta {
    margin-top: 20px;
    padding: 16px;
    text-align: center;
  }

  .hero {
    padding-top: 68px;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 64px;
  }

  .hero-copy {
    max-width: 680px;
  }

  .cleaner-panel {
    width: min(100%, 560px);
    justify-self: center;
  }

  .section {
    padding: 90px 0;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 25px;
  }

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

  .process-header {
    display: block;
  }

  .process-header h2 {
    margin-top: 24px;
  }

  .process-layout,
  .faq-layout,
  .boundary-grid {
    grid-template-columns: 1fr;
  }

  .faq-intro {
    position: static;
  }

  .report-columns {
    grid-template-columns: 1fr;
  }

  .report-divider {
    min-height: 60px;
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .report-divider span {
    transform: rotate(90deg);
  }

  .boundary-lists {
    max-width: 620px;
  }

  .footer-grid {
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 32px;
  }
}

@media (max-width: 600px) {
  :root {
    --shell: calc(100vw - 28px);
  }

  .header-inner {
    min-height: 64px;
  }

  .site-nav {
    min-height: calc(100vh - 64px);
  }

  .brand {
    font-size: 12px;
  }

  .hero {
    padding-top: 48px;
  }

  .hero-layout {
    padding-bottom: 58px;
  }

  .eyebrow {
    margin-bottom: 22px;
    font-size: 9px;
  }

  .hero h1 {
    font-size: clamp(55px, 18vw, 76px);
    line-height: 0.86;
  }

  .hero h1 span {
    margin-left: 0;
  }

  .hero-deck {
    margin-top: 30px;
    font-size: 21px;
  }

  .hero-note {
    font-size: 13px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .text-link {
    width: max-content;
  }

  .cleaner-panel::before {
    display: none;
  }

  .cleaner-body {
    padding: 18px;
  }

  .dropzone {
    min-height: 225px;
  }

  .panel-footer {
    gap: 8px;
    font-size: 7px;
  }

  .trust-strip {
    grid-template-columns: 1fr 1fr;
  }

  .trust-strip > div {
    min-height: 80px;
    padding-left: 15px;
    border-bottom: 1px solid var(--line);
  }

  .trust-strip > div:nth-child(3) {
    border-left: 1px solid var(--line);
  }

  .trust-strip strong {
    font-size: 15px;
  }

  .section {
    padding: 76px 0;
  }

  .section-heading {
    margin-bottom: 42px;
  }

  .section-heading h2,
  .process-header h2,
  .boundary-copy h2,
  .faq-intro h2 {
    font-size: 42px;
  }

  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .evidence-item {
    min-height: 240px;
  }

  .evidence-item h3 {
    margin-top: 46px;
  }

  .process-header {
    margin-bottom: 42px;
  }

  .process-layout {
    gap: 46px;
  }

  .diagram-canvas {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .diagram-line {
    width: 1px;
    height: 34px;
    margin: auto;
    flex-direction: column;
  }

  .diagram-line::before {
    top: 0;
    bottom: 0;
    left: 0;
    width: 1px;
    height: auto;
  }

  .diagram-line span {
    top: 8px;
    left: 12px;
  }

  .diagram-processor {
    margin: auto;
  }

  .diagram-log {
    grid-template-columns: 1fr;
  }

  .report-card {
    box-shadow: 6px 6px 0 rgba(22, 25, 20, 0.13);
  }

  .report-bar {
    grid-template-columns: 1fr auto;
  }

  .report-bar > span:nth-child(2) {
    display: none;
  }

  .report-column {
    padding: 24px 18px;
  }

  .report-column dl div {
    grid-template-columns: 0.75fr 1.25fr;
    gap: 12px;
    font-size: 9px;
  }

  .report-foot {
    min-height: auto;
    gap: 16px;
    align-items: flex-start;
    padding-block: 15px;
  }

  .report-foot > span {
    display: none;
  }

  .boundary-section {
    padding: 76px 0;
  }

  .boundary-lists {
    grid-template-columns: 1fr;
  }

  .boundary-lists > div + div {
    border-top: 1px solid var(--ink);
    border-left: 0;
  }

  .faq-layout {
    gap: 44px;
  }

  .faq-list summary {
    min-height: 76px;
    grid-template-columns: 30px 1fr 20px;
    gap: 10px;
    font-size: 13px;
  }

  .faq-list details > div {
    padding: 0 26px 24px 40px;
  }

  .final-cta {
    padding: 82px 0;
  }

  .cta-inner h2 {
    font-size: clamp(50px, 15vw, 72px);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
    margin-bottom: 20px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .prototype-toast {
    right: 14px;
    bottom: 14px;
    left: 14px;
  }
}
