/* Shared styles for the meaningful-background versions (6–8).
   ui-ux-pro-max: Modern Dark (Cinema) · Outfit + Inter, serif headline from version 3 (Noto Serif TC) · red accent */
:root {
  --bg: #0A0A0A; --surface: #141414; --line: #2A2A2A; --fg: #F2F2F2; --muted: #9A9A9A; --dim: #5C5C5C;
  --accent: #FF4A3D; --accent-rgb: 255, 74, 61;
  --display: "Outfit", "Noto Sans TC", sans-serif; --body: "Inter", "Noto Sans TC", sans-serif;
  --serif: "Noto Serif TC", serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); }
body { background: transparent; color: var(--fg); font: 16px/1.75 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--bg); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 40px; }
.accent { color: var(--accent); }
.label { font: 600 14px var(--body); color: var(--accent); letter-spacing: .02em; }

/* bilingual: every visible string exists as .zh and .en */
html[lang="en"] .zh, html:not([lang="en"]) .en { display: none !important; }

#stage { position: fixed; inset: 0 0 auto 0; z-index: 0; width: 100%; height: 100vh; height: 100lvh; display: block; }
.no-webgl #stage { display: none; }
main, .nav, footer { position: relative; z-index: 1; }
.solid { background: var(--bg); }

.nav { position: fixed; inset: 0 0 auto; z-index: 20; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); background: rgba(10,10,10,.55); border-bottom: 1px solid rgba(255,255,255,.06); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.brand { font: 700 18px var(--display); }
.brand span { color: var(--accent); }
.nav ul { display: flex; gap: 32px; list-style: none; padding: 0; font-size: 14px; color: var(--muted); }
.nav ul a { transition: color .2s; }
.nav ul a:hover { color: var(--fg); }
.nav ul a[aria-current] { color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 4px; }
.burger { display: none; place-content: center; gap: 6px; width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; cursor: pointer; }
.burger span { display: block; width: 22px; height: 2px; background: var(--fg); border-radius: 2px; transition: transform .25s var(--ease); }
.nav.open .burger span:first-child { transform: translateY(4px) rotate(45deg); }
.nav.open .burger span:last-child { transform: translateY(-4px) rotate(-45deg); }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang button { min-width: 44px; min-height: 36px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 13px var(--body); cursor: pointer; transition: background .2s, color .2s; }
.lang button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

.sec { padding: 140px 0; }
.title h2 { font: 700 clamp(44px, 6vw, 84px)/1 var(--display); letter-spacing: -.02em; color: #C9C9C9; }
.title h2 + p { font: 900 clamp(22px, 2.4vw, 32px)/1.3 var(--body); color: var(--fg); margin-top: 8px; }

/* about: version 1 layout + version 3 serif headline and drop cap */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.about .photo { border-radius: 4px; overflow: hidden; background: #E4E4E4; aspect-ratio: 4/5; }
.about .photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; filter: grayscale(1) contrast(1.05); transition: filter .8s var(--ease); }
.about .photo:hover img { filter: grayscale(0); }
.about .copy > * + * { margin-top: 28px; }
.hello { font: 700 22px var(--display); color: var(--accent); }
.serif-h { font: 900 clamp(32px, 3.4vw, 52px)/1.3 var(--serif); color: #EDEAE4; }
.dropcap { color: #CFCFCF; font-size: 17px; line-height: 1.9; }
.dropcap::first-letter { float: left; font: 900 76px/.9 var(--serif); color: var(--accent); margin: 6px 14px 0 0; }
.about .more { color: #CFCFCF; }
.info { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.info ul { list-style: none; padding: 0; margin-top: 8px; }
.info li { color: #CFCFCF; font-size: 15px; }
.info li::before { content: "▸ "; color: var(--accent); }

/* expertise pillars */
.pillars { margin-top: 64px; border-top: 1px solid var(--line); }
.pillar { display: grid; grid-template-columns: 4fr 5fr 3fr; gap: 48px; padding: 56px 0; border-bottom: 1px solid var(--line); }
.p-no { font: 600 14px var(--body); color: var(--accent); }
.pillar h3 { font: 900 clamp(24px, 2.4vw, 36px)/1.3 var(--body); margin-top: 12px; }
.p-sub { display: block; margin-top: 10px; font: 500 14px var(--display); color: var(--muted); }
.p-body p, .p-body li { color: #CFCFCF; }
.p-body ul { list-style: none; padding: 0; margin-top: 14px; display: grid; gap: 12px; }
.p-body li { padding-left: 18px; position: relative; }
.p-body li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }
.p-body b { color: var(--fg); }
.p-stat strong { display: block; font: 800 clamp(34px, 3.4vw, 54px)/1.05 var(--display); color: var(--accent); letter-spacing: -.02em; }
.p-stat > span { display: block; margin-top: 10px; font-size: 14px; color: var(--muted); }

/* experience */
.resume { display: grid; grid-template-columns: 5fr 7fr; gap: 80px; }
.resume .left { position: sticky; top: 120px; align-self: start; }
.edu { margin-top: 56px; }
.edu div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.edu strong { display: block; font-weight: 600; }
.edu span { font-size: 14px; color: var(--muted); }
.edu .hl { display: block; margin-top: 4px; font-size: 13px; line-height: 1.6; color: var(--accent); }
.edu .hl span { color: inherit; font-size: inherit; }
.edu .label, .edu .label span { color: var(--accent); font-size: 14px; }
.edu + .edu { margin-top: 40px; }
.timeline { position: relative; padding-left: 36px; }
.timeline .rail { position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline .rail i { position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(0); }
.job { position: relative; padding-bottom: 64px; }
.job:last-child { padding-bottom: 0; }
.job::before { content: ""; position: absolute; left: -36px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px rgba(var(--accent-rgb), .18); }
.job h3 { font: 700 clamp(22px, 2.2vw, 28px)/1.3 var(--display); color: var(--accent); }
.job .when { font-size: 14px; color: var(--accent); opacity: .8; margin-top: 4px; }
.job p { color: #CFCFCF; margin-top: 16px; }
.job p.win { color: var(--fg); font: 700 clamp(19px, 1.7vw, 23px)/1.5 var(--body); margin-top: 18px; }
.wins { list-style: none; padding: 0; margin-top: 14px; display: grid; gap: 10px; }
.wins li { color: #CFCFCF; padding-left: 18px; position: relative; }
.wins li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }

/* international: magazine collage */
.intl-lede { margin-top: 24px; color: #CFCFCF; font-size: clamp(17px, 1.5vw, 21px); }
.cgroup { display: grid; grid-template-columns: 64px 1fr; gap: 24px; margin-top: 96px; }
.vlabel { writing-mode: vertical-rl; font: 900 30px/1 var(--body); color: var(--accent); letter-spacing: .3em; }
html[lang="en"] .vlabel { font: 800 26px/1 var(--display); letter-spacing: .08em; }
.collage { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: start; }
.piece { position: relative; margin: 0; }
.cphoto { border-radius: 4px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0,0,0,.8); transition: transform .6s var(--ease); background: var(--surface); }
.cphoto img, .cphoto .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.cphoto .ph { display: grid; }
/* second photo pinned over the corner (e.g. a return visit) */
.inset { position: absolute; right: -18px; bottom: 120px; width: 46%; z-index: 3; transform: rotate(4deg); border: 6px solid #EDEDED; border-bottom-width: 30px; box-shadow: 0 24px 40px -16px rgba(0,0,0,.85); background: #EDEDED; transition: transform .6s var(--ease); }
.inset img { display: block; width: 100%; height: auto; }
.inset > span { position: absolute; left: 0; right: 0; bottom: -24px; text-align: center; font: 700 12px var(--body); color: #0A0A0A; }
.piece:hover .inset { transform: rotate(0deg) scale(1.04); }
.in .p0 .inset { right: 20px; width: 40%; }
@media (max-width: 900px) { .inset, .in .p0 .inset { right: -4px; bottom: auto; top: -18px; width: 38%; border-width: 4px; border-bottom-width: 24px; } .inset > span { bottom: -20px; font-size: 11px; } }   /* phones: pin to the photo’s top corner so it never covers the caption */
/* real photos keep their own ratio (16:9 or otherwise) so nothing is cropped; placeholders keep the designed ratio */
.cphoto.natural { aspect-ratio: auto !important; }
.cphoto.natural img { height: auto; }
.piece:hover .cphoto { transform: rotate(0deg) scale(1.02) !important; }
.ph { display: grid; place-items: center; color: var(--dim); font-size: 13px; background: repeating-linear-gradient(135deg, #121212 0 14px, #161616 14px 28px); }
.big { position: absolute; top: -48px; left: -12px; font: 800 110px/1 var(--display); color: transparent; -webkit-text-stroke: 1.5px rgba(255,74,61,.8); pointer-events: none; z-index: 2; }
.piece figcaption { margin-top: 16px; display: grid; gap: 4px; }   /* text spans the full width of its photo */
.piece figcaption b { font: 800 22px/1.35 var(--body); }
.piece figcaption .meta { font-size: 13px; color: var(--accent); }
.piece figcaption .story { color: #CFCFCF; font-size: 14px; line-height: 1.7; }
.piece figcaption .outcome { margin-top: 6px; padding-left: 18px; position: relative; color: var(--fg); font-weight: 700; font-size: 15px; line-height: 1.6; }
.piece figcaption .outcome::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }
.todo { color: var(--dim); font-style: italic; }
.out .lead { grid-column: 1 / 8; } .out .lead .cphoto { aspect-ratio: 3/2; transform: rotate(-1.5deg); }
.out .side { grid-column: 8 / 13; margin-top: 140px; } .out .side .cphoto { aspect-ratio: 4/3; transform: rotate(2deg); }
.in .p0 { grid-column: 1 / 9; } .in .p0 .cphoto { aspect-ratio: 4/5; transform: rotate(1.5deg); }
.in .p1 { grid-column: 9 / 13; margin-top: 160px; } .in .p1 .cphoto { aspect-ratio: 16/10; transform: rotate(-1deg); }
.in .p2 { grid-column: 3 / 10; margin-top: 140px; }   /* clear the big outline number above */ .in .p2 .cphoto { aspect-ratio: 4/3; transform: rotate(-2deg); }
.in .p3 { grid-column: 8 / 12; margin-top: 120px; } .in .p3 .cphoto { aspect-ratio: 1; transform: rotate(2.5deg); }
@media (max-width: 900px) { .cgroup { grid-template-columns: 1fr; } .vlabel { writing-mode: horizontal-tb; } .collage { grid-template-columns: 1fr; } .piece { grid-column: auto !important; margin-top: 128px !important; } .collage > .piece:first-child { margin-top: 72px !important; } }

/* works */
.works { display: grid; grid-template-columns: repeat(12, 1fr); gap: 28px; margin-top: 56px; }
/* every photo is 16:9 (most source photos are), so nothing gets cropped */
.work { grid-column: span 4; display: block; }
.work.lead { grid-column: span 8; grid-row: span 2; }
.work .img { overflow: hidden; border-radius: 4px; background: var(--surface); aspect-ratio: 16/9; }
.work img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform .9s var(--ease), filter .6s; filter: brightness(.85); }
.work:hover img { transform: scale(1); filter: brightness(1); }
.work .meta { padding-top: 18px; }
.work h3 { font: 600 20px/1.4 var(--display); margin-top: 4px; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; display: inline; transition: background-size .5s var(--ease); }
.work:hover h3 { background-size: 100% 2px; }
.work .wsum { margin-top: 10px; color: #BDBDBD; font-size: 14.5px; line-height: 1.75; max-width: 60ch; }

.works-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.clink { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font: 600 14px var(--body); color: var(--accent); }
.edu .clink { display: flex; width: fit-content; }
.clink i { font-style: normal; transition: transform .3s var(--ease); }
.clink:hover i { transform: translateX(4px); }
.all-link { display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 10px 0 24px; border: 1px solid var(--line); border-radius: 999px; font: 600 16px var(--body); transition: border-color .3s, background .3s, color .3s; }
.all-link b { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 999px; background: #1E1E1E; font: 700 14px var(--display); color: var(--accent); transition: background .3s, color .3s; }
.all-link i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--bg); font-style: normal; font-size: 18px; transition: transform .4s var(--ease); }
.all-link:hover { border-color: var(--accent); background: rgba(255,74,61,.08); }
.all-link:hover i { transform: translateX(4px); }

/* contact */
.contact { min-height: 90vh; display: flex; flex-direction: column; justify-content: center; }
.contact > .wrap { width: 100%; }   /* auto margins would otherwise shrink it in the flex column */
.contact h2 { font: 800 clamp(52px, 9vw, 150px)/.95 var(--display); letter-spacing: -.035em; margin-top: 12px; }
.contact-row { display: flex; flex-direction: column; gap: 48px; margin-top: 64px; }
.contact-row p { color: #CFCFCF; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.8; max-width: none; }
.channels { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; border-top: 1px solid var(--line); }
.channels a { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 64px; border-bottom: 1px solid var(--line); font: 600 20px var(--display); transition: color .2s, padding .4s var(--ease); }
.channels a:hover { color: var(--accent); padding-left: 10px; }
.channels small { font: 400 13px var(--body); color: var(--muted); }
footer { border-top: 1px solid var(--line); }
footer .wrap { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; padding-bottom: 24px; font-size: 13px; color: var(--dim); }
.fsocial { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; }
.fsocial a { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: #BDBDBD; transition: color .2s, border-color .2s; }
.fsocial a::after { content: ""; position: absolute; inset: -5px; }   /* keeps a 44px tap target around the smaller circle */
.fsocial a:hover, .fsocial a:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
.fsocial svg { width: 15px; height: 15px; }

@media (max-width: 900px) {
  .wrap { padding: 0 20px; }
  .nav .wrap { display: grid; grid-template-columns: 1fr auto auto; grid-template-rows: 68px auto; align-items: center; height: auto; gap: 0 12px; }
  .nav ul { grid-column: 1 / -1; }
  .burger { display: grid; }
  .nav ul { display: none; order: 3; width: 100%; flex-direction: column; gap: 0; margin: 0; padding: 4px 0 20px; font-size: 17px; }
  .nav.open ul { display: flex; }
  .nav ul a { display: block; padding: 12px 0; }
  .nav ul a[aria-current] { box-shadow: none; padding-bottom: 12px; color: var(--accent); }
  .about, .resume { grid-template-columns: 1fr; gap: 48px; }
  /* mobile order: About title → photo → Hello…; Experience: jobs before education */
  .about { gap: 0; } .about .copy, .resume .left { display: contents; }
  .about .title { order: -1; } .about .photo { margin-top: 28px; }
  .resume .title { order: -1; } .resume .edu { order: 2; }
  .about .photo.color img { filter: grayscale(0); }
  .resume .left { position: static; }
  .pillar { grid-template-columns: 1fr; gap: 28px; padding: 64px 0; }
  .works { grid-template-columns: 1fr; }
  .work, .work.lead { grid-column: auto; grid-row: auto; }
  .channels { grid-template-columns: 1fr; }
  .info { grid-template-columns: 1fr; }
  .sec { padding: 96px 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { transition: none !important; animation: none !important; } }

/* slide-in animations start off-canvas: clip so they never widen the page on mobile */
main { overflow-x: clip; }

/* mobile paragraph breaks inserted at sentence ends by dist.py */
.mbr { display: none; }
@media (max-width: 720px) { .mbr { display: block; height: 18px; } .about .mbr { height: 28px; } }   /* same gap as real paragraphs in each context */

/* content that only one layout shows */
.phone-only { display: none; }
@media (max-width: 900px) { .desk-only { display: none; } .phone-only { display: inline; } }
