/* TaiLexi AI — 和紙・墨・藍・朱 */
:root {
  --paper: #efe9e0; --paper-2: #e7dfd2; --paper-3: #f6f2ec;
  --sumi: #1c1d21; --ink-2: #55565e; --ink-3: #8a877f;
  --ai: #22395c; --shu: #c4432b;
  --line: rgba(28, 29, 33, .14); --line-2: rgba(28, 29, 33, .26);
  --serif: "Cormorant Garamond", "Noto Serif TC", "Noto Serif JP", "Songti TC", serif;
  --mincho: "Noto Serif TC", "Noto Serif JP", "Songti TC", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Hiragino Sans", "Microsoft JhengHei", system-ui, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html { background: var(--paper); }
body { margin: 0; font: 400 16px/1.9 var(--sans); color: var(--sumi); letter-spacing: .03em; position: relative; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: url(/img/washi.webp) repeat; background-size: 720px; opacity: .5; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 32px; }
::selection { background: rgba(196, 67, 43, .18); }

/* ── 印章 ─────────────────────────── */
.seal { width: 34px; height: 34px; flex: none; }
.seal rect { fill: var(--shu); }
.seal text { fill: #f7efe6; font: 600 20px/1 var(--serif); letter-spacing: -.04em; }

/* ── 頁首 ─────────────────────────── */
header.top { position: absolute; inset: 0 0 auto; z-index: 5; }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 26px; padding-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 600 21px/1 var(--serif); letter-spacing: .06em; }
.brand .seal { animation: stamp .9s 1.5s var(--ease) both; }
nav.links { display: flex; align-items: center; gap: 30px; font-size: 13.5px; letter-spacing: .14em; }
nav.links a { text-decoration: none; position: relative; padding: 4px 0; }
nav.links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
nav.links a:hover::after { transform: scaleX(1); transform-origin: left; }
nav.links .lang { border: 1px solid var(--line-2); padding: 3px 14px; letter-spacing: .08em; }
nav.links .lang::after { display: none; }

/* ── 首屏 ─────────────────────────── */
.hero { position: relative; min-height: min(94vh, 900px); display: flex; align-items: center; overflow: hidden; padding: 120px 0 110px; }
.hero-art { position: absolute; top: 0; right: 0; bottom: 0; width: 74vw; z-index: 0; will-change: transform;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24%), linear-gradient(to bottom, #000 72%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 24%), linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-composite: intersect; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: right center;
  animation: inkIn 2.6s .1s var(--ease) both, breathe 26s 2.7s ease-in-out infinite alternate; transform-origin: 70% 50%; }
.hero .wrap { position: relative; z-index: 1; width: 100%; }
.hero-copy { max-width: 620px; }
.eyebrow { display: flex; align-items: center; gap: 14px; font: 500 15px/1 var(--serif); letter-spacing: .32em; color: var(--ink-2); margin: 0 0 34px; }
.eyebrow::before { content: ""; width: 44px; height: 1px; background: var(--sumi); transform-origin: left; animation: draw 1.2s .3s var(--ease) both; }
.hero h1 { font: 600 clamp(34px, 5.1vw, 62px)/1.42 var(--mincho); letter-spacing: .06em; margin: 0 0 30px; }
.hero h1 .ln { display: block; }
.hero h1 em { font-style: normal; color: var(--ai); }
.hero h1 .ln:nth-child(1) { animation: rise 1.6s .45s var(--ease) both; }
.hero h1 .ln:nth-child(2) { animation: rise 1.6s .7s var(--ease) both; }
.eyebrow { animation: rise 1.4s .2s var(--ease) both; }
.lede { font-size: clamp(15px, 1.55vw, 17px); line-height: 2.05; color: var(--ink-2); margin: 0 0 40px; max-width: 540px; animation: rise 1.6s 1s var(--ease) both; }
.ctas { display: flex; flex-wrap: wrap; gap: 14px 34px; align-items: center; animation: rise 1.6s 1.2s var(--ease) both; }
.btn { display: inline-flex; align-items: center; gap: 14px; background: var(--sumi); color: var(--paper-3); text-decoration: none;
  padding: 15px 30px; font-size: 14.5px; letter-spacing: .16em; position: relative; overflow: hidden; transition: color .5s var(--ease); }
.btn::before { content: ""; position: absolute; inset: 0; background: var(--ai); transform: translateX(-101%); transition: transform .6s var(--ease); }
.btn:hover::before { transform: none; }
.btn > * { position: relative; }
.arrow { display: inline-block; width: 26px; height: 1px; background: currentColor; position: relative; transition: width .5s var(--ease); }
.arrow::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 1px; background: currentColor; transform: rotate(35deg); transform-origin: right; }
a:hover > .arrow, .card:hover .arrow { width: 40px; }
.textlink { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 14.5px; letter-spacing: .14em; padding: 6px 0;
  border-bottom: 1px solid var(--line-2); }

.tate { position: absolute; left: max(20px, calc((100vw - 1160px) / 2 - 40px)); top: 50%; translate: 0 -50%; z-index: 1;
  writing-mode: vertical-rl; font: 500 13px/1 var(--mincho); letter-spacing: .5em; color: var(--ink-3); display: none;
  animation: fade 2s 1.6s ease both; }
.tate::after { content: ""; display: block; width: 1px; height: 64px; margin: 18px auto 0; background: var(--line-2); }
@media (min-width: 1300px) { .tate { display: block; } }

.scroll { position: absolute; left: 50%; bottom: 26px; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px;
  font: 500 11px/1 var(--serif); letter-spacing: .34em; color: var(--ink-3); text-decoration: none; animation: fade 2s 2s ease both; translate: -50% 0; }
.scroll i { width: 1px; height: 58px; background: var(--line); position: relative; overflow: hidden; }
.scroll i::after { content: ""; position: absolute; inset: 0; background: var(--sumi); animation: drip 2.4s 2.4s cubic-bezier(.6, 0, .3, 1) infinite; }

/* ── 理念 ─────────────────────────── */
.manifesto { text-align: center; padding: 100px 0 120px; position: relative; }
.manifesto .stroke { display: block; width: 1px; height: 80px; margin: 0 auto 46px; background: var(--shu); transform-origin: top; }
html.js .manifesto .stroke { transform: scaleY(0); transition: transform 1.4s var(--ease); }
html.js .manifesto.in .stroke { transform: none; }
.manifesto blockquote { margin: 0 auto 30px; font: 500 clamp(26px, 3.6vw, 42px)/1.6 var(--mincho); letter-spacing: .12em; }
.manifesto p { max-width: 640px; margin: 0 auto; color: var(--ink-2); line-height: 2.2; }

/* ── 數字 ─────────────────────────── */
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats li { padding: 38px 20px 34px; text-align: center; position: relative; }
.stats li + li::before { content: ""; position: absolute; left: 0; top: 26%; bottom: 26%; width: 1px; background: var(--line); }
.stats b { display: block; font: 500 clamp(40px, 4.6vw, 60px)/1 var(--serif); letter-spacing: .01em; color: var(--sumi); margin-bottom: 14px; font-variant-numeric: lining-nums; }
.stats b small { font: 500 .36em/1 var(--mincho); margin-left: .3em; color: var(--ink-2); letter-spacing: .1em; }
.stats li > span { font-size: 13.5px; color: var(--ink-2); letter-spacing: .14em; }

/* ── 區塊標題 ─────────────────────── */
section { padding: 120px 0; position: relative; }
.head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px 60px; align-items: end; margin-bottom: 64px; }
.label { display: flex; align-items: center; gap: 12px; font: 600 13px/1 var(--serif); letter-spacing: .38em; color: var(--shu); margin: 0 0 18px; }
.label::before { content: ""; width: 7px; height: 7px; background: var(--shu); border-radius: 50%; }
.head h2 { font: 600 clamp(28px, 3.4vw, 40px)/1.4 var(--mincho); letter-spacing: .1em; margin: 0; }
.head p { margin: 0; color: var(--ink-2); line-height: 2.1; }

/* ── 產品 ─────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card { background: var(--paper-3); text-decoration: none; display: flex; flex-direction: column; padding: 30px 32px 30px; position: relative; overflow: hidden;
  transition: background-color .6s var(--ease); }
.card::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--ai); transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease); }
.card:hover { background: #fbf8f3; }
.card:hover::after { transform: scaleX(1); }
.card .meta { display: flex; justify-content: space-between; align-items: baseline; font: 500 14px/1 var(--serif); letter-spacing: .2em; color: var(--ink-3); }
.card .meta .no { font-size: 17px; color: var(--sumi); }
.card .meta .tag { font: 400 12.5px/1 var(--sans); letter-spacing: .2em; }
.card figure { margin: 6px auto 10px; width: min(230px, 78%); aspect-ratio: 1; }
.card figure img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: transform 1.2s var(--ease), filter 1.2s var(--ease); }
.card:hover figure img { transform: scale(1.06) translateY(-4px); filter: contrast(1.12); }
.card h3 { font: 600 22px/1.45 var(--mincho); letter-spacing: .08em; margin: 0 0 4px; }
.card h3 .sub { display: block; font: 400 13px/1.6 var(--sans); letter-spacing: .14em; color: var(--ink-3); margin-top: 4px; }
.card p { margin: 10px 0 24px; color: var(--ink-2); font-size: 14.5px; line-height: 2; flex: 1; }
.card .url { display: flex; align-items: center; justify-content: space-between; font: 500 15px/1 var(--serif); letter-spacing: .1em; padding-top: 18px; border-top: 1px solid var(--line); }
.new { display: inline-block; font: 600 10.5px/1 var(--serif); letter-spacing: .24em; color: var(--shu); border: 1px solid var(--shu); padding: 4px 6px 3px 8px; margin-left: 10px; vertical-align: 5px; }

/* ── 做法 ─────────────────────────── */
.approach { background: #1e2c44 url(/img/washi.webp) repeat; background-size: 720px; background-blend-mode: multiply; color: var(--paper-3); }
.approach .head p, .approach .steps p { color: rgba(239, 233, 224, .7); }
.approach .label, .approach .steps .kan { color: #e2694f; }
.approach .label::before { background: #e2694f; }
.approach .steps > div { border-left-color: rgba(239, 233, 224, .2); }
.approach::before { content: "理"; position: absolute; right: 3vw; bottom: 30px; font: 600 min(22vw, 300px)/1 var(--mincho); color: rgba(239, 233, 224, .035); pointer-events: none; z-index: 0; }
.approach .wrap { position: relative; z-index: 1; }
.approach.en::before { content: "道"; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 56px; gap: 0; counter-reset: s; position: relative; }
.steps > div { padding: 6px 30px 0; border-left: 1px solid var(--line-2); }
.steps .kan { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.steps .kan b { font: 500 44px/1 var(--serif); color: #e2694f; letter-spacing: .02em; font-variant-numeric: lining-nums; }
.steps .kan i { font: 500 15px/1 var(--mincho); font-style: normal; color: rgba(239, 233, 224, .45); letter-spacing: .2em; }
.steps h3 { font: 600 18.5px/1.6 var(--mincho); letter-spacing: .1em; margin: 0 0 12px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 2.05; }

/* ── 聯絡 ─────────────────────────── */
.contact { text-align: center; padding: 140px 0 130px; }
.contact .label { justify-content: center; }
.contact h2 { font: 600 clamp(28px, 3.4vw, 40px)/1.4 var(--mincho); letter-spacing: .12em; margin: 0 0 18px; }
.contact p { color: var(--ink-2); margin: 0 auto 46px; max-width: 560px; line-height: 2.1; }
.mail { display: inline-flex; align-items: center; gap: 18px; font: 500 clamp(24px, 3.4vw, 40px)/1.2 var(--serif); letter-spacing: .04em; text-decoration: none;
  padding-bottom: 12px; background: linear-gradient(var(--sumi), var(--sumi)) left bottom / 100% 1px no-repeat; transition: background-size .7s var(--ease), color .5s; }
.mail:hover { color: var(--ai); background-size: 0 1px; background-position: right bottom; }

footer { border-top: 1px solid var(--line); padding: 36px 0 44px; font-size: 13px; color: var(--ink-3); letter-spacing: .1em; }
footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
footer .brand { font-size: 17px; color: var(--sumi); }
footer .brand .seal { width: 26px; height: 26px; animation: none; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--sumi); }

/* ── 捲動浮現（main.js 加 html.js 才生效；無 JS 時全部直接顯示） ── */
html.js .reveal { opacity: 0; transform: translateY(26px); filter: blur(4px); transition: opacity 1.3s var(--ease), transform 1.3s var(--ease), filter 1.3s var(--ease); }
html.js .reveal.in { opacity: 1; transform: none; filter: none; }
html.js .grid .card:nth-child(3n+2) { transition-delay: .12s; }
html.js .grid .card:nth-child(3n) { transition-delay: .24s; }
html.js .steps > div:nth-child(2) { transition-delay: .12s; }
html.js .steps > div:nth-child(3) { transition-delay: .24s; }
html.js .steps > div:nth-child(4) { transition-delay: .36s; }
html.js .stats li:nth-child(2) { transition-delay: .1s; }
html.js .stats li:nth-child(3) { transition-delay: .2s; }
html.js .stats li:nth-child(4) { transition-delay: .3s; }
html.js .card.reveal { transition: opacity 1.3s var(--ease), transform 1.3s var(--ease), filter 1.3s var(--ease), background-color .6s var(--ease); }

@keyframes rise { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes inkIn { from { opacity: 0; filter: blur(16px) saturate(.4); transform: scale(1.08); } to { opacity: 1; filter: none; transform: scale(1); } }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.045) translate(-.6%, .4%); } }
@keyframes stamp { 0% { opacity: 0; transform: scale(1.9) rotate(-8deg); } 60% { opacity: 1; transform: scale(.94) rotate(1deg); } 100% { opacity: 1; transform: none; } }
@keyframes drip { 0% { transform: translateY(-100%); } 55% { transform: translateY(0); } 100% { transform: translateY(100%); } }

/* ── 響應式 ───────────────────────── */
@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 50px; }
  .head { grid-template-columns: 1fr; align-items: start; }
  html.js .grid .card:nth-child(n) { transition-delay: 0s; }
  html.js .grid .card:nth-child(2n) { transition-delay: .12s; }
}
@media (max-width: 820px) {
  .wrap { padding: 0 20px; }
  header.top .wrap { padding-top: 18px; padding-bottom: 18px; }
  nav.links { gap: 18px; }
  nav.links .opt { display: none; }
  .hero { flex-direction: column; align-items: stretch; min-height: 0; padding: 104px 0 0; }
  .hero-art { order: 2; }
  .hero-art { position: relative; width: 100%; height: 320px; margin-top: 18px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%); -webkit-mask-composite: source-over;
    mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%); mask-composite: add; }
  .hero-art img { object-position: 82% 50%; }
  .scroll { display: none; }
  .manifesto { padding: 70px 0 80px; }
  .manifesto .stroke { height: 56px; margin-bottom: 34px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats li:nth-child(3)::before { display: none; }
  .stats li:nth-child(n+3) { border-top: 1px solid var(--line); }
  section { padding: 84px 0; }
  .head { margin-bottom: 40px; }
  .contact { padding: 96px 0; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  html.js .grid .card:nth-child(n) { transition-delay: 0s; }
  .steps { grid-template-columns: 1fr; row-gap: 40px; }
  .steps > div { padding: 0 0 0 22px; }
  .steps .kan { font-size: 38px; margin-bottom: 16px; }
  .card { padding: 26px 22px; }
  .hero h1 { letter-spacing: .03em; }
  .brand { font-size: 18px; }
  .stats li { padding: 30px 8px 26px; }
  .mail { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  html.js .reveal { opacity: 1; transform: none; filter: none; }
  html.js .manifesto .stroke { transform: none; }
}
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
html[lang="en"] .hero h1 { font-family: var(--serif); font-weight: 600; letter-spacing: 0; line-height: 1.12; font-size: clamp(40px, 5.4vw, 74px); }
html[lang="en"] .hero-copy { max-width: 700px; }
html[lang="en"] .eyebrow { letter-spacing: .24em; }
html[lang="en"] .manifesto blockquote, html[lang="en"] .head h2, html[lang="en"] .contact h2 { font-family: var(--serif); letter-spacing: .01em; }
html[lang="en"] .card h3 { font-family: var(--serif); letter-spacing: .01em; font-size: 26px; }
html[lang="en"] .steps h3 { font-family: var(--serif); letter-spacing: .01em; font-size: 22px; }
@media (min-width: 821px) and (max-height: 860px) { .scroll { display: none; } }

/* ── 服務對象 ─────────────────────── */
.serve { padding-top: 40px; }
.serve-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--sumi); }
.serve-grid > div { padding: 28px 22px 26px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.serve-grid > div:last-child { border-right: 0; }
.serve-grid h3 { font: 600 18px/1.5 var(--mincho); letter-spacing: .08em; margin: 0 0 12px; }
.serve-grid p { margin: 0 0 18px; color: var(--ink-2); font-size: 14px; line-height: 2; flex: 1; }
.serve-grid .uses { font: 500 13px/1.5 var(--serif); letter-spacing: .08em; color: var(--ai); border-top: 1px solid var(--line); padding-top: 12px; }
html[lang="en"] .serve-grid h3 { font-family: var(--serif); font-size: 21px; letter-spacing: .01em; }
html.js .serve-grid > div:nth-child(2) { transition-delay: .08s; }
html.js .serve-grid > div:nth-child(3) { transition-delay: .16s; }
html.js .serve-grid > div:nth-child(4) { transition-delay: .24s; }
html.js .serve-grid > div:nth-child(5) { transition-delay: .32s; }
@media (max-width: 980px) {
  .serve-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .serve-grid > div { border-bottom: 1px solid var(--line); }
  .serve-grid > div:nth-child(2n) { border-right: 0; }
  html.js .serve-grid > div:nth-child(n) { transition-delay: 0s; }
}
@media (max-width: 560px) {
  .serve-grid { grid-template-columns: 1fr; }
  .serve-grid > div { border-right: 0; padding: 22px 4px; }
}

/* 響應式補強（2026-10-11）：中等寬度欄數減半、浮水印只在大螢幕 */
@media (max-width: 1180px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .serve-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .serve-grid > div { border-bottom: 1px solid var(--line); }
  .serve-grid > div:nth-child(3n) { border-right: 0; }
  .serve-grid > div:nth-child(2n) { border-right: 1px solid var(--line); }
  .serve-grid > div:nth-child(3n) { border-right: 0; }
  html.js .serve-grid > div:nth-child(n) { transition-delay: 0s; }
}
@media (max-width: 980px) { .approach::before { display: none; } }
@media (max-width: 760px) {
  .serve-grid { grid-template-columns: 1fr; }
  .serve-grid > div, .serve-grid > div:nth-child(n) { border-right: 0; padding: 22px 4px; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; row-gap: 40px; }
  .steps .kan b { font-size: 36px; }
}

.approach::before { display: none !important; }  /* 浮水印字會壓到第四欄，拿掉求乾淨 */
.card .meta .no { font-variant-numeric: lining-nums; }
