/* 基本設定 */

* { box-sizing: border-box; }

:root { --content-width: min(780px, 83vw); --ink: #495f4c; }

html { scroll-behavior: smooth; }

body { margin: 0; background: #fff; color: #242722; font: 14px/1.6 Arial, Helvetica, sans-serif; }

[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }

button { font: inherit; }

a:hover { color: #79866c; }

a:focus-visible, button:focus-visible { outline: 2px solid #70805c; outline-offset: 5px; }

.content-width { width: var(--content-width); margin-inline: auto; }

.skip { position: fixed; top: -80px; z-index: 50; padding: 12px; background: #fff; }

.skip:focus { top: 0; }



/* Logo 與選單：獨立於主圖，避免被捲動效果隱藏 */

header { position: relative; min-height: 190px; padding: 30px 0; }

.wordmark { display: block; width: min(360px, 44vw); margin-inline: auto; }

.wordmark img { display: block; width: 100%; height: auto; }

header nav { position: fixed; right: 5.3%; top: 38px; z-index: 20; display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; background: rgba(255,255,255,.96); font-size: 13px; }

nav a[aria-current="page"] { color: #969b90; }

.menu-toggle { display: none; }

.intro { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; font-size: 9px; letter-spacing: 1.5px; color: #73776e; }



/* 捲簾：後方主圖 + 前方不透明白色作品頁 */

#work-view { position: relative; isolation: isolate; }

.home-hero { position: sticky; top: 0; z-index: 0; width: 100%; background: #fff; }

.home-hero .work { margin: 0; }

.home-hero .art img {

  width: 100%;

  height: max(300px, calc(100svh - 222px));

  object-fit: contain;

}

.work-sheet { position: relative; z-index: 1; background: #fff; }

#work-view.is-home .work-sheet { padding-top: 48px; padding-bottom: 40px; min-height: 100svh; }

/* 白底是整片實體背景，不是圖片淡出。會遮住後方主圖。 */

#gallery.home-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 40px 24px; }

#gallery.home-gallery .work { min-width: 0; margin: 0; }

#gallery.home-gallery .work:nth-child(3n + 2) { margin-top: 32px; }

.art { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: zoom-in; }

.art img { display: block; width: 100%; height: auto; }

.work { margin: 0 0 38px; }

.work figcaption { display: none; }

.categories { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; margin: 48px 0 64px; }

.categories a { padding: 10px 24px; border: 1px solid #b7bcb0; font-size: 10px; letter-spacing: 1px; }

.categories a:hover { background: #f1f3ed; }

.reveal-work { opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .25s ease; }

.reveal-work.is-visible { opacity: 1; transform: none; }



/* 聯絡與自介 */

.home-contact { margin: 70px 0 20px; padding: 50px 0 30px; border-top: 1px solid #e4e7df; text-align: center; }

.home-contact h2 { margin: 0 0 16px; font: normal clamp(28px, 4vw, 40px)/1.3 Georgia, serif; }

.home-contact p { color: #73776e; }

.contact-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 40px; min-height: 48px; margin-top: 20px; padding: 14px 22px; border: 1px solid var(--ink); border-radius: 2px; background: #fff; color: var(--ink); font-size: 15px; letter-spacing: 1px; }

.contact-button:hover, .contact-button:focus-visible { background: var(--ink); color: #fff; }

#about-view { max-width: 550px; padding: 25px 0 80px; }

#about-view p { font-size: 16px; line-height: 1.9; }

h1 { font: normal 38px/1.3 Georgia, serif; }

.eyebrow { font-size: 10px !important; letter-spacing: 2px; }

footer { position: relative; display: flex; justify-content: space-between; gap: 16px; margin-top: 60px !important; padding: 20px 0 100px; background: #fff; color: #8a8d84; font-size: 9px; letter-spacing: 1px; }



/* 固定聯絡圖示與返回首頁 */

.social-links { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 25; display: flex; gap: 4px; padding: 4px; border: 1px solid #e4e7df; border-radius: 999px; background: #fff; }

.social-links a { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink); }

.social-links svg { display: block; width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.social-links a:hover, .social-links a:focus-visible { background: #f1f3ed; }

.social-links a::after { content: attr(data-tooltip); position: absolute; right: 0; bottom: calc(100% + 12px); padding: 6px 10px; border-radius: 4px; background: var(--ink); color: #fff; font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; }

.social-links a:hover::after, .social-links a:focus-visible::after { opacity: 1; visibility: visible; }

.back-home { position: fixed; left: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 25; display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px; border: 1px solid #e4e7df; border-radius: 999px; background: #fff; color: var(--ink); font-size: 12px; }

.back-home:hover { background: #f1f3ed; }



/* 放大視窗 */

#lightbox { position: fixed; width: 88vw; max-width: 1100px; height: 86vh; height: 86dvh; max-height: 96dvh; margin: auto; padding: 44px 76px 20px; border: 0; background: #fff; overflow: auto; }

#lightbox[open] { display: flex; flex-direction: column; gap: 12px; }

#lightbox::backdrop { background: rgba(25,29,22,.85); }

#large-image { display: block; flex: 1 1 0; min-height: 0; width: 100%; height: 100%; object-fit: contain; touch-action: pan-y pinch-zoom; }

.close { position: absolute; right: 14px; top: 5px; width: 44px; height: 36px; padding: 0; background: none; border: 0; font-size: 30px; cursor: pointer; }

.lightbox-controls { display: flex; align-items: center; justify-content: center; gap: 12px; flex-shrink: 0; }

.lightbox-controls button { position: absolute; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 0; background: transparent; color: #697363; cursor: pointer; }

#previous-image { left: 14px; }

#next-image { right: 14px; }

.lightbox-controls button:hover { color: #242722; }

.lightbox-controls button:disabled { opacity: .25; cursor: default; }

.lightbox-controls svg { display: block; width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

#image-count { font-size: 12px; color: #73776e; }

.caption { flex-shrink: 0; }

.caption h2 { margin: 4px 0; font-size: 14px; font-weight: normal; }

.caption p { margin: 0; color: #757c6c; font-size: 12px; }

body.lightbox-open { overflow: hidden; }



@media (min-width: 1450px) {

  :root { --content-width: min(1000px, 68vw); }

}

@media (max-width: 700px) {

  header { min-height: 154px; padding-top: 26px; }

  .wordmark { width: min(260px, calc(100vw - 100px)); margin-left: 16px; margin-right: 0; }

  .menu-toggle { position: fixed; top: 16px; right: 16px; z-index: 35; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid #d9dfd3; border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; }

  .menu-symbol { font-size: 24px; line-height: 1; }

  header nav { display: none; top: 72px; right: 16px; width: 190px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 90px); overflow-y: auto; margin: 0; padding: 12px; gap: 0; border: 1px solid #e4e7df; border-radius: 8px; background: #fff; box-shadow: 0 8px 28px #24272214; }

  header nav.is-open { display: flex; }

  header nav a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; font-size: 12px; letter-spacing: 1px; }

  .intro { font-size: 8px; letter-spacing: .7px; }

  .home-hero .art img { height: max(280px, calc(100svh - 186px)); }

  #work-view.is-home .work-sheet { padding-top: 28px; }

  #gallery.home-gallery { grid-template-columns: minmax(0, 1fr); gap: 28px; }

  #gallery.home-gallery .work:nth-child(3n + 2) { margin-top: 0; }

  .categories { gap: 12px; }

  .categories a { padding-inline: 16px; }

  .home-contact { margin-top: 48px; padding-top: 36px; }

  #lightbox { width: 94vw; height: 88dvh; padding: 44px 12px 16px; }

  .lightbox-controls { justify-content: space-between; }

  .lightbox-controls button { position: static; transform: none; }

  footer { font-size: 8px; letter-spacing: .5px; }

  .social-links { right: 12px; }

  .back-home { left: 12px; }

}

@media (prefers-reduced-motion: reduce) {

  html { scroll-behavior: auto; }

  .home-hero { position: relative; }

  .reveal-work, .reveal-work.is-visible { opacity: 1; transform: none; transition: none; }

}

/* 手機：縮減主圖上方留白 */

@media (max-width: 700px) {

  header {

    min-height: 0;

    padding-top: 20px;

    padding-bottom: 20px;

  }



  .intro {

    margin-bottom: 10px;

  }



  .home-hero .art img {

    object-position: center top;

  }

}

@media (max-width: 700px) {

  .home-hero .art img {

    height: auto;

    max-height: none;

  }



  #work-view.is-home .work-sheet {

    padding-top: 20px;

  }

}

@media (min-width: 701px) {

  header nav {

    top: 38px;

    right: 4%;



    gap: 6px;

    padding: 0;

    background: transparent;

  }



  header nav a {

    align-self: flex-start;

    padding: 7px 12px;



    background: rgba(255, 255, 255, 0.92);

    color: #626b5d;



    font-size: 12px;

    letter-spacing: 1.2px;



    transition:

      color 0.2s ease,

      background-color 0.2s ease;

  }



  header nav a:hover {

    background: #fff;

    color: #242722;

  }



  header nav a[aria-current="page"] {

    color: #242722;

    text-decoration: underline;

    text-decoration-thickness: 1px;

    text-underline-offset: 6px;

  }

}

/* 首頁小圖：瀑布流，統一縫隙 */

#gallery.home-gallery {

  display: block;

  column-count: 3;

  column-gap: 24px;

}



#gallery.home-gallery > .work:nth-child(n) {

  display: block;

  width: 100%;

  margin: 0 0 24px;



  break-inside: avoid;

  page-break-inside: avoid;

}



#gallery.home-gallery .art img {

  display: block;

  width: 100%;

  height: auto;

}



/* 平板：兩欄 */

@media (min-width: 701px) and (max-width: 1000px) {

  #gallery.home-gallery {

    column-count: 2;

  }

}



/* 手機：一欄 */

@media (max-width: 700px) {

  #gallery.home-gallery {

    column-count: 1;

  }

}

/* 首頁主圖：滿版 Banner */

.home-hero {

  overflow: hidden;

}



.home-hero .art img {

  width: 100%;

  height: 60vh;

  height: 60svh;

  max-height: none;



  object-fit: cover;

  object-position: center ;

  transform: none;

}



/* 手機 Banner 不要太高 */

@media (max-width: 700px) {

  .home-hero .art img {

    height: 45vh;

    height: 45svh;

  }

}

/* 統一作品瀑布流：首頁 24px，分類頁 32px */
#gallery {
  display: block;
  column-count: 3;
  column-gap: 32px;
}

#gallery.home-gallery {
  display: block;
  column-count: 3;
  column-gap: 24px;
}

#gallery > .work:nth-child(n) {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0 0 32px;
  break-inside: avoid;
  page-break-inside: avoid;
}

#gallery.home-gallery > .work:nth-child(n) {
  margin: 0 0 24px;
}

@media (min-width: 701px) and (max-width: 1000px) {
  #gallery,
  #gallery.home-gallery {
    column-count: 2;
  }
}

@media (max-width: 700px) {
  #gallery,
  #gallery.home-gallery {
    column-count: 1;
  }
}
