/* ================================================================
   臻邸 不動產顧問｜網站樣式
   ================================================================ */

:root {
  --bg: #0a0a0a;
  --bg-alt: #111111;
  --card: #0e0e0e;
  --card-2: #131313;
  --line: rgba(238, 236, 230, 0.1);
  --text: #eeece6;
  --muted: #b8b6b0;
  --dim: #8d8b86;
  --gold: #c9a45c;
  --btn: #f4f2ec;
  --btn-text: #111111;

  --sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
  --serif: 'Noto Serif TC', 'Songti TC', 'PMingLiU', serif;

  --container: 1200px;
  --gutter: 24px;
  --header-h: 96px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-weight: 500; line-height: 1.3; letter-spacing: 0.02em; text-wrap: balance; }
ul { margin: 0; padding: 0; list-style: none; }
svg { flex-shrink: 0; }

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

/* ---------- 共用元件 ---------- */

.eyebrow {
  display: block;
  margin-bottom: 18px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

/* 中文在大字級下 500 會顯得太粗，展示標題用 400 */
.h-xl { font-size: clamp(36px, 5vw, 60px); font-weight: 400; }
.h-lg { font-size: clamp(30px, 4vw, 52px); font-weight: 400; }
.h-md { font-size: clamp(22px, 2.4vw, 28px); }
.lead { color: var(--muted); font-size: 17px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border: 1px solid var(--btn);
  background: var(--btn);
  color: var(--btn-text);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: background 0.3s, color 0.3s;
}
.btn svg { width: 14px; height: 14px; transition: transform 0.3s var(--ease); }
.btn:hover { background: transparent; color: var(--text); }
.btn:hover svg { transform: translateX(4px); }

.btn-outline { background: transparent; color: var(--text); border-color: rgba(238, 236, 230, 0.85); }
.btn-outline:hover { background: var(--btn); color: var(--btn-text); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.link-arrow svg { width: 14px; height: 14px; transition: transform 0.3s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

.section { padding: 120px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 72px; }
.section-head.center { flex-direction: column; align-items: center; text-align: center; }
.section-head p { max-width: 460px; color: var(--muted); text-align: right; }

/* 進場動畫：有 JS 才會先隱藏 */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- 頁首 ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  transition: background 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.site-header.is-solid { background: rgba(10, 10, 10, 0.96); border-color: var(--line); }
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo { display: inline-flex; align-items: baseline; gap: 10px; }
.logo-name { font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: 0.12em; }
.logo-tag { color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: 0.28em; }

.nav { display: flex; gap: 40px; font-size: 15px; font-weight: 500; letter-spacing: 0.08em; }
.nav a { position: relative; padding: 6px 0; }
.nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 20px; }
.header-phone { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; letter-spacing: 0.04em; }
.header-phone .icon-ring {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.header-phone svg { width: 16px; height: 16px; }

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.menu-toggle svg { width: 20px; height: 20px; margin: auto; }

.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 auto;
  z-index: 49;
  display: none;
  padding: 24px var(--gutter) 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.mobile-menu.is-open { display: block; }
.mobile-menu a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; letter-spacing: 0.08em; }
.mobile-menu .btn { margin-top: 24px; width: 100%; justify-content: center; }

/* ---------- 首頁主視覺 ---------- */

.hero {
  position: relative;
  min-height: max(640px, 100svh);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); animation: heroZoom 2.4s var(--ease) forwards; }
@keyframes heroZoom { to { transform: scale(1); } }
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.15) 100%),
    linear-gradient(to right, rgba(0, 0, 0, 0.45), transparent 60%);
}
.hero .container { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; padding-bottom: 48px; }
.hero-copy { max-width: 620px; }
.hero-copy h1 { margin-bottom: 24px; }
.hero-copy p { margin-bottom: 36px; color: rgba(238, 236, 230, 0.82); font-size: 17px; max-width: 460px; }

.media { width: 470px; max-width: 100%; }
.media .eyebrow { margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.marquee { overflow: hidden; mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 44px; width: max-content; animation: marquee 26s linear infinite; }
.marquee-track span { font-family: var(--serif); font-size: 18px; font-weight: 500; color: rgba(238, 236, 230, 0.7); letter-spacing: 0.12em; white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track, .hero-bg { animation: none; transform: none; } }

/* ---------- 物件卡片 ---------- */

.listing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); transition: border-color 0.4s; }
.card:hover { border-color: rgba(201, 164, 92, 0.5); }
.card-media { position: relative; aspect-ratio: 384 / 260; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.card:hover .card-media img { transform: scale(1.05); }
.badge {
  position: absolute;
  top: 16px; left: 16px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.88);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.card-body { padding: 24px 24px 26px; }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.card-title h3 { font-size: 20px; letter-spacing: 0.06em; }
.price { color: var(--gold); font-size: 18px; font-weight: 500; white-space: nowrap; }
.card-loc { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 14px; }
.card-loc svg { width: 15px; height: 15px; }
.specs { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.specs span { display: inline-flex; align-items: center; gap: 7px; }
.specs svg { width: 17px; height: 17px; }

.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: -24px 0 48px; }
.filters button {
  padding: 8px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.3s;
}
.filters button:hover { color: var(--text); border-color: rgba(238, 236, 230, 0.4); }
.filters button.is-active { background: var(--btn); border-color: var(--btn); color: var(--btn-text); }
.empty { grid-column: 1 / -1; padding: 60px 0; color: var(--muted); text-align: center; }

/* ---------- 成交實績 ---------- */

.stats-img { width: 100%; aspect-ratio: 3 / 1; object-fit: cover; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 80px; text-align: center; }
.stat-num { font-size: clamp(36px, 4vw, 48px); font-weight: 500; line-height: 1.2; letter-spacing: 0.02em; }
.stat-num small { font-size: 0.6em; margin-left: 4px; }
.stat-label { margin-top: 8px; color: var(--muted); font-size: 15px; letter-spacing: 0.08em; }

/* ---------- 服務流程 ---------- */

.steps { display: grid; gap: 24px; }
.step {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  padding: 32px;
  background: var(--card-2);
  border: 1px solid var(--line);
}
.step-icon { display: grid; place-items: center; padding-left: 40px; border-left: 1px solid var(--line); color: var(--muted); }
.step-icon svg { width: 44px; height: 44px; }
.step-num { color: var(--gold); font-size: 15px; letter-spacing: 0.1em; }
.step h3 { margin: 6px 0 12px; font-size: 28px; letter-spacing: 0.08em; }
.step p { max-width: 420px; color: var(--muted); font-size: 15px; }
.step.is-flip { grid-template-columns: auto 1fr; }
.step.is-flip .step-icon { order: -1; padding: 0 40px 0 0; border-left: 0; border-right: 1px solid var(--line); }
.step.is-flip .step-text { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }

/* ---------- 關於我們 ---------- */

.about { display: grid; grid-template-columns: 588fr 588fr; gap: 24px; align-items: center; }
.about-img { width: 100%; aspect-ratio: 588 / 459; object-fit: cover; object-position: center 20%; }
.about-copy { padding-left: 24px; }
.about-copy h2 { margin-bottom: 24px; }
.about-copy .lead { max-width: 460px; margin-bottom: 28px; }
.checks { display: grid; gap: 12px; margin-bottom: 36px; color: var(--muted); font-size: 15px; }
.checks li { display: flex; align-items: center; gap: 14px; }
.checks svg { width: 16px; height: 16px; color: var(--gold); }

/* ---------- 客戶好評 ---------- */

.t-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.t-col { display: flex; flex-direction: column; gap: 64px; }
.t-col:last-child { padding-top: 0; }
.t-card { padding: 36px 32px 32px; background: var(--card-2); border: 1px solid var(--line); }
.t-card.is-narrow { max-width: 340px; }
.t-card.is-wide { max-width: 450px; }
.t-quote { width: 28px; height: 28px; color: var(--gold); }
.stars { display: flex; gap: 4px; margin: 18px 0 20px; color: var(--gold); }
.stars svg { width: 15px; height: 15px; }
.t-card blockquote { margin: 0 0 24px; color: var(--muted); font-size: 16px; line-height: 1.85; }
.t-person { display: flex; align-items: center; gap: 14px; padding-top: 24px; border-top: 1px solid var(--line); }
.t-person img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.t-person strong { display: block; font-weight: 500; letter-spacing: 0.06em; }
.t-person span { color: var(--muted); font-size: 13px; }

/* ---------- 預約諮詢 ---------- */

.cta { position: relative; padding: 270px 0 260px; overflow: hidden; }
.cta-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cta::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.35) 70%); }
.cta .container { position: relative; z-index: 1; }
.cta h2 { margin-bottom: 28px; }
.cta p { max-width: 480px; margin-bottom: 40px; color: rgba(238, 236, 230, 0.8); font-size: 17px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------- 頁尾 ---------- */

.site-footer { padding: 72px 0 40px; background: var(--bg); }
.footer-top { display: grid; grid-template-columns: 1fr auto; gap: 48px; }
.footer-brand p { max-width: 280px; margin-top: 18px; color: var(--muted); font-size: 14px; }
.social { display: flex; gap: 18px; margin-top: 56px; }
.social a { color: var(--muted); transition: color 0.3s; }
.social a:hover { color: var(--gold); }
.social svg { width: 22px; height: 22px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(140px, auto)); gap: 32px 48px; }
.footer-cols h4 { margin-bottom: 18px; font-size: 14px; font-weight: 700; letter-spacing: 0.16em; }
.footer-cols li { margin-bottom: 10px; font-size: 14px; }
.footer-cols a:hover { color: var(--gold); }
.footer-cols .muted { color: var(--muted); max-width: 220px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }

/* ---------- 內頁標題 ---------- */

.page-head { padding: calc(var(--header-h) + 110px) 0 72px; background: var(--bg-alt); text-align: center; }
.page-head h1 { margin-bottom: 18px; }
.page-head p { color: var(--muted); font-size: 17px; }
.page-body { padding-bottom: 72px; background: var(--bg-alt); }

/* ---------- 物件詳細頁 ---------- */

.detail { padding: calc(var(--header-h) + 100px) 0 64px; background: var(--bg-alt); }
.detail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.detail-head h1 { font-size: clamp(34px, 4.4vw, 56px); font-weight: 400; letter-spacing: 0.06em; }
.detail-head .card-loc { margin-top: 10px; font-size: 15px; }
.detail-price { color: var(--text); font-size: clamp(22px, 2.4vw, 30px); font-weight: 500; white-space: nowrap; }

.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 24px; aspect-ratio: 1200 / 500; }
.gallery button { position: relative; padding: 0; border: 0; background: #000; overflow: hidden; cursor: zoom-in; }
.gallery button:first-child { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease), opacity 0.3s; }
.gallery button:hover img { transform: scale(1.04); }

.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; margin-top: 24px; align-items: start; }
.detail-main { display: grid; gap: 24px; }
.panel { padding: 28px 24px; background: var(--card); }
.panel h2 { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); font-size: 22px; letter-spacing: 0.08em; }
.panel p + p { margin-top: 20px; }
.panel p { color: var(--muted); font-size: 15px; line-height: 1.9; }
.addr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; font-size: 15px; }
.addr dt { display: inline; font-weight: 500; }
.addr dt::after { content: '：'; }
.addr dd { display: inline; margin: 0; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tags li { padding: 6px 14px; border: 1px solid var(--line); color: var(--muted); font-size: 14px; letter-spacing: 0.06em; }

.overview { position: sticky; top: calc(var(--header-h) + 24px); }
.overview ul { display: grid; gap: 20px; margin-bottom: 28px; }
.overview li { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 15px; }
.overview svg { width: 22px; height: 22px; color: var(--text); }
.overview .btn { width: 100%; justify-content: center; }
.overview .btn + .btn { margin-top: 12px; }

/* 燈箱 */
.lightbox { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.92); }
.lightbox.is-open { display: grid; }
.lightbox img { max-width: min(1200px, 100%); max-height: 86vh; object-fit: contain; }
.lightbox button { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); background: rgba(10, 10, 10, 0.6); color: var(--text); cursor: pointer; }
.lightbox button svg { width: 20px; height: 20px; }
.lb-close { top: 24px; right: 24px; }
.lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 24px; top: 50%; transform: translateY(-50%); }

/* ---------- 404 ---------- */

.notfound { position: relative; min-height: 100svh; display: grid; place-items: center; padding: calc(var(--header-h) + 40px) 0 80px; text-align: center; overflow: hidden; }
.notfound .cta-bg { opacity: 0.85; }
.notfound::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.notfound .container { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.nf-code { font-family: var(--serif); font-size: clamp(72px, 10vw, 120px); font-weight: 700; line-height: 1; letter-spacing: 0.06em; }
.notfound h1 { margin: 28px 0 22px; }
.notfound p { max-width: 440px; margin-bottom: 36px; color: rgba(238, 236, 230, 0.82); }

/* ---------- 響應式 ---------- */

@media (max-width: 1100px) {
  .nav { gap: 28px; }
  .header-phone span:last-child { display: none; }
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --header-h: 76px; }
  .nav, .header-actions .btn, .header-phone { display: none; }
  .menu-toggle { display: grid; }
  .section { padding: 88px 0; }
  .section-head { flex-direction: column; align-items: flex-start; margin-bottom: 48px; }
  .section-head p { text-align: left; }
  .hero .container { flex-direction: column; align-items: flex-start; }
  .media { width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 48px; margin-top: 56px; }
  .stats-img { aspect-ratio: 2 / 1; }
  .about { grid-template-columns: 1fr; }
  .about-copy { padding-left: 0; padding-top: 16px; }
  .t-grid { grid-template-columns: 1fr; }
  .t-col { gap: 24px; }
  .t-card.is-narrow, .t-card.is-wide { max-width: none; }
  .cta { padding: 140px 0; }
  .footer-top { grid-template-columns: 1fr; }
  .social { margin-top: 28px; }
  .detail-grid { grid-template-columns: 1fr; }
  .overview { position: static; }
  .gallery { aspect-ratio: auto; grid-template-columns: 1fr 1fr; grid-template-rows: auto; gap: 12px; }
  .gallery button { aspect-ratio: 4 / 3; }
  .gallery button:first-child { grid-column: span 2; grid-row: auto; aspect-ratio: 16 / 10; }
}

@media (max-width: 640px) {
  .listing-grid { grid-template-columns: 1fr; }
  .step, .step.is-flip { grid-template-columns: 1fr; padding: 28px 24px; }
  .step-icon, .step.is-flip .step-icon { order: -1; justify-content: start; padding: 0 0 20px; margin-bottom: 20px; border: 0; border-bottom: 1px solid var(--line); }
  .step.is-flip .step-text { align-items: flex-start; text-align: left; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .addr { grid-template-columns: 1fr; }
  .detail-head { flex-direction: column; align-items: flex-start; }
  .hide-sm { display: none; }
}
