/* ==========================================================================
   wlynam.com — shared stylesheet.
   Sidebar + content layout used by every page. Tokens up top; retune here
   and the whole site follows. Light by default, dark when the visitor's
   system is set to dark.
   ========================================================================== */

/* — Archivo (variable, self-hosted) — */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('/assets/fonts/archivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('/assets/fonts/archivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('/assets/fonts/archivo-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* — tokens — */
/* Two columns on desktop. Name, role and links stay pinned on the left; About, Projects and a short Experience list scroll on the right. Stacks to one column on phones. */
:root {
  --bg: #fbfbfa;
  --text: #121212;
  --dim: #6b6b6b;
  --accent: #2348e8;
  --rule: #e4e4e2;
  --hover: #f1f2f6;
  --font: 'Archivo', system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111213; --text: #ededed; --dim: #9a9a9a; --accent: #7d95ff; --rule: #26282b; --hover: #1a1c22; color-scheme: dark; }
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; padding-inline: 24px; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.layout { max-width: 1040px; margin: 0 auto; display: grid; grid-template-columns: 340px 1fr; gap: 64px; }

aside { position: sticky; top: 0; align-self: start; padding-block: 72px 40px; display: flex; flex-direction: column; gap: 24px; min-height: 100vh; }
aside h1 { margin: 0; font-size: 44px; font-weight: 800; font-stretch: 118%; letter-spacing: -.03em; line-height: 1; }
aside .role { margin: 0; font-size: 17px; font-weight: 600; }
aside .loc { margin: -18px 0 0; color: var(--dim); font-size: 15px; }
.toc { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; }
.toc a { display: flex; align-items: center; gap: 12px; padding-block: 6px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: var(--dim); }
.toc a::before { content: ''; width: 24px; height: 1px; background: currentColor; transition: width .15s ease; }
.toc a:hover, .toc a.on { color: var(--text); }
.toc a:hover::before, .toc a.on::before { width: 48px; }
.links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border: 1.5px solid var(--text); border-radius: 999px; font-weight: 700; font-size: 14px; text-decoration: none; }
.btn:hover { background: var(--text); color: var(--bg); }
.links .t { font-size: 14px; font-weight: 600; text-decoration: none; color: var(--dim); }
.links .t:hover { color: var(--accent); }

main { padding-block: 72px 120px; display: flex; flex-direction: column; gap: 72px; min-width: 0; }
section h2 { margin: 0 0 20px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.about p { margin: 0 0 16px; font-size: 18px; max-width: 56ch; text-wrap: pretty; }
.about p:last-child { margin: 0; color: var(--dim); }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.item { display: grid; grid-template-columns: 96px 1fr; gap: 4px 20px; padding: 18px 16px; margin-inline: -16px; border-radius: 8px; text-decoration: none; transition: background .15s ease; }
a.item:hover { background: var(--hover); }
.item .yr { grid-row: span 2; font-size: 13px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; padding-top: 3px; }
.item .nm { font-size: 17px; font-weight: 700; }
a.item:hover .nm { color: var(--accent); }
.item .nm .arr { display: inline-block; margin-left: 6px; transition: transform .15s ease; }
a.item:hover .arr { transform: translate(3px, -3px); }
.item .ds { color: var(--dim); font-size: 15px; }

.more { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  aside { position: static; min-height: 0; padding-block: 56px 8px; }
  .toc { display: none; }
  .links { margin-top: 8px; }
  main { padding-block: 48px 120px; gap: 56px; }
}
@media (max-width: 480px) { .item { grid-template-columns: 1fr; } .item .yr { grid-row: auto; padding: 0; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--dim); margin-bottom: 8px; }
.back:hover { color: var(--accent); }
.back b { font-weight: 800; color: var(--text); }
.kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
aside .kicker + h1 { margin-top: -12px; }
.lede { margin: 0; font-size: 17px; color: var(--dim); text-wrap: pretty; }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; font-weight: 600; }
.prose p { margin: 0 0 16px; font-size: 18px; max-width: 56ch; text-wrap: pretty; }
.prose p:last-child { margin-bottom: 0; }
.prose figure { margin: 32px 0; }
.prose figure img, .prose figure video { display: block; width: 100%; height: auto; border-radius: 8px; background: var(--hover); }
.prose figcaption { margin-top: 8px; font-size: 13px; color: var(--dim); }
.prose figure.one { max-width: 420px; }
.prose figure.ph { margin: 32px 0; }
.figs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; margin: 32px 0; }
.figs figure { margin: 0; }
@media (max-width: 480px) { .figs { grid-template-columns: 1fr; } }
.prose .steps { margin-top: 28px; }
.prose .steps p { font-size: 16px; }
.shotrow { display: grid; grid-template-columns: 1fr 180px; gap: 24px; align-items: start; }
.shotrow + .shotrow { margin-top: 40px; }
.prose .shotrow h3 { margin: 0 0 8px; font-size: 17px; }
.phone { margin: 0; }
.phone img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 16px; }
.prose .plain { margin: 0 0 16px; padding-left: 20px; font-size: 18px; max-width: 56ch; display: flex; flex-direction: column; gap: 8px; }
.prose code { font-size: .88em; padding: 1px 5px; border-radius: 4px; background: var(--hover); }
@media (max-width: 560px) { .shotrow { grid-template-columns: 1fr; } .phone { max-width: 220px; } }
.video { position: relative; display: block; max-width: 100%; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #0b0c0e; color: #fff; text-decoration: none; }
.video .play { position: absolute; inset: 0; display: grid; place-items: center; }
.video .play span { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 26px; padding-left: 4px; }
.video .cap { position: absolute; left: 16px; bottom: 14px; font-size: 13px; opacity: .8; }
.ph { border: 1.5px dashed var(--rule); border-radius: 10px; padding: 20px; color: var(--dim); font-size: 15px; display: flex; flex-direction: column; gap: 6px; max-width: 60ch; }
.ph b { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.ph.tall { aspect-ratio: 16/9; justify-content: center; align-items: center; text-align: center; max-width: 100%; }
.status { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: var(--hover); font-size: 13px; font-weight: 600; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #e0a100; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: flex; flex-direction: column; gap: 28px; }
.steps > li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 4px 16px; }
.steps > li::before { content: counter(s); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--text); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.steps h3 { margin: 4px 0 6px; font-size: 17px; }
.pager { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 24px; }
.pager a { text-decoration: none; display: flex; flex-direction: column; gap: 2px; font-weight: 700; }
.pager a span { font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.pager a:hover { color: var(--accent); }
.pager .next { text-align: right; margin-left: auto; }
aside h1.proj { font-size: 40px; }
.proj { scroll-margin-top: 24px; padding: 24px 20px; margin-inline: -20px; border-radius: 10px; display: flex; flex-direction: column; gap: 10px; transition: background .15s ease; }
@media (hover: hover) { .proj:hover { background: var(--hover); } }
.proj .hd { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.proj h3 { margin: 0; font-size: 22px; font-weight: 800; font-stretch: 112%; letter-spacing: -.02em; }
.proj .yr { color: var(--dim); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.proj p.kicker { margin-top: -4px; font-size: 12px; }
.proj p { margin: 0; font-size: 17px; max-width: 58ch; text-wrap: pretty; }
.proj .dimp { color: var(--dim); }
.proj .shot { display: block; width: 100%; max-width: 300px; height: auto; border-radius: 8px; margin-block: 6px; }
.proj .links { margin-top: 4px; }
.expand { display: flex; flex-direction: column; gap: 24px; padding-top: 8px; }
.expand[hidden] { display: none; }
.expand h4 { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.toc a.sub { padding-left: 36px; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; }
.toc a.sub::before { width: 12px; }
.toc a.sub:hover::before, .toc a.sub.on::before { width: 24px; }
.readmore { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit;
  align-self: flex-start; margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: none; }
.readmore span { transition: transform .15s ease; }
.readmore:hover span { transform: translateY(2px); }
.readmore[aria-expanded="true"] span { transform: rotate(180deg); }
.projects { display: flex; flex-direction: column; gap: 8px; }
main > .lede { font-size: 19px; color: var(--text); max-width: 56ch; }

/* — skip link — */
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; padding: 10px 16px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }
.skip:focus { left: 8px; top: 8px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
