/* =========================================================
   responsive.css
   滚动进场 · 断点适配 · 动效降级
   Editorial Paper · 日式画册 / 暖白纸感
   ========================================================= */

/* =========================================================
   滚动进场动画
   ========================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
[data-reveal].in {
  opacity: 1;
  transform: none;
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 720px) {
  /* 手机端：导航变成左上角的横向条，不再占用左侧一整列 */
  :root { --rail: 0px; }

  .nav-wrap {
    top: max(12px, env(safe-area-inset-top, 0px));
    left: 10px;
    width: auto;
    padding-left: 0;
    transform: none;
  }

  .nav { flex-direction: row; align-items: center; padding: 5px 6px; border-radius: 12px; }

  .nav-links {
    flex-direction: row;
    gap: 2px;
  }

  .nav-divider {
    width: 1px;
    height: 24px;
    margin: 0 3px;
  }

  .theme-toggle {
    width: auto;
    min-width: 42px;
    gap: 3px;
    padding: 6px 7px 9px;
    font-size: 10px;
    border-radius: 9px;
  }
  .theme-toggle svg { width: 17px; height: 17px; }

  .nav-link {
    min-width: 44px;
    gap: 3px;
    padding: 6px 7px 9px;
    font-size: 10px;
    border-radius: 9px;
  }

  .nav-link svg { width: 17px; height: 17px; }

  /* 横排后指示条改成底部短线 */
  .nav-link::before {
    left: 50%;
    top: auto;
    bottom: 3px;
    width: 0;
    height: 2px;
    transform: translateX(-50%);
    transition: width 0.3s var(--ease), background 0.3s ease;
  }

  .nav-link.is-current::before {
    width: 16px;
    height: 2px;
  }

  .slide { padding-top: 76px; }

  /* 窄屏翻页点挪到底部居中，横着排 */
  .pager {
    top: auto;
    right: auto;
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .pager-dot { width: 6px; height: 6px; }
  .pager-dot.is-active { width: 22px; height: 6px; }

  .hero {
    min-height: 100vh;
    min-height: 92svh;
    padding-top: 88px;
  }
  .avatar { width: 82px; height: 82px; margin-bottom: 26px; }
  .avatar-initial { font-size: 31px; }
  .scroll-hint { display: none; }

  .section-en { display: none; }

  .apps-search { flex: 1 1 100%; max-width: none; margin-left: 0; }

  /* 艺术品 */
  #artworks { padding-top: 68px; padding-bottom: 44px; }
  #artworks .section-head { margin-bottom: 18px; }
  .art-panel { padding: 12px; border-radius: 14px; }
  .art-toolbar { margin-bottom: 12px; }
  .art-tab { padding: 7px 14px; font-size: 13px; }
  .art-pane .photo-stage {
    height: min(380px, calc(100svh - 250px));
    border-radius: 10px;
  }

  /* 视频 */
  .video-stage { width: min(100%, calc((100svh - 300px) * 16 / 9)); padding: 6px; border-radius: 12px; }
  .video-frame { border-radius: 8px; }
  .video-foot {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
  }

  .contact-card { border-radius: 14px; }
  .email-card.is-primary { padding: 15px 18px; }
  .email-card.is-primary .email-addr { font-size: 13.5px; }
  .email-card.is-backup { padding: 6px 12px; }
  .email-card.is-backup .email-addr { font-size: 11px; }
  .slide--contact .footer { bottom: calc(38px + env(safe-area-inset-bottom, 0px)); }
  .contact-link { padding: 9px 16px; font-size: 13px; }

  .toast { font-size: 13.2px; padding: 11px 18px; }
}

/* =========================================================
   触屏 / 窄屏性能优化
   ========================================================= */
@media (max-width: 720px), (hover: none) and (pointer: coarse) {
  :root {
    --glass-blur: blur(8px);
  }

  .bg-grain { display: none; }
  .cursor-glow { display: none; }
  .video-hint { display: none; }

  .blob {
    filter: blur(70px);
    animation: none;
  }
  .blob-3 { opacity: 0.16; }

  /* 导航在移动端直接用实色底，滚动更跟手 */
  .nav,
  .nav.scrolled {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background-color: rgba(251, 248, 243, 0.96);
  }
  :root[data-theme="dark"] .nav,
  :root[data-theme="dark"] .nav.scrolled {
    background-color: rgba(32, 30, 27, 0.96);
  }
}

@media (max-width: 430px) {
  .contact-links { flex-direction: column; align-items: stretch; }
  .contact-link { justify-content: center; }

  .nav { padding: 4px 5px; }
  .nav-links { gap: 1px; }
  .nav-link { min-width: 40px; padding: 5px 6px 8px; font-size: 9.5px; }
}

@media (max-width: 352px) {
  .nav-link { font-size: 9px; }
  .nav-link svg { width: 15px; height: 15px; }
}

/* =========================================================
   动效降级
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
