/* ============================================
   Perlart 手作理想国 — 响应式样式
   ============================================ */

/* === Tablet (768px - 1199px) === */
@media (max-width: 1199px) {
  :root {
    --nav-height: 72px;
  }

  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }

  .section {
    padding: var(--space-16) 0;
  }

  .hero__title {
    font-size: var(--text-4xl);
  }

  .hero__subtitle {
    font-size: var(--text-xl);
  }

  .stats {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
  }

  .stat__number {
    font-size: var(--text-4xl);
  }

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

  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }
}

/* === Mobile (< 768px) === */
@media (max-width: 767px) {
  :root {
    --nav-height: var(--nav-height-mobile);
  }

  html {
    font-size: 15px;
  }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }

  .container {
    padding: 0 var(--space-4);
  }

  .section {
    padding: var(--space-12) 0;
  }

  .section-sm {
    padding: var(--space-8) 0;
  }

  .section-header {
    margin-bottom: var(--space-10);
  }

  .section-header h2 {
    font-size: var(--text-2xl);
  }

  .section-header p {
    font-size: var(--text-base);
  }

  /* === Mobile Navigation === */
  .nav__toggle {
    display: flex;
  }

  .nav__menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--color-cream);
    flex-direction: column;
    align-items: flex-start;
    padding: calc(var(--nav-height) + var(--space-8)) var(--space-8) var(--space-8);
    gap: var(--space-1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: right var(--transition-base);
    z-index: var(--z-modal-backdrop);
  }

  .nav__menu.active {
    right: 0;
  }

  .nav__link {
    color: var(--color-ink) !important;
    font-size: var(--text-base);
    padding: var(--space-3) 0;
    width: 100%;
    border-bottom: 1px solid var(--color-light-gray);
  }

  .nav__link:hover,
  .nav__link.active {
    color: var(--color-gold) !important;
  }

  /* Mobile Menu Overlay */
  .nav__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: var(--z-fixed);
  }

  .nav__overlay.active {
    display: block;
  }

  /* === Mobile Hero === */
  .hero {
    min-height: 500px;
    height: 85vh;
  }

  .hero__title {
    font-size: var(--text-3xl);
    letter-spacing: 2px;
  }

  .hero__subtitle {
    font-size: var(--text-lg);
    letter-spacing: 3px;
  }

  .hero__desc {
    font-size: var(--text-base);
  }

  .hero__actions {
    flex-direction: column;
    align-items: center;
  }

  .hero__scroll {
    display: none;
  }

  /* === Mobile Page Hero === */
  .page-hero {
    height: 40vh;
    min-height: 280px;
  }

  .page-hero__title {
    font-size: var(--text-3xl);
  }

  /* === Mobile Stats === */
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
    padding: var(--space-10) 0;
  }

  .stat__number {
    font-size: var(--text-3xl);
  }

  /* === Mobile Portfolio === */
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .portfolio-item--wide {
    grid-column: span 2;
  }

  .portfolio-item--tall {
    grid-row: span 1;
  }

  .portfolio-item__overlay {
    opacity: 1;
    background: linear-gradient(180deg, transparent 50%, rgba(44,44,44,0.7) 100%);
  }

  /* === Mobile Service Cards === */
  .service-card {
    padding: var(--space-6);
  }

  .service-card__icon {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }

  /* === Mobile Timeline === */
  .timeline::before {
    left: var(--space-4);
  }

  .timeline__item,
  .timeline__item:nth-child(odd) {
    flex-direction: column;
    text-align: left;
    padding-left: var(--space-12);
  }

  .timeline__dot {
    left: var(--space-4);
    transform: translateX(-50%);
  }

  .timeline__content {
    width: 100%;
  }

  /* === Mobile Footer === */
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer__brand {
    max-width: 100%;
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }

  /* === Mobile Cards Grid === */
  .cards-grid {
    grid-template-columns: 1fr !important;
  }

  /* === Mobile Form Grid === */
  .form-row {
    grid-template-columns: 1fr;
  }

  /* === Mobile Filter Tabs === */
  .filter-tabs {
    gap: var(--space-1);
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
  }

  .filter-tab {
    flex-shrink: 0;
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-4);
  }

  /* === Mobile Quote === */
  .quote-block {
    padding: var(--space-8);
  }

  .quote-block::before {
    font-size: 80px;
  }

  .quote-block__text {
    font-size: var(--text-lg);
  }

  /* === Mobile Back to Top === */
  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: var(--space-4);
    right: var(--space-4);
  }

  /* === Mobile Buttons === */
  .btn {
    min-height: 44px;
    padding: var(--space-3) var(--space-6);
  }
}

/* === Small Mobile (< 375px) === */
@media (max-width: 374px) {
  html {
    font-size: 14px;
  }

  .hero__title {
    font-size: var(--text-2xl);
  }

  .portfolio-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }
}
