/* ════════════════════════════════════════════════════════════════
   textory — editorial redesign
   Type: Times New Roman (EN serif) + Noto Sans TC (中文 sans)
   ════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }
input, select, textarea, button { font: inherit; }

:root {
  --serif: 'Newsreader', 'Times New Roman', 'Noto Serif TC', serif;
  --sans: 'Noto Sans TC', 'Helvetica Neue', Helvetica, Arial, system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px; --s-11: 160px;

  --max-w: 1440px;
  --gutter: clamp(20px, 4vw, 56px);
  --section-y: clamp(104px, 15vw, 208px);

  --bg: #f3efe7; --bg-2: #ebe6dc;
  --ink: #1a1814; --ink-2: #4a463e; --ink-3: #8a8478;
  --rule: #d6d0c2; --rule-2: #cac3b3;
  --accent: #5B8FCC; --accent-2: #4a82b5;

  --fs-display: clamp(48px, 7.5vw, 132px);
  --fs-h2: clamp(36px, 5.5vw, 80px);
  --fs-body: 16px;
  --tracking-tight: -0.02em;
  --lh-body: 1.7;
}

[data-theme="paper"] { --bg:#f3efe7; --bg-2:#ebe6dc; --ink:#1a1814; --ink-2:#4a463e; --ink-3:#8a8478; --rule:#d6d0c2; --rule-2:#cac3b3; }
[data-theme="ink"]   { --bg:#131210; --bg-2:#1c1a17; --ink:#f0ece2; --ink-2:#b8b1a2; --ink-3:#6a6457; --rule:#2c2924; --rule-2:#3a3631; }
[data-theme="bone"]  { --bg:#fafaf6; --bg-2:#f1efe7; --ink:#111111; --ink-2:#444444; --ink-3:#999999; --rule:#e2dfd5; --rule-2:#d4d0c4; }

[data-accent="blue"]  { --accent:#5B8FCC; --accent-2:#4a82b5; }
[data-accent="rust"]  { --accent:#B5552B; --accent-2:#9c4623; }
[data-accent="olive"] { --accent:#7A7A4A; --accent-2:#62623a; }
[data-accent="ink"]   { --accent: var(--ink); --accent-2: var(--ink-2); }

/* Blue theme — blue ground, black body type, white accents */
[data-theme="blue"] {
  --bg:#5B8FCC; --bg-2:#4E82BF;
  --ink:#0C1219; --ink-2:#21344A; --ink-3:#EAF2FB;
  --rule:rgba(255,255,255,0.30); --rule-2:rgba(255,255,255,0.45);
  --accent:#FFFFFF; --accent-2:rgba(255,255,255,0.82);
}

/* ════════════════════════════════════════════════════════════════
   Nimbus Cloud — PANTONE 13-4108 TCX (#D5D5D8)
   ════════════════════════════════════════════════════════════════
   底色由深藍換成冷調淺灰，整套文字階層跟著反轉：原本靠白色撐起的
   accent 在淺底上等於隱形，改用沉穩的品牌藍。每個值都對照 #D5D5D8
   驗過對比度，最低 4.6:1（WCAG AA），主文字 12.1:1（AAA）。 */
[data-theme="nimbus"] {
  --bg:#D5D5D8;      /* PANTONE 13-4108 TCX  Nimbus Cloud        */
  --bg-2:#C6C6CB;    /* 圖片載入前的底、contain 圖的留白         */

  /* 文字：Cool Gray 家族，取代純黑。指定的 Cool Gray 9 C 在這個底色上
     只有 3.03:1，達不到內文標準 4.5:1，所以按用途分層 —— 內文往深處
     推到達標，9 C 本色留給不影響閱讀的小標籤與線條。            */
  --ink:#53565A;     /* Cool Gray 11 C  主文字   5.04:1  AA      */
  --ink-2:#5A5D60;   /* 次要內文                 4.52:1  AA      */
  --ink-3:#75787B;   /* Cool Gray 9 C  編號/標籤 3.03:1  裝飾用  */

  --rule:rgba(117,120,123,0.34);    /* Cool Gray 9 C 的線條版本  */
  --rule-2:rgba(117,120,123,0.55);

  /* 品牌藍：logo 用 Brilliant Blue 本色（圖形標準 3:1，3.26:1 通過），
     但它當文字只有 3.26:1，所以文字用途一律走加深版。           */
  --accent:#0078BA;  /* 18-4247 TPG Brilliant Blue — 圖形/底色   */
  --accent-2:#00588A;/* 連結與強調文字           5.19:1  AA      */
}


/* PANTONE 13-0002 TCX  White Sand — Nimbus 的暖調版本。
   亮度幾乎相同（0.673 vs 0.667），所以文字階層沿用同一套對比關係，
   只把中性灰往暖處偏一點，跟底色的色溫一致。 */
[data-theme="sand"] {
  --bg:#DBD5D1;
  --bg-2:#CCC5C0;

  --ink:#57534F;     /* 暖調 Cool Gray 11   5.06:1  AA */
  --ink-2:#5E5A56;   /*                     4.54:1  AA */
  --ink-3:#7A7570;   /* 暖調 Cool Gray 9    3.06:1  裝飾用 */

  --rule:rgba(122,117,112,0.34);
  --rule-2:rgba(122,117,112,0.55);

  --accent:#0078BA;  /* Brilliant Blue 本色 */
  --accent-2:#00588A;
}

/* Headline type modes */
[data-type="serif"] .hero-headline,
[data-type="serif"] .section-title,
[data-type="serif"] .stat-num,
[data-type="serif"] .srv-en,
[data-type="serif"] .case-client,
[data-type="serif"] .footer-word,
[data-type="serif"] .clients-row,
[data-type="serif"] .intro-word {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: var(--tracking-tight);
}

[data-type="sans"] .hero-headline,
[data-type="sans"] .section-title,
[data-type="sans"] .stat-num,
[data-type="sans"] .srv-en,
[data-type="sans"] .case-client,
[data-type="sans"] .footer-word,
[data-type="sans"] .clients-row,
[data-type="sans"] .intro-word {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.015em;
}

/* English headlines force serif (Times) per direction; Chinese stays sans */
[data-type="sans"] .hero-headline em,
[data-type="sans"] .section-title em {
  font-style: italic;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}

[data-type="mixed"] .hero-headline,
[data-type="mixed"] .stat-num,
[data-type="mixed"] .srv-en,
[data-type="mixed"] .case-client,
[data-type="mixed"] .clients-row,
[data-type="mixed"] .footer-word,
[data-type="mixed"] .intro-word {
  font-family: var(--serif);
  font-weight: 400;
}
[data-type="mixed"] .section-title {
  font-family: var(--sans);
  font-weight: 700;
}

body {
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  transition: background 0.45s ease, color 0.45s ease;
}
[data-cursor-on="true"] body,
[data-cursor-on="true"] a,
[data-cursor-on="true"] button { cursor: none; }
::selection { background: var(--accent); color: var(--bg); }

/* Cursor */
.cursor { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; display: none; }
[data-cursor-on="true"] .cursor { display: block; }
.cursor-dot { position: absolute; width: 6px; height: 6px; background: var(--ink); border-radius: 50%; transform: translate(-50%,-50%); transition: width 0.25s, height 0.25s; will-change: transform; box-shadow: 0 0 3px rgba(255,255,255,0.55); }
.cursor-ring { position: absolute; width: 36px; height: 36px; border: 1px solid var(--ink); border-radius: 50%; transform: translate(-50%,-50%); transition: width 0.3s, height 0.3s; will-change: transform; box-shadow: 0 0 4px rgba(255,255,255,0.45); }
.cursor.is-link .cursor-dot { transform: translate(-50%,-50%) scale(0); }
.cursor.is-link .cursor-ring { width: 56px; height: 56px; }
.cursor.is-big .cursor-dot { width: 10px; height: 10px; }
.cursor.is-big .cursor-ring { width: 80px; height: 80px; }
.cursor.is-hidden .cursor-dot, .cursor.is-hidden .cursor-ring { opacity: 0; }

/* Intro */
.intro { position: fixed; inset: 0; z-index: 9998; background: var(--bg); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-6); transition: transform 0.75s cubic-bezier(0.76,0,0.24,1) 0.8s, opacity 0.4s ease 1.2s; }
.intro.gone { transform: translateY(-101%); opacity: 0; pointer-events: none; }
.intro-mark { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.intro-word { font-family: var(--serif); font-size: clamp(64px, 12vw, 180px); line-height: 1; letter-spacing: -0.04em; font-style: italic; opacity: 0; transform: translateY(20px); animation: introIn 0.7s cubic-bezier(0.4,0,0.2,1) 0.15s forwards; }
.intro-word-img { font-style: normal; display: block; opacity: 0; transform: translateY(20px) scale(0.96); animation: introIn 0.8s cubic-bezier(0.4,0,0.2,1) 0.15s forwards; }
.intro-word-img img { display: block; width: clamp(180px, 28vw, 380px); height: auto; }
.intro-zh { font-family: var(--sans); font-size: 11px; letter-spacing: 0.4em; text-transform: uppercase; opacity: 0; animation: introIn 0.6s ease 0.5s forwards; }
.intro-meta { display: flex; gap: var(--s-3); font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; opacity: 0; animation: introIn 0.6s ease 0.65s forwards; color: rgba(240,236,226,0.45); }
@keyframes introIn { to { opacity: 1; transform: none; } }

/* Tape */
.tape { overflow: hidden; background: var(--bg); color: var(--ink); padding: 10px 0; }
.tape-track { display: flex; gap: 32px; width: max-content; animation: tapeMove 38s linear infinite; font-family: var(--mono); font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; align-items: center; }
.tape-track > span { white-space: nowrap; }
@keyframes tapeMove { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 80; display: flex; align-items: center; justify-content: space-between; padding: 16px var(--gutter); pointer-events: none; border-bottom: 1px solid transparent; transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), background 0.3s ease, padding 0.3s ease, border-color 0.3s ease; }
.nav.scrolled { background: var(--bg); border-bottom-color: var(--rule); padding-top: 11px; padding-bottom: 11px; pointer-events: auto; }
.nav.nav-hidden { transform: translateY(-100%); }
.nav > * { pointer-events: auto; }
.nav-brand, .nav-links a, .nav-toggle span { color: var(--ink); }
.nav-brand { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.nav-mark-img { line-height: 0; margin-bottom: 0; }
.nav-mark { font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1; }
.nav-mark-img { display: inline-flex; align-items: center; }
.nav-mark-img img { display: block; height: 40px; width: auto; }
.nav-sub { font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.55; }
.nav-links { display: flex; gap: var(--s-7); }
.nav-links a { display: inline-flex; align-items: baseline; gap: 6px; font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: 0.04em; position: relative; padding: 6px 0; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: currentColor; transition: right 0.4s cubic-bezier(0.6,0,0.2,1); }
.nav-links a:hover::after { right: 0; }
.nav-num { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; opacity: 0.6; font-weight: 400; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 1px; background: currentColor; transition: transform 0.3s, opacity 0.3s; }
.nav-toggle.open span:first-child { transform: translateY(3px) rotate(45deg); }
.nav-toggle.open span:last-child { transform: translateY(-3px) rotate(-45deg); }

/* Hero */
.hero { position: relative; min-height: 100dvh; padding: clamp(120px, 16vh, 180px) var(--gutter) var(--s-9); display: grid; grid-template-columns: 1fr; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s-5) var(--s-8); max-width: var(--max-w); width: 100%; margin: 0 auto; }
[data-hero="stack"] .hero-grid { grid-template-columns: 1fr; }
[data-hero="wide"] .hero-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.8fr); }

.hero-meta { grid-column: 1 / -1; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: var(--s-4); }

.hero-headline {
  grid-column: 1 / -1;
  font-family: var(--serif);
  font-size: var(--fs-display);
  line-height: 0.96;
  letter-spacing: var(--tracking-tight);
  font-weight: 400;
  color: var(--ink);
}
[data-hero="stack"] .hero-headline { grid-column: 1 / -1; }
.hero-headline em { font-style: italic; color: var(--accent-2); font-weight: 300; }
.hero-headline .line { display: block; overflow: hidden; }
.hero-headline .line-inner { display: inline-block; transform: translateY(110%); will-change: transform; }
.hero-headline.is-in .line-inner { transform: translateY(0); transition: transform 1.1s cubic-bezier(0.16,1,0.3,1); }
.hero-headline.is-in .line:nth-child(1) .line-inner { transition-delay: 0.05s; }
.hero-headline.is-in .line:nth-child(2) .line-inner { transition-delay: 0.18s; }
.hero-headline.is-in .line:nth-child(3) .line-inner { transition-delay: 0.31s; }

.hero-zh { grid-column: 1 / 2; align-self: start; max-width: 480px; margin-top: calc(var(--s-5) * -1); }
.zh-large { font-family: var(--sans); font-size: clamp(20px, 1.8vw, 26px); line-height: 1.55; font-weight: 400; color: var(--ink-2); text-wrap: pretty; word-break: keep-all; overflow-wrap: break-word; line-break: strict; }

.hero-foot { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--s-7); padding-top: var(--s-5); align-items: end; }
.hero-foot-col { display: flex; flex-direction: column; gap: 6px; }
.foot-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); }
.hero-foot-col p { font-family: var(--sans); font-size: 14px; color: var(--ink); }
.hero-cta { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border: 1px solid var(--ink); border-radius: 999px; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; transition: background 0.3s, color 0.3s, transform 0.3s; }
.hero-cta:hover { background: var(--ink); color: var(--bg); transform: translateX(4px); }

.hero-visual { grid-column: 2 / 3; align-self: start; }
[data-hero="stack"] .hero-visual { grid-column: 1 / -1; margin-top: var(--s-7); }
.hero-frame { display: flex; flex-direction: column; gap: var(--s-3); }
.hero-img-wrap { aspect-ratio: 4 / 5; overflow: hidden; }
[data-hero="stack"] .hero-img-wrap { aspect-ratio: 16 / 9; }
.hero-img-wrap img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 1.6s cubic-bezier(0.2,0.8,0.2,1); }
.hero-img-wrap.is-in img { transform: scale(1); }
.hero-frame-meta { display: flex; gap: var(--s-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }

.hero-scroll-cue { position: absolute; bottom: var(--s-5); right: var(--gutter); display: flex; flex-direction: column; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-3); }
.cue-line { width: 1px; height: 50px; background: linear-gradient(to bottom, var(--ink-2), transparent); animation: cuePulse 2.2s ease-in-out infinite; }
@keyframes cuePulse { 0%,100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; } 50% { opacity: 1; transform: scaleY(1); } }

/* Section shell */
.section { padding: var(--section-y) var(--gutter); max-width: var(--max-w); margin: 0 auto; }
.section-head { display: flex; flex-direction: column; gap: var(--s-4); margin-bottom: var(--s-9); max-width: 1100px; }
.section-head-compact { margin-bottom: var(--s-5); }
.section-num { font-family: var(--mono); font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent-2); }
.section-title { font-family: var(--sans); font-size: var(--fs-h2); line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; }
.section-title em { font-style: italic; font-family: var(--serif); font-weight: 400; color: var(--accent-2); letter-spacing: -0.01em; }
.section-title-md { font-size: clamp(28px, 3.5vw, 48px); }
.section-title-big { font-size: clamp(38px, 4.6vw, 72px); }

/* About */
.about-body { display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--s-9); border-top: 1px solid var(--rule); padding-top: var(--s-7); margin-bottom: var(--s-9); }
.about-body-compact { grid-template-columns: 0.9fr 1.5fr; gap: var(--s-8); margin-bottom: 0; }
.about-lead { display: flex; flex-direction: column; gap: var(--s-4); }
.lead-mark { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); }
.about-lead > p:not(.lead-mark) { font-family: var(--sans); font-size: clamp(18px, 1.8vw, 24px); line-height: 1.55; font-weight: 500; color: var(--ink); text-wrap: pretty; word-break: break-word; line-break: strict; }
.about-text { display: flex; flex-direction: column; gap: var(--s-5); }
.about-text p { font-family: var(--sans); font-size: 16px; line-height: 1.85; color: var(--ink-2); text-wrap: pretty; word-break: break-word; line-break: strict; }
.about-text em { font-style: normal; color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--accent); padding-bottom: 1px; }
.about-tags { grid-column: 1 / -1; display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-5); }
.about-tags li { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; border: 1px solid var(--rule-2); padding: 8px 14px; border-radius: 999px; color: var(--ink-2); transition: background 0.3s, color 0.3s, border-color 0.3s; }
.about-tags li:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.about-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule); }
.stat { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-6) var(--s-4) 0 0; border-right: 1px solid var(--rule); }
.stat:last-child { border-right: none; }
.stat-num { font-family: var(--sans); font-size: clamp(48px, 6vw, 88px); font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--ink); }
.stat-num em { font-size: 0.5em; font-style: italic; font-family: var(--serif); color: var(--accent-2); vertical-align: super; font-weight: 400; }
.stat-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }

/* Services */
.services-list { border-top: 1px solid var(--rule); }
.service-row { display: grid; grid-template-columns: 70px 1fr 60px; gap: var(--s-5); align-items: start; padding: var(--s-7) 0; border-bottom: 1px solid var(--rule); position: relative; transition: padding 0.4s ease; }
.service-row::before { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleY(0); transform-origin: bottom; transition: transform 0.5s cubic-bezier(0.6,0,0.2,1); z-index: -1; margin: 0 calc(var(--gutter) * -1); }
.service-row:hover::before { transform: scaleY(1); transform-origin: top; }
.service-row:hover { color: var(--bg); padding-left: var(--s-5); padding-right: var(--s-5); }
.service-row:hover .srv-num, .service-row:hover .srv-zh, .service-row:hover .srv-desc { color: inherit; opacity: 0.95; }
.service-row:hover .srv-mark { transform: translateX(8px); color: var(--accent-2); }
.srv-num { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; color: var(--ink-3); transition: color 0.3s; }
.srv-titles { display: flex; flex-direction: column; gap: 6px; }
.srv-en { font-family: var(--serif); font-size: clamp(28px, 3vw, 44px); font-style: italic; font-weight: 400; line-height: 1.05; letter-spacing: -0.01em; }
.srv-zh { font-family: var(--sans); font-size: 14px; font-weight: 500; letter-spacing: 0.05em; color: var(--ink-3); transition: color 0.3s; }
.srv-desc { grid-column: 2 / 3; font-family: var(--sans); font-size: 14px; line-height: 1.7; color: var(--ink); opacity: 0.7; max-width: 640px; margin-top: 4px; transition: color 0.3s, opacity 0.3s; text-wrap: pretty; word-break: break-word; line-break: strict; }
.srv-mark { justify-self: end; font-family: var(--serif); font-size: 28px; color: var(--ink-3); transition: transform 0.4s ease, color 0.3s; }

/* Works */
.works-head { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); align-items: end; margin-bottom: var(--s-7); }
.works-intro { font-family: var(--sans); font-size: 16px; line-height: 1.8; color: var(--ink-2); max-width: 460px; text-wrap: pretty; word-break: break-word; line-break: strict; }

.works-filter { display: flex; gap: var(--s-2); flex-wrap: wrap; padding: var(--s-5) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: var(--s-7); }
.filter-btn { display: inline-flex; align-items: baseline; gap: 6px; padding: 10px 16px; border: 1px solid transparent; border-radius: 999px; font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink-2); transition: background 0.25s, color 0.25s, border-color 0.25s; }
.filter-btn:hover { color: var(--ink); }
.filter-btn .filter-count { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--ink-3); }
.filter-btn.active { background: var(--ink); color: var(--bg); }
.filter-btn.active .filter-count { color: var(--accent-2); }

.cases-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-7) var(--s-6); }
.case-card { display: flex; flex-direction: column; gap: var(--s-4); transition: opacity 0.4s ease, transform 0.4s ease; }
.case-card.hidden { display: none; }
.case-card.fade-in { animation: caseFadeIn 0.5s ease both; }
@keyframes caseFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.case-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-2); }
.case-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s cubic-bezier(0.2,0.8,0.2,1), filter 0.5s; filter: grayscale(0.15); }
.case-media.is-contain { background: var(--bg-2); }
.case-media.is-contain img { object-fit: contain; }
.case-card:hover .case-media img { transform: scale(1.04); filter: grayscale(0); }
.case-hover { position: absolute; top: var(--s-4); right: var(--s-4); display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--bg); color: var(--ink); border-radius: 999px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0; transform: translateY(-6px); transition: opacity 0.3s, transform 0.3s; }
.case-card:hover .case-hover { opacity: 1; transform: translateY(0); }
.hover-arrow { font-family: var(--serif); font-size: 14px; }
.case-media-placeholder { background: repeating-linear-gradient(-45deg, var(--bg-2), var(--bg-2) 14px, var(--bg) 14px, var(--bg) 28px); display: flex; align-items: center; justify-content: center; }
.placeholder-stripe { background: var(--bg); padding: var(--s-3) var(--s-5); display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--ink-3); }
.case-info { display: flex; flex-direction: column; gap: var(--s-2); }
.case-cat { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-2); }
.case-client { font-family: var(--sans); font-size: clamp(20px, 2vw, 28px); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); }
.case-name { font-family: var(--sans); font-size: 15px; color: var(--ink-2); line-height: 1.4; }
.case-year { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--ink-3); margin-top: 4px; }

.cases-empty { padding: var(--s-9) 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s-4); border: 1px dashed var(--rule); }
.empty-mark { font-family: var(--serif); font-size: 48px; color: var(--ink-3); font-style: italic; }
.cases-empty p { font-family: var(--sans); font-size: 16px; color: var(--ink-2); line-height: 1.6; }

/* Clients marquee */
.section-clients { padding: var(--s-9) 0; max-width: var(--max-w); margin: 0 auto; }
.clients-head { padding: 0 var(--gutter); margin-bottom: var(--s-5); }
.clients-marquee { display: flex; flex-direction: column; gap: var(--s-5); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: var(--s-7) 0; overflow: hidden; }
.clients-row { display: flex; gap: var(--s-5); width: max-content; align-items: center; font-family: var(--serif); font-style: italic; font-size: clamp(18px, 2.2vw, 32px); font-weight: 400; letter-spacing: -0.01em; color: var(--ink); }
.clients-row .dot { color: var(--accent-2); }
.clients-row span:not(.dot) { transition: color 0.3s; font-style: normal; font-family: var(--sans); font-weight: 600; }
.clients-row span:not(.dot):hover { color: var(--accent-2); font-style: italic; font-family: var(--serif); font-weight: 400; }
.clients-row-a { animation: clientsScroll 60s linear infinite; }
.clients-row-b { animation: clientsScrollReverse 75s linear infinite; }
@keyframes clientsScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes clientsScrollReverse { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* Archive */
.archive-table { border-top: 1px solid var(--ink); }
.archive-row { display: grid; grid-template-columns: 60px 1fr 240px 80px; gap: var(--s-5); align-items: center; padding: var(--s-5) 0; border-bottom: 1px solid var(--rule); font-size: 15px; position: relative; transition: padding 0.3s, color 0.3s; }
.archive-row::before { content: ""; position: absolute; left: calc(var(--gutter) * -1); right: calc(var(--gutter) * -1); top: 0; bottom: 0; background: var(--accent); opacity: 0; transition: opacity 0.3s; z-index: -1; }
.archive-row:not(.archive-head):hover::before { opacity: 0.08; }
.archive-row:not(.archive-head):hover { padding-left: var(--s-3); }
.archive-head { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--rule-2); }
.col-num { font-family: var(--mono); font-size: 12px; color: var(--ink-3); letter-spacing: 0.1em; }
.col-name { font-family: var(--sans); font-weight: 500; color: var(--ink); }
.col-cat { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-2); }
.col-year { font-family: var(--mono); font-size: 13px; color: var(--ink-2); letter-spacing: 0.05em; text-align: right; }

/* Contact */
.contact-promise { font-family: var(--sans); font-size: 14px; color: var(--ink-2); line-height: 1.7; margin-top: var(--s-3); padding-top: var(--s-4); border-top: 1px solid var(--rule); max-width: 560px; text-wrap: pretty; word-break: break-word; line-break: strict; }
.contact-grid { display: grid; grid-template-columns: 0.8fr 1.4fr; gap: var(--s-9); border-top: 1px solid var(--rule); padding-top: var(--s-7); }
.contact-info { display: flex; flex-direction: column; gap: var(--s-6); }
.info-block { display: flex; flex-direction: column; gap: 6px; }
.info-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-3); }
.info-block a { font-family: var(--sans); font-size: 18px; font-weight: 500; color: var(--ink); position: relative; width: fit-content; }
.info-block a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.4s cubic-bezier(0.6,0,0.2,1); }
.info-block a:hover::after { transform: scaleX(1); }
.info-block p { font-family: var(--sans); font-size: 17px; color: var(--ink); }

.contact-form { display: flex; flex-direction: column; gap: var(--s-5); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); }
.field input, .field select, .field textarea { background: transparent; border: none; border-bottom: 1px solid var(--rule-2); padding: 14px 0; font-family: var(--sans); font-size: 17px; color: var(--ink); outline: none; resize: none; transition: border-color 0.3s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); opacity: 0.6; }
.field select { cursor: pointer; }
.form-submit { display: inline-flex; align-items: center; justify-content: space-between; width: fit-content; min-width: 280px; padding: 18px 28px; margin-top: var(--s-3); background: var(--ink); color: var(--bg); border-radius: 999px; font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; transition: background 0.3s, transform 0.3s; }
.form-submit:hover { background: var(--accent); transform: translateX(4px); }
.submit-arrow { font-family: var(--serif); font-size: 22px; }

/* Footer */
.footer { background: var(--bg); color: var(--ink); padding: var(--s-9) var(--gutter) var(--s-5); margin-top: var(--s-9); }
.footer-top { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--s-7); align-items: start; max-width: var(--max-w); margin: 0 auto; padding-bottom: var(--s-7); border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-mark { display: flex; flex-direction: column; gap: var(--s-3); }
.footer-word { font-family: var(--serif); font-size: clamp(48px, 7vw, 96px); font-style: italic; line-height: 1; letter-spacing: -0.03em; color: var(--accent-2); }
.footer-word-img { font-style: normal; display: block; }
.footer-word-img img { display: block; width: clamp(140px, 20vw, 240px); height: auto; }
.footer-zh { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.6; }
.footer-nav { display: flex; flex-direction: column; gap: var(--s-3); }
.footer-nav a { font-family: var(--sans); font-size: 14px; opacity: 0.7; transition: opacity 0.3s, transform 0.3s; width: fit-content; }
.footer-nav a:hover { opacity: 1; transform: translateX(6px); }
.footer-social { display: flex; flex-direction: column; gap: var(--s-3); }
.footer-social a { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.7; transition: opacity 0.3s, color 0.3s; }
.footer-social a:hover { opacity: 1; color: var(--accent-2); }
.footer-bottom { display: flex; justify-content: space-between; max-width: var(--max-w); margin: 0 auto; padding-top: var(--s-5); font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.4; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16,1,0.3,1); }
.reveal.visible { opacity: 1; transform: none; }

/* Tweaks panel */
.tweaks { position: fixed; bottom: 24px; right: 24px; width: 280px; background: var(--bg); border: 1px solid var(--ink); z-index: 100; font-family: var(--sans); box-shadow: 0 20px 60px rgba(0,0,0,0.18); transform-origin: bottom right; animation: tweaksIn 0.4s cubic-bezier(0.2,0.8,0.2,1); }
@keyframes tweaksIn { from { opacity: 0; transform: scale(0.9) translateY(10px); } to { opacity: 1; transform: none; } }
.tweaks-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--rule); background: var(--ink); color: var(--bg); }
.tweaks-title { font-family: var(--mono); font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; }
.tweaks-close { font-size: 22px; line-height: 1; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.tweaks-body { padding: 16px; display: flex; flex-direction: column; gap: 18px; max-height: 70vh; overflow-y: auto; }
.tweak-section { display: flex; flex-direction: column; gap: 8px; }
.tweak-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); }
.tweak-radios { display: flex; gap: 4px; }
.tweak-radios button { flex: 1; padding: 8px 10px; border: 1px solid var(--rule-2); font-family: var(--sans); font-size: 12px; color: var(--ink-2); transition: background 0.2s, color 0.2s, border-color 0.2s; }
.tweak-radios button:hover { border-color: var(--ink); color: var(--ink); }
.tweak-radios button.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tweak-swatches button { aspect-ratio: 1; padding: 0; position: relative; }
.tweak-swatches button::before { content: ""; position: absolute; inset: 4px; background: var(--swatch); border-radius: 50%; }
.tweaks-foot { padding: 10px 16px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); }

/* Responsive */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.open { display: flex; flex-direction: column; position: fixed; inset: 0; background: var(--bg); color: var(--ink); padding: 100px var(--gutter) var(--s-7); gap: var(--s-5); z-index: 70; pointer-events: auto; }
  .nav-links.open a { color: var(--ink); font-size: 28px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-foot { grid-template-columns: 1fr 1fr; }
  .hero-cta { grid-column: 1 / -1; justify-self: start; margin-top: var(--s-3); }
  .hero-img-wrap { aspect-ratio: 16 / 9; }
  .about-body { grid-template-columns: 1fr; gap: var(--s-6); }
  .about-stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .service-row { grid-template-columns: 50px 1fr 40px; }
  .service-row .srv-desc { grid-column: 2 / 3; }
  .works-head { grid-template-columns: 1fr; gap: var(--s-4); }
  .cases-grid { gap: var(--s-6); }
  .archive-row { grid-template-columns: 40px 1fr 100px; gap: var(--s-3); font-size: 14px; }
  .col-cat { display: none; }
  .contact-grid { grid-template-columns: 1fr; gap: var(--s-7); }
  .footer-top { grid-template-columns: 1fr; gap: var(--s-5); }
}
@media (max-width: 768px) {
  .cases-grid { grid-template-columns: 1fr; }
  .hero-foot { grid-template-columns: 1fr; gap: var(--s-4); }
}
@media (max-width: 640px) {
  :root { --fs-display: clamp(36px, 10.5vw, 54px); --fs-h2: clamp(27px, 7.6vw, 42px); }
  .hero-headline { line-height: 1.03; letter-spacing: -0.015em; }
  .section-title-big { font-size: clamp(38px, 12vw, 60px); }
  .form-row { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .tweaks { width: calc(100vw - 32px); right: 16px; bottom: 16px; }
  /* filter: one swipeable row instead of wrapping into a messy block */
  .works-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 calc(var(--gutter) * -1) var(--s-7); padding: var(--s-5) var(--gutter); }
  .works-filter::-webkit-scrollbar { display: none; }
  .filter-btn { flex: 0 0 auto; }
}
/* Touch devices: keep the "open case" cue visible and drop hover-only grayscale */
@media (hover: none) {
  .case-hover { opacity: 1; transform: none; }
  .case-media img { filter: grayscale(0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .hero-headline .line-inner { transform: none; }
}

/* ════════════════════════════════════════════════════════════════
   Centered layout — everything reads from the middle
   ════════════════════════════════════════════════════════════════ */
body { text-align: center; }

/* Hero headline — one unified serif, smaller */
[data-type="sans"] .hero-headline,
.hero-headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.2vw, 88px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
[data-type="sans"] .hero-headline em,
.hero-headline em { font-family: var(--serif); font-style: italic; font-weight: 400; }

/* ── home ── */
.hero-meta { justify-content: center; gap: var(--s-5); flex-wrap: wrap; }
.hero-zh { grid-column: 1 / -1; margin-left: auto; margin-right: auto; }
.zh-large, .about-text p, .about-lead > p, .srv-desc,
.works-intro, .contact-promise { margin-left: auto; margin-right: auto; }
.hero-foot { justify-items: center; }
.hero-cta { grid-column: 1 / -1; justify-self: center; }
.about-body, .about-body-compact { grid-template-columns: 1fr; }
.about-tags { justify-content: center; }
.section-head, .works-head { grid-template-columns: 1fr; justify-items: center; }
.section-title, .works-intro { margin-left: auto; margin-right: auto; }
.works-filter { justify-content: center; }
.service-row { grid-template-columns: 1fr; gap: var(--s-2); }
.srv-titles { align-items: center; }
.srv-mark { justify-self: center; }
.contact-grid, .footer-top { grid-template-columns: 1fr; justify-items: center; }
.contact-info { justify-items: center; }
.form-submit { margin-left: auto; margin-right: auto; }
.footer-mark, .footer-nav { align-items: center; }
.footer-bottom { justify-content: center; gap: var(--s-5); flex-wrap: wrap; }
.footer-nav a:hover { transform: none; }
/* typing in a centred box is awkward — keep inputs left-read */
.field input, .field textarea, .field select { text-align: left; }

/* ── case pages (.case-detail beats their inline <style>) ── */
.case-detail .cd-hero-grid { justify-items: center; }
.case-detail .cd-back { justify-self: center; }
.case-detail .cd-back:hover { gap: 10px; }
.case-detail .cd-meta-row { justify-content: center; }
.case-detail .cd-subtitle,
.case-detail .cd-pillar-p { margin-left: auto; margin-right: auto; }
.case-detail .cd-intro,
.case-detail .cd-approach,
.case-detail .cd-deliv,
.case-detail .cd-credits-wrap,
.case-detail .cd-next-wrap { grid-template-columns: 1fr; justify-items: center; }
.case-detail .cd-pillar { grid-template-columns: 1fr; gap: var(--s-2); }
.case-detail .cd-pillar-num { padding-top: 0; }
.case-detail .cd-gallery-head { justify-content: center; gap: var(--s-4); }
.case-detail .cd-credits-grid { justify-items: center; }
.case-detail .cd-credit-row { align-items: center; }
.case-detail .cd-next-meta { justify-content: center; }
.case-detail .cd-grid-item-cap { left: 50%; transform: translateX(-50%); }

/* Hero headline — one font, one colour, no italic */
[data-type="sans"] .hero-headline em,
.hero-headline em {
  font-family: var(--serif);
  font-style: normal;
  font-weight: 400;
  color: inherit;
  letter-spacing: inherit;
}

/* Services — stack + centre (override the old 3-column grid placement) */
.service-row { grid-template-columns: 1fr; gap: var(--s-3); justify-items: center; }
.service-row .srv-num,
.service-row .srv-titles,
.service-row .srv-desc { grid-column: auto; }
.service-row .srv-desc { margin-left: auto; margin-right: auto; max-width: 60ch; }
.service-row .srv-titles { align-items: center; }
.srv-en { font-style: normal; }

/* Tighter vertical rhythm — 208px sections left cavernous gaps once centred */
:root { --section-y: clamp(64px, 8vw, 120px); }

/* max-width blocks were left-aligned, not centred — give them auto margins */
.section-head, .works-head, .about-body, .services-list,
.contact-grid, .cases-grid { margin-left: auto; margin-right: auto; }

/* ── English display type — geometric sans (Poppins); CJK falls back to Noto Sans TC ── */
:root { --display: 'Poppins', 'Noto Sans TC', 'Helvetica Neue', Arial, sans-serif; }

.hero-headline, [data-type="sans"] .hero-headline,
.hero-headline em, [data-type="sans"] .hero-headline em,
.section-title, [data-type="sans"] .section-title,
.section-title em, [data-type="sans"] .section-title em,
.srv-en, [data-type="sans"] .srv-en,
.case-client, [data-type="sans"] .case-client,
.clients-row, [data-type="sans"] .clients-row,
.footer-word, [data-type="sans"] .footer-word,
.intro-word, [data-type="sans"] .intro-word,
.case-detail .cd-title, .case-detail .cd-title em,
.case-detail .cd-approach-title,
.case-detail .cd-gallery-h,
.case-detail .cd-outcome-h,
.case-detail .cd-next-h, .case-detail .cd-next-h em {
  font-family: var(--display);
}
.hero-headline, [data-type="sans"] .hero-headline { font-weight: 500; letter-spacing: -0.02em; }

/* Intro curtain — bump the Chinese lockup a touch */
.intro-zh { font-size: 14px; }

/* Hero headline — all white, fully uniform */
.hero-headline, [data-type="sans"] .hero-headline,
.hero-headline em, [data-type="sans"] .hero-headline em { color: var(--ink); }

/* Gallery — boxes hug their photo's own aspect (set inline), so no crop and no colour fill */
.case-detail .cd-grid-item.span-half { grid-column: span 6; }
.case-detail .cd-grid-item.span-half-centre { grid-column: 4 / span 6; }
.case-detail .cd-grid-item { background: transparent; }
.case-detail .cd-hero-img { background: transparent; aspect-ratio: auto; }
@media (max-width: 768px) {
  .case-detail .cd-grid-item.span-half,
  .case-detail .cd-grid-item.span-half-centre { grid-column: 1 / -1; }
}

/* Hero headline <em> — inherit EVERYTHING; it must be indistinguishable from the rest */
.hero-headline em,
[data-type="sans"] .hero-headline em,
[data-type="serif"] .hero-headline em,
[data-type="mixed"] .hero-headline em {
  font-family: inherit;
  font-weight: inherit;
  font-style: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  color: inherit;
}

/* Hero — match AJA's actual Poppins settings: normal tracking, 1.25 line-height */
.hero-headline, [data-type="sans"] .hero-headline {
  letter-spacing: normal;
  line-height: 1.25;
}

/* Approach pillars — bigger now the "三個切角" heading is gone */
.case-detail .cd-pillar-h { font-size: clamp(28px, 3vw, 44px); }
.case-detail .cd-pillar-p { font-size: 18px; line-height: 1.9; max-width: 64ch; }

/* Approach — drop the pillars' top rule (doubled up once the heading was removed) */
.case-detail .cd-pillars { border-top: none; }

/* Portrait photos: cap the width so they don't grow taller than the screen */
.case-detail .cd-grid-item.is-portrait { max-width: 400px; justify-self: center; width: 100%; }
.case-detail .cd-hero-img.is-portrait { max-width: 500px; }

/* Approach — hero already draws a divider underneath itself; drop the second rule */
.case-detail .cd-approach { border-top: none; }

/* ════════════════════════════════════════════════════════════════
   Chinese type, AJA-style
   1. light weight (they use 300, not 500/700)
   2. POSITIVE tracking (they use +0.02em; negative cramps CJK)
   3. restrained size (their CJK H1 is 36px while English display is 72px)
   ════════════════════════════════════════════════════════════════ */
.section-title, [data-type="sans"] .section-title,
.section-title em, [data-type="sans"] .section-title em,
.section-title-big,
.zh-large, .srv-zh,
.about-lead > p:not(.lead-mark),
.case-detail .cd-title, .case-detail .cd-title em,
.case-detail .cd-subtitle,
.case-detail .cd-pillar-h,
.case-detail .cd-gallery-h,
.case-detail .cd-outcome-h,
.case-detail .cd-next-h, .case-detail .cd-next-h em {
  font-weight: 300;
  letter-spacing: 0.02em;
}
.case-client, [data-type="sans"] .case-client { font-weight: 400; letter-spacing: 0.01em; }

/* CJK display sizes — let English be the big voice, Chinese stays modest */
.case-detail .cd-title { font-size: clamp(30px, 3.6vw, 56px); line-height: 1.35; }
.section-title { font-size: clamp(28px, 3.4vw, 52px); line-height: 1.3; }
.section-title-big { font-size: clamp(30px, 3.8vw, 60px); line-height: 1.35; }
.case-detail .cd-next-h { font-size: clamp(28px, 3.4vw, 52px); line-height: 1.3; }
.case-detail .cd-gallery-h { font-size: clamp(24px, 2.4vw, 36px); }

/* Chinese at 300 was unreadable on the blue ground — restore the previous weights
   (AJA can run 300 because their background is near-white; ours is mid-blue) */
.section-title, [data-type="sans"] .section-title,
.section-title em, [data-type="sans"] .section-title em,
.section-title-big,
.srv-zh,
.about-lead > p:not(.lead-mark),
.case-client, [data-type="sans"] .case-client,
.case-detail .cd-title, .case-detail .cd-title em { font-weight: 500; }

.zh-large,
.case-detail .cd-subtitle { font-weight: 400; }

.case-detail .cd-pillar-h,
.case-detail .cd-gallery-h,
.case-detail .cd-outcome-h,
.case-detail .cd-next-h, .case-detail .cd-next-h em { font-weight: 700; }

/* Nudge the CJK display back up — 56/52 read too small */
.case-detail .cd-title { font-size: clamp(34px, 4.2vw, 66px); }
.section-title { font-size: clamp(32px, 4vw, 66px); }
.case-detail .cd-next-h { font-size: clamp(30px, 3.8vw, 60px); }

/* Hero — the Chinese line was pulled up (negative margin) and stuck under the descenders; give it room */
.hero-zh { margin-top: var(--s-6); }
.hero-headline { line-height: 1.32; }

/* Contact — make the email link match the plain info text (same font/size/weight) */
.info-block a { font-family: var(--sans); font-size: 17px; font-weight: 400; }

/* Contact — the email <a> has width:fit-content; centre it inside the flex column */
.info-block { align-items: center; }

/* ── Gallery grouped by orientation: same-orientation photos share a size ── */
.case-detail .cd-grid-item.g-l    { grid-column: span 6; }        /* landscape — 2 per row */
.case-detail .cd-grid-item.g-l-c  { grid-column: 4 / span 6; }    /* lone landscape, centred */
.case-detail .cd-grid-item.g-p    { grid-column: span 4; }        /* portrait — 3 per row */
.case-detail .cd-grid-item.g-p-c1 { grid-column: 5 / span 4; }    /* 1 left over, centred */
.case-detail .cd-grid-item.g-p-c2 { grid-column: 3 / span 4; }    /* 2 left over, centred pair */
.case-detail .cd-grid-item { max-width: none; }                   /* drop the old portrait cap */
@media (max-width: 768px) {
  .case-detail .cd-grid { grid-template-columns: 1fr 1fr; }
  .case-detail .cd-grid-item,
  .case-detail .cd-grid-item.g-l, .case-detail .cd-grid-item.g-l-c,
  .case-detail .cd-grid-item.g-p, .case-detail .cd-grid-item.g-p-c1,
  .case-detail .cd-grid-item.g-p-c2 { grid-column: auto !important; }
}
@media (max-width: 520px) {
  .case-detail .cd-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════
   Mobile reading optimisation
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* the hard <br> line-breaks were tuned for desktop — let phones wrap naturally */
  .about-text p br, .about-lead > p br, .zh-large br { display: none; }

  /* body copy: bigger + looser so it's comfortable on a small screen */
  .about-text p, .srv-desc, .works-intro, .contact-promise { font-size: 16px; line-height: 1.9; }
  .zh-large { font-size: 19px; line-height: 1.75; }
  .about-lead > p:not(.lead-mark) { font-size: 19px; line-height: 1.75; }

  /* keep text off the screen edges */
  .about-text p, .srv-desc, .works-intro, .contact-promise,
  .zh-large, .about-lead > p { padding-left: 4px; padding-right: 4px; }

  /* hero: tighter so the headline + CTA fit one screen */
  .hero-headline { font-size: clamp(30px, 8.5vw, 44px); line-height: 1.28; }
  .hero-meta { font-size: 10px; gap: var(--s-3); }
  .hero-foot { gap: var(--s-4); }

  /* case pages */
  .case-detail .cd-hero { padding-top: clamp(96px, 22vw, 140px); }
  .case-detail .cd-subtitle { font-size: 17px; line-height: 1.85; }
  .case-detail .cd-pillar-h { font-size: 22px; }
  .case-detail .cd-pillar-p { font-size: 16px; line-height: 1.95; }
  .case-detail .cd-meta-row { gap: var(--s-3); font-size: 10px; }
  .case-detail .cd-credit-val { font-size: 15px; line-height: 1.7; }
  .case-detail .cd-next-h { font-size: clamp(24px, 7vw, 34px); }

  /* tap targets ≥ 44px */
  .filter-btn { padding: 12px 18px; }
  .nav-links.open a { padding: 10px 0; }
  .form-submit { padding: 16px 28px; }
  .info-block a { padding: 6px 0; display: inline-block; }

  /* forms: 16px stops iOS zooming in on focus */
  .field input, .field select, .field textarea { font-size: 16px; }
  .field { text-align: left; }
}

/* very small phones */
@media (max-width: 380px) {
  .hero-headline { font-size: 28px; }
  .section-title { font-size: 26px; }
  .case-detail .cd-title { font-size: 26px; }
}

/* Filter row scrolls horizontally on phones — centring it clips the first chip
   off the left edge, so start from the left and let it scroll. */
@media (max-width: 640px) {
  .works-filter { justify-content: flex-start; scroll-padding-left: var(--gutter); }
}

/* Belt-and-braces: nothing may ever push the page wider than the phone screen */
html, body { max-width: 100%; overflow-x: hidden; }
@media (max-width: 640px) {
  .hero-meta .meta-line,
  .hero-foot-col p,
  .foot-label, .section-num, .lead-mark,
  .case-detail .cd-meta-row,
  .case-detail .cd-credit-val { overflow-wrap: anywhere; word-break: break-word; }
  .hero-meta { letter-spacing: 0.12em; }
  .hero-foot-col p { font-size: 13px; letter-spacing: 0; }
  .case-detail .cd-credit-val { font-size: 14px; }
}

/* iOS Safari inflates body text on its own ("text autosizing"), which blew the
   layout past the screen on iPhone while every desktop engine measured fine. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Hero is the one block iOS "font boosting" hits hardest — make it physically
   impossible for the headline to exceed the screen even if Safari inflates it. */
.hero, .hero-grid, .hero-meta, .hero-headline, .hero-zh, .hero-foot { max-width: 100%; min-width: 0; }
.hero-headline, .hero-headline .line, .hero-headline .line-inner {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
}
.hero-headline .line-inner { display: block; }   /* inline-block could shrink-wrap wider than the box */
@media (max-width: 640px) {
  .hero-meta { flex-direction: column; gap: var(--s-2); }
  .hero-meta .meta-line { max-width: 100%; }
}

/* Phone hero: smaller type + each sentence held on ONE line (no mid-phrase wrap) */
@media (max-width: 640px) {
  [data-type="sans"] .hero-headline, .hero-headline {
    font-size: 26px;
    line-height: 1.35;
  }
  .hero-headline .line-inner { white-space: nowrap; }   /* keep each sentence intact */
}
@media (max-width: 380px) {
  [data-type="sans"] .hero-headline, .hero-headline { font-size: 23px; }
}

/* ════════════════════════════════════════════════════════════════
   "View case" badge — must never cover the photo's subject
   ════════════════════════════════════════════════════════════════
   It used to sit top-right, straight over the focal point of most
   shots. Desktop keeps it, but parked in the bottom-right corner and
   only while hovering. Touch devices get no overlay at all — there is
   no hover state to dismiss it, so the arrow moves next to the client
   name where it can't hide anything. */
.case-hover {
  top: auto;
  bottom: var(--s-4);
  right: var(--s-4);
  transform: translateY(6px);
  background: var(--ink);
  color: var(--bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.case-card:hover .case-hover { transform: translateY(0); }

/* ── 外連箭頭 ─────────────────────────────────────────
   U+2197「↗」帶有 emoji presentation，iOS 會自動把它渲染成彩色
   emoji，跟版面完全不搭。改成向量繪製：用 mask 把 SVG 當形狀、
   顏色交給 background-color，所以它會跟著文字色與主題走。
   路徑和 hero 的「View Projects」按鈕是同一條，維持一致的語彙。 */
:root {
  --arrow-ne: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M1 13L13 1M13 1H4M13 1V10' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.hover-arrow,
.case-client::after {
  display: inline-block;
  background-color: currentColor;
  -webkit-mask: var(--arrow-ne) no-repeat center / contain;
          mask: var(--arrow-ne) no-repeat center / contain;
}
.hover-arrow { width: 10px; height: 10px; }

@media (hover: none) {
  .case-hover { display: none; }
  .case-client::after {
    content: "";
    width: 0.4em;
    height: 0.4em;
    margin-left: 0.5em;
    vertical-align: 0.14em;
    color: var(--accent-2);
  }
}

/* ── 手機：專案之間要看得出斷點 ─────────────────────────
   單欄堆疊時，一張圖緊接著下一張圖，滑動時分不出哪段文字屬於
   哪個案子。線畫在卡片自己身上（不是用相鄰選擇器），篩選隱藏卡片時
   線會跟著整張一起消失，不會留下孤立的橫線。 */
@media (max-width: 768px) {
  .cases-grid { gap: var(--s-7); }
  .case-card { padding-bottom: var(--s-6); border-bottom: 1px solid var(--rule); }
  .case-card:last-child { padding-bottom: 0; border-bottom: none; }
}

/* ════════════════════════════════════════════════════════════════
   No orphans — never leave one word (or one 字) alone on a line
   ════════════════════════════════════════════════════════════════ */
.section-title,
.contact-promise,
.works-intro,
.cd-next-h, .case-detail .cd-next-h,
.cd-title, .case-detail .cd-title,
.cd-subtitle, .case-detail .cd-subtitle,
.cd-pillar-h, .case-detail .cd-pillar-h {
  text-wrap: balance;          /* modern engines even out the last line   */
  text-wrap: pretty;           /* …falls back to pretty where balance N/A */
}
.cd-title, .case-detail .cd-title,
.section-title, .cd-next-h, .case-detail .cd-next-h { text-wrap: balance; }

/* A <br> splits the title into two logical lines, but the balancer only ever
   looks at the block as a whole — so the second half kept stranding its last
   character. Each half is its own block, and balances on its own. */
.cd-title .cd-tline, .case-detail .cd-title .cd-tline {
  display: block;
  text-wrap: balance;
}
/* The brand line ("Kärcher 凱馳") fits on one line, but balance kept splitting
   it in two to even the widths — stranding the Chinese half. pretty only steps
   in to avoid a real orphan, so a line that fits simply stays whole. */
.cd-title .cd-tline:first-child,
.case-detail .cd-title .cd-tline:first-child { text-wrap: normal; }

/* CJK line-breaking: a Chinese run has no spaces, so the browser will happily
   snap it mid-word ("新/品", "企/劃"). keep-all forbids that — the title now
   only ever wraps at a space or at a <wbr> we placed on a real phrase boundary,
   so no word and no compound ever splits across two lines. break-word is the
   safety net if a single unbreakable run is still wider than the column. */
.cd-title, .case-detail .cd-title,
.cd-title .cd-tline, .case-detail .cd-title .cd-tline,
.cd-next-h, .case-detail .cd-next-h {
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;   /* 避頭尾 — never start a line on 。、！？ etc. */
}

@media (max-width: 640px) {
  /* 15-字 titles cannot fit a 353px screen at 34px — shrink a notch so the
     balanced break lands mid-phrase instead of stranding the last character */
  .case-detail .cd-title { font-size: clamp(26px, 7.4vw, 30px); line-height: 1.3; }
  /* Latin sentences that are one word too long for the line */
  .contact-promise .en, .form-note, .info-block a { text-wrap: pretty; }
}

/* ════════════════════════════════════════════════════════════════
   Contact form — Netlify Forms
   ════════════════════════════════════════════════════════════════ */

/* Honeypot: has to exist in the DOM for bots to find, but never be seen or
   focused by a real visitor. display:none would let some bots skip it. */
.form-hp {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.form-status {
  margin-top: var(--s-4);
  padding: 14px 18px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  text-wrap: pretty;
  border: 1px solid var(--rule-2);
  border-radius: 2px;
}
.form-status[data-kind="ok"]   { color: var(--ink);   background: rgba(22,24,28,0.07); }
.form-status[data-kind="warn"] { color: var(--ink-2); background: rgba(22,24,28,0.12); }

.form-submit[disabled] { opacity: 0.55; cursor: default; }


/* ════════════════════════════════════════════════════════════════
   Skip link — 鍵盤使用者可跳過導覽直接進主要內容
   ════════════════════════════════════════════════════════════════ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 14px 22px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; }

/* Footer 聯絡信箱 */
.footer-contact { margin-top: var(--s-3); }
.footer-contact a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: color 0.3s, border-color 0.3s;
}
.footer-contact a:hover { color: var(--accent-2); border-color: var(--accent); }

/* 可見的鍵盤焦點框（原本只有瀏覽器預設，藍底上幾乎看不到） */
a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
