/* ATTACH 新網站（本機版 v5，參考 hao0321.com 的版面語言）。色彩／字體依 04_品牌/STYLE_GUIDE.md。單一品牌藍 --brand，層次靠透明度。 */
:root {
  --brand: #0080FF;
  --brand-text: #0069D1; /* 小字與藍底白字用，對比達 AA */
  --paper: #F4F5F2;
  --white: #FFFFFF;
  --ink: #111315;
  --muted: rgba(17, 19, 21, .62);
  --line: rgba(17, 19, 21, .15);
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --latin: "DM Sans", "Noto Sans TC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-hero: clamp(3.4rem, 1.4rem + 8.4vw, 8.5rem);
  --fs-h2: clamp(1.5rem, 1.05rem + 1.9vw, 2.5rem);
  --fs-display: clamp(2.25rem, 1.2rem + 5.2vw, 5.25rem);
  --fs-lead: clamp(1.0625rem, .98rem + .4vw, 1.3125rem);
  --fs-body: clamp(.9375rem, .916rem + .094vw, 1rem);
  --pad-x: clamp(20px, 5.2vw, 84px);
  --section-y: clamp(64px, 9vw, 132px);
  --container: 1240px;
  --header-h: 68px;
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--font); font-size: var(--fs-body); line-height: 1.85; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: rgba(0,128,255,.25); color: var(--ink); }
.container { width: 100%; max-width: calc(var(--container) + var(--pad-x) * 2); margin: 0 auto; padding-inline: var(--pad-x); }

/* 頁首 */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 10; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; padding-inline: var(--pad-x); background: rgba(244,245,242,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__name { font-family: var(--latin); font-weight: 800; letter-spacing: .04em; font-size: 1.05rem; }
.site-nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 32px); font-size: .875rem; }
.site-nav a { text-decoration: none; font-weight: 500; padding: 8px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--brand); }
.site-nav .nav-btn { padding: 9px 18px; border: 1px solid var(--line); background: #fff; border-bottom: 1px solid var(--line); transition: border-color .2s, color .2s; }
.site-nav .nav-btn:hover { border-color: var(--brand); color: var(--brand); }

/* 首屏 */
.hero { padding-top: var(--header-h); background: var(--paper); border-bottom: 1px solid var(--line); }
.hero__grid { display: grid; grid-template-columns: minmax(0,1fr); gap: clamp(32px, 5vw, 56px); padding-block: clamp(40px, 7vw, 96px); align-items: center; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); column-gap: clamp(32px, 5vw, 80px); } }
.hero__title { font-size: var(--fs-hero); font-weight: 700; line-height: 1.06; letter-spacing: -.035em; color: var(--ink); text-wrap: nowrap; }
.hero__title em { font-style: normal; color: var(--brand); }
.hero__sub { margin-top: clamp(20px, 3vw, 36px); font-size: var(--fs-lead); font-weight: 500; max-width: 24em; }
.hero__actions { margin-top: clamp(24px, 3vw, 40px); display: flex; flex-wrap: wrap; gap: 16px; }
.btn { display: inline-flex; align-items: center; gap: 14px; padding: 15px 26px; background: var(--brand-text); color: #fff; text-decoration: none; font-weight: 700; border: 1px solid var(--brand-text); transition: background .2s, color .2s, transform .2s; }
.btn:hover { background: var(--ink); border-color: var(--ink); transform: translateY(-2px); }
.hero__art { position: relative; margin: 0; padding: clamp(14px, 3vw, 36px); }
.hero__svg { display: block; width: 100%; max-width: 460px; height: auto; margin-inline: auto; }
@media (prefers-reduced-motion: no-preference) {
  .ring { transform-box: fill-box; transform-origin: center; animation: ring 4s ease-in-out infinite; }
  .ring--b { animation-delay: -2s; }
  .approach { animation: dash 6s linear infinite; }
}
@keyframes dash { to { stroke-dashoffset: -90; } }

/* 區塊標題 */
.section-head { padding-top: var(--section-y); padding-bottom: clamp(8px, 2vw, 24px); }
.eyebrow { font-family: var(--mono); font-size: .75rem; letter-spacing: .22em; font-weight: 700; color: var(--brand-text); display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.eyebrow::before { content: ""; width: 40px; height: 1px; background: var(--brand); }
.section-title { font-family: var(--latin); font-size: var(--fs-display); font-weight: 700; letter-spacing: -.04em; line-height: 1; }

/* 案例 */
.case { padding-block: clamp(40px, 6vw, 80px); position: relative; }
.case__grid { display: grid; grid-template-columns: minmax(0,1fr); gap: clamp(28px, 4vw, 44px); grid-template-areas: "head" "fig" "body"; }
@media (min-width: 900px) {
  .case__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); column-gap: clamp(40px, 6vw, 96px); row-gap: clamp(20px, 2.4vw, 32px); grid-template-areas: "fig head" "fig body"; align-items: start; }
  .case--2 .case__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-areas: "head fig" "body fig"; }
  .fig { position: sticky; top: calc(var(--header-h) + 24px); }
}
.case__head { grid-area: head; align-self: end; }
.case__body { grid-area: body; }
.fig { grid-area: fig; min-width: 0; margin: 0; }
.case__num { display: none; }
.tag { font-family: var(--mono); font-size: .75rem; font-weight: 700; letter-spacing: .22em; color: var(--brand-text); display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tag::after { content: ""; flex: 0 0 40px; height: 1px; background: var(--brand); }
.case__title { font-family: var(--latin); font-size: var(--fs-h2); font-weight: 700; line-height: 1.18; letter-spacing: -.025em; }

.row { padding-block: clamp(14px, 1.8vw, 20px); border-top: 1px solid var(--line); }
.row__label { font-family: var(--mono); font-size: .6875rem; font-weight: 700; letter-spacing: .2em; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.row p { max-width: 38em; color: var(--ink); }
.row--solve { margin-top: 8px; padding: clamp(18px, 2.4vw, 26px); background: var(--brand-text); color: #fff; border: 0; }
.row--solve .row__label { color: #fff; }
.row--solve p { color: #fff; font-size: var(--fs-lead); font-weight: 500; line-height: 1.75; }
.row__more { margin-top: 14px; font-size: var(--fs-body) !important; }
.link { font-weight: 700; text-decoration: none; border-bottom: 2px solid #fff; color: #fff; }
.link:hover { background: #fff; color: var(--brand-text); }

/* 示意圖（置於淡藍圖卡內） */
.fig__frame { position: relative; background: rgba(0,128,255,.08); padding: clamp(18px, 3.2vw, 44px); }
.fig__svg { display: block; width: 100%; height: auto; background: #fff; padding: clamp(8px, 1.6vw, 18px); }
.fig__cap { margin-top: 12px; font-family: var(--mono); font-size: .6875rem; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; }
.t-mono { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; fill: var(--ink); fill-opacity: .75; font-weight: 700; }
.t-lab { font-family: var(--font); font-size: 13px; font-weight: 700; fill: var(--ink); }
.t-chip { font-family: var(--font); font-size: 14px; font-weight: 500; }
.t-ai { font-family: var(--latin); font-size: 22px; font-weight: 800; fill: #fff; }

/* 示意圖動畫（未偏好減少動態時啟用） */
@media (prefers-reduced-motion: no-preference) {
  .seg-mix { transform-box: fill-box; transform-origin: left center; animation: remix 6s ease-in-out infinite; animation-delay: var(--d); }
  .wave { transform-box: fill-box; transform-origin: center; animation: wave 1.6s ease-in-out infinite; animation-delay: var(--d); }
  .ai-ring { transform-box: fill-box; transform-origin: center; animation: ring 2.6s ease-in-out infinite; }
  .tool { animation: swap 4.8s ease-in-out infinite; animation-delay: var(--d); }
}
@keyframes remix { 0%, 8% { opacity: 0; transform: translateX(-14px) scaleX(.6); } 24%, 80% { opacity: 1; transform: none; } 94%, 100% { opacity: 0; transform: translateX(10px) scaleX(.8); } }
@keyframes wave { 0%, 100% { transform: scaleY(.55); } 50% { transform: scaleY(1.08); } }
@keyframes ring { 0%, 100% { transform: scale(.94); opacity: .9; } 50% { transform: scale(1.1); opacity: .25; } }
@keyframes swap { 0%, 70%, 100% { stroke-dashoffset: 0; } 85% { stroke-dashoffset: 16; } }

/* 聯絡 */
.contact { position: relative; overflow: hidden; background: var(--brand-text); color: #fff; padding-block: var(--section-y); margin-top: clamp(40px, 6vw, 80px); }
.contact .container { position: relative; }
.contact__title { font-family: var(--latin); font-size: var(--fs-display); font-weight: 700; letter-spacing: -.04em; line-height: 1.02; color: #fff; }
.contact__mail { display: inline-block; margin-top: clamp(20px, 3vw, 36px); font-family: var(--latin); font-size: clamp(1.4rem, 1rem + 2.2vw, 2.5rem); font-weight: 700; color: #fff; text-decoration: none; border-bottom: 3px solid #fff; padding-bottom: 4px; overflow-wrap: anywhere; }
.contact__mail:hover { background: #fff; color: var(--brand-text); }
.footer__copy { font-family: var(--mono); font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.site-footer { padding-block: 28px; background: var(--paper); }
.footer__row { display: flex; justify-content: space-between; align-items: center; }

/* 進場動畫 */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s 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; }
  .btn { transition: none; }
}
@media (max-width: 480px) {
  .hero__title { text-wrap: wrap; }
  .site-nav { gap: 14px; }
}

.hero__what { margin-top: 10px; color: var(--muted); max-width: 28em; }
.section-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.motion-toggle { font-family: var(--mono); font-size: .6875rem; letter-spacing: .16em; text-transform: uppercase; padding: 9px 16px; background: #fff; border: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.motion-toggle:hover { border-color: var(--brand); color: var(--brand); }
.case__deck { margin-top: 8px; font-family: var(--latin); font-size: var(--fs-lead); font-weight: 500; color: var(--muted); }
.contact__hint { margin-top: clamp(16px, 2vw, 24px); font-size: var(--fs-lead); color: #fff; }
.paused *, .paused *::before, .paused *::after { animation-play-state: paused !important; }
.paused .seg-mix { animation: none !important; } /* 暫停時顯示完整片段 */
.nobr { display: inline-block; }

/* 手機：放大圖內與小標文字 */
@media (max-width: 480px) {
  .fig__frame { padding: 10px; }
  .fig__svg { padding: 6px; }
  .t-mono { font-size: 15px; letter-spacing: .06em; }
  .t-lab, .t-chip { font-size: 16px; }
  .row__label, .fig__cap, .motion-toggle, .tag, .eyebrow { font-size: .8125rem; }
}
