/* ---------- Tokens ---------- */
:root {
  --pine: #21403f;        /* headings, primary buttons */
  --pine-deep: #17302f;
  --ink: #2a3635;         /* body text */
  --muted: #5d6c6a;
  --mist: #eef3f2;        /* tinted sections */
  --paper: #fafcfb;       /* page background */
  --line: #d6e0de;
  --sage: #9db8ae;        /* placeholder tint */
  --dusk: #4f7385;        /* links / accents */

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 6px;
  --max: 1080px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--dusk); }
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--dusk);
  outline-offset: 3px;
}
.wrap { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }

h1, h2, h3 { font-family: var(--serif); color: var(--pine); font-weight: 500; line-height: 1.15; margin: 0 0 .6em; }
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); letter-spacing: -0.01em; }
.h1-sub { display: block; margin-top: .55em; font-size: .5em; font-style: italic; font-weight: 400; line-height: 1.3; color: var(--dusk); max-width: 30em; }
h2 { font-size: clamp(1.9rem, 3.5vw, 2.5rem); margin-bottom: 1.1em; }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1.1em; }
.prose { max-width: 62ch; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(250, 252, 251, .94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--pine); text-decoration: none; }
.brand-logo { height: 46px; width: auto; }
.brand-text { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; line-height: 1.1; display: flex; flex-direction: column; }
.brand-text small { font-family: var(--sans); font-size: .8rem; font-weight: 400; color: var(--muted); margin-top: .15rem; }
nav ul { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: .35rem 0; border-bottom: 2px solid transparent; }
nav a:hover { border-bottom-color: var(--dusk); }

/* ---------- Buttons ---------- */
.button-row { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 1.75rem; }
.btn {
  display: inline-block; padding: .8rem 1.5rem; border-radius: var(--radius);
  font-weight: 600; text-decoration: none; border: 2px solid var(--pine);
  transition: background-color .2s, color .2s;
}
.btn-primary { background: var(--pine); color: #fff; }
.btn-primary:hover { background: var(--pine-deep); }
.btn-secondary { background: transparent; color: var(--pine); }
.btn-secondary:hover { background: var(--mist); }

/* ---------- Image placeholders ---------- */
.img-placeholder, .map-placeholder {
  margin: 0;
  display: grid; place-items: center; text-align: center;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.35) 0 14px, transparent 14px 28px),
    var(--sage);
  color: var(--pine-deep);
  border-radius: var(--radius);
  font-weight: 600;
  overflow: hidden;
}
.img-placeholder small, .map-placeholder small { font-weight: 400; opacity: .85; }
.img-placeholder img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-tint { background: var(--mist); }
.section-intro { max-width: 60ch; color: var(--muted); margin-top: -.4em; margin-bottom: 2rem; }
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }

/* Hero */
.hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 4.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.lead { font-size: 1.25rem; color: var(--muted); max-width: 46ch; }
.hero-img { margin: 0; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; object-position: center center; }

/* How we help */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; }
.panel h3 { font-size: 1.25rem; }
.tag-list { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-list li { background: var(--mist); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .9rem; font-size: .95rem; }
.tag-list.featured li { background: var(--pine); border-color: var(--pine); color: #fff; font-weight: 600; }
.tag-list a { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.tag-list a:hover { border-bottom-style: solid; }
.panel-note { color: var(--muted); font-size: .98rem; margin: 0; }

/* How therapy unfolds - 3 step process */
.process { margin-top: clamp(2.5rem, 6vw, 3.5rem); padding-top: clamp(2rem, 5vw, 2.75rem); border-top: 1px solid var(--line); }
.process > h3 { text-align: center; margin-bottom: 2rem; }
.process-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 2.5rem); }
.process-step { text-align: left; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--pine); color: #fff; font-family: var(--serif); font-size: 1.15rem; margin-bottom: .9rem; }
.step-title { font-family: var(--serif); color: var(--pine); font-weight: 500; font-size: 1.2rem; margin: 0 0 .4rem; }
.process-step p { color: var(--muted); margin: 0; }
@media (max-width: 860px) { .process-steps { grid-template-columns: 1fr; gap: 1.75rem; } }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.card-grid.two { grid-template-columns: repeat(2, 1fr); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-img { aspect-ratio: 8 / 5; border-radius: 0; }
img.card-img { width: 100%; height: auto; object-fit: cover; }
.card-body { padding: 1.4rem 1.5rem 1.6rem; }
.card-body h3 { font-size: 1.3rem; }
.card-body p { color: var(--muted); }
.text-link { font-weight: 600; }
.card-source { margin: 0; font-size: .78rem; color: var(--muted); font-style: italic; }

/* Data tables (used on article pages) */
.table-wrap { overflow-x: auto; margin: 0 0 1.75rem; border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.data-table th, .data-table td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table thead th { background: var(--mist); color: var(--pine); font-weight: 600; }
.data-table tbody tr:last-child td { border-bottom: 0; }

/* Article pages */
.article-header { padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; border-bottom: 1px solid var(--line); }
.back-link { display: inline-block; margin-bottom: 1rem; font-weight: 600; font-size: .95rem; }
.byline { color: var(--muted); margin: 0; }
.article-body { padding: clamp(2rem, 5vw, 3rem) 0; max-width: 72ch; }
.article-body h2 { font-size: 1.55rem; margin-top: 2.2em; }
.article-body h2:first-child { margin-top: 0; }
.ref-list { padding-left: 1.3rem; font-size: .92rem; color: var(--muted); line-height: 1.75; }
.ref-list li { margin-bottom: .7rem; }
.article-figure { margin: 2.5rem 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 2; background: var(--mist); }
.article-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Program feature cards (I See You / Digital Wellbeing) */
.program-cards { display: grid; gap: 1.75rem; margin-top: 1rem; }
.program-card { display: grid; grid-template-columns: 300px 1fr; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.program-card .program-img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; display: block; }
.program-card .card-body { padding: 1.85rem; }
@media (max-width: 860px) {
  .program-card { grid-template-columns: 1fr; }
  .program-card .program-img { aspect-ratio: 4 / 3; }
}
html[lang^="zh"] .article-body { max-width: 42em; }

/* About */
.about-block { display: grid; grid-template-columns: 240px 1fr; gap: clamp(1.5rem, 4vw, 3rem); padding: 2.25rem 0; border-top: 1px solid var(--line); }
.about-block:first-of-type { border-top: 0; padding-top: 0; }
.about-intro { margin-bottom: 2.5rem; }
.about-logo { height: 84px; width: auto; margin-bottom: 1rem; }
.about-label h3 { margin: 0; }
.profile-block { grid-template-columns: minmax(220px, 320px) 1fr; align-items: start; }
.portrait { margin: 0; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--mist); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.facts { margin: 1.5rem 0 0; display: grid; gap: .9rem; }
.facts div { border-left: 3px solid var(--sage); padding-left: 1rem; }
.facts dt { font-weight: 600; color: var(--pine); }
.facts dd { margin: 0; color: var(--muted); }
.facts .tag-list { margin: .5rem 0 0; }
.facts .tag-list li { color: var(--ink); }
.facts .tag-list.featured li { color: #fff; }

/* Services */
.programs { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.program-banner { margin: 0 0 1.5rem; border-radius: var(--radius); overflow: hidden; aspect-ratio: 2 / 1; background: var(--sage); }
.program-banner video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.approach { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.method-list { margin: 0; padding: 0; list-style: none; display: grid; gap: .6rem; }
.method-list li { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--dusk); border-radius: var(--radius); padding: .85rem 1.1rem; font-weight: 500; }
.info-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-top: 3rem; }
.info-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; }
.info-box h3 { font-size: 1.3rem; }
.info-box p { margin: 0; color: var(--muted); }
.detail-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.detail-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.detail-list li:last-child { border-bottom: 0; }
.detail-list strong { color: var(--pine); text-align: right; font-weight: 600; }
.info-box .note { font-size: .98rem; background: var(--mist); border-radius: var(--radius); padding: .85rem 1rem; }
.info-box .note strong { color: var(--pine); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(2rem, 5vw, 4rem); align-items: stretch; }
.contact-details h3 { font-size: 1.2rem; margin-top: 1.75rem; }
.contact-details h3:first-child { margin-top: 0; }
.contact-form { margin-top: .75rem; display: grid; gap: 1rem; max-width: 32rem; }
.contact-form label { display: block; font-weight: 600; color: var(--pine); font-size: .95rem; margin-bottom: .35rem; }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form textarea {
  width: 100%; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; color: var(--ink); background: #fff;
}
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: 3px solid var(--dusk); outline-offset: 1px; border-color: var(--dusk); }
.contact-form .btn { justify-self: start; border: 2px solid var(--pine); }
address { font-style: normal; margin-bottom: 1rem; }
.map-placeholder { min-height: 340px; }
.map { min-height: 340px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map iframe { display: block; width: 100%; height: 100%; min-height: 340px; border: 0; }
.map-placeholder iframe { width: 100%; height: 100%; border: 0; min-height: 340px; }

/* Footer */
.site-footer { background: var(--pine-deep); color: #d9e5e2; padding: 1.75rem 0; font-size: .95rem; }
.site-footer p { margin: 0; }
.site-footer a { color: #fff; }
.footer-brand { display: flex; align-items: center; gap: .75rem; }
.footer-brand img { height: 30px; width: auto; filter: invert(1); }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid, .two-col, .contact-grid, .about-block, .profile-block { grid-template-columns: 1fr; }
  .card-grid, .card-grid.two, .info-row { grid-template-columns: 1fr; }
  .hero-img { aspect-ratio: 4 / 3; order: -1; }
  .portrait { max-width: 320px; }
  html { scroll-padding-top: 110px; }
}
@media (max-width: 520px) {
  nav ul { gap: 1.1rem; }
  .header-inner { padding: .5rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Language switcher ---------- */
.header-inner { gap: .75rem 1.5rem; }
.lang-switch { display: flex; gap: .35rem; font-size: .9rem; }
.lang-switch a { padding: .3rem .75rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; line-height: 1.4; }
.lang-switch a:hover { border-color: var(--dusk); }
.lang-switch a[aria-current="page"] { background: var(--pine); border-color: var(--pine); color: #fff; }
.lang-switch a:focus-visible { outline: 3px solid var(--dusk); outline-offset: 2px; }
@media (max-width: 860px) { .lang-switch { order: 3; } }

/* ---------- Chinese pages (Traditional and Simplified) ---------- */
html[lang="zh-Hant"] {
  --serif: "Newsreader", "Noto Serif TC", "Songti TC", "PMingLiU", "Source Han Serif TC", serif;
  --sans: "Figtree", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}
html[lang="zh-Hans"] {
  --serif: "Newsreader", "Noto Serif SC", "Songti SC", "SimSun", "Source Han Serif SC", serif;
  --sans: "Figtree", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
html[lang^="zh"] body { line-height: 1.85; letter-spacing: .02em; }
html[lang^="zh"] h1, html[lang^="zh"] h2, html[lang^="zh"] h3 { line-height: 1.35; letter-spacing: .02em; }
html[lang^="zh"] h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
html[lang^="zh"] .h1-sub { font-style: normal; line-height: 1.6; font-size: .48em; }
html[lang^="zh"] .prose { max-width: 36em; }
html[lang^="zh"] .lead { max-width: 30em; }
html[lang^="zh"] .section-intro { max-width: 38em; }
html[lang^="zh"] .brand-text small { letter-spacing: .04em; }
.addr-en { display: inline-block; margin-top: .35rem; color: var(--muted); font-size: .95rem; letter-spacing: 0; }
