/* 首頁主題變數與全域基礎設定 */
:root {
  --ink: #11110f;
  --title-ink: #37250f;
  --mountain: #6f9d82;
  --mountain-dark: #2f6e60;
  --sky: #c9e0ec;
  --water: #8ac6bc;
  --field: #efc96f;
  --panel: rgba(239, 247, 236, 0.82);
  --accent: #528d44;
  --artist-pin: #ec652d;
  --side-menu-bg: rgba(244, 231, 178, 0.9);
  --home-gutter: clamp(18px, 5vw, 72px);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  font-size: clamp(93.75%, calc(87.5% + 0.35vw), 112.5%);
  overflow-x: clip;
}
body {
  margin: 0;
  font-family:
    "Noto Serif TC", "Source Han Serif TC", "Microsoft JhengHei", serif;
  color: var(--ink);
  background: linear-gradient(
    180deg,
    var(--sky) 0%,
    #b8d5d5 28%,
    var(--mountain) 52%,
    #aeb47a 68%,
    var(--field) 82%,
    var(--water) 100%
  );
  background-attachment: fixed;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  color: #37250f;
  text-wrap: balance;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: 10px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--mountain-dark);
  color: #fff;
  transform: translateY(-160%);
}
.skip-link:focus {
  transform: none;
}

/* 固定背景：地圖、色彩疊層與紙張顆粒 */
.map-bg {
  position: fixed;
  inset: 0;
  z-index: -4;
  overflow: hidden;
  filter: saturate(1.18) contrast(0.94) sepia(0.08);
  opacity: 0.58;
  mix-blend-mode: multiply;
}
.map-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/images/ok-map.jpg") center top/cover no-repeat;
  transform: scale(var(--map-scale, 1.06))
    translate(var(--map-shift-x, 0), var(--map-shift-y, 0));
  transform-origin: center top;
  transition: transform 0.25s linear;
  will-change: transform;
}
.color-wash {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(
      180deg,
      rgba(201, 224, 236, 0.88) 0%,
      rgba(201, 224, 236, 0.78) 26%,
      rgba(111, 157, 130, 0.58) 50%,
      rgba(239, 201, 111, 0.7) 73%,
      rgba(138, 198, 188, 0.72) 100%
    ),
    radial-gradient(
      circle at 68% 18%,
      rgba(244, 231, 178, 0.42),
      transparent 26%
    );
  pointer-events: none;
}
.grain {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.32),
      rgba(255, 255, 255, 0) 44%
    ),
    repeating-linear-gradient(
      0deg,
      rgba(17, 17, 15, 0.025) 0 1px,
      transparent 1px 5px
    );
  pointer-events: none;
}

/* 首頁頁首與導覽 */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(20px, 3vw, 46px);
  padding: clamp(18px, 2.2vw, 28px) var(--home-gutter);
  background: linear-gradient(
    to bottom,
    rgba(201, 224, 236, 0.94),
    rgba(201, 224, 236, 0)
  );
}
.brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 0.08em;
  font-weight: 900;
  font-size: clamp(1.1rem, 1.45vw, 1.3rem);
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--title-ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand small {
  display: inline;
  font-size: inherit;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--mountain-dark);
}
.home-nav {
  display: flex;
  gap: clamp(14px, 2.2vw, 34px);
  font-size: 1.0625rem;
  font-weight: 800;
}
.home-nav a {
  width: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--title-ink);
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  transition: color 0.18s ease;
}

@media (min-width: 901px) {
  .home-nav a:first-child {
    margin-right: 18px;
  }
}
.home-nav a:hover,
.home-nav a:focus-visible {
  color: var(--artist-pin);
}
.home-menu-toggle {
  display: none;
  min-width: 58px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid rgba(55, 37, 15, 0.18);
  border-radius: 999px;
  color: var(--title-ink);
  background: var(--side-menu-bg);
  font:
    900 0.8125rem/1 "Noto Serif TC",
    "Microsoft JhengHei",
    serif;
  cursor: pointer;
}
.tools {
  display: flex;
  gap: 10px;
}
.tool {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(17, 17, 15, 0.14);
  background: rgba(244, 231, 178, 0.82);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(47, 110, 96, 0.16);
  font-weight: 900;
}

/* 共用首頁區塊與首屏內容 */
.section {
  min-height: 100vh;
  position: relative;
  padding: clamp(112px, 10vw, 146px) var(--home-gutter) clamp(72px, 7vw, 104px);
  display: grid;
  align-items: center;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.hero {
  grid-template-columns: minmax(300px, 680px) minmax(420px, 760px);
  justify-content: center;
  gap: clamp(36px, 3vw, 56px);
}
.hero-copy {
  position: relative;
  z-index: 7;
  max-width: 680px;
}
.kicker {
  letter-spacing: 0.1em;
  color: var(--mountain-dark);
  font-size: clamp(0.875rem, 1.15vw, 1.2rem);
  font-weight: 900;
  line-height: 1.5;
  margin-bottom: 16px;
}
.title {
  font-size: clamp(4.6rem, 6.6vw, 7.25rem);
  line-height: 0.96;
  margin: 0 0 22px;
  letter-spacing: 0;
}
.title-line {
  position: relative;
  display: block;
}
.title-street {
  width: max-content;
  max-width: 100%;
  padding: 0.02em 0 0.1em;
  font-size: 0.95em;
  letter-spacing: clamp(0.25em, 2vw, 0.32em);
  white-space: nowrap;
}
.title-story {
  width: 100%;
  margin-top: 0.02em;
  padding: 0.02em 0 0.08em;
  font-size: 0.72em;
  line-height: 1.02;
  letter-spacing: 0;
  text-align: justify;
  text-align-last: justify;
  text-justify: inter-character;
  white-space: nowrap;
}
.subtitle {
  color: var(--title-ink);
  font-size: clamp(1.5rem, 3vw, 2.625rem);
  letter-spacing: 0.16em;
  margin-bottom: 28px;
}
.lead {
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  line-height: 2;
  width: 100%;
  max-width: none;
  text-align: justify;
  text-align-last: left;
  text-justify: inter-ideograph;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: 34px;
  padding: 15px 30px;
  border-radius: 999px;
  background: var(--mountain-dark);
  color: white;
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 16px 30px rgba(47, 110, 96, 0.22);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 19px 34px rgba(47, 110, 96, 0.28);
}
.hero-copy .btn {
  border-radius: 8px;
}
.hero-visual {
  position: relative;
  z-index: 8;
  width: 100%;
  margin: 0;
  justify-self: center;
  filter: drop-shadow(0 24px 42px rgba(47, 110, 96, 0.24));
}
.hero-visual-layered {
  aspect-ratio: 20 / 19;
}
.hero-art-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  animation: hero-layer-fade 0.9s ease-out forwards;
  will-change: opacity;
}
.hero-art-background {
  animation-delay: 0.68s;
}
.hero-art-accent {
  animation-delay: 0.4s;
}
.hero-art-figure {
  animation-delay: 0.12s;
}
@keyframes hero-layer-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 展覽故事、藝術家路線與內容卡片 */
.story {
  --story-top-gap: clamp(3.875rem, 3vw, 5.125rem);
  grid-template-columns: 320px minmax(360px, 1fr);
  align-items: start;
  gap: clamp(32px, 3vw, 56px);
  padding-top: var(--story-top-gap);
  padding-right: var(--home-gutter);
  padding-bottom: clamp(42px, 4vw, 60px);
  padding-left: clamp(84px, 7vw, 112px);
}
.route {
  position: sticky;
  top: var(--story-top-gap);
  align-self: start;
  justify-self: start;
  margin-top: 0;
  margin-left: 0;
  padding-left: 38px;
  border-left: 2px dashed var(--mountain-dark);
}
.dot {
  position: relative;
  margin: 0 0 54px;
}
.dot:before {
  content: "";
  position: absolute;
  left: -51px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--mountain-dark);
  box-shadow: 0 0 0 9px rgba(82, 141, 68, 0.32);
}
.place {
  font-size: 1.375rem;
  font-weight: 900;
  color: var(--title-ink);
}
.card {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(17, 17, 15, 0.13);
  border-radius: 10px;
  padding: clamp(28px, 3vw, 44px);
  box-shadow: 0 24px 58px rgba(47, 110, 96, 0.17);
}
.card h2 {
  font-size: clamp(2.375rem, 4vw, 3.375rem);
  margin: 0 0 16px;
  letter-spacing: 0.12em;
}
.card p {
  font-size: 1.0625rem;
  line-height: 2;
}
.art {
  height: 330px;
  border-radius: 8px;
  margin: 26px 0;
  background:
    linear-gradient(
      180deg,
      rgba(201, 224, 236, 0.18),
      rgba(239, 201, 111, 0.24)
    ),
    url("/assets/images/ok-map.jpg") center/cover;
  filter: saturate(1.1) contrast(0.94);
  box-shadow: inset 0 0 0 2px rgba(17, 17, 15, 0.1);
}
.story .route,
.section .card {
  position: relative;
  z-index: 5;
}
.artist-list {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  max-height: 72vh;
  margin-top: 0;
  overflow-y: auto;
  padding-right: 12px;
}
.artist-list .dot {
  margin-bottom: clamp(2rem, 2.8vw, 2.75rem);
}
.artist-list .dot:last-child {
  margin-bottom: 0;
}
.artist-list .dot:before {
  left: -45px;
  top: 9px;
  width: 14px;
  height: 14px;
  box-shadow: 0 0 0 6px rgba(82, 141, 68, 0.25);
}
.artist-list .place {
  display: inline;
  margin-left: 0;
  font-size: clamp(1.125rem, 0.95rem + 0.35vw, 1.25rem);
  line-height: 1.35;
}

/* 藝術家節點的滑入回饋 */
@keyframes artist-dot-ripple {
  0% {
    box-shadow:
      0 0 0 6px rgba(82, 141, 68, 0.3),
      0 0 0 0 rgba(82, 141, 68, 0.34),
      0 0 12px rgba(47, 110, 96, 0.22);
  }
  70% {
    box-shadow:
      0 0 0 6px rgba(82, 141, 68, 0.24),
      0 0 0 18px rgba(82, 141, 68, 0),
      0 0 22px rgba(47, 110, 96, 0.32);
  }
  100% {
    box-shadow:
      0 0 0 6px rgba(82, 141, 68, 0.3),
      0 0 0 22px rgba(82, 141, 68, 0),
      0 0 12px rgba(47, 110, 96, 0.22);
  }
}
.artist-list .dot::before {
  transform: scale(1);
  transition:
    transform 0.25s ease,
    background-color 0.25s ease;
}
.artist-list .dot:hover::before,
.artist-list .dot:focus-within::before {
  background: var(--accent);
  transform: scale(1.08);
  animation: artist-dot-ripple 1.25s ease-out infinite;
}

/* 精選內容與展覽資訊卡片 */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2vw, 26px);
  margin-top: clamp(28px, 3vw, 38px);
}
.gallery .mini {
  min-height: 260px;
  border-radius: 10px;
  background: rgba(244, 231, 178, 0.86);
  border: 1px solid rgba(17, 17, 15, 0.11);
  padding: clamp(21px, 2.2vw, 28px);
  box-shadow: 0 15px 36px rgba(47, 110, 96, 0.13);
}
.mini .thumb {
  height: 120px;
  border-radius: 8px;
  background: url("/assets/images/ok-map.jpg") center/cover;
  margin-bottom: 20px;
  filter: saturate(1.05) contrast(0.94);
}
.mini h3 {
  margin: 0 0 8px;
}
.mini a {
  color: var(--mountain-dark);
  font-weight: 900;
  text-decoration: none;
  transition: color 0.18s ease;
}
.mini a:hover,
.mini a:focus-visible {
  color: var(--artist-pin);
}
.info-card {
  min-height: auto !important;
}
.info-card .thumb {
  height: 86px;
}
.card-wide {
  width: 100%;
  max-width: 1100px;
  margin: auto;
}

/* 捲動顯示動畫 */
.fade {
  opacity: 0;
  transform: translateY(50px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.fade.show {
  opacity: 1;
  transform: translateY(0);
}

/* 響應式：平板橫向與窄桌面 */
@media (max-width: 1100px) {
  header {
    gap: 20px;
  }
  .brand {
    font-size: 1.1rem;
  }
  .home-nav {
    gap: 16px;
    font-size: 0.9375rem;
  }
  .story {
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 40px;
  }
}

/* 響應式：平板與行動版導覽 */
@media (max-width: 900px) {
  header {
    padding: 16px 22px;
    background: linear-gradient(
      to bottom,
      rgba(201, 224, 236, 0.98),
      rgba(201, 224, 236, 0.9) 74%,
      rgba(201, 224, 236, 0)
    );
  }
  .brand {
    font-size: clamp(0.95rem, 2.8vw, 1.05rem);
  }
  .home-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }
  .home-nav {
    position: absolute;
    top: 100%;
    left: 22px;
    right: 22px;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 12px;
    border: 1px solid rgba(55, 37, 15, 0.13);
    border-radius: 10px;
    background: rgba(247, 242, 223, 0.97);
    box-shadow: 0 18px 44px rgba(47, 110, 96, 0.2);
    backdrop-filter: blur(12px);
  }
  .home-nav.is-open {
    display: grid;
  }
  .home-nav a {
    width: auto;
    padding: 11px 12px;
    border-radius: 7px;
    text-align: center;
    white-space: normal;
  }
  .home-nav a:hover,
  .home-nav a:focus-visible {
    color: #fff;
    background: var(--mountain-dark);
  }
  .tools {
    display: none;
  }
  .section {
    padding: 108px 22px 72px;
  }
  .hero,
  .story {
    display: block;
  }
  .hero-visual {
    margin: 48px auto 0;
  }
  .title {
    font-size: clamp(4.25rem, 10.5vw, 6.25rem);
  }
  .subtitle {
    font-size: clamp(1.5rem, 5vw, 1.875rem);
  }
  .lead {
    font-size: 1.0625rem;
  }
  .route {
    position: relative;
    top: auto;
    margin-bottom: 44px;
  }
  .card {
    padding: clamp(24px, 5vw, 34px);
  }
  .card h2 {
    font-size: 2.375rem;
  }
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .map-bg::before {
    background-position: center top;
  }
  .map-bg {
    --map-scale: 1.12;
  }
}

/* 故事區塊的平板間距修正 */
@media (max-width: 900px) {
  .story {
    padding-top: 88px;
    padding-bottom: 52px;
  }
}

/* 響應式：一般手機 */
@media (max-width: 640px) {
  header {
    padding: 14px 18px 18px;
  }
  .brand {
    font-size: clamp(0.9rem, 3.6vw, 0.95rem);
  }
  .brand small {
    font-size: inherit;
  }
  .home-nav {
    left: 18px;
    right: 18px;
    font-size: 0.875rem;
  }
  .section {
    padding: 112px 18px 64px;
  }
  .story {
    padding-top: 88px;
    padding-bottom: 48px;
  }
  .hero {
    min-height: 100svh;
  }
  .hero-visual {
    margin-top: 38px;
  }
  .title {
    font-size: clamp(3.4rem, 16vw, 5.4rem);
  }
  .title-street {
    font-size: 1.02em;
  }
  .title-story {
    font-size: 0.68em;
  }
  .subtitle {
    font-size: 1.4375rem;
    line-height: 1.55;
    letter-spacing: 0.11em;
  }
  .kicker {
    font-size: 0.75rem;
    line-height: 1.7;
    letter-spacing: 0.24em;
  }
  .card h2 {
    font-size: 2.125rem;
    letter-spacing: 0.08em;
  }
  .gallery {
    grid-template-columns: 1fr;
  }
  .gallery .mini {
    min-height: auto;
  }
  .route {
    margin-left: 18px;
  }
  .btn {
    width: 100%;
    justify-content: center;
    margin-top: 28px;
  }
  .artist-list .place {
    font-size: 1.125rem;
  }
}

/* 響應式：小型手機 */
@media (max-width: 420px) {
  .section {
    padding-inline: 16px;
  }
  .lead,
  .card p {
    font-size: 1rem;
  }
  .card {
    padding: 22px;
  }
  .artist-list {
    padding-right: 0;
  }
}

/* 行動版密度與觸控尺寸微調；置於窄螢幕規則後以維持原有覆寫順序 */
@media (max-width: 900px) {
  header {
    padding: 0.875rem 1.25rem 1rem;
  }
  .home-menu-toggle {
    min-height: 44px;
  }
  .home-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
  }
  .section {
    padding: 5.25rem 1.25rem 2.75rem;
  }
  .hero {
    padding-top: 6.5rem;
    padding-bottom: 2.75rem;
  }
  .hero-copy {
    max-width: 38rem;
    margin-inline: auto;
  }
  .kicker {
    margin-bottom: 0.6rem;
  }
  .title {
    margin-bottom: 0.9rem;
  }
  .subtitle {
    margin-bottom: 1rem;
  }
  .lead {
    line-height: 1.75;
  }
  .btn {
    margin-top: 1.25rem;
    padding: 0.8rem 1.4rem;
  }
  .story {
    padding-top: 5.25rem;
    padding-bottom: 2.5rem;
  }
  .route {
    margin: 0 0 1.75rem 0.85rem;
    padding-left: 1.9rem;
  }
  .hero-visual {
    margin-top: 1.5rem;
  }
  .artist-list .dot {
    margin-bottom: clamp(1.3rem, 4vw, 1.6rem);
  }
  .card {
    padding: clamp(1.3rem, 4.5vw, 1.75rem);
  }
  .card h2 {
    margin-bottom: 0.75rem;
    font-size: clamp(2rem, 7vw, 2.3rem);
  }
  .card p {
    line-height: 1.78;
  }
  .gallery {
    gap: 0.875rem;
    margin-top: 1.25rem;
  }
}

/* 手機版內容密度微調 */
@media (max-width: 640px) {
  header {
    padding: 0.75rem 1rem 0.9rem;
  }
  .home-nav {
    left: 1rem;
    right: 1rem;
    padding: 0.625rem;
  }
  .home-nav a {
    padding: 0.65rem 0.7rem;
  }
  .section {
    padding: 4.875rem 1rem 2.25rem;
  }
  .hero {
    min-height: auto;
    padding-top: 6.15rem;
    padding-bottom: 2.35rem;
  }
  .hero-visual {
    margin-top: 1.25rem;
  }
  .title {
    margin-bottom: 0.75rem;
  }
  .subtitle {
    margin-bottom: 0.8rem;
  }
  .lead {
    line-height: 1.72;
  }
  .btn {
    margin-top: 1.125rem;
  }
  .story {
    padding-top: 4.875rem;
    padding-bottom: 2.25rem;
  }
  .route {
    margin-left: 0.75rem;
    margin-bottom: 1.5rem;
  }
  .card {
    padding: 1.25rem;
  }
  .card h2 {
    font-size: 2rem;
    letter-spacing: 0.065em;
  }
  .gallery {
    gap: 0.7rem;
    margin-top: 1rem;
  }
  .gallery .info-card {
    padding: 0.95rem;
  }
  .info-card .thumb {
    display: none;
  }
}

/* 中型手機保留首屏按鈕的內容寬度 */
@media (min-width: 481px) and (max-width: 640px) {
  .hero-copy .btn {
    width: auto;
  }
}

/* 頁尾 gutter 與首頁主要內容對齊 */
@media (max-width: 640px) {
  body .site-footer {
    --footer-gutter: 1rem;
  }
}
@media (min-width: 641px) and (max-width: 900px) {
  body .site-footer {
    --footer-gutter: 1.25rem;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(25rem, 1.1fr);
    gap: clamp(1.75rem, 3vw, 2.5rem);
  }
  .hero-copy .kicker {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
  }
  .hero-copy .title {
    font-size: clamp(3.5rem, 6.4vw, 5rem);
  }
  .hero-copy .subtitle {
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    letter-spacing: 0.12em;
  }
  .hero-copy .lead {
    font-size: 1rem;
    line-height: 1.85;
  }
}

/* 無障礙：尊重使用者的減少動態效果偏好 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .fade {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-visual {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .hero-art-layer {
    opacity: 1;
    transform: none;
    filter: none;
    animation: none;
  }
  .artist-list .dot:hover::before,
  .artist-list .dot:focus-within::before {
    animation: none;
    box-shadow:
      0 0 0 8px rgba(82, 141, 68, 0.28),
      0 0 18px rgba(47, 110, 96, 0.28);
  }
}
.card.overview-card p {
  margin-top: 50px;
}
