/* =========================================================
   Jarhead Studio — 深色藝廊風
   ========================================================= */
:root {
  --bg: #111110;
  --surface: #2A2926;
  --line: #34322E;
  --text: #E9E4DA;
  --text-2: #CFC9BE;
  --muted: #A39E94;
  --faint: #8A857C;
  --accent: #C9A27A;

  --font-body: 'Noto Serif TC', serif;
  --font-display: 'Cormorant Garamond', 'Noto Serif TC', serif;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --max: 1360px;
  --pad: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--text); text-decoration: none; transition: color .4s ease; }
a:hover { color: var(--accent); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

.container { max-width: var(--max); margin: 0 auto; padding-inline: var(--pad); }
.section { padding-top: 120px; }
#about { padding-top: 140px; }

.skip {
  position: absolute; left: 16px; top: -60px; padding: 12px 20px;
  background: var(--accent); color: var(--bg); z-index: 10; transition: top .3s;
}
.skip:focus { top: 16px; }

/* ---------- 文字 ---------- */
.eyebrow { margin: 0 0 12px; font-size: 13px; letter-spacing: .35em; color: var(--accent); }
.title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 56px; line-height: 1.1; }
.display {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(48px, 7vw, 104px); line-height: 1; letter-spacing: -.01em;
}
.display-sm {
  margin: 0; font-family: var(--font-display); font-weight: 400; font-style: italic;
  font-size: clamp(44px, 6vw, 80px); line-height: 1.1;
}
.lead { margin: 0; font-size: 18px; line-height: 1.8; color: var(--text-2); }

/* ---------- 導覽 ---------- */
.site-header {
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center;
  padding-block: 28px;
}
.brand { font-family: var(--font-display); font-size: 26px; letter-spacing: .08em; }
.nav { display: flex; flex-wrap: wrap; gap: 32px; font-size: 14px; letter-spacing: .15em; }

/* ---------- 預留位置 ---------- */
.ph {
  width: 100%; background: var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.ph span { font-size: 12px; letter-spacing: .2em; color: var(--faint); padding: 16px; text-align: center; }
.tone-2 { background: #33312D; }
.tone-3 { background: #25241F; }
.tone-4 { background: #2E2C28; }

/* ---------- 主視覺 ---------- */
.hero {
  position: relative; height: 78vh; min-height: 480px; max-height: 820px;
  display: flex; align-items: flex-end; overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-media .ph { height: 100%; align-items: flex-start; justify-content: flex-end; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { /* 讓文字在亮照片上也讀得清楚 */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(17,17,16,.65), rgba(17,17,16,0) 55%);
}
.hero-text {
  position: relative; z-index: 1; padding: 56px; max-width: 760px;
  display: flex; flex-direction: column; gap: 16px;
}
.hero-text .eyebrow { margin: 0; }

/* ---------- 作品 ---------- */
.works-head {
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-end;
  margin-bottom: 40px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 20px; font: inherit; font-size: 14px; letter-spacing: .1em;
  cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--text-2);
  transition: background-color .35s ease, color .35s ease, border-color .35s ease;
}
.chip:hover { border-color: var(--accent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.masonry { column-count: 3; column-gap: 20px; transition: opacity .35s ease; }
.masonry.is-switching { opacity: 0; }
.work { margin: 0 0 20px; break-inside: avoid; }
.work[hidden] { display: none; }
.frame {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  overflow: hidden; cursor: zoom-in;
}
.frame > .ph, .frame > img { transition: transform 1.2s var(--ease), filter .6s ease; }
.work:hover .frame > *, .frame:focus-visible > * { transform: scale(1.04); filter: brightness(1.12); }
.work figcaption {
  display: flex; justify-content: space-between; padding-top: 12px;
  font-size: 13px; letter-spacing: .1em; color: var(--muted); transition: color .4s ease;
}
.work:hover figcaption { color: var(--text); }

/* ---------- 關於 ---------- */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 72px; align-items: center; }
.about-text { display: flex; flex-direction: column; gap: 24px; }
.about-text .eyebrow { margin: 0; }
.about-text p:not(.eyebrow) { margin: 0; font-size: 17px; line-height: 2; color: var(--text-2); }

/* ---------- 聯絡 ---------- */
.contact {
  padding-top: 160px; padding-bottom: 120px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.contact .eyebrow { margin: 0; }
.contact .lead { font-size: 17px; }
.cta {
  margin-top: 16px; padding: 16px 40px; min-height: 44px;
  border: 1px solid var(--accent); color: var(--accent); font-size: 15px; letter-spacing: .2em;
  transition: background-color .4s ease, color .4s ease;
}
.cta:hover { background: var(--accent); color: var(--bg); }
.contact-links {
  list-style: none; margin: 16px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 48px;
}
.contact-links a {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px;
  font-size: 16px; letter-spacing: .12em; color: var(--text-2);
}
.contact-links a:hover { color: var(--accent); }
.contact-links svg {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .4s var(--ease);
}
.contact-links .dot { fill: currentColor; stroke: none; }
.contact-links a:hover svg { transform: translateY(-2px); }
.about-text p.quote {
  font-family: var(--font-display); font-style: italic; font-size: 30px; line-height: 1.35; color: var(--text);
}

/* ---------- 頁尾 ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between;
  padding-block: 32px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint);
}
.social { display: flex; gap: 24px; }

/* ---------- 燈箱 ---------- */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: rgba(10,10,9,.96); color: var(--text);
  display: grid; grid-template-columns: 72px 1fr 72px; grid-template-rows: 1fr auto;
  align-items: center; opacity: 0; transition: opacity .45s ease, display .45s allow-discrete, overlay .45s allow-discrete;
}
.lightbox:not([open]) { display: none; }
.lightbox[open] { opacity: 1; }
@starting-style { .lightbox[open] { opacity: 0; } }
.lightbox::backdrop { background: transparent; }
.lb-stage {
  grid-column: 2; height: calc(100vh - 120px); display: flex; align-items: center; justify-content: center;
  padding-top: 40px;
}
.lb-stage > * { max-width: 100%; max-height: 100%; width: auto; animation: lb-in .6s var(--ease) both; }
.lb-stage > .ph { width: min(80vw, 900px); max-height: 100%; }
.lb-stage > img { object-fit: contain; height: auto; }
@keyframes lb-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.lb-caption { grid-column: 1 / -1; margin: 0; padding: 20px; text-align: center; font-size: 14px; letter-spacing: .15em; color: var(--muted); }
.lightbox button {
  width: 48px; height: 48px; border: 0; background: none; color: var(--text-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: color .3s ease;
}
.lightbox button:hover { color: var(--accent); }
.lightbox svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.lb-close { position: absolute; top: 16px; right: 16px; }
.lb-prev { grid-column: 1; justify-self: center; }
.lb-next { grid-column: 3; justify-self: center; }

/* ---------- 動態 ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.rise { animation: rise 1.2s var(--ease) both; }
.d1 { animation-delay: .25s; }
.d2 { animation-delay: .5s; }
.fade-in { animation: fade 1.6s ease both; }

/* 捲動浮現：由 main.js 加上 .is-visible；沒有 JS 時內容照常顯示 */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 響應式 ---------- */
@media (max-width: 900px) {
  :root { --pad: 24px; }
  .masonry { column-count: 2; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero-text { padding: 32px; }
  .title { font-size: 44px; }
  .lightbox { grid-template-columns: 48px 1fr 48px; }
}
@media (max-width: 560px) {
  .masonry { column-count: 1; }
  .nav { gap: 20px; }
  .section { padding-top: 88px; }
  #about { padding-top: 100px; }
  .contact { padding-top: 120px; padding-bottom: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
}
