/* Additional small-screen styles. The desktop stylesheet and scripts are unchanged. */
@media screen and (max-width: 1023px) {
  :root { --gutter: clamp(20px, 4vw, 40px); }
  html { scroll-padding-top: 24px; }
  body { min-width: 0; }
  .page-width { min-width: 0; }

  .site-header {
    height: auto;
    min-height: 118px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
    padding: 14px var(--gutter) 0;
  }
  .brand { font-size: 30px; gap: 12px; }
  .brand > span { font-size: 7px; padding-left: 12px; }
  .header-enquiry { gap: 14px; min-height: 44px; font-size: 12px; }
  .site-header nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--rule);
  }
  .site-header nav a { padding: 14px 0; min-height: 44px; font-size: 11px; }
  .site-header nav a::after { bottom: 4px; }

  .hero { height: calc(100svh - 118px); min-height: 540px; max-height: 900px; }
  .hero-copy {
    left: var(--gutter);
    right: var(--gutter);
    top: 44%;
    transform: translateY(-50%);
  }
  .hero-copy .eyebrow { font-size: 9px; letter-spacing: 1.5px; margin-bottom: 24px; }
  .hero h1 { font-size: clamp(54px, 9vw, 88px); letter-spacing: -2.5px; line-height: 1.07; margin-bottom: 24px; }
  .hero-chinese { font-size: 12px; line-height: 1.8; letter-spacing: 2px; margin-bottom: 24px; }
  .hero-link { min-height: 44px; font-size: 12px; }
  .hero-footer { bottom: 20px; grid-template-columns: 1fr auto; gap: 20px; }
  .scroll-cue { display: none; }
  .hero-project { min-width: 0; }
  .hero-project strong { overflow-wrap: anywhere; }
  .hero-controls { gap: 10px; }
  .hero-controls button, #hero-pause { width: 44px; height: 44px; }

  .intro { padding: 64px 0 72px; }
  .intro-layout { grid-template-columns: 1fr; gap: 28px; margin-top: 32px; }
  .intro h2 { font-size: clamp(42px, 7vw, 64px); line-height: 1.1; letter-spacing: -1.6px; }
  .intro-copy { max-width: 560px; padding-top: 0; }
  .intro-copy p { font-size: 14px; }
  .intro-copy p[lang] { font-size: 13px; }
  .text-link { min-height: 44px; }
  .section-top { align-items: flex-start; gap: 24px; }
  .section-top h2 { font-size: clamp(36px, 5.6vw, 56px); letter-spacing: -1.2px; }
  .section-top > .text-link { flex-shrink: 0; }
  .selected { padding-bottom: 56px; }
  .featured-grid { gap: 16px; }
  .featured-type { font-size: 9px; line-height: 1.6; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
  .featured-open, .tile .expand { opacity: 1; transform: none; }
  .selected-bottom { gap: 18px; line-height: 1.8; }
  .spotlight { height: 480px; }
  .spotlight-heading { right: var(--gutter); }
  .spotlight h2 { font-size: clamp(44px, 7vw, 64px); line-height: 1.08; letter-spacing: -1.5px; }
  .spotlight-caption { font-size: 9px; }
  .light-link { min-height: 44px; }

  .studio-about { padding-top: 56px; padding-bottom: 64px; }
  .about-panel { padding: 24px 0 28px; }
  .about-heading { gap: 16px; margin-bottom: 24px; }
  .about-heading .studio-language button { min-width: 44px; min-height: 44px; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .about-copy p { font-size: 14px; line-height: 1.95; }
  .about-discuss { min-height: 44px; align-items: center; font-size: 11px; }
  .about-details { padding: 24px; }
  .about-detail p { font-size: 13px; }
  .studio-about .services { margin-top: 32px; }
  .services { grid-template-columns: 1fr; gap: 18px; }
  .service-link {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 28px;
    gap: 6px 14px;
    min-height: 94px;
    padding: 22px 0;
  }
  .service-number { grid-column: 1; grid-row: 1 / 3; align-self: center; }
  .service-list h3 { grid-column: 2; grid-row: 1; font-size: clamp(22px, 4vw, 30px); line-height: 1.25; }
  .service-zh { grid-column: 2; grid-row: 2; margin-left: 0; font-size: 11px; }
  .service-icon { grid-column: 3; grid-row: 1 / 3; width: 28px; align-self: center; }

  .work { padding-top: 0; padding-bottom: 64px; }
  .work .section-top { flex-direction: column; gap: 20px; }
  .archive-note { text-align: left; font-size: 12px; }
  .archive-note span { font-size: 11px; }
  .work-toolbar { flex-direction: column; align-items: stretch; gap: 14px; margin: 26px 0 20px; padding-bottom: 16px; }
  .work-toolbar .category-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 0 12px;
    padding: 0;
  }
  .category-tabs button {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 3px 6px;
    align-items: center;
    min-width: 0;
    min-height: 60px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--rule);
    font-size: 11px;
    line-height: 1.4;
    text-align: left;
  }
  .category-tabs .category-label { grid-column: 1; grid-row: 2; margin: 0; font-size: 10px; }
  .category-tabs small { grid-column: 2; grid-row: 1 / 3; align-self: center; margin: 0; font-size: 9px; }
  .category-tabs button[aria-pressed=true] { background: #e9ebdf; }
  .category-tabs button[aria-pressed=true]::after { bottom: 0; }
  .work-toolbar #result-count { padding: 0; text-align: right; font-size: 10px; }
  .gallery { display: block; column-count: 2; column-gap: 16px; }
  .gallery-column { display: contents; }
  .tile { display: inline-block; width: 100%; break-inside: avoid; margin: 0 0 16px; vertical-align: top; }

  .contact { padding: 40px 0; }
  .contact-heading { gap: 28px; margin: 34px 0 40px; }
  .contact h2 { font-size: clamp(48px, 8vw, 78px); letter-spacing: -2px; line-height: 1.08; }
  .contact-circle { width: 76px; height: 76px; flex: 0 0 76px; font-size: 38px; margin-right: 0; }
  .contact-footer { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
  .contact-footer > *, .wechat-contact { min-height: 60px; }
  .contact-footer span { font-size: 10px; }
  .contact-footer strong, .wechat-contact button { font-size: 14px; line-height: 1.6; }
  .wechat-contact button { min-height: 32px; }
  .site-footer { padding-top: 30px; }
  .footer-top { gap: 20px; }
  .footer-top nav { gap: 20px; }
  .footer-top nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-signature { gap: 24px; }
  .footer-signature > a { font-size: clamp(68px, 12vw, 140px); letter-spacing: -4px; }
  .footer-signature > span { font-size: 10px; letter-spacing: 2px; }
  .footer-bottom { flex-wrap: wrap; gap: 12px 24px; line-height: 1.7; font-size: 9px; }
  .footer-bottom > a { display: inline-flex; align-items: center; min-height: 44px; }

  #viewer {
    padding: calc(104px + env(safe-area-inset-top, 0px)) 16px calc(196px + env(safe-area-inset-bottom, 0px));
    height: 100dvh;
    width: 100%;
    max-height: 100dvh;
  }
  #viewer-image { min-width: 0; min-height: 0; width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 300px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
  .viewer-top, .viewer-bottom { left: 16px; right: 16px; gap: 16px; }
  .viewer-top { top: calc(12px + env(safe-area-inset-top, 0px)); align-items: flex-start; }
  .viewer-top > div { min-width: 0; }
  .viewer-top .eyebrow { font-size: 7px; letter-spacing: 1.2px; }
  #viewer-category { display: block; font-size: 16px; line-height: 1.5; }
  .viewer-top button { min-width: 68px; min-height: 44px; gap: 10px; padding: 4px 0; flex-shrink: 0; }
  .previous, .next { top: auto; bottom: calc(136px + env(safe-area-inset-bottom, 0px)); width: 44px; height: 44px; }
  .previous { left: 16px; }
  .next { right: 16px; }
  .viewer-thumbnails { left: 16px; right: 16px; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); gap: 8px; padding: 6px 2px; }
  .viewer-thumbnails button { flex: 0 0 64px; width: 64px; height: 48px; }
  .viewer-bottom { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); min-height: 44px; font-size: 11px; }
  .viewer-bottom > a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 0; }
  #viewer-description { top: calc(96px + env(safe-area-inset-top, 0px)); left: 16px; right: 16px; max-height: 42px; font-size: 11px; }
  #viewer:has(#viewer-description:not([hidden])) { padding-top: calc(152px + env(safe-area-inset-top, 0px)); }
  #viewer:has(#viewer-description:not([hidden])) #viewer-image { max-height: calc(100dvh - 348px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }

  #enquiry {
    width: 100%;
    max-width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    padding: 26px 22px;
    overscroll-behavior: contain;
    scroll-padding: 24px;
    -webkit-overflow-scrolling: touch;
  }
  .enquiry-head { gap: 16px; }
  .enquiry-head h2 { font-size: 34px; }
  .enquiry-head button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; min-height: 44px; padding: 0; }
  .enquiry-note { font-size: 12px; }
  #enquiry label { font-size: 12px; }
  #enquiry input, #enquiry select, #enquiry textarea { font-size: 16px; min-height: 48px; }
  #enquiry textarea { min-height: 120px; }
  .enquiry-prepare { width: 100%; min-height: 48px; font-size: 12px; }
  .enquiry-actions > * { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-size: 12px; }
}

@media screen and (max-width: 599px) {
  .brand > span { display: none; }
  .site-header nav { gap: 10px; }
  .site-header nav a { font-size: 10.5px; }
  .hero h1 { font-size: clamp(46px, 12vw, 72px); letter-spacing: -2px; }
  .hero-copy .eyebrow { max-width: 270px; font-size: 8px; line-height: 1.7; letter-spacing: 1.2px; }
  .hero-footer { grid-template-columns: 1fr; gap: 12px; bottom: 16px; }
  .hero-project { flex-direction: row; align-items: center; gap: 12px; }
  .hero-project > span { font-size: 7px; }
  .hero-project strong { font-size: 10px; }
  .hero-controls > span { margin-right: auto; }
  .intro-copy br { display: none; }
  .section-index > span:last-child { font-size: 9px; }
  .section-top { flex-direction: column; gap: 16px; }
  .section-top h2 { font-size: clamp(36px, 9vw, 48px); }
  .featured-grid { grid-template-columns: 1fr; gap: 28px; }
  .featured-image { aspect-ratio: auto; }
  .featured-image img { height: auto; }
  .featured-type { margin-top: 12px; font-size: 10px; }
  .selected-bottom { flex-direction: column; gap: 5px; margin-top: 28px; }
  .spotlight { height: 420px; }
  .spotlight > img { object-position: 60% 50%; }
  .spotlight h2 { font-size: clamp(42px, 10.5vw, 58px); }
  .spotlight-caption { bottom: 20px; }
  .about-heading h2 { font-size: 12px; }
  .about-heading h2 span { display: block; margin: 4px 0 0; font-size: 11px; }
  .about-details { padding: 20px; }
  .about-detail h3 span { display: inline-block; margin-left: 8px; }
  .work-toolbar .category-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .gallery { column-count: 1; }
  .tile { margin-bottom: 14px; }
  .contact-top { align-items: flex-start; flex-direction: column; gap: 12px; }
  .contact-top > span { font-size: 11px; }
  .contact-heading { display: block; margin-top: 28px; }
  .contact h2 { font-size: clamp(44px, 10.8vw, 64px); letter-spacing: -1.8px; }
  .contact-circle { width: 64px; height: 64px; margin: 24px 0 0 auto; font-size: 34px; }
  .contact-footer { grid-template-columns: 1fr; gap: 24px; }
  .footer-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-signature { flex-direction: column; align-items: flex-start; gap: 22px; margin: 26px 0; }
  .footer-signature > a { font-size: clamp(52px, 14.5vw, 88px); letter-spacing: -3px; }
  .footer-signature > span { text-align: left; padding-bottom: 0; }
  .enquiry-grid { grid-template-columns: 1fr; gap: 16px; }
  .enquiry-head h2 { font-size: 30px; }
  #enquiry { padding: 24px 18px; }
  .enquiry-actions { flex-direction: column; }
}

@media screen and (max-width: 1023px) and (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: 480px; }
  #viewer { padding-top: calc(76px + env(safe-area-inset-top, 0px)); padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)); }
  #viewer-image { max-height: calc(100dvh - 216px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
  .viewer-top { top: calc(8px + env(safe-area-inset-top, 0px)); }
  .viewer-top .eyebrow { margin-bottom: 2px; }
  #viewer-category { font-size: 15px; }
  .previous, .next { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
  .viewer-thumbnails { left: 76px; right: 76px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .viewer-thumbnails button { flex-basis: 60px; width: 60px; height: 42px; }
  .viewer-bottom { bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
}

@media screen and (max-width: 1023px) and (hover: none) {
  .featured-card:hover img, .tile:hover img { transform: none; }
  .service-link:hover { padding-left: 0; }
}
