/* ============================================================
   Eugene Chen Law — Redesign 2026
   Color palette: 墨綠 + 香檳金 + 米白
   ============================================================ */

:root {
  --green-deep: #1F3A2E;
  --green-mid: #2D5443;
  --gold: #C9A96E;
  --gold-soft: #E5D5B0;
  --cream: #F8F5EE;
  --paper: #FFFFFF;
  --ink: #1A1A1A;
  --ink-soft: #4A4A4A;
  --gray: #6B7065;
  --line: #E2DDD0;

  --serif-cn: "Noto Serif SC", "Noto Serif TC", "PingFang SC", "PingFang TC", "Source Han Serif SC", "Songti SC", serif;
  --sans-cn: "PingFang SC", "PingFang TC", "Noto Sans SC", "Noto Sans TC", "Microsoft YaHei", "Heiti SC", sans-serif;
  --serif-cn-tw: "Noto Serif TC", "PingFang TC", "Source Han Serif TC", "Songti TC", serif;
  --sans-cn-tw: "PingFang TC", "Noto Sans TC", "Heiti TC", sans-serif;
  --serif-en: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --sans-en: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;

  --max: 1240px;
  --gutter: clamp(20px, 4vw, 56px);

  /* ============================================================
     Typography scale (unified)
     ============================================================ */
  --fs-h1: clamp(38px, 4.6vw, 60px);
  --fs-h2: clamp(28px, 3.2vw, 42px);
  --fs-h3: clamp(20px, 2vw, 26px);
  --fs-h4: 18px;
  --fs-lead: 18px;
  --fs-body: 16px;
  --fs-small: 15px;
  --fs-caption: 14px;
  --fs-meta: 13px;
  --fs-eyebrow: 12px;

  --lh-tight: 1.3;
  --lh-normal: 1.6;
  --lh-relaxed: 1.8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans-cn), var(--sans-en);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--green-deep); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: 0.7; }

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4 { font-family: var(--serif-cn), var(--serif-en); line-height: var(--lh-tight); font-weight: 600; letter-spacing: .01em; }
h1 { font-size: var(--fs-h1); letter-spacing: -.01em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-weight: 600; }

.eyebrow {
  font-family: var(--sans-en);
  font-size: var(--fs-eyebrow);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 16px;
}

p { margin: 0 0 1.1em; max-width: 70ch; }
p.lead { font-size: var(--fs-lead); color: var(--ink-soft); line-height: var(--lh-normal); }

/* ============================================================
   Layout
   ============================================================ */

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: clamp(64px, 9vw, 128px) 0; }
.section-tight { padding: clamp(48px, 6vw, 80px) 0; }

/* ============================================================
   Header / Nav
   ============================================================ */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(248, 245, 238, 0.92);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter); max-width: var(--max); margin: 0 auto;
}
.brand {
  font-family: var(--serif-cn), var(--serif-en);
  font-size: var(--fs-h4); font-weight: 600; color: var(--green-deep); letter-spacing: .02em;
  display: inline-flex; align-items: center;
}
.brand span { color: var(--gold); }
.brand-logo {
  height: 44px; width: auto; display: block;
  /* White logo → dark green for light nav */
  filter: brightness(0) saturate(100%) invert(17%) sepia(28%) saturate(1071%)
          hue-rotate(108deg) brightness(95%) contrast(91%);
}
.footer-brand .brand-logo {
  height: 40px;
  /* White logo stays white on dark footer */
  filter: none;
}
.attorney .brand-logo { filter: none; }

.lang-switch {
  display: inline-flex; gap: 12px; margin-right: 24px;
  font-family: var(--sans-en); font-size: var(--fs-meta); letter-spacing: .12em;
}
.lang-switch a { color: var(--ink-soft); }
.lang-switch a.active { color: var(--green-deep); font-weight: 700; }
.lang-switch span.sep { color: var(--line); }
.nav-right { display: flex; align-items: center; }

@media (max-width: 720px) {
  .lang-switch { margin-right: 12px; font-size: var(--fs-eyebrow); }
}
.nav-links {
  display: flex; gap: 36px; list-style: none; font-size: var(--fs-small); font-weight: 500;
}
.nav-links a { color: var(--ink); }
.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green-deep); color: var(--cream);
  padding: 11px 22px; border-radius: 999px;
  font-size: var(--fs-caption); font-weight: 600; letter-spacing: .02em;
  transition: background .2s;
}
.nav-cta:hover { background: var(--green-mid); opacity: 1; color: var(--cream); }

@media (max-width: 880px) {
  .nav-links { display: none; }
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 32px; border-radius: 999px;
  font-size: var(--fs-small); font-weight: 600; letter-spacing: .02em;
  border: 1.5px solid transparent; cursor: pointer; transition: all .2s;
}
.btn-primary { background: var(--green-deep); color: var(--cream); }
.btn-primary:hover { background: var(--green-mid); color: var(--cream); opacity: 1; }
.btn-ghost { background: transparent; color: var(--green-deep); border-color: var(--green-deep); }
.btn-ghost:hover { background: var(--green-deep); color: var(--cream); opacity: 1; }
.btn-link { font-family: var(--sans-en); font-size: var(--fs-caption); letter-spacing: .15em; text-transform: uppercase; color: var(--green-deep); font-weight: 600; }
.btn-link::after { content: " →"; transition: transform .2s; display: inline-block; }
.btn-link:hover::after { transform: translateX(4px); }

/* ============================================================
   Hero
   ============================================================ */

.hero {
  padding: clamp(72px, 10vw, 140px) 0 clamp(80px, 10vw, 120px);
  position: relative; overflow: hidden;
}
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.hero-text h1 { color: var(--green-deep); margin-bottom: 24px; }
.hero-text h1 .gold { color: var(--gold); font-style: italic; font-weight: 500; }
.hero-sub {
  font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-soft); line-height: 1.7;
  max-width: 560px; margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-image {
  position: relative; aspect-ratio: 4/5; border-radius: 4px; overflow: hidden;
  background: var(--green-deep);
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; }
.hero-image::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(31,58,46,.15));
}
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-image { max-height: 480px; }
}

/* ============================================================
   Trust bar
   ============================================================ */

.trust {
  background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 28px 0;
}
.trust-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  align-items: center;
  font-family: var(--sans-en); font-size: var(--fs-eyebrow); letter-spacing: .14em;
  text-transform: uppercase; color: var(--gray); font-weight: 500;
}
.trust-row > span:not(.dot) {
  text-align: center; padding: 0 16px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}
.trust-row > span:first-child { border-left: 0; }
.trust-row .dot { display: none; }
@media (max-width: 980px) {
  .trust-row { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
  .trust-row > span:not(.dot):nth-child(odd) { border-left: 0; }
  .trust-row > span:not(.dot):nth-child(3) { border-left: 0; }
}
@media (max-width: 560px) {
  .trust-row { grid-template-columns: 1fr; row-gap: 14px; }
  .trust-row > span:not(.dot) { border-left: 0; }
}

/* ============================================================
   Quick Help (client self-service strip)
   ============================================================ */

.quick-help {
  background: linear-gradient(180deg, var(--cream) 0%, #F2EBDC 100%);
  padding: clamp(48px, 6vw, 80px) 0;
  border-bottom: 1px solid var(--line);
}
.quick-help-head {
  text-align: center; margin-bottom: 40px;
}
.quick-help-head .eyebrow { margin-bottom: 12px; }
.quick-help-head h2 {
  color: var(--green-deep);
  font-size: clamp(24px, 2.6vw, 34px);
  margin: 0 auto;
  max-width: 28ch;
}
.quick-help-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.qh-card {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 32px 28px;
  transition: all .25s;
  text-decoration: none; color: inherit;
}
.qh-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 18px 36px -20px rgba(31,58,46,.18);
  opacity: 1;
}
.qh-icon {
  width: 48px; height: 48px;
  background: var(--green-deep); color: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(20px, 2vw, 26px); font-weight: 700;
  margin-bottom: 20px;
  font-family: var(--serif-en);
}
.qh-card h3 {
  font-size: var(--fs-h4); color: var(--green-deep);
  margin-bottom: 8px; line-height: 1.35;
}
.qh-card p {
  color: var(--ink-soft); font-size: var(--fs-caption); line-height: 1.6;
  flex: 1; margin-bottom: 18px;
}
.qh-card .qh-cta {
  font-family: var(--sans-en); font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--green-deep);
}
.qh-card .qh-cta::after {
  content: " →"; transition: transform .2s; display: inline-block;
}
.qh-card:hover .qh-cta::after { transform: translateX(4px); }

@media (max-width: 880px) { .quick-help-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Section heading
   ============================================================ */

.section-head {
  display: grid; grid-template-columns: 1fr 1.5fr; gap: 48px;
  margin-bottom: 64px; align-items: end;
}
.section-head h2 { color: var(--green-deep); }
.section-head .desc { font-size: var(--fs-lead); color: var(--ink-soft); max-width: 60ch; }
@media (max-width: 720px) {
  .section-head { grid-template-columns: 1fr; gap: 16px; }
}

/* ============================================================
   Service cards
   ============================================================ */

.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.svc-card {
  background: var(--paper); padding: 36px 32px;
  border: 1px solid var(--line); border-radius: 8px;
  transition: all .25s; display: flex; flex-direction: column;
}
.svc-card:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 18px 40px -20px rgba(31,58,46,.18); }
.svc-card .num {
  font-family: var(--serif-en); font-size: var(--fs-meta); color: var(--gold);
  letter-spacing: .15em; margin-bottom: 20px; font-weight: 600;
}
.svc-card h3 { color: var(--green-deep); margin-bottom: 12px; font-size: clamp(20px, 2vw, 26px); }
.svc-card p { color: var(--ink-soft); font-size: var(--fs-small); line-height: 1.7; flex: 1; margin-bottom: 24px; }
@media (max-width: 880px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .services-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Attorney spotlight
   ============================================================ */

.attorney {
  background: var(--green-deep); color: var(--cream);
}
.attorney h2 { color: var(--cream); }
.attorney h2 .gold { color: var(--gold); font-style: italic; font-weight: 500; }
.attorney .eyebrow { color: var(--gold); }
.attorney .desc { color: rgba(248,245,238,.78); }
.attorney-grid {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.attorney-photo {
  aspect-ratio: 4/5; border-radius: 4px; overflow: hidden;
  background: var(--green-mid);
}
.attorney-photo img { width: 100%; height: 100%; object-fit: cover; }
.attorney-credentials {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px 32px;
  margin: 32px 0; padding-top: 24px;
  border-top: 1px solid rgba(201,169,110,.3);
}
.cred { font-size: var(--fs-caption); }
.cred dt { font-family: var(--sans-en); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; font-weight: 600; }
.cred dd { color: var(--cream); line-height: 1.55; }
.attorney .btn-ghost { color: var(--gold); border-color: var(--gold); }
.attorney .btn-ghost:hover { background: var(--gold); color: var(--green-deep); }
@media (max-width: 880px) { .attorney-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Insights / Blog teaser
   ============================================================ */

.insights-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.post {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line); padding-top: 28px;
}
.post .date { font-family: var(--sans-en); font-size: var(--fs-eyebrow); letter-spacing: .15em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 14px; }
.post h4 { color: var(--green-deep); margin-bottom: 10px; line-height: 1.4; font-size: var(--fs-h4); }
.post p { color: var(--ink-soft); font-size: var(--fs-small); flex: 1; margin-bottom: 18px; }
@media (max-width: 880px) { .insights-grid { grid-template-columns: 1fr; } }

/* ============================================================
   CTA banner
   ============================================================ */

.cta-banner {
  background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%);
  text-align: center; padding: clamp(72px, 8vw, 120px) var(--gutter);
}
.cta-banner h2 { color: var(--cream); margin-bottom: 24px; }
.cta-banner h2 .gold { color: var(--gold); font-style: italic; font-weight: 500; }
.cta-banner p { color: rgba(248,245,238,.8); margin: 0 auto 36px; font-size: var(--fs-lead); max-width: 580px; }
.cta-banner .btn-primary { background: var(--gold); color: var(--green-deep); }
.cta-banner .btn-primary:hover { background: var(--gold-soft); color: var(--green-deep); }

/* ============================================================
   Footer
   ============================================================ */

footer {
  background: var(--ink); color: rgba(248,245,238,.72); padding: 80px 0 32px;
  font-size: var(--fs-caption); line-height: 1.75;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 56px;
}
footer h5 { color: var(--cream); font-family: var(--sans-en); font-size: var(--fs-eyebrow); letter-spacing: .2em; text-transform: uppercase; margin-bottom: 20px; font-weight: 600; }
footer ul { list-style: none; }
footer li { margin-bottom: 10px; }
footer a { color: rgba(248,245,238,.72); }
footer a:hover { color: var(--gold); opacity: 1; }
.footer-brand .brand { color: var(--cream); font-size: var(--fs-lead); white-space: nowrap; }
.footer-brand .brand span { color: var(--gold); }
.footer-brand p { font-size: var(--fs-caption); max-width: 32ch; margin-top: 12px; }
.footer-bottom {
  border-top: 1px solid rgba(248,245,238,.12); padding-top: 28px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  font-size: var(--fs-eyebrow); color: rgba(248,245,238,.5);
}
.disclaimer { max-width: 75ch; font-size: var(--fs-eyebrow); line-height: 1.65; color: rgba(248,245,238,.45); }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Inner page hero
   ============================================================ */

.page-hero {
  padding: clamp(56px, 6vw, 96px) 0 clamp(40px, 4.5vw, 64px);
  border-bottom: 1px solid var(--line);
}
.page-hero h1 { color: var(--green-deep); margin-bottom: 20px; font-size: clamp(36px, 4.5vw, 60px); }
.page-hero p.lead { max-width: 60ch; }

/* ============================================================
   Step list (used on resource pages)
   ============================================================ */

.step-list { display: flex; flex-direction: column; gap: 24px; margin-top: 48px; }
.step {
  display: grid; grid-template-columns: auto 1fr; gap: 32px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 36px 40px;
  align-items: start;
  transition: border-color .2s;
}
.step:hover { border-color: var(--gold); }
.step-num {
  font-family: var(--serif-en);
  font-size: 56px; font-weight: 600;
  color: var(--gold); line-height: 1; letter-spacing: -.02em;
  min-width: 80px;
}
.step h3 {
  color: var(--green-deep); margin-bottom: 12px; font-size: clamp(20px, 2vw, 26px);
}
.step p { color: var(--ink-soft); font-size: var(--fs-body); line-height: 1.75; margin-bottom: 12px; }
.step p:last-child { margin-bottom: 0; }
.step ul { margin: 12px 0; padding-left: 22px; color: var(--ink-soft); font-size: var(--fs-small); line-height: 1.8; }
.step ul li { margin-bottom: 4px; }
.step .external {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px;
  font-family: var(--sans-en); font-size: var(--fs-meta); font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--green-deep);
  padding: 12px 22px; border: 1.5px solid var(--green-deep); border-radius: 999px;
  transition: all .2s;
}
.step .external:hover { background: var(--green-deep); color: var(--cream); opacity: 1; }

@media (max-width: 720px) {
  .step { grid-template-columns: 1fr; gap: 8px; padding: 28px 24px; }
  .step-num { font-size: 40px; min-width: auto; }
}

/* Highlight callout box */
.callout {
  background: linear-gradient(135deg, rgba(201,169,110,.08), rgba(201,169,110,.02));
  border-left: 4px solid var(--gold);
  padding: 24px 28px;
  border-radius: 4px;
  margin-top: 32px;
}
.callout strong { color: var(--green-deep); }
.callout p {
  color: var(--ink);
  margin-bottom: 0;
  font-size: var(--fs-small);
  line-height: var(--lh-relaxed);
}

/* 全站中文斷行優化 —
   - keep-all：只在標點處（。，； 等）斷行，不在詞中間斷
   - text-wrap: pretty：英文段落使用智慧斷行避免孤兒字
   - 對 :lang(zh) 適用 keep-all；英文頁面不影響
*/
:lang(zh) p,
:lang(zh) li,
:lang(zh) h1,
:lang(zh) h2,
:lang(zh) h3,
:lang(zh) h4,
[lang^="zh"] p,
[lang^="zh"] li,
[lang^="zh"] h1,
[lang^="zh"] h2,
[lang^="zh"] h3,
[lang^="zh"] h4 {
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-break: strict;
}

body, p, h1, h2, h3, h4, li {
  text-wrap: pretty;
}

/* ============================================================
   Categories list (used on services / green card pages)
   ============================================================ */

.cat-list {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px;
  margin-top: 48px;
}
.cat {
  background: var(--paper); padding: 40px 36px;
  border-left: 3px solid var(--gold); border-radius: 4px;
}
.cat h3 { color: var(--green-deep); margin-bottom: 8px; font-size: clamp(20px, 2vw, 26px); }
.cat .tag { font-family: var(--sans-en); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 16px; }
.cat ul { list-style: none; padding: 0; }
.cat li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: var(--fs-small); color: var(--ink-soft); }
.cat li:last-child { border-bottom: 0; }
@media (max-width: 720px) { .cat-list { grid-template-columns: 1fr; } }

/* ============================================================
   Contact
   ============================================================ */

.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px;
  align-items: start;
}
.contact-card { background: var(--paper); padding: 48px; border-radius: 6px; border: 1px solid var(--line); }
.contact-row { padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact-row:last-child { border-bottom: 0; }
.contact-row dt { font-family: var(--sans-en); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; font-weight: 600; }
.contact-row dd { font-size: var(--fs-lead); color: var(--ink); }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; gap: 32px; } }
