/* Editorial system. Shared tokens also support the existing article components.
   Keep this after page-specific styles; homepage layouts use portfolio-* classes. */
:root {
  --bg: #f5f5f2;
  --surface: #fff;
  --bg2: #eeefec;
  --text-primary: #17202a;
  --text-secondary: #495660;
  --text: var(--text-primary);
  --text2: var(--text-secondary);
  --muted: var(--text-secondary);
  --navy: #26323a;
  --accent: #d96a28;
  --accent-text: #a44716;
  --a: var(--accent-text);
  --b: var(--navy);
  --a-rgb: 164, 71, 22;
  --b-rgb: 38, 50, 58;
  --border: #cbd1d1;
  --border2: #b4bec0;
  --border-subtle: #d3d8d7;
  --border-strong: #adb7ba;
  --chapter-before: clamp(64px, 6vw, 88px);
  --chapter-after: clamp(48px, 5vw, 68px);
  --rule: var(--border2);
  --card: var(--surface);
  --nav-bg: var(--bg);
  --radius: 3px;
  --font: 'Inter', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
  --content-width: 1224px;
  --reading-width: 760px;
  --gutter: clamp(20px, 4vw, 48px);
  --space-section: clamp(52px, 6vw, 84px);
  --space-grid: clamp(24px, 3vw, 40px);
  --transition: 180ms ease;
}
body { font-family: var(--font); font-size: 17px; line-height: 1.8; overflow-x: clip; }
a { text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-text); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 5px; }
img { max-width: 100%; }
button { font: inherit; }
[id] { scroll-margin-top: 112px; }
.container { max-width: calc(var(--content-width) + 2 * var(--gutter)); padding-inline: var(--gutter); }
.orb, .hero-float { display: none; }
.reveal { opacity: 1; transform: none; transition: none; }
.grad-text, .label, .nav-logo { background: none; -webkit-text-fill-color: currentColor; }
.label { color: var(--accent-text); font-size: 12px; }
.btn-primary, .btn-secondary, .form-submit, .social-btn { border-radius: var(--radius); box-shadow: none; }
.btn-primary, .form-submit { background: var(--text-primary); color: var(--surface); border: 1px solid var(--text-primary); }
.btn-primary:hover, .form-submit:hover { background: var(--navy); color: #fff; transform: none; }
.btn-secondary { background: transparent; color: var(--text-primary); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--surface); color: var(--text-primary); transform: none; }
.hero-badge { background: none; border: 0; border-radius: 0; padding: 0; color: var(--text2); }
.hero-badge::before { display: none; }
.port-card, .blog-card, .decision-card, .course-card, .press-card, .citation-box { border-radius: var(--radius); box-shadow: none; }
.port-card:hover, .blog-card:hover { box-shadow: none; transform: none; }
.article-shell { max-width: calc(var(--reading-width) + 2 * var(--gutter)); padding-inline: var(--gutter); }
.article-shell p, .article-shell li { font-size: 17px; line-height: 1.9; }
.article-shell h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.3; word-break: normal; overflow-wrap: break-word; }
.article-shell h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.45; }
.article-hero-image, .article-inline-image { border-radius: var(--radius); }
.article-shell .article-lead { font-size: 19px; }
.article-meta, .essay-meta { color: var(--text-secondary); }
h2.stitle, .case-map-header h2 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.3; letter-spacing: -.025em; }
.cases-hero h1, .profile-heading h1 { font-size: clamp(34px, 4.5vw, 58px); line-height: 1.25; letter-spacing: -.035em; }
.profile-v2026 section { padding: var(--space-section) 0; }
.profile-v2026 .about-grid { grid-template-columns: minmax(200px, .65fr) minmax(0, 1.35fr); align-items: start; gap: 64px; }
.profile-v2026 .about-photo { width: 100%; max-width: 320px; margin-top: 12px; border-radius: var(--radius); }
.profile-v2026 #about h2 { font-size: 36px; line-height: 1.35; margin-bottom: 24px; }
.profile-v2026 #about h2 br { display: none; }
.profile-v2026 #about .about-text { font-size: 17px; }
.profile-v2026 .case-map-figure { max-width: 880px; }
.case-map-item { border-radius: var(--radius); }
.case-map-item strong { font-size: clamp(23px, 2.5vw, 32px); line-height: 1.3; }
.site-nav { height: 88px; padding: 0 max(var(--gutter), calc((100vw - var(--content-width)) / 2)); background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 1px solid var(--border); gap: 24px; }
.site-nav .nav-logo { display: block; color: var(--text-primary); font-size: 18px; font-weight: 650; line-height: 1.4; letter-spacing: -.02em; flex-shrink: 0; }
.nav-logo span { display: block; color: var(--text-secondary); font-size: 12px; font-weight: 500; letter-spacing: .025em; margin-top: 3px; }
.site-nav .nav-links { gap: 28px; align-items: center; flex-wrap: nowrap; }
.site-nav .nav-links li { display: block; }
.site-nav .nav-links a { font-size: 15px; min-height: 44px; font-weight: 550; padding: 0; color: var(--text-primary); }
.site-nav .nav-links a:hover { color: var(--accent-text); }
.site-nav .nav-lang { border: 0; border-left: 1px solid var(--border2); border-radius: 0; padding-left: 22px !important; background: none; }
.nav-toggle { background: transparent; border: 1px solid var(--border2); padding: 6px 12px; color: var(--text); border-radius: var(--radius); min-height: 44px; cursor: pointer; }
.nav-toggle[hidden] { display: none; }
.site-footer { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; padding: 48px max(var(--gutter), calc((100vw - var(--content-width)) / 2)) 24px; gap: 32px; background: var(--bg); border-top: 1px solid var(--border); }
.footer-identity { flex: 1 1 420px; }
.footer-identity strong { font-size: 18px; font-weight: 600; }
.footer-identity strong span { margin-left: 12px; font-size: 14px; }
.footer-identity p { font-size: 14px; margin: 9px 0; color: var(--text2); }
.footer-identity small { font-size: 13px; color: var(--text2); }
.site-footer .footer-links { max-width: 350px; gap: 0 22px; justify-content: flex-start; }
.site-footer .footer-links a { font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; color: var(--text); }
.site-release { margin-top: 0; font-size: 13px; }
/* Homepage: five sections, fixed reading order and no JS-dependent content. */
.portfolio-home section, .english-v2026 section { padding: var(--space-section) 0; }
.portfolio-home #hero, .english-v2026 #hero { display: block; min-height: 0; padding: 146px 0 36px; }
.editorial-kicker { font-size: 12px; letter-spacing: .12em; line-height: 1.6; font-weight: 650; color: var(--accent-text); margin: 0 0 20px; }
.portfolio-hero h1 { font-size: clamp(48px, 6vw, 78px); line-height: 1.12; letter-spacing: -.04em; font-weight: 650; margin: 0; }
.portfolio-hero h1 span { display: block; font-size: .5em; letter-spacing: -.025em; font-weight: 500; margin-top: 14px; line-height: 1.2; }
.portfolio-position { font-size: clamp(16px, 1.7vw, 22px); line-height: 1.5; font-weight: 500; margin: 26px 0 16px; color: var(--navy); }
.portfolio-lead { font-size: clamp(18px, 1.8vw, 23px); line-height: 1.75; max-width: 34em; color: var(--text-secondary); margin: 0; }
.portfolio-hero .hero-actions { margin-top: 28px; justify-content: flex-start; gap: 16px; }
.portfolio-hero .hero-actions a { font-size: 15px; font-weight: 600; min-height: 48px; padding: 12px 22px; gap: 24px; line-height: 1.4; }
.credibility-line { display: flex; flex-wrap: wrap; gap: 12px 32px; list-style: none; border-top: 1px solid var(--border); padding: 22px 0 0; margin-top: 36px; font-size: 14px; color: var(--text2); font-weight: 500; }
.credibility-line a { color: inherit; text-decoration: none; }
.credibility-line a:hover { text-decoration: underline; }
.portfolio-section { border-top: 1px solid var(--border); }
.section-heading { display: flex; gap: 32px; justify-content: space-between; align-items: flex-end; margin-bottom: 36px; }
.section-heading .editorial-kicker { margin-bottom: 12px; }
.portfolio-home h2 { font-size: clamp(27px, 3vw, 39px); line-height: 1.35; letter-spacing: -.025em; font-weight: 600; margin: 0; }
.section-link { flex-shrink: 0; font-size: 14px; color: var(--text); padding-block: 10px; }
.project-list { display: grid; gap: 44px; }
.project-card { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: center; min-width: 0; }
.project-image { display: block; overflow: hidden; border-radius: var(--radius); background: #e5e7e3; aspect-ratio: 16 / 10; }
.project-image picture { display: block; height: 100%; }
.project-image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition); }
.project-image:hover img { transform: scale(1.015); }
.project-card:first-child img { object-position: center 46%; }
.project-card:last-child img { object-fit: contain; background: #f0efeb; }
.project-copy { min-width: 0; }
.project-category { font-size: 14px; color: var(--text2); letter-spacing: .035em; margin-bottom: 14px; }
.project-category span { color: var(--accent-text); margin-right: 16px; }
.project-copy h3 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.35; font-weight: 650; margin-bottom: 16px; letter-spacing: -.02em; }
.project-copy h3 a { color: var(--text); text-decoration: none; }
.project-copy > p:not(.project-category) { font-size: 18px; line-height: 1.8; color: var(--text2); max-width: 29em; }
.project-end { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; border-top: 1px solid var(--border); margin-top: 24px; padding-top: 14px; }
.project-end small { font-size: 13px; color: var(--text2); }
.project-end a { font-size: 15px; color: var(--text); min-height: 44px; display: inline-flex; align-items: center; gap: 22px; }
.practice-grid, .evidence-grid, .notes-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--space-grid); }
.practice-grid article { border-top: 1px solid var(--border2); padding-top: 24px; }
.practice-number { font-size: 12px; color: var(--accent-text); }
.practice-grid h3 { font-size: 24px; font-weight: 600; margin: 22px 0 4px; line-height: 1.35; }
.practice-subtitle { font-weight: 600; margin-bottom: 16px; font-size: 15px; }
.practice-grid p:not(.practice-subtitle), .note-item > p:not(.note-meta) { font-size: 16px; color: var(--text2); line-height: 1.85; }
.practice-grid a { display: inline-block; margin-top: 20px; padding-block: 8px; font-size: 14px; color: var(--text); }
.quiet-exit { margin-top: 40px; font-size: 13px; }
.quiet-exit a { color: var(--text2); }
.portfolio-home .evidence-section { background: var(--navy); color: #f5f5f2; border: 0; }
.evidence-section .editorial-kicker { color: #f3ac7e; }
.evidence-section .section-heading > p { font-size: 14px; line-height: 1.8; color: #d1d8da; }
.evidence-grid article { padding-top: 28px; border-top: 1px solid #647178; }
.evidence-type { font-size: 12px; letter-spacing: .05em; color: #c1cbce; }
.evidence-grid h3 { font-size: clamp(22px, 2.2vw, 28px); font-weight: 500; margin: 20px 0 16px; line-height: 1.4; }
.evidence-grid article > p:not(.evidence-type) { color: #d1d8da; font-size: 16px; }
.evidence-grid a { display: inline-block; padding-block: 8px; margin-top: 18px; font-size: 13px; color: #f5f5f2; }
.evidence-links { display: flex; flex-wrap: wrap; gap: 14px 28px; padding-top: 28px; margin-top: 36px; border-top: 1px solid #647178; }
.evidence-links a { font-size: 13px; color: #d1d8da; }
.note-item { padding-top: 22px; border-top: 1px solid var(--border2); }
.note-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--text2); }
.note-item h3 { margin: 18px 0 12px; font-size: 22px; font-weight: 600; line-height: 1.5; }
.note-item h3 a { color: var(--text); text-decoration: none; }
.note-item h3 a:hover, .project-copy h3 a:hover { text-decoration: underline; }
.portfolio-contact { margin-top: var(--space-section); padding-top: 56px; border-top: 1px solid var(--border2); }
.portfolio-home #contact, .portfolio-home #contact h2, .portfolio-home #contact .editorial-kicker { text-align: left; }
.portfolio-contact > p:not(.editorial-kicker) { color: var(--text2); margin: 18px 0 28px; font-size: 16px; }
.contact-link-row { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: baseline; }
.contact-link-row a { color: var(--text); font-size: 14px; padding-block: 8px; }
.contact-link-row .contact-main { font-size: 25px; margin-right: 24px; }
.direct-links { display: flex; gap: 24px; margin-top: 12px; font-size: 13px; }
.direct-links a { color: var(--text2); padding-block: 8px; }
.archive-paths { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 36px; font-size: 13px; }
.archive-paths a { color: var(--text2); padding-block: 8px; }
/* The same 12-column measure aligns the hero with the two-column projects. */
@media (min-width: 901px) {
  .portfolio-hero .container { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
  .portfolio-hero .container > * { grid-column: 1 / span 8; }
  .portfolio-hero .container > .credibility-line { grid-column: 1 / -1; }
  .english-v2026 .portfolio-hero h1 { grid-column: 1 / span 10; }
}
/* Narrow overrides for the legacy button rules that declare !important. */
.portfolio-hero .btn-primary { background: var(--navy) !important; }
.portfolio-hero .btn-primary:hover { background: var(--text-primary) !important; }
.portfolio-hero .btn-secondary { border-color: transparent !important; min-width: 112px; }
.portfolio-hero .btn-secondary:hover { background: transparent; border-color: var(--border2) !important; }
.portfolio-hero .hero-actions a span { line-height: 1; }
@media (max-width: 900px) {
  .site-nav .nav-links { gap: 15px; }
  .site-nav .nav-links a { font-size: 15px; }
  .site-nav .nav-logo { font-size: 15px; }
  .practice-grid, .evidence-grid { gap: 24px; }
  .project-card { gap: 30px; grid-template-columns: 1fr 1fr; }
  .project-copy h3 { font-size: 25px; }
  .project-copy > p:not(.project-category) { font-size: 17px; }
}
@media (max-width: 760px) {
  .profile-v2026 .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .profile-v2026 .about-photo { max-width: 200px; }
  .site-nav:has(.nav-toggle[hidden]) { position: relative; }
  .site-nav { min-height: 76px; height: auto; padding: 14px var(--gutter); flex-wrap: wrap; gap: 12px; }
  .site-nav .nav-logo { font-size: 15px; }
  .site-nav .nav-links { display: flex; flex-wrap: wrap; width: 100%; gap: 4px 20px; padding-top: 8px; }
  .site-nav .nav-links li { display: block; }
  .site-nav .nav-links a { font-size: 15px; }
  .site-nav .nav-links.is-collapsible:not(.is-open) { display: none; }
  .site-nav .nav-lang { padding-left: 0 !important; border: 0; }
  .nav-toggle:not([hidden]) { display: inline-flex; align-items: center; gap: 16px; }
  .portfolio-home #hero, .english-v2026 #hero { padding-top: 126px; padding-bottom: 36px; }
  .portfolio-position { max-width: 28em; margin-top: 24px; }
  .portfolio-hero h1 { font-size: clamp(43px, 8vw, 62px); }
  .portfolio-hero h1 span { font-size: .56em; }
  .credibility-line { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-top: 28px; padding-top: 18px; font-size: 13px; line-height: 1.6; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 28px; }
  .section-heading .section-link { padding-block: 4px; }
  .project-card { grid-template-columns: 1fr; gap: 20px; }
  .project-image { aspect-ratio: 16/10; }
  .project-copy > p:not(.project-category) { max-width: none; }
  .project-list { gap: 40px; }
  .project-copy h3 { font-size: 26px; margin-bottom: 12px; }
  .project-category { margin-bottom: 10px; }
  .project-end { margin-top: 18px; padding-top: 8px; }
  .practice-grid, .evidence-grid, .notes-grid { grid-template-columns: 1fr; gap: 28px; }
  .practice-grid h3 { margin-top: 12px; }
  .practice-grid a, .evidence-grid a { margin-top: 10px; }
  .evidence-grid h3 { margin: 12px 0; }
  .notes-grid { gap: 24px; }
  .note-item h3 { margin-top: 12px; }
  .portfolio-contact { padding-top: 40px; }
  .contact-link-row { gap: 8px 24px; }
  .contact-link-row .contact-main { flex-basis: 100%; }
  .site-footer { padding-top: 32px; }
  .footer-identity { flex-basis: 100%; }
  .article-shell { padding-top: 116px; }
  .article-shell p, .article-shell li { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .project-image:hover img { transform: none; }
}

/* Chapter openings: one canvas, with a stronger boundary than internal items.
   Scoped to the homepage major sections; Hero and inner components keep their layout. */
.portfolio-home .portfolio-section {
  padding-top: var(--chapter-before);
  padding-bottom: var(--chapter-after);
  border-top: 1px solid var(--border-strong);
}
.portfolio-home .portfolio-section > .container > .section-heading {
  margin-bottom: 32px;
}
.portfolio-home .portfolio-section > .container > .section-heading .editorial-kicker {
  position: relative;
  padding-top: 21px;
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  white-space: nowrap;
}
.portfolio-home .portfolio-section > .container > .section-heading .editorial-kicker::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 2px;
  background: var(--accent);
}
.portfolio-home .project-end,
.portfolio-home .practice-grid article,
.portfolio-home .note-item,
.portfolio-home .portfolio-contact {
  border-color: var(--border-subtle);
}
.portfolio-home .evidence-section {
  background: var(--bg);
  color: var(--text-primary);
  border-top: 1px solid var(--border-strong);
}
.portfolio-home .evidence-section .editorial-kicker { color: var(--accent-text); }
.portfolio-home .evidence-section .section-heading > p,
.portfolio-home .evidence-type,
.portfolio-home .evidence-grid article > p:not(.evidence-type),
.portfolio-home .evidence-links a { color: var(--text-secondary); }
.portfolio-home .evidence-grid a { color: var(--text-primary); }
.portfolio-home .evidence-grid article,
.portfolio-home .evidence-links { border-color: var(--border-subtle); }
@media (max-width: 760px) {
  .portfolio-home .portfolio-section > .container > .section-heading { margin-bottom: 28px; }
  .portfolio-home .portfolio-section > .container > .section-heading .editorial-kicker::before { width: 42px; }
  .portfolio-home .portfolio-section > .container > .section-heading h2 { text-wrap: pretty; }
}
