/* =========================================================
   高概念 hi-concept — 官網樣式
   品牌色取自 Logo 實際色值：#231714 墨 / #FAFAFA 地
   ========================================================= */

:root {
  --ink:        #231714;
  --ink-soft:   #4A3B36;
  --muted:      #7A6B65;
  --ground:     #FAFAFA;
  --surface:    #FFFFFF;
  --rule:       #E3DCD7;
  --rule-firm:  #C9BEB7;
  --overlay:    rgba(35, 23, 20, .92);

  --sans: "Noto Sans TC", -apple-system, "Segoe UI", "Microsoft JhengHei", sans-serif;
  --disp: "Jost", "Noto Sans TC", var(--sans);

  --nav-h: 4.5rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --measure: 68ch;
  --wide: 78rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.wrap { max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }
.prose { max-width: var(--measure); }

/* ---------- 頁首（固定，置中字標，右側漢堡）---------- */
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding-inline: var(--gutter);
}
.wordmark {
  grid-column: 2;
  font-family: var(--disp); font-weight: 500;
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  letter-spacing: .04em; text-decoration: none; line-height: 1;
}
.wordmark b { font-weight: 600; }
.nav-toggle {
  grid-column: 3; justify-self: end;
  width: 2.75rem; height: 2.75rem;
  background: none; border: 0; cursor: pointer; padding: 0;
  display: grid; place-content: center; gap: .32rem;
}
.nav-toggle span { display: block; width: 1.5rem; height: 2px; background: var(--ink); transition: transform .25s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(.34rem) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-.34rem) rotate(-45deg); }

/* ---------- 抽屜選單 ---------- */
.drawer {
  position: fixed; inset: 0 0 0 auto; z-index: 49;
  width: min(24rem, 84vw);
  background: var(--overlay); color: var(--ground);
  padding: calc(var(--nav-h) + 2rem) 2rem 2rem;
  transform: translateX(100%); transition: transform .3s ease;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: .25rem;
}
.drawer[data-open="true"] { transform: translateX(0); }
.drawer a { text-decoration: none; }
.drawer > a, .drawer .group > a {
  font-family: var(--disp); font-size: 1.15rem; font-weight: 500;
  letter-spacing: .06em; padding: .7rem 0;
  border-bottom: 1px solid rgba(250,250,250,.16);
  display: block;
}
.drawer .sub { display: grid; gap: 0; max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.drawer .group[data-open="true"] .sub { max-height: 30rem; }
.drawer .sub a { font-size: .95rem; color: rgba(250,250,250,.78); padding: .45rem 0 .45rem 1rem; }
.drawer .sub a:hover { color: var(--ground); }
.scrim { position: fixed; inset: 0; z-index: 48; background: rgba(35,23,20,.4); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim[data-open="true"] { opacity: 1; pointer-events: auto; }

main { padding-top: var(--nav-h); }

/* ---------- 通用區塊 ---------- */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section + .section { border-top: 1px solid var(--rule); }
.eyebrow {
  font-family: var(--disp); font-size: .72rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .75rem;
}
h1, h2, h3 { text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.85rem, 4.4vw, 2.9rem); line-height: 1.25; letter-spacing: -.01em; font-weight: 700; }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); line-height: 1.35; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 500; }
p { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-lg { display: flex; flex-direction: column; gap: 2.25rem; }

/* ---------- Hero 輪播 ---------- */
.hero { position: relative; background: var(--surface); border-bottom: 1px solid var(--rule); }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-track > a { flex: 0 0 100%; scroll-snap-align: center; }
.hero-track img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.hero-dots { position: absolute; bottom: 1.1rem; left: 50%; transform: translateX(-50%); display: flex; gap: .55rem; z-index: 2; }
.hero-dots button { width: .55rem; height: .55rem; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: rgba(35,23,20,.3); transition: background .2s, transform .2s; }
.hero-dots button:hover { background: rgba(35,23,20,.55); }
.hero-dots button[aria-selected="true"] { background: var(--ink); transform: scale(1.35); }

/* 左右鍵：桌機才顯示，手機直接滑比較自然 */
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 2.75rem; height: 2.75rem; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  color: var(--ink); font-size: 1.5rem; line-height: 1; padding: 0;
  display: grid; place-items: center; opacity: 0; transition: opacity .2s, background .2s;
}
.hero:hover .hero-arrow, .hero-arrow:focus-visible { opacity: 1; }
.hero-arrow:hover { background: var(--ground); }
.hero-arrow.prev { left: 1rem; }
.hero-arrow.next { right: 1rem; }
@media (hover: none) { .hero-arrow { display: none; } }

/* ---------- 定位陳述（首頁最重要的一段）---------- */
/* 主張放左、支撐它的數字放右。claim 刻意維持 34ch 的短行寬（中文最好讀的
   長度），但短行寬會在寬螢幕留下大片空白 —— 那片空白要有內容，不然看起來
   像忘了填。 */
.thesis { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 1fr); gap: 2rem 3.5rem; align-items: start; }
.thesis-main { display: flex; flex-direction: column; gap: 1.5rem; }
.thesis-facts { display: flex; flex-direction: column; gap: 1rem; }
.thesis .claim {
  font-size: clamp(1.15rem, 2.6vw, 1.55rem); line-height: 1.65; font-weight: 500;
  max-width: 34ch;
}
.thesis .claim em { font-style: normal; box-shadow: inset 0 -.5em 0 rgba(35,23,20,.07); }
.facts { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.facts div { background: var(--ground); padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: .15rem; }
.facts dt { font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
.facts dd { margin: 0; font-family: var(--disp); font-size: 1.5rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.facts dd small { font-family: var(--sans); font-size: .85rem; font-weight: 400; color: var(--ink-soft); }

/* ---------- 分類入口 ---------- */
/* 欄數由產生器依項目數帶入（--cols），最後一列才不會留空格露出底色 */
.cat-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
@media (max-width: 62rem) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 34rem) { .cat-grid { grid-template-columns: 1fr; } }
.cat-grid a {
  background: var(--ground); padding: 1.75rem 1.5rem 2rem; text-decoration: none;
  display: flex; flex-direction: column; gap: .5rem; transition: background .2s;
}
.cat-grid a:hover { background: var(--surface); }
.cat-grid .en { font-family: var(--disp); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.cat-grid .zh { font-size: 1.2rem; font-weight: 700; }
.cat-grid p { font-size: .9rem; color: var(--ink-soft); }
.cat-grid .more { margin-top: .35rem; font-size: .82rem; color: var(--muted); }

/* ---------- 合作品牌牆 ---------- */
/* 設計稿為 4×2 八格，固定欄數才不會留下空格 */
.logo-wall { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
@media (max-width: 46rem) { .logo-wall { grid-template-columns: repeat(2, 1fr); } }
.logo-cell { position: relative; background: var(--surface); aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; }
.logo-cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.logo-cell .name { font-family: var(--disp); font-size: .95rem; letter-spacing: .08em; color: var(--ink-soft); transition: opacity .35s; }
.logo-cell:hover img, .logo-cell:focus-within img { opacity: 1; }
.logo-cell:hover .name, .logo-cell:focus-within .name { opacity: 0; }
.placeholder { background: repeating-linear-gradient(45deg, var(--surface) 0 8px, var(--ground) 8px 16px); }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 1.1rem 0; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--disp); color: var(--muted); flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding-bottom: 1.2rem; color: var(--ink-soft); max-width: var(--measure); }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--ink); color: var(--ground); text-decoration: none;
  font-family: var(--disp); font-size: .88rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .85rem 1.75rem; border: 1px solid var(--ink); transition: background .2s, color .2s;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--ground); }

/* ---------- 頁尾 ---------- */
.site-foot { background: var(--ink); color: var(--ground); padding-block: 3rem 2rem; margin-top: 0; }
.site-foot a { color: inherit; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(250,250,250,.18); }
.foot-grid h3 { font-family: var(--disp); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(250,250,250,.5); margin-bottom: .6rem; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; font-size: .92rem; }
.foot-legal { padding-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; font-size: .8rem; color: rgba(250,250,250,.55); }

/* ---------- 麵包屑 ---------- */
.crumbs { font-size: .82rem; color: var(--muted); padding-block: 1.25rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- 商品格（3:4，Q27）---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1.5rem 1.25rem; }
.product-grid figure { margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.product-grid .shot { aspect-ratio: 3 / 4; background: var(--surface); border: 1px solid var(--rule); overflow: hidden; }
.product-grid .shot img { width: 100%; height: 100%; object-fit: cover; }
.product-grid figcaption { font-size: .92rem; }

/* ---------- 施工標記（僅開發期）---------- */
.todo { border: 1px dashed var(--rule-firm); background: var(--surface); padding: 1rem 1.25rem; font-size: .88rem; color: var(--muted); }
.todo b { color: var(--ink); font-weight: 500; }

/* ---------- 聯絡頁：表單 + 右欄 ---------- */
/* 表單原本被限制在 46rem，右側空掉近 400px。改成兩欄後，
   把「直接聯絡」與填寫提示放進右欄，版面才用得滿也才有層次。 */
.contact-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(17rem, 1fr); gap: 3rem 3.5rem; align-items: start; margin-top: 2.5rem; }
.contact-aside { display: flex; flex-direction: column; gap: 2rem; position: sticky; top: calc(var(--nav-h) + 2rem); }
.aside-note h3 { margin-bottom: .7rem; }
.aside-note ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .89rem; color: var(--ink-soft); }
.aside-note li { padding-left: .9rem; position: relative; }
.aside-note li::before { content: "—"; position: absolute; left: 0; color: var(--rule-firm); }
.aside-note strong { color: var(--ink); font-weight: 500; }
.aside-addr { font-style: normal; font-size: .82rem; line-height: 1.9; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 1.25rem; }

/* 直接聯絡管道：右欄裡垂直堆疊 */
.direct { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.direct-card { background: var(--surface); padding: 1.15rem 1.35rem; text-decoration: none; display: flex; flex-direction: column; gap: .25rem; transition: background .2s; }
.direct-card:hover { background: var(--ground); }
.direct-card .k { font-family: var(--disp); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.direct-card .v { font-size: 1.1rem; font-weight: 500; }
.direct-card .n { font-size: .82rem; color: var(--muted); }

/* ---------- 詢價表單 ---------- */
.inquiry { display: flex; flex-direction: column; gap: 1.5rem; }
.form-note { font-size: .88rem; color: var(--muted); }
.req { color: #94402F; font-weight: 700; }
.form-error { background: #FBEDEA; border-left: 3px solid #94402F; padding: .9rem 1.2rem; font-size: .92rem; }
/* 固定欄寬，否則每一列會依標籤字數各自計算，標籤右緣會歪掉 */
.field-row { display: grid; grid-template-columns: 6.5rem minmax(0,1fr) 2.5rem minmax(0,1fr); gap: .6rem 1rem; align-items: center; }
.field-block { display: flex; flex-direction: column; gap: .5rem; }
.inquiry label { font-size: .92rem; font-weight: 500; white-space: nowrap; }
.inquiry input[type=text], .inquiry input[type=tel], .inquiry input[type=email],
.inquiry select, .inquiry textarea {
  font-family: inherit; font-size: .95rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule-firm); border-radius: 0; padding: .6rem .75rem;
  width: 100%; line-height: 1.5;
}
.inquiry select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
.inquiry :focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.inquiry textarea { resize: vertical; min-height: 7rem; }
.inquiry .check { display: flex; align-items: center; gap: .6rem; font-weight: 400; cursor: pointer; }
.inquiry .check input { width: 1.05rem; height: 1.05rem; accent-color: var(--ink); }
.inquiry .qty-label { color: var(--muted); font-weight: 400; }
.inquiry .btn { align-self: flex-start; border: 0; cursor: pointer; font-family: var(--disp); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 62rem) {
  .contact-layout { grid-template-columns: 1fr; }
  .contact-aside { position: static; }
  .thesis { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 34rem) { .facts { grid-template-columns: 1fr; } }
@media (max-width: 44rem) {
  .field-row { grid-template-columns: 1fr; gap: .35rem; }
  .inquiry .qty-label { margin-top: .5rem; }
}

/* ---------- 送出後的確認頁 ---------- */
/* 已定案不寄自動回覆信，客戶端的確認完全靠這一頁，所以做得比一般頁面厚 */
.done { display: flex; flex-direction: column; gap: 3rem; }
.done-head { display: flex; gap: 1.5rem; align-items: flex-start; }
.done-head .tick { flex: none; color: var(--ink); margin-top: .25rem; }
.done-head .lede { font-size: 1.05rem; color: var(--ink-soft); max-width: 52ch; }
.done-head code { font-family: var(--disp); font-size: .95em; background: var(--surface); border: 1px solid var(--rule); padding: .1rem .4rem; }

.urgent { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--rule); padding: 1.5rem 1.75rem; }
.urgent h3 { margin-bottom: .35rem; }
.urgent p { font-size: .92rem; color: var(--ink-soft); max-width: 46ch; }
.urgent-links { display: flex; gap: .75rem; flex-wrap: wrap; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.steps li { background: var(--ground); padding: 1.5rem; display: flex; gap: 1rem; align-items: flex-start; }
.steps .n { font-family: var(--disp); font-size: .8rem; letter-spacing: .12em; color: var(--muted); flex: none; padding-top: .2rem; }
.steps h3 { margin-bottom: .3rem; }
.steps p { font-size: .89rem; color: var(--ink-soft); }

.prep { border-left: 3px solid var(--ink); padding: .25rem 0 .25rem 1.5rem; }
.prep h3 { margin-bottom: .8rem; }
.prep ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .93rem; color: var(--ink-soft); max-width: 60ch; }
.prep li strong { color: var(--ink); font-weight: 500; margin-right: .4rem; }

.onward { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.onward a { background: var(--surface); padding: 1.25rem 1.5rem; text-decoration: none; display: flex; flex-direction: column; gap: .2rem; transition: background .2s; }
.onward a:hover { background: var(--ground); }
.onward .k { font-family: var(--disp); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.onward .v { font-size: 1.05rem; font-weight: 500; }

@media (max-width: 40rem) {
  .done-head { flex-direction: column; gap: 1rem; }
  .urgent { flex-direction: column; align-items: flex-start; }
}
