/* CW Group website styles.
   Design approved 9 October 2026 (Specification section K): Version 1.1.
   Colours, fonts and elements follow docs/03_CW_Brand_Guidelines.md (Part 2). */

/* ---------- Tokens ---------- */
:root {
  --primary: #1C3B38; --primary-deep: #132A28;
  --accent: #B08D57; --accent-soft: #D9C08F;
  --on-primary: #DCE3D9; --on-primary-muted: #A9B8AE; --on-accent: #1B2E24;
  --ground: #F2F4F0; --ground-alt: #E4E9E2;
  --ink: #222B26; --ink-soft: #51605A; --rule: #D3D9D0;
  --heading: #1C3B38;
  --serif: 'Noto Serif TC', 'Songti TC', 'PMingLiU', Georgia, serif;
  --sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', 'Helvetica Neue', Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #18211F; --ground-alt: #1F2A27;
    --ink: #E8EDE6; --ink-soft: #B9C4BD; --rule: #34413D; --heading: #E8EDE6;
    color-scheme: dark;
  }
}
/* English: Albert Sans (chosen by Jack and Bill, October 2026). Chinese keeps Noto Serif TC / Noto Sans TC. */
html[data-lang="en"] {
  --serif: 'Albert Sans', 'Noto Sans TC', 'Helvetica Neue', Arial, sans-serif;
  --sans: 'Albert Sans', 'Noto Sans TC', 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--sans); font-size: 18px; line-height: 1.75;
}
@media (min-width: 900px) { body { font-size: 19px; } }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.4; margin: 0; color: var(--heading); }
h2 { font-size: clamp(28px, 3.4vw, 40px); }
h3 { font-size: 21px; font-weight: 500; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 16px; }
.skip:focus { left: 12px; top: 12px; }

/* Language: Traditional Chinese by default; the button switches */
html[data-lang="zh"] .en, html[data-lang="en"] .zh { display: none; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 700px) { .wrap { padding: 0 40px; } }
section { padding: 72px 0; }
@media (min-width: 900px) { section { padding: 112px 0; } }
section[id] { scroll-margin-top: 72px; }

/* ---------- Header and footer ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--primary); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.logo img { height: 28px; width: auto; }
.nav { display: none; gap: 32px; margin-left: auto; }
.nav a { color: var(--on-primary); text-decoration: none; font-size: 18px; }
.nav a:hover { color: var(--accent-soft); }
@media (min-width: 860px) { .nav { display: flex; } }
.lang {
  font: inherit; font-size: 18px; cursor: pointer; background: transparent;
  color: var(--accent-soft); border: 1px solid var(--accent); border-radius: 2px; padding: 4px 16px;
}
.lang:hover { background: rgba(176, 141, 87, 0.15); }
.site-footer { background: var(--primary-deep); color: var(--on-primary-muted); padding: 28px 0; font-size: 18px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a { color: var(--on-primary); text-decoration: none; }
.site-footer a:hover { color: var(--accent-soft); }

/* ---------- Shared elements ---------- */
.btn-outline { display: inline-block; border: 1px solid var(--accent); color: var(--accent-soft); text-decoration: none; padding: 13px 30px; border-radius: 2px; }
.btn-outline:hover { background: rgba(176, 141, 87, 0.15); }
.cheng { position: absolute; font-family: var(--serif); font-weight: 600; line-height: 1; color: var(--on-primary); opacity: 0.08; pointer-events: none; user-select: none; }
.muted { color: var(--ink-soft); }
.nb { display: inline-block; } /* keeps a Chinese phrase together when the line wraps */
.on-green { background: var(--primary); color: var(--on-primary); }
.on-green h2, .on-green h3 { color: #FFFFFF; }
.photo { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }

/* ---------- Hero: full-screen banyan video under deep teal ---------- */
.hero { position: relative; overflow: hidden; min-height: min(100vh, 960px); display: flex; align-items: center; padding: 0; color: var(--on-primary); }
.hero .bg { position: absolute; inset: 0; overflow: hidden; }
.hero .bg img { width: 100%; height: 100%; object-fit: cover; }
.hero .bg::after { content: ""; position: absolute; inset: 0; background: rgba(19, 42, 40, 0.8); }
html.hv .hero .bg { background: var(--primary-deep); }   /* video will play: start on teal, not the photo */
html.hv .hero .bg img { opacity: 0; animation: none; }
.hero .cheng { font-size: clamp(320px, 44vw, 640px); left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; }
.hero .wrap { position: relative; z-index: 2; width: 100%; text-align: center; padding-top: 96px; padding-bottom: 96px; }
.hero h1 { color: #FFFFFF; font-weight: 500; font-size: clamp(28px, 3.4vw, 46px); line-height: 1.55; letter-spacing: 0.04em; }
.hero h1 .nb { display: block; }
.hero .lead { font-size: clamp(19px, 1.6vw, 21px); max-width: 28em; margin: 28px auto 40px; }

/* ---------- Section frame: vertical Chinese heading with a formal numeral ---------- */
.sec { display: grid; gap: 28px; }
.vh { display: flex; align-items: baseline; gap: 16px; }
.num { font-family: var(--serif); font-weight: 500; font-size: 20px; color: var(--ink-soft); }
.vh h2 { font-size: clamp(28px, 3vw, 38px); }
.vh h2 .nb { display: inline-block; }
.on-green .num { color: var(--accent-soft); }
@media (min-width: 900px) {
  html[data-lang="zh"] .sec { grid-template-columns: 88px 1fr; gap: 64px; }
  html[data-lang="zh"] .vh { flex-direction: column; align-items: center; gap: 20px; position: sticky; top: 120px; align-self: start; }
  html[data-lang="zh"] .vh h2 { writing-mode: vertical-rl; letter-spacing: 0.14em; line-height: 1.2; font-size: clamp(30px, 2.6vw, 38px); }
  html[data-lang="zh"] .vh h2 .nb { display: inline; }
  html[data-lang="zh"] .vh::after { content: ""; width: 1px; height: 64px; background: var(--accent); }
}
html[data-lang="en"] .vh { margin-bottom: 8px; }

/* ---------- 壹 Who we are ---------- */
.who .lead { font-family: var(--serif); font-weight: 500; color: var(--heading); font-size: clamp(23px, 2.6vw, 34px); line-height: 1.65; max-width: 22em; margin: 0 0 56px; }
html[data-lang="en"] .who .lead { max-width: 28em; }
.who-body { display: grid; gap: 40px; }
@media (min-width: 900px) { .who-body { grid-template-columns: 5fr 6fr; gap: 64px; align-items: start; } }
.who figure { margin: 0; aspect-ratio: 1; }
.who .text { max-width: 34em; }
@media (min-width: 900px) { .who .text { padding-top: 24px; } }

/* ---------- Full-width photo (slightly taller than its frame, for the parallax drift) ---------- */
.band { position: relative; height: min(70vh, 680px); min-height: 340px; padding: 0; overflow: hidden; }
.band img { position: absolute; left: 0; bottom: -10%; width: 100%; height: 120%; object-fit: cover; object-position: center center; }

/* ---------- 貳 What stays the same ---------- */
.same .statements { border-top: 1px solid rgba(220, 227, 217, 0.2); }
.same .row { display: grid; gap: 8px 48px; padding: 32px 0; border-bottom: 1px solid rgba(220, 227, 217, 0.2); align-items: baseline; }
@media (min-width: 760px) { .same .row { grid-template-columns: minmax(200px, 3fr) 5fr; } }
.same .word { font-family: var(--serif); font-weight: 600; color: #FFFFFF; font-size: clamp(36px, 4.6vw, 64px); line-height: 1.2; letter-spacing: 0.06em; }
html[data-lang="en"] .same .word { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: 0; }
.same .row p { font-size: clamp(19px, 1.6vw, 21px); }
.same .close { margin-top: 48px; font-family: var(--serif); font-weight: 500; color: var(--accent-soft); font-size: clamp(20px, 2vw, 25px); max-width: 30em; }

/* ---------- 參 How it works ---------- */
.how .intro { font-size: clamp(19px, 1.8vw, 22px); margin: 0 0 40px; max-width: 34em; }
.how figure { margin: 0 0 56px; aspect-ratio: 21 / 9; overflow: hidden; border-radius: 2px; }
.how figure img { height: 120%; margin-top: -10%; }
@media (max-width: 699px) { .how figure { aspect-ratio: 4 / 3; } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 40px; }
@media (min-width: 700px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .steps { grid-template-columns: repeat(4, 1fr); gap: 36px; } }
.steps .n { display: block; font-family: var(--serif); font-weight: 500; font-size: 52px; line-height: 1; color: var(--heading); margin-bottom: 18px; }
.steps .n::after { content: ""; display: block; width: 40px; height: 2px; background: var(--accent); margin-top: 18px; }
.steps h3 { margin-bottom: 8px; }
@media (max-width: 699px) { /* phones: numeral beside its step */
  .steps { gap: 28px; }
  .steps li { display: grid; grid-template-columns: 52px 1fr; column-gap: 16px; }
  .steps .n { grid-row: span 2; font-size: 38px; margin-bottom: 0; }
  .steps .n::after { width: 28px; margin-top: 10px; }
}

/* ---------- 肆 The people behind CW ---------- */
.people { background: var(--ground-alt); }
.people .sub { color: var(--ink-soft); font-family: var(--serif); font-size: 20px; margin: 0 0 24px; }
.people .quote { font-family: var(--serif); font-weight: 500; color: var(--heading); font-size: clamp(23px, 2.5vw, 32px); line-height: 1.75; max-width: 24em; margin: 0; }
html[data-lang="en"] .people .quote { max-width: 30em; }

/* ---------- 伍 Questions ---------- */
.faq { max-width: 860px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:first-child { border-top: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative; font-family: var(--serif); font-weight: 500; font-size: 20px; color: var(--heading); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-family: var(--sans); font-size: 26px; color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 24px; color: var(--ink-soft); }

/* ---------- 陸 Contact: like the end of a letter ---------- */
.contact .letter { max-width: 640px; }
.contact .letter p { font-size: clamp(19px, 1.8vw, 22px); }
.contact .sign { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--accent); display: inline-block; }
.contact .mail { display: inline-block; margin: 0 0 12px; font-family: var(--serif); font-size: clamp(26px, 3.2vw, 40px); color: var(--accent-soft); text-decoration: none; }
.contact .small { color: var(--on-primary-muted); }

/* ---------- English type treatment ---------- */
html[data-lang="en"] h1, html[data-lang="en"] h2, html[data-lang="en"] .lead,
html[data-lang="en"] .word, html[data-lang="en"] .quote, html[data-lang="en"] .close,
html[data-lang="en"] .steps .n, html[data-lang="en"] .contact .mail { font-weight: 300; letter-spacing: 0.02em; }
html[data-lang="en"] h3, html[data-lang="en"] .faq summary, html[data-lang="en"] .sub, html[data-lang="en"] .num { font-weight: 400; letter-spacing: 0.01em; }
html[data-lang="en"] .hero h1 { font-weight: 700; letter-spacing: 0.01em; }   /* Bill: bold English headline */
html[data-lang="en"] .hero .lead { font-weight: 400; }
html[data-lang="en"] .same .word { font-weight: 400; }

/* ---------- Text pages (privacy notice, 404) ---------- */
.page-head { background: var(--primary); color: var(--on-primary); padding: 64px 0 56px; }
.page-head h1 { color: #FFFFFF; font-size: clamp(30px, 4vw, 44px); }
.page-head p { margin: 12px 0 0; color: var(--on-primary-muted); }
.prose { max-width: 46em; }
.prose h2 { font-size: clamp(22px, 2.4vw, 26px); margin: 48px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 6px; }
.back { display: inline-block; margin-top: 48px; color: var(--heading); }

/* ---------- Motion: subtle, and only when the visitor allows it ---------- */
html.motion .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s ease, transform 0.9s ease; }
html.motion .reveal.in { opacity: 1; transform: none; }
@keyframes slowzoom { from { transform: scale(1); } to { transform: scale(1.08); } }
html.motion .zoom { animation: slowzoom 24s ease-out forwards; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
