/* ===== 共用樣式（首頁與所有內頁通用）===== */

:root {
  --bg: #f4f1ec;
  --bg-deep: #ebe6dd;
  --ink: #1a1814;
  --ink-soft: #5a554c;
  --accent: #b8531a;
  --line: #d8d2c5;
  --paper: #fbf9f5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Serif TC', 'Fraunces', serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== NAVIGATION ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.4rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(244, 241, 236, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

nav.scrolled { border-bottom-color: var(--line); }

.logo {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  position: relative;
  padding: 0.2rem 0;
  transition: color 0.3s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--ink);
  border-radius: 100px;
  font-family: 'DM Mono', monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.3s;
}

.nav-cta:hover { background: var(--ink); color: var(--bg); }

@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
}

/* ===== BUTTONS ===== */
.btn {
  padding: 1rem 2rem;
  border-radius: 100px;
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: transparent;
}

.btn-ghost:hover { border-color: var(--ink); }

/* ===== FOOTER ===== */
footer {
  background: var(--ink);
  color: var(--bg);
  padding: 4rem 3rem 2rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(244, 241, 236, 0.15);
}

.footer-brand {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.footer-brand em {
  font-style: italic;
  color: var(--accent);
}

.footer-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(244, 241, 236, 0.6);
}

.footer-col h4 {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(244, 241, 236, 0.5);
  margin-bottom: 1.2rem;
  font-weight: 400;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.6rem; }

.footer-col a {
  color: var(--bg);
  text-decoration: none;
  font-family: 'Noto Serif TC', serif;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(244, 241, 236, 0.4);
}

@media (max-width: 768px) {
  .footer-top { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================ */
/* ===== 內頁專用樣式（首頁不需要）========== */
/* ============================================ */

/* ===== 內頁 HERO ===== */
.page-hero {
  padding: 10rem 3rem 5rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.breadcrumb {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  margin-bottom: 2rem;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  animation: fadeUp 0.8s ease 0.1s both;
}

.breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.3s;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--ink); }

.page-hero h1 {
  font-family: 'Fraunces', 'Noto Serif TC', serif;
  font-weight: 300;
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.8s ease 0.2s both;
}

.page-hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.page-hero .tagline {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  color: var(--ink-soft);
  max-width: 700px;
  line-height: 1.4;
  animation: fadeUp 0.8s ease 0.3s both;
}

/* ===== 服務介紹區 ===== */
.intro {
  padding: 7rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 5rem;
  align-items: start;
}

.intro-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 100px;
}

.intro-label::before {
  content: '';
  width: 30px;
  height: 1px;
  background: var(--ink-soft);
}

.intro-text h2 {
  font-family: 'Fraunces', 'Noto Serif TC', serif;
  font-weight: 300;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.intro-text h2 em {
  font-style: italic;
  color: var(--accent);
}

.intro-text p {
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.2rem;
}

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; padding: 4rem 1.5rem; gap: 2rem; }
  .intro-label { position: static; }
}

/* ===== 作品展示區 ===== */
.gallery {
  padding: 5rem 3rem 7rem;
  background: var(--bg-deep);
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.gallery-header h2 {
  font-family: 'Fraunces', 'Noto Serif TC', serif;
  font-weight: 300;
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.gallery-header h2 em {
  font-style: italic;
  color: var(--accent);
}

.gallery-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.5s ease;
}

.gallery-item:hover { transform: translateY(-6px); }

.gallery-thumb {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-info {
  padding: 1.2rem 0.2rem 0;
}

.gallery-title {
  font-family: 'Fraunces', 'Noto Serif TC', serif;
  font-weight: 400;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.gallery-meta {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
}

/* 占位符視覺 */
.placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  color: var(--ink-soft);
  font-size: 1.2rem;
  letter-spacing: 0.05em;
}

.placeholder-1 { background: linear-gradient(135deg, var(--bg) 0%, var(--bg-deep) 100%); }
.placeholder-2 { background: linear-gradient(135deg, #2a2620 0%, #1a1814 100%); color: var(--paper); }
.placeholder-3 { background: linear-gradient(135deg, var(--accent) 0%, #6b2d0f 100%); color: var(--paper); }
.placeholder-4 { background: linear-gradient(135deg, var(--bg-deep) 0%, var(--line) 100%); }
.placeholder-5 { background: linear-gradient(135deg, #3a2820 0%, var(--ink) 100%); color: var(--paper); }
.placeholder-6 { background: linear-gradient(135deg, var(--paper) 0%, var(--bg-deep) 100%); }

@media (max-width: 900px) {
  .gallery { padding: 3rem 1.5rem 5rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

/* ===== 服務流程 ===== */
.process {
  padding: 7rem 3rem;
}

.process-header {
  margin-bottom: 5rem;
  text-align: center;
}

.process-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.process-header h2 {
  font-family: 'Fraunces', 'Noto Serif TC', serif;
  font-weight: 300;
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.process-header h2 em {
  font-style: italic;
  color: var(--accent);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.process-step {
  position: relative;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.process-num {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 3rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 1rem;
}

.process-step h3 {
  font-family: 'Fraunces', 'Noto Serif TC', serif;
  font-weight: 500;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.process-step p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .process { padding: 4rem 1.5rem; }
  .process-grid { grid-template-columns: repeat(2, 1fr); gap: 2.5rem; }
  .process-header { margin-bottom: 3rem; }
}

@media (max-width: 480px) {
  .process-grid { grid-template-columns: 1fr; }
}

/* ===== CTA 區 ===== */
.cta {
  background: var(--ink);
  color: var(--bg);
  padding: 6rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 83, 26, 0.15) 0%, transparent 70%);
}

.cta-inner {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.cta-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(244, 241, 236, 0.5);
  margin-bottom: 1.5rem;
}

.cta h2 {
  font-family: 'Fraunces', 'Noto Serif TC', serif;
  font-weight: 300;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.cta h2 em {
  font-style: italic;
  color: var(--accent);
}

.cta p {
  color: rgba(244, 241, 236, 0.7);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.cta .btn-primary {
  background: var(--bg);
  color: var(--ink);
}

.cta .btn-primary:hover {
  background: var(--accent);
  color: var(--bg);
}

@media (max-width: 768px) {
  .cta { padding: 4rem 1.5rem; }
}

/* === Lightbox 燈箱 === */
.gallery-thumb img { cursor: zoom-in; }

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 20, 0.95);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox.active { display: flex; }

.lightbox img {
  max-width: 95%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 10000;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
  background: white;
  color: var(--ink);
}

.lightbox-close { top: 1.5rem; right: 2rem; width: 44px; height: 44px; font-size: 1.5rem; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); width: 50px; height: 50px; font-size: 1.8rem; }
.lightbox-prev { left: 2rem; }
.lightbox-next { right: 2rem; }

.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  background: rgba(26,24,20,0.7);
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
}

.lightbox-caption {
  position: absolute;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-family: 'Noto Serif TC', serif;
  font-size: 1rem;
  text-align: center;
}

@media (max-width: 768px) {
  .lightbox-prev { left: 0.5rem; width: 40px; height: 40px; font-size: 1.4rem; }
  .lightbox-next { right: 0.5rem; width: 40px; height: 40px; font-size: 1.4rem; }
  .lightbox-close { top: 1rem; right: 1rem; width: 38px; height: 38px; }
}

/* === 加強響應式設計 === */
/* 確保所有圖片都不會超出容器 */
img {
  max-width: 100%;
  height: auto;
}

/* 平板（768~1024px）優化 */
@media (max-width: 1024px) {
  nav { padding: 1rem 2rem; }
  .hero { padding: 7rem 2rem 3rem; gap: 2rem; }
  .section { padding: 4rem 2rem; }
  .page-hero { padding: 8rem 2rem 3rem; }
  .intro, .contact, .about { padding: 4rem 2rem; }
}

/* 大螢幕（1600px+）優化 */
@media (min-width: 1600px) {
  .hero, .section, .page-hero, .intro, .contact, .about, .process, .gallery {
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* 超寬螢幕（2000px+）置中內容 */
@media (min-width: 2000px) {
  body {
    background: var(--bg);
  }
  nav, footer, .marquee {
    max-width: 100%;
  }
}

/* === print 內頁圖片原比例顯示 === */
.print-original .gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.print-original .gallery-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  background: transparent;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(26,24,20,0.08);
}

.print-original .gallery-thumb img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  transition: transform 0.4s ease;
}

.print-original .gallery-item:hover .gallery-thumb img {
  transform: scale(1.03);
}

@media (max-width: 900px) {
  .print-original .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .print-original .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* === signage 內頁圖片原比例顯示 === */
.signage-original .gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.signage-original .gallery-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  background: transparent;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(26,24,20,0.08);
}

.signage-original .gallery-thumb img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  transition: transform 0.4s ease;
}

.signage-original .gallery-item:hover .gallery-thumb img {
  transform: scale(1.03);
}

.signage-original .gallery-info {
  display: none;
}

@media (max-width: 900px) {
  .signage-original .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .signage-original .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* === network 內頁圖片原比例顯示 === */
.network-original .gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.network-original .gallery-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  background: transparent;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(26,24,20,0.08);
}

.network-original .gallery-thumb img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  transition: transform 0.4s ease;
}

.network-original .gallery-item:hover .gallery-thumb img {
  transform: scale(1.03);
}

@media (max-width: 900px) {
  .network-original .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .network-original .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* === 所有內頁 Hero 大標統一風格（斜體 + 加粗）=== */
.page-hero h1 {
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.page-hero h1 em {
  font-style: italic;
  font-weight: 600;
  color: var(--accent);
}

/* === 所有內頁服務介紹 h2 統一風格（整段棕色 + 加粗，無斜體）=== */
.intro-text h2 {
  font-style: normal;
  font-weight: 500;
  color: var(--accent);
}

.intro-text h2 em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}

/* === 所有內頁 服務流程大標統一風格（加粗 + 棕色強調）=== */
.process-header h2 {
  font-style: normal;
  font-weight: 500;
}

.process-header h2 em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}

/* === 所有內頁 CTA 大標統一風格（加粗 + 棕色強調）=== */
.cta h2 {
  font-style: normal;
  font-weight: 500;
}

.cta h2 em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}

/* === Logo 圖片樣式（橫式 SVG）=== */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.logo img {
  height: 40px;
  width: auto;
  display: block;
  transition: opacity 0.3s ease;
}

.logo:hover img {
  opacity: 0.75;
}

/* 手機版稍微縮小 */
@media (max-width: 768px) {
  .logo img {
    height: 32px;
  }
}