:root {
  --ink: #101214;
  --charcoal: #1a1f24;
  --slate: #2a3138;
  --stone: #f3efe6;
  --paper: #faf7f1;
  --cream: #e8e2d6;
  --metal: #8d9398;
  --brass: #b0894a;
  --brass-bright: #d4af6a;
  --glass: #2f6f6c;
  --glass-bright: #4ea8a4;
  --glass-mist: rgba(78, 168, 164, 0.14);
  --purple: #6b3d8a;
  --text: #22272c;
  --muted: #5b636b;
  --white: #ffffff;
  --danger: #b42318;
  --header-h: 5.25rem;
  --header-h-lg: 7.25rem;
  --max: 72rem;
  --gutter: 1.25rem;
  --radius: 2px;
  --shadow: 0 18px 50px rgba(16, 18, 20, 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --font-body: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--paper);
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

figure {
  margin: 0;
}

a {
  color: var(--glass);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 4000;
  background: var(--brass);
  color: var(--ink);
  padding: 0.6rem 1rem;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: min(var(--max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffff;
  border-bottom: 1px solid rgba(16, 18, 20, 0.1);
  transition: box-shadow 0.3s var(--ease);
}

.site-header.is-scrolled {
  box-shadow: 0 8px 24px rgba(16, 18, 20, 0.08);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.logo {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  text-decoration: none;
}

.logo img {
  width: min(52vw, 232px);
  height: auto;
  max-height: 5.6rem;
  object-fit: contain;
  object-position: left center;
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.75rem;
}

.header-tel {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.header-tel:hover {
  color: var(--brass);
}

.menu-toggle {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(16, 18, 20, 0.18);
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.desktop-nav {
  display: none;
}

.desktop-nav ul {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.35rem;
}

.desktop-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 1.02rem;
  letter-spacing: 0.06em;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}

.desktop-nav a:hover,
.desktop-nav a[aria-current="page"] {
  color: var(--brass);
  border-bottom-color: var(--brass);
}

/* ---------- Mobile overlay menu ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  z-index: 2000;
  background: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1.1rem 1.25rem 2.75rem;
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 2rem;
  position: relative;
  min-height: 2.75rem;
}

.mobile-menu-title {
  font-family: var(--font-display);
  color: var(--stone);
  font-size: 1.5rem;
  margin: 0;
  text-align: center;
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.menu-close {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(232, 226, 214, 0.3);
  background: transparent;
  color: var(--stone);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-menu nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu nav a {
  display: block;
  color: var(--stone);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6.4vw, 2.05rem);
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(232, 226, 214, 0.12);
  text-align: center;
}

.mobile-menu nav a[aria-current="page"] {
  color: var(--brass-bright);
}

.mobile-menu-cta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.85rem;
  padding: 0.65rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s, border-color 0.25s, transform 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn-primary:hover {
  background: var(--brass-bright);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--stone);
  border-color: rgba(243, 239, 230, 0.45);
}

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

.btn-whatsapp {
  background: #128c7e;
  color: var(--white);
}

.btn-whatsapp:hover {
  background: #0e7a6e;
  color: var(--white);
}

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

.btn-line:hover {
  background: var(--ink);
  color: var(--stone);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(86vh, 46rem);
  display: grid;
  align-items: end;
  color: var(--stone);
  overflow: hidden;
  background: var(--ink);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.88) contrast(1.05);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(16, 18, 20, 0.18) 0%, rgba(16, 18, 20, 0.28) 38%, rgba(16, 18, 20, 0.86) 100%),
    linear-gradient(90deg, rgba(16, 18, 20, 0.45), transparent 55%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: 5rem 0 3.2rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.85rem;
  color: var(--brass-bright);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
  margin: 0 0 1rem;
}

.hero h1 {
  font-size: clamp(2.3rem, 7vw, 4.4rem);
}

.hero-lead {
  max-width: 38rem;
  margin: 0 0 1.6rem;
  color: rgba(243, 239, 230, 0.88);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-hero {
  background: var(--charcoal);
  color: var(--stone);
  padding: 3.2rem 0 2.6rem;
  border-bottom: 3px solid var(--brass);
}

.page-hero p {
  max-width: 40rem;
  margin: 0;
  color: rgba(243, 239, 230, 0.8);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--metal);
}

.breadcrumb a {
  color: var(--cream);
  text-decoration: none;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.4rem;
  color: var(--metal);
}

/* ---------- Sections ---------- */
.section {
  padding: 4.2rem 0;
}

.section-dark {
  background: var(--charcoal);
  color: var(--stone);
}

.section-stone {
  background: var(--stone);
}

.section-head {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 2.2rem;
  max-width: 40rem;
}

.section-head h2,
.prose h2,
.prose h3 {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  line-height: 1.3;
  margin: 0 0 0.7rem;
}

.section-head h2,
.prose h2 {
  font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.kicker {
  margin: 0;
  color: var(--brass);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
}

/* ---------- Cards / services ---------- */
.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

.service-card {
  position: relative;
  display: block;
  background: var(--ink);
  color: var(--stone);
  text-decoration: none;
  min-height: 16rem;
  overflow: hidden;
  isolation: isolate;
}

.service-card img {
  width: 100%;
  height: 16.5rem;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.service-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 28%, rgba(16, 18, 20, 0.88));
}

.service-card:hover img {
  transform: scale(1.05);
}

.service-card:hover,
.service-card:hover h3 {
  color: var(--brass);
}

.service-card-body {
  position: absolute;
  left: 1.15rem;
  right: 1.15rem;
  bottom: 1.1rem;
  z-index: 1;
}

.service-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.25rem;
  letter-spacing: 0.04em;
}

.service-card p {
  margin: 0;
  color: rgba(243, 239, 230, 0.75);
  font-size: 0.9rem;
}

.feature-grid {
  display: grid;
  gap: 1.25rem;
}

.feature {
  padding: 1.4rem 1.3rem 1.5rem;
  background: var(--white);
  border-top: 2px solid var(--brass);
  box-shadow: var(--shadow);
}

.section-dark .feature {
  background: var(--slate);
  box-shadow: none;
}

.feature h3 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
}

.section-dark .feature p {
  color: rgba(243, 239, 230, 0.72);
}

/* ---------- Prose / split ---------- */
.prose {
  max-width: 46rem;
}

.prose p {
  margin: 0 0 1.1rem;
}

.original-copy {
  padding: 1.4rem 1.3rem;
  background: var(--white);
  border-left: 3px solid var(--brass);
  color: var(--text);
}

.section-dark .original-copy {
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
}

.split {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.split img {
  width: 100%;
  height: min(28rem, 70vw);
  object-fit: cover;
}

.cred-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cred-list li {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(16, 18, 20, 0.1);
}

.cred-list strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

/* ---------- Contact ---------- */
.contact-layout {
  display: grid;
  gap: 2rem;
}

.contact-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.contact-list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(16, 18, 20, 0.08);
}

.contact-list a {
  color: inherit;
}

.contact-form {
  display: grid;
  gap: 0.95rem;
  padding: 1.5rem;
  background: var(--white);
  box-shadow: var(--shadow);
}

.contact-form h2 {
  font-family: var(--font-display);
  margin: 0;
}

.prose .btn {
  margin: 0.35rem 0.55rem 0.35rem 0;
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.contact-form .req {
  color: var(--danger);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid #d5d0c6;
  background: var(--paper);
  color: var(--text);
  font: inherit;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius);
}

.contact-form textarea {
  min-height: 8.5rem;
  resize: vertical;
}

.form-note,
.form-success,
.form-error {
  margin: 0;
  font-size: 0.92rem;
}

.form-error {
  color: var(--danger);
}

.form-success {
  color: var(--glass);
}

.map-frame {
  position: relative;
  min-height: 18rem;
  background: var(--cream);
  border: 1px solid var(--cream);
}

.map-frame iframe {
  width: 100%;
  height: 20rem;
  border: 0;
}

.map-caption {
  margin: 0.6rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(243, 239, 230, 0.78);
  padding: 3rem 0 1.6rem;
}

.footer-grid {
  display: grid;
  gap: 1.8rem;
  margin-bottom: 2rem;
}

.site-footer h2 {
  font-family: var(--font-display);
  color: var(--stone);
  font-size: 1.35rem;
  margin: 0 0 0.6rem;
}

.site-footer a {
  color: var(--cream);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brass-bright);
}

.footer-nav {
  display: grid;
  gap: 0.4rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  justify-content: space-between;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(232, 226, 214, 0.12);
  font-size: 0.85rem;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 900;
  width: 2.8rem;
  height: 2.8rem;
  border: 0;
  background: var(--brass);
  color: var(--ink);
  font-size: 1.15rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Motion ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .service-card img,
  .btn {
    transition: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Sitemap list ---------- */
.sitemap-list {
  columns: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sitemap-list a {
  display: block;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(16, 18, 20, 0.08);
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
}

/* ---------- Desktop ---------- */
@media (min-width: 720px) {
  :root {
    --gutter: 2rem;
  }

  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .split {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .contact-layout {
    grid-template-columns: 0.9fr 1.1fr;
  }

  .footer-grid {
    grid-template-columns: 1.3fr 1fr 1fr;
  }

  .sitemap-list {
    columns: 2;
  }
}

@media (min-width: 1100px) {
  .menu-toggle {
    display: none;
  }

  .header-actions {
    display: flex;
  }

  .logo img {
    width: 232px;
    max-width: 248px;
    max-height: 6.2rem;
  }

  .desktop-nav {
    display: block;
    border-top: 1px solid rgba(16, 18, 20, 0.08);
  }

  .service-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .case-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Cases gallery ---------- */
.case-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.4rem;
}

.case-filter {
  min-height: 2.4rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(16, 18, 20, 0.16);
  background: var(--white);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.case-filter[aria-pressed="true"] {
  background: var(--ink);
  color: var(--stone);
  border-color: var(--ink);
}

.case-count {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.case-card {
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--ink);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  position: relative;
}

.case-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.case-card:hover img,
.case-card:focus-visible img {
  transform: scale(1.05);
}

.case-card span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.4rem 0.7rem 0.65rem;
  background: linear-gradient(180deg, transparent, rgba(16, 18, 20, 0.88));
  color: var(--stone);
  font-size: 0.82rem;
}

.case-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  z-index: 2400;
  background: rgba(10, 12, 14, 0.94);
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  padding: 1rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-close {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(243, 239, 230, 0.35);
  background: transparent;
  color: var(--stone);
  font-size: 1.6rem;
  cursor: pointer;
}

.lightbox-prev,
.lightbox-next {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(243, 239, 230, 0.35);
  background: transparent;
  color: var(--stone);
  font-size: 1.8rem;
  cursor: pointer;
}

.lightbox-prev {
  grid-column: 1;
  grid-row: 2;
}

.lightbox-next {
  grid-column: 3;
  grid-row: 2;
}

.lightbox figure {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  max-height: calc(100dvh - 8rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100dvh - 10rem);
  object-fit: contain;
}

.lightbox figcaption {
  margin-top: 0.8rem;
  color: var(--cream);
  text-align: center;
  font-size: 0.92rem;
}

.lightbox figcaption strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
}
