/* Shared responsive layer. Desktop composition remains controlled by each page. */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: clip; }
img, video, svg { max-width: 100%; }

/* Case-study hero images carry their own typography and must keep their native ratio. */
.case-hero {
  display: block !important;
  width: 100%;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
}
.case-hero .hero-bg {
  display: block;
  width: 100%;
  max-width: none;
  min-height: 0 !important;
  height: auto !important;
  object-fit: contain;
  object-position: center;
}

.mobile-menu-toggle { display: none; }
.mobile-menu { display: none; }

@media (max-width: 1279px) {
  .studio, .capabilities { gap: clamp(40px, 6vw, 80px); }
  .hero, .section-head, .capabilities, .studio { padding-left: clamp(32px, 4vw, 48px); padding-right: clamp(32px, 4vw, 48px); }
  .case-shell, .case-body { max-width: 1200px; margin-left: auto; margin-right: auto; }
  .case-body { padding-left: clamp(28px, 5vw, 72px); padding-right: clamp(28px, 5vw, 72px); }
}

@media (max-width: 1023px) {
  .site-header, body > header { min-width: 0; }
  .hero h1 { font-size: clamp(96px, 15vw, 180px); }
  .hero-bottom { gap: 28px; }
  .capabilities { gap: 48px; }
  .studio { min-height: 0; }
  .studio-copy h2 { font-size: clamp(48px, 6vw, 70px); }
  .stats-grid { gap: 32px 48px; }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro-grid, .carousel-section, .detail-grid { gap: 48px; }
  .case-body { padding-left: 40px; padding-right: 40px; }
  .timeline { padding-left: 32px; padding-right: 32px; }
  .timeline .container { gap: 32px; }
  .section-title h3 { font-size: clamp(48px, 7vw, 72px); line-height: .95; }
  body:has(.sticky-nav) main, body:has(.sticky-nav) main > section { width: 100%; max-width: 100%; min-width: 0; }
}

/* Keep work navigation available until the shared mobile menu takes over. */
@media (min-width: 841px) and (max-width: 980px) {
  body:has(.works-grid) > header > nav {
    display: flex !important;
    gap: clamp(16px, 2vw, 24px);
    font-size: 11px;
  }
}

@media (min-width: 841px) and (max-width: 900px) {
  body:has(.case-hero) > header > nav {
    display: flex !important;
    gap: clamp(18px, 2.5vw, 28px);
    font-size: 11px;
  }
}

@media (max-width: 840px) {
  .mobile-menu-toggle { position: relative; z-index: 1002; display: inline-flex; width: 48px; height: 44px; align-items: center; justify-content: center; border: 1px solid currentColor; background: transparent; color: inherit; font-family: Arial, "Microsoft YaHei", sans-serif; font-size: 13px; font-weight: 900; line-height: 1; letter-spacing: .02em; }
  .mobile-menu-toggle::before { content: 'MENU'; }
  body.mobile-menu-open .mobile-menu-toggle::before { content: 'CLOSE'; }
  body.mobile-menu-open { overflow: hidden; }
  .mobile-menu { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; gap: 24px; padding: 112px 24px 32px; background: #fff; color: #000; opacity: 0; pointer-events: none; transform: translateY(-12px); transition: opacity .2s ease, transform .2s ease; overflow-x: hidden; overflow-y: auto; }
  body.mobile-menu-open .mobile-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .mobile-menu nav { display: flex !important; flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .mobile-menu nav > a, .mobile-menu .nav-group > a, .mobile-menu .site-nav-group > a { display: block; padding: 16px 0; border-bottom: 1px solid rgba(0,0,0,.14); font-size: 22px; font-weight: 800; letter-spacing: .02em; }
  .mobile-menu .nav-group, .mobile-menu .site-nav-group { position: relative; padding: 0; }
  .mobile-menu .nav-group::after, .mobile-menu .site-nav-group::after { display: none; }
  .mobile-menu nav a, .mobile-menu nav a:hover, .mobile-menu nav a:focus, .mobile-menu nav a.site-nav-active, .mobile-menu nav a.site-nav-current { background: transparent !important; transform: none !important; }
  .mobile-menu nav a.site-nav-active::after, .mobile-menu nav a.site-nav-current::after { content: none !important; display: none !important; }
  .mobile-menu .dropdown, .mobile-menu .site-dropdown { position: static; left: auto; top: auto; display: block; width: 100%; max-width: 100%; min-width: 0; padding: 0 0 10px 16px; border: 0; box-shadow: none; background: transparent; opacity: 1; pointer-events: auto; transform: none !important; }
  .mobile-menu .dropdown a, .mobile-menu .site-dropdown a { display: block; width: fit-content; max-width: 100%; padding: 9px 0; background: transparent; font-size: 15px; white-space: normal; }
  .mobile-menu .dropdown a:hover, .mobile-menu .site-dropdown a:hover, .mobile-menu .site-dropdown a.site-nav-current { color: #ffd400 !important; background: transparent !important; }
  .mobile-menu .mobile-lang { display: flex; gap: 18px; padding-top: 8px; }
  .mobile-menu .mobile-lang button { border: 0; background: transparent; padding: 8px 0; font-family: Arial, "Microsoft YaHei", sans-serif; font-size: 14px; font-weight: 900; line-height: 1; }
  .mobile-menu-toggle { display: none !important; }
  body > header, .site-header { z-index: 1001; grid-template-columns: 72px minmax(0, 1fr) auto !important; column-gap: 14px; height: 72px !important; padding: 0 16px 0 0 !important; }
  .case-hero { margin-top: 72px; }

  .case-body > .intro-grid:first-child {
    margin-top: 0;
  }
  body > header .brand, .site-brand { width: 72px; height: 72px; cursor: pointer; }
  body > header > nav, .site-header > nav { display: none !important; }
  body > header > .lang, .site-header > .site-lang { grid-column: 3; justify-self: end; margin: 0; }
  body:has(.works-grid) > header > .lang { display: flex !important; align-items: center; visibility: visible; opacity: 1; }
  body:has(.works-grid) .mobile-menu > .mobile-lang { display: flex !important; align-items: center; visibility: visible; opacity: 1; }
  body > header .mobile-menu-toggle, .site-header .mobile-menu-toggle { grid-column: 4; }
  body:has(.case-hero) > header {
    grid-template-columns: 72px minmax(0, 1fr) auto auto !important;
    column-gap: 12px;
  }
  body:has(.case-hero) > header .back {
    grid-column: 3;
    justify-self: end;
    gap: 0;
    white-space: nowrap;
  }
  body:has(.case-hero) > header .back .lang-switch { display: none; }
  body:has(.case-hero) > header .mobile-menu-toggle { grid-column: 4; }
  .hero, .section-head, .capabilities, .studio, footer { padding-left: 24px; padding-right: 24px; }
  .hero-bottom, .capabilities, .studio, footer { grid-template-columns: 1fr; }
  .hero-bottom { margin-top: 24px; }
  .hero-actions { position: relative; right: auto; bottom: auto; z-index: 2; justify-content: flex-start; flex-wrap: wrap; }
  .hero-actions .btn { flex: 0 0 auto; justify-content: center; white-space: nowrap; }
  .capabilities { padding-top: 84px; padding-bottom: 84px; }
  .capabilities, .capabilities > *, .cap-head, .cap-list, .sector-list { min-width: 0; }
  .capabilities { grid-template-columns: minmax(0, 1fr); }
  .studio { gap: 56px; padding-top: 84px; padding-bottom: 84px; }
  .studio { overflow: hidden; }
  .studio-visual { max-width: 620px; width: 100%; margin: 0 auto; }
  .studio-copy { max-width: 760px; margin: 0 auto; }
  .lab-inner { width: min(100% - 48px, 900px); }
  .section-head, .lab-head { display: block; }
  .head-copy { text-align: left; margin-top: 24px; }
  .works-grid, .projects-grid { grid-template-columns: 1fr; }
  body:has(.works-grid) main { padding-top: 72px; }
  body:has(.works-grid) .works-grid {
    gap: 10px;
    padding: 10px;
    background: #fff;
  }
  body:has(.works-grid) .work-card {
    width: 100%;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 4 / 5;
    border-radius: 0;
  }
  body:has(.works-grid) .work-card > img {
    transform: none !important;
  }
  body:has(.works-grid) .work-card .caption { display: none; }
  body:has(.works-grid) .work-card .overlay {
    min-height: 0;
    height: auto;
    padding: 18px 18px 16px;
    gap: 14px;
    background: rgba(255,255,255,.94);
    transform: none;
  }
  body:has(.works-grid) .work-card .overlay .top { align-items: center; }
  body:has(.works-grid) .work-card .overlay h2 {
    max-width: 100%;
    margin: 0 0 12px;
    font-size: clamp(25px, 7.5vw, 36px);
    line-height: .96;
    letter-spacing: -.045em;
  }
  body:has(.works-grid) .work-card .overlay p { display: none; }
  body:has(.works-grid) .work-card .overlay .btn {
    min-height: 0;
    padding: 0;
    border: 0;
    font-size: 10px;
    text-decoration: underline;
    text-underline-offset: 4px;
  }
  body:has(.works-grid) .work-card .overlay .btn:hover {
    background: transparent;
    color: #000;
    transform: none;
  }
  .project-card { aspect-ratio: 4 / 5; }
  .case-body { padding-left: 24px; padding-right: 24px; }
  .intro-grid, .carousel-section, .detail-grid, .case-grid, .split, .split.reverse { grid-template-columns: 1fr; gap: 40px; }
  .intro-grid { margin-top: 110px; }
  .carousel-section { margin-top: 80px; }
  .detail-grid { margin-top: 96px; }
  .case-grid { gap: 28px; }
  .timeline { min-height: 780px; padding-left: 24px; padding-right: 24px; }
  .timeline.dark { min-height: 820px; }
  .timeline .container { grid-template-columns: 1fr; gap: 40px; }
  .timeline .media, .timeline .media.tall, .timeline .media.video, .timeline .media.square, .timeline .media.left { grid-column: 1; width: 100%; max-width: 620px; margin: 0 auto; }
  .timeline .copy, .timeline .copy.right, .timeline .copy.wide { grid-column: 1; width: min(100%, 620px); margin: 0 auto; }
  .timeline.dark .copy { left: 0; top: 0; }
  .section-title h3 { font-size: clamp(42px, 11vw, 64px); }
  .way-footer { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .hero { min-height: 780px; padding-top: 148px; padding-bottom: 28px; justify-content: flex-start; }
  .hero::before { inset: auto 0 0; height: 42%; clip-path: none; background-position: center center; }
  .hero-mark { inset: 18% 4% auto; }
  .hero > .reveal { width: 100%; }
  .hero h1 { font-size: clamp(76px, 22vw, 132px); line-height: .8; }
  .hero-lead { font-size: clamp(30px, 8vw, 50px) !important; line-height: 1.05 !important; }
  .hero-actions .btn, .studio-btn { min-height: 48px; padding-left: 22px; padding-right: 22px; }
  .section-head h2, .capabilities h2 { font-size: clamp(48px, 14vw, 82px); }
  .cap-item { min-height: 96px; padding: 26px 10px; }
  .cap-item h3 { font-size: clamp(28px, 8vw, 44px); }
  .lab { min-height: 760px; padding-top: 110px; }
  .lab h2 { font-size: clamp(78px, 24vw, 150px); }
  .lab-card { flex-basis: min(80vw, 360px); padding: 24px; }
  .stats-grid { gap: 28px 20px; }
  .stat-value { font-size: clamp(42px, 14vw, 64px); }
  .way-footer { padding: 58px 24px 30px; gap: 34px; }
  .way-footer .footer-logo { font-size: 38px; }
  .way-footer .footer-link { font-size: clamp(18px, 5vw, 24px); overflow-wrap: anywhere; }
  .way-legal { padding: 14px 24px; font-size: 11px; }
  .case-hero { min-height: 0; height: auto; padding: 0 !important; }
  .case-hero .hero-bg { display: block; width: 100%; min-height: 0; height: auto; object-fit: contain; object-position: center; }
  .case-body h1, .case-body h2 { overflow-wrap: normal; word-break: keep-all; }
  .case-body h2 { font-size: clamp(34px, 9vw, 58px); line-height: 1.04; }
  .case-body p { font-size: 16px; line-height: 1.65; }
  .thumbs { grid-template-columns: repeat(4, 1fr) !important; }
  .carousel-main { aspect-ratio: 4 / 3; }
  .related { padding-left: 24px; padding-right: 24px; }
  .timeline { min-height: 680px; }
  .timeline.dark { min-height: 720px; }
  .timeline-year { font-size: 42vw; }
  .hero-copy { width: 100%; }
  .hero-copy p:last-child { font-size: clamp(18px, 5vw, 24px); line-height: 1.45; }
  .absolute.top-24.left-12 { left: 18px; right: 18px; max-width: calc(100vw - 36px); }
  .absolute.top-24.left-12 h2 { font-size: clamp(68px, 22vw, 96px); max-width: 100%; }
}

@media (max-width: 400px) {
  .hero, .section-head, .capabilities, .studio, footer { padding-left: 18px; padding-right: 18px; }
  .mobile-menu { padding-left: 18px; padding-right: 18px; }
  body:has(.case-hero) > header {
    padding-right: 12px !important;
    column-gap: 8px;
  }
  body:has(.case-hero) > header .back > a { font-size: 11px; }
  .hero h1 { font-size: 21vw; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { width: 100%; }
  .studio-note { right: -8px; width: 154px; padding: 20px; font-size: 9px; }
  .case-body { padding-left: 18px; padding-right: 18px; }
  .case-grid { grid-template-columns: 1fr; }
  .way-footer { padding-left: 18px; padding-right: 18px; }
  .way-legal { padding-left: 18px; padding-right: 18px; }
}

@media (min-width: 1440px) {
  .hero > div:not(.hero-mark), .section-head, .capabilities, .studio { max-width: 1920px; margin-left: auto; margin-right: auto; }
}

@media (min-width: 1921px) {
  .hero > .reveal {
    position: relative;
    left: clamp(-160px, -4vw, -80px);
  }
}
