/* dave-kuo.com — site styles */
:root {
  --ink: #111418;
  --body: #3D434B;
  --muted: #5A616B;
  --ground: #F7F7F5;
  --surface: #FFFFFF;
  --line: #E2E1DC;
  --line-soft: #ECEBE6;
  --placeholder: #ECEBE6;
  --accent: #C2410C;
  --accent-dark: #9A3412;
  --dark: #111418;
  --dark-muted: #A9AFB8;
  --radius: 10px;
  --max: 1200px;
  --gutter: clamp(20px, 5vw, 48px);
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0; }
p, ul, ol, dl, figure, blockquote { margin: 0; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; color: #fff; }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.label { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.label--sm { font-size: 12px; letter-spacing: 0.08em; }
.lead { font-size: 19px; line-height: 1.6; color: var(--body); max-width: 680px; }
.muted { color: var(--body); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--ground); }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; padding-top: 20px; padding-bottom: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; text-decoration: none; }
.brand__avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.nav__links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; font-size: 15px; margin-left: auto; }
.nav__links a { text-decoration: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 22px; border-radius: 6px; font-weight: 600; font-size: 16px; text-decoration: none; border: 1px solid transparent; }
.btn--sm { min-height: 44px; padding: 10px 18px; font-size: 15px; font-weight: 500; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #2A3038; color: #fff; }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-dark); color: #fff; }
.btn--ghost { border-color: var(--ink); font-weight: 500; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Hero */
.hero { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; padding-top: clamp(56px, 8vw, 112px); padding-bottom: 72px; }
.hero__main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.hero h1 { font-size: clamp(34px, 3.8vw, 52px); line-height: 1.08; letter-spacing: -0.02em; }
.now { flex: 1 1 320px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.now__item { padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.now__item:last-child { padding-bottom: 0; border-bottom: 0; }
.now__item h2 { font-family: var(--font-body); font-size: 15px; font-weight: 600; }
.now__item p { font-size: 14px; line-height: 1.5; color: var(--body); }

/* Highlights */
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats { display: flex; flex-wrap: wrap; gap: 32px; padding-top: 36px; padding-bottom: 36px; }
.stat { flex: 1 1 220px; }
.band-quote { margin-top: 0; margin-bottom: 0; padding-bottom: 40px; }
.band-quote blockquote { border-top: 1px solid var(--line); padding-top: 32px; max-width: 860px; }
.band-quote blockquote p { font-family: var(--font-head); font-weight: 500; font-size: clamp(21px, 2.2vw, 27px); line-height: 1.35; color: var(--ink); }
.band-quote figcaption { margin-top: 14px; font-size: 15px; color: var(--muted); }
.band-quotes { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; row-gap: 28px; padding-bottom: 40px; }
.band-quotes .band-quote { margin: 0; padding-bottom: 0; }
.band-quotes .band-quote blockquote { max-width: none; }
.band-quotes .band-quote blockquote p { font-size: clamp(19px, 1.7vw, 23px); }
@media (max-width: 860px) { .band-quotes { grid-template-columns: 1fr; } }
.stat__num { font-family: var(--font-head); font-weight: 600; font-size: 40px; letter-spacing: -0.01em; color: var(--accent); line-height: 1.2; }
.stat p:last-child { font-size: 15px; line-height: 1.5; color: var(--body); }

/* Sections */
.section { padding-top: 96px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 40px; }
.section--tight { padding-top: 72px; padding-bottom: 72px; }
.section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.section__head > div { display: flex; flex-direction: column; gap: 12px; }
.section h2, .h2 { font-size: clamp(30px, 3.6vw, 48px); letter-spacing: -0.02em; line-height: 1.1; }

/* Work cards */
.cards { display: flex; flex-wrap: wrap; gap: 24px; list-style: none; padding: 0; }
.card { position: relative; flex: 1 1 340px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card__media { aspect-ratio: 16 / 10; border-bottom: 1px solid var(--line); overflow: hidden; background: var(--placeholder); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media--contain img { object-fit: contain; }
.card__body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.card h3 { font-size: 24px; letter-spacing: -0.01em; line-height: 1.2; }
.card__blurb { font-size: 15px; color: var(--body); flex-grow: 1; }
.card__metric { font-size: 14px; font-weight: 600; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.card__link { font-size: 15px; font-weight: 600; color: var(--accent); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card { transition: border-color .15s ease, box-shadow .15s ease; }
.card:hover { border-color: #C9C7C0; box-shadow: 0 6px 20px rgba(17, 20, 24, .07); }
.card:hover .card__link { color: var(--accent-dark); text-decoration: underline; }
.card:has(.card__link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.card__link:focus-visible { outline: none; }
.card__media img { transition: transform .3s ease; }
.card:hover .card__media img { transform: scale(1.02); }
@media (prefers-reduced-motion: reduce) { .card, .card__media img { transition: none; } .card:hover .card__media img { transform: none; } }

/* Approach */
.steps { display: flex; flex-wrap: wrap; border-top: 1px solid var(--ink); list-style: none; padding: 0; }
.steps li { flex: 1 1 240px; padding: 28px 28px 28px 0; display: flex; flex-direction: column; gap: 12px; }
.steps .num { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.steps h3 { font-size: 22px; }
.steps p { font-size: 15px; color: var(--body); }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.note p:last-child { flex: 1 1 480px; font-size: 16px; color: var(--body); }

/* Capabilities */
.caps { display: flex; flex-wrap: wrap; gap: 40px; padding-top: 72px; padding-bottom: 72px; }
.caps > div { flex: 1 1 220px; display: flex; flex-direction: column; gap: 12px; }
.caps h3 { font-size: 18px; }
.caps p { font-size: 15px; line-height: 1.8; color: var(--body); }

/* About */
.about { display: flex; flex-wrap: wrap; gap: 56px; padding-top: 96px; padding-bottom: 96px; }
.about__side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.about__main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.portrait { aspect-ratio: 4 / 5; max-width: 360px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--placeholder); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.about__main > p { font-size: 18px; line-height: 1.7; color: var(--body); }
.timeline { list-style: none; padding: 0; border-top: 1px solid var(--ink); }
.timeline li { display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.timeline .yrs { font-family: var(--font-mono); font-size: 14px; color: var(--muted); flex: 0 0 120px; }
.timeline .org { font-weight: 600; flex: 1 1 200px; }
.timeline .role { color: var(--body); flex: 1 1 260px; }
.about__main > .timeline__label { font-size: 12px; line-height: 1.4; color: var(--muted); margin: 16px 0 -12px; }

/* Contact */
.contact { background: var(--dark); color: #fff; }
.contact a { color: #fff; }
.contact a:hover { color: #FDBA74; }
.contact__inner { padding-top: 96px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 48px; }
.contact .label { color: var(--dark-muted); }
.contact h2 { font-size: clamp(34px, 4.6vw, 64px); letter-spacing: -0.025em; line-height: 1.05; max-width: 900px; }
.contact__email { font-size: clamp(20px, 2.2vw, 28px); font-weight: 500; text-underline-offset: 6px; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.contact__links { display: flex; flex-wrap: wrap; gap: 4px 32px; }
.contact__links a { min-height: 44px; display: inline-flex; align-items: center; }
.footer-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid #2C3139; font-size: 14px; color: var(--dark-muted); }

/* Case study */
.cs-intro { padding-top: 48px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 24px; }
.crumb { min-height: 44px; display: inline-flex; align-items: center; width: fit-content; text-decoration: none; }
.cs-intro h1 { font-size: clamp(34px, 3.8vw, 52px); line-height: 1.08; letter-spacing: -0.02em; max-width: 960px; }
.cs-intro .lead { font-size: 20px; max-width: 760px; }
.facts { display: flex; flex-wrap: wrap; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); margin-top: 8px; }
.facts > div { flex: 1 1 200px; padding: 20px 24px 20px 0; display: flex; flex-direction: column; gap: 6px; }
.facts dt { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.facts .hi { color: var(--accent); }
.hero-img { aspect-ratio: 21 / 9; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.hero-img img { width: 100%; height: 100%; object-fit: contain; }
.hero-img--cover img { object-fit: cover; }
.caption { margin-top: 12px; font-size: 14px; color: var(--muted); }
.cs-body { display: flex; flex-wrap: wrap; gap: 56px; padding-top: 80px; padding-bottom: 80px; }
.cs-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 56px; }
.cs-aside { flex: 1 1 280px; min-width: 0; }
.cs-block { display: flex; flex-direction: column; gap: 16px; }
.cs-block .num { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.cs-block h2 { font-size: 32px; letter-spacing: -0.015em; line-height: 1.15; }
.cs-block p, .cs-block li { font-size: 17px; line-height: 1.7; color: var(--body); }
.cs-block ul { padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.figure { display: flex; flex-direction: column; gap: 12px; }
.figure__frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.figure__frame--pad { padding: 24px; }
.figure figcaption { font-size: 14px; color: var(--muted); }
.factbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.factbox p:last-child { font-size: 15px; line-height: 1.5; }
.quote { padding: 28px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; }
.quote p { font-family: var(--font-head); font-weight: 500; font-size: 22px; line-height: 1.4; color: var(--ink) !important; }
.quote footer { font-size: 15px; color: var(--muted); }

/* Milestones: vertical by default; horizontal when the column is wide enough for all four in one row */
.cs-block { container-type: inline-size; }
.milestones { list-style: none; margin: 4px 0 0 5px; padding: 0 0 0 24px; display: flex; flex-direction: column; gap: 28px; border-left: 2px solid var(--ink); }
.milestones li { position: relative; display: flex; flex-direction: column; gap: 4px; line-height: 1.4; }
.milestones .dot { position: absolute; left: -31px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); }
@container (min-width: 620px) {
  .milestones { flex-direction: row; gap: 0; margin: 4px 0 0; padding: 0; border-left: 0; border-top: 2px solid var(--ink); }
  .milestones li { flex: 1 1 0; padding: 18px 16px 0 0; }
  .milestones .dot { left: 0; top: -7px; }
}
/* Long timelines (8 phases) stay vertical at every width */
.milestones.milestones--long { flex-direction: column; gap: 22px; margin: 4px 0 0 5px; padding: 0 0 0 24px; border-top: 0; border-left: 2px solid var(--ink); }
.milestones.milestones--long li { flex: none; padding: 0; }
.milestones.milestones--long .dot { left: -31px; top: 3px; }
.milestones .dot--hi { background: var(--accent); }
.milestones .when { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.milestones .what { font-size: 16px; font-weight: 600; color: var(--ink); }
.milestones .what--hi { color: var(--accent); }
.milestones .detail { font-size: 14px !important; line-height: 1.5 !important; }

.flow { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.flow__step { flex: 1 1 112px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.flow__step--hi { background: var(--ink); border-color: var(--ink); }
.flow__step--hi .flow__t { color: #fff; }
.flow__step--hi .flow__d, .flow__step--hi .flow__n { color: #D5D9DE !important; }
.flow__n { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.flow__t { font-family: var(--font-head); font-weight: 600; font-size: 16px; line-height: 1.25; color: var(--ink); }
.flow__d { font-size: 14px !important; line-height: 1.5 !important; }
.flow__arrow { flex: 0 0 auto; align-self: center; font-size: 18px; color: var(--accent); }
.loop { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px dashed #B9B7AF; border-radius: var(--radius); padding: 14px 18px; }
.loop span:first-child { font-size: 20px; color: var(--accent); }
.loop span:last-child { font-size: 15px; color: var(--body); }

.project { display: flex; flex-direction: column; gap: 20px; padding-top: 32px; border-top: 1px solid var(--ink); }
.project__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.project__name { font-family: var(--font-head); font-weight: 600; font-size: 22px; color: var(--ink) !important; }
.project__media { aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.project__media img { width: 100%; height: 100%; object-fit: cover; }
.project h3 { font-size: 28px; letter-spacing: -0.015em; line-height: 1.2; }

.next { border-top: 1px solid var(--line); background: var(--surface); }
.next__inner { padding-top: 56px; padding-bottom: 56px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.next__title { font-family: var(--font-head); font-weight: 600; font-size: clamp(28px, 3vw, 40px); letter-spacing: -0.02em; }
.site-footer { background: var(--dark); color: var(--dark-muted); }
.site-footer a { color: #fff; }
.site-footer .wrap { padding-top: 32px; padding-bottom: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px; }

@media (max-width: 640px) {
  .nav { row-gap: 12px; }
  .nav__links { gap: 4px 18px; order: 3; flex-basis: 100%; margin-left: 0; }
  .timeline li { flex-direction: column; gap: 2px; }
  .timeline .yrs, .timeline .org, .timeline .role { flex: none; }
  .flow__arrow { transform: rotate(90deg); flex-basis: 100%; text-align: center; }
  .stat__num { font-size: 34px; }
}

/* Delivery practice + partnerships */
.subhead { font-size: 22px; }
.ops-block { display: flex; flex-direction: column; gap: 20px; }
.ops h4, .ops p { margin: 0; }
.ops { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 32px; border-top: 1px solid var(--line); list-style: none; padding: 0; margin: 0; }
.ops li { padding: 24px 0; display: flex; flex-direction: column; gap: 8px; }
.ops h4 + p { margin-top: 4px; }
.ops h4 { font-size: 13px; font-family: var(--font-mono); font-weight: 400; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.ops p { font-size: 15px; color: var(--body); }
.ops .ops__org { font-family: var(--font-head); font-size: 20px; color: var(--ink); }
.ops .ops__partner { margin-top: auto; font-size: 13px; color: var(--muted); }
.section__intro { max-width: 680px; font-size: 17px; color: var(--body); }

/* Language toggle (EN / 中文) */
.lang { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; line-height: 1; }
.lang__opt { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 38px; padding: 0 12px; border-radius: 999px; text-decoration: none; color: var(--body); }
a.lang__opt:hover { color: var(--accent); }
.lang__opt.is-current { background: var(--ink); color: #fff; font-weight: 600; }
@media (max-width: 640px) {
  .nav { column-gap: 12px; }
  .lang__opt { min-width: 40px; padding: 0 9px; }
}

/* Simplified Chinese pages */
html[lang="zh-Hans"] body { font-family: "Public Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif; line-height: 1.75; }
html[lang="zh-Hans"] h1, html[lang="zh-Hans"] h2, html[lang="zh-Hans"] h3, html[lang="zh-Hans"] .brand, html[lang="zh-Hans"] .stat__num, html[lang="zh-Hans"] .ops .ops__org { font-family: "Newsreader", "Noto Serif SC", "Songti SC", "STSong", Georgia, serif; letter-spacing: 0; }
html[lang="zh-Hans"] .hero h1 { line-height: 1.3; }
html[lang="zh-Hans"] .label, html[lang="zh-Hans"] .ops h4 { letter-spacing: 0.04em; }
