/* Be Vietnam Pro (self-hosted, same files as the old build). */
@font-face{font-family:Be Vietnam Pro;font-style:normal;font-display:swap;font-weight:400;src:url(./be-vietnam-pro-vietnamese-400-normal-CRcqvyg1.woff2) format("woff2"),url(./be-vietnam-pro-vietnamese-400-normal-BuGn0gnm.woff) format("woff");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}
@font-face{font-family:Be Vietnam Pro;font-style:normal;font-display:swap;font-weight:400;src:url(./be-vietnam-pro-latin-ext-400-normal-CiZNW1ec.woff2) format("woff2"),url(./be-vietnam-pro-latin-ext-400-normal-DYBYyMQr.woff) format("woff");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:Be Vietnam Pro;font-style:normal;font-display:swap;font-weight:400;src:url(./be-vietnam-pro-latin-400-normal-PpnXBOrz.woff2) format("woff2"),url(./be-vietnam-pro-latin-400-normal-bXgqVju9.woff) format("woff");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:Be Vietnam Pro;font-style:normal;font-display:swap;font-weight:500;src:url(./be-vietnam-pro-vietnamese-500-normal-DREgrEoJ.woff2) format("woff2"),url(./be-vietnam-pro-vietnamese-500-normal-CfdwVo8-.woff) format("woff");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}
@font-face{font-family:Be Vietnam Pro;font-style:normal;font-display:swap;font-weight:500;src:url(./be-vietnam-pro-latin-ext-500-normal-h0Fp6aX0.woff2) format("woff2"),url(./be-vietnam-pro-latin-ext-500-normal-CK0UkkKf.woff) format("woff");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:Be Vietnam Pro;font-style:normal;font-display:swap;font-weight:500;src:url(./be-vietnam-pro-latin-500-normal-B6LVzGNe.woff2) format("woff2"),url(./be-vietnam-pro-latin-500-normal-BJkVuMHw.woff) format("woff");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:Be Vietnam Pro;font-style:normal;font-display:swap;font-weight:600;src:url(./be-vietnam-pro-vietnamese-600-normal-nyU-ZL2p.woff2) format("woff2"),url(./be-vietnam-pro-vietnamese-600-normal-DkpCIyan.woff) format("woff");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}
@font-face{font-family:Be Vietnam Pro;font-style:normal;font-display:swap;font-weight:600;src:url(./be-vietnam-pro-latin-ext-600-normal-BNd8euf0.woff2) format("woff2"),url(./be-vietnam-pro-latin-ext-600-normal-BeUwKxhG.woff) format("woff");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:Be Vietnam Pro;font-style:normal;font-display:swap;font-weight:600;src:url(./be-vietnam-pro-latin-600-normal-BZDkUTrt.woff2) format("woff2"),url(./be-vietnam-pro-latin-600-normal-5IO4e7bK.woff) format("woff");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}
/* Minimal, content-first layout in the spirit of antfu.me: one narrow column, plain text, small inline badges. */
:root {
  --bg: #ffffff;
  --fg: #2f2f2f;
  --fg-deep: #111111;
  --fg-muted: #6b6b6b;
  --border: #e6e6e6;
  --badge: #f3f3f3;
  --accent: #0f766e;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0d; --fg: #c8c8c8; --fg-deep: #f2f2f2; --fg-muted: #8a8a8a;
    --border: #262626; --badge: #1b1b1b; --accent: #5eead4; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0d; --fg: #c8c8c8; --fg-deep: #f2f2f2; --fg-muted: #8a8a8a;
  --border: #262626; --badge: #1b1b1b; --accent: #5eead4; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.75 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.dots-bg, .chrome-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.nav, main, footer { position: relative; z-index: 1; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; }

/* Native transitions preserve normal links, history, and browser navigation. */
@view-transition { navigation: auto; }
.nav { view-transition-name: site-nav; }
main { view-transition-name: page-content; }
::view-transition-group(*) { animation-duration: .28s; }
::view-transition-old(site-nav) { display: none; }
::view-transition-new(site-nav) { animation: none; }
::view-transition-old(page-content) { animation: page-leave .18s ease-in both; }
::view-transition-new(page-content) { animation: page-enter .28s ease-out both; }
@keyframes page-leave {
  to { opacity: 0; transform: translateY(-6px); }
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@supports not (view-transition-name: page-content) {
  main { animation: page-enter .28s ease-out both; }
}

/* Header */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto; padding: 20px 24px;
}
.nav-logo { color: var(--fg-deep); display: block; }
.signature { display: block; width: 110px; height: auto; }
/* Reveal the initial, connected letters, then the Vietnamese accent. */
.sig-reveal { stroke-dasharray: 1; stroke-dashoffset: 1; animation: sign .4s ease-in forwards; }
.sig-reveal-2 { animation-delay: .35s; animation-duration: 1.4s; animation-timing-function: cubic-bezier(.4, 0, .6, 1); }
.sig-reveal-3 { animation-delay: 1.8s; animation-duration: .15s; }
@keyframes sign { to { stroke-dashoffset: 0; } }
.nav-text { font-size: 15px; white-space: nowrap; }
.lang-switch { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-muted); font-size: 14px; }
.lang-switch button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--fg-muted); font: inherit; }
.lang-switch button[aria-pressed="true"] { color: var(--fg-deep); font-weight: 600; }
.term-btn { font-size: 15px; font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a, .icon-btn {
  color: var(--fg-muted); text-decoration: none; font-size: 15px;
  background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; transition: color .15s;
}
.nav-links a:hover, .icon-btn:hover { color: var(--fg-deep); }
.nav-links svg { width: 19px; height: 19px; }
.theme-sun { display: none; }
:root[data-theme="dark"] .theme-sun { display: block; }
:root[data-theme="dark"] .theme-moon { display: none; }

/* Content */
main { max-width: 65ch; margin: 0 auto; padding: 40px 24px 64px; }
h1 { margin: 0 0 4px; font-size: 2.1rem; line-height: 1.25; font-weight: 600; color: var(--fg-deep); }
.subtitle { margin: 0 0 32px; color: var(--fg-muted); font-style: italic; }
h2 {
  margin: 48px 0 12px; font-size: 1.1rem; font-weight: 600; color: var(--fg-deep);
}
p { margin: 0 0 18px; }
strong { color: var(--fg-deep); font-weight: 600; }
.prose a {
  color: var(--fg-deep); text-decoration: none;
  border-bottom: 1px solid var(--border); transition: border-color .15s;
}
.prose a:hover { border-color: var(--fg-deep); }

/* Rows of "label: badge badge badge" like antfu.me */
.facts { display: grid; gap: 6px; margin: 0 0 28px; }
.fact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fact-label { color: var(--fg-muted); min-width: 92px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 1px 9px; border-radius: 6px;
  background: var(--badge); color: var(--fg-deep);
  font-size: .88rem; line-height: 1.7; text-decoration: none;
}
a.badge { border: 0; transition: opacity .15s; }
a.badge:hover { opacity: .75; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* Skills list */
.skills { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.skills li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.skills .level { color: var(--fg-muted); font-size: .9rem; }

.muted { color: var(--fg-muted); }
.term-hint { color: var(--fg-muted); font-size: .92rem; }
kbd {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em;
  padding: 0 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px;
}
/* Blog: post list on /blog/ and article typography on each post. */
.post-list { list-style: none; margin: 0 0 8px; padding: 0; }
.post-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 6px 0; }
.prose .post-list a { border-bottom: 0; color: var(--fg); transition: color .15s; }
.prose .post-list a:hover { color: var(--fg-deep); }
.post-list time { color: var(--fg-muted); font-size: .85rem; white-space: nowrap; }
.post-meta { color: var(--fg-muted); font-size: .9rem; margin: 0 0 32px; }
.post-back { display: inline-block; margin-bottom: 24px; color: var(--fg-muted); font-size: .9rem; }
.prose .post-back { border-bottom: 0; }
.post h2 { margin-top: 40px; }
.post h3 { margin: 28px 0 8px; font-size: 1rem; color: var(--fg-deep); }
.post ul, .post ol { margin: 0 0 18px; padding-left: 1.4em; }
.post li { margin-bottom: 4px; }
.post blockquote { margin: 0 0 18px; padding: 2px 0 2px 16px; border-left: 3px solid var(--border); color: var(--fg-muted); }
.post code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; background: var(--badge); padding: 1px 6px; border-radius: 5px; }
.post pre { margin: 0 0 18px; padding: 14px 16px; overflow-x: auto; background: var(--badge); border-radius: 8px; line-height: 1.55; }
.post pre code { background: none; padding: 0; font-size: .85rem; }
.post img { max-width: 100%; height: auto; border-radius: 8px; }

/* Projects: one row per project, title + short description + small badges. */
.project-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.project-list li { padding: 16px 0; border-bottom: 1px solid var(--border); }
.project-list h2 { margin: 0 0 4px; font-size: 1.05rem; }
.project-list p { margin: 0 0 8px; color: var(--fg); }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.project-list li.product-row { display: grid; grid-template-columns: 168px 1fr; gap: 18px; align-items: start; padding: 20px 0; }
.product-thumb { display: block; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--badge); }
.prose a.product-thumb { border-bottom: 1px solid var(--border); }
.product-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .35s ease; }
.product-thumb:hover img { transform: scale(1.03); }
.prose a.product-more { font-size: .9rem; color: var(--fg-muted); border-bottom: 0; }
.prose a.product-more:hover { color: var(--fg-deep); }
@media (max-width: 560px) { .project-list li.product-row { grid-template-columns: 1fr; gap: 12px; } }

/* Product intro pages (/projects/<slug>/): what it does, a demo video, screenshots, and the link to the app last. */
.product-video { margin: 0 0 8px; }
.product-video video, .product-shot img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  border: 1px solid var(--border); border-radius: 8px; background: var(--badge);
}
.product-video figcaption, .product-shot figcaption { margin-top: 8px; color: var(--fg-muted); font-size: .85rem; }
.product-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.product-points li { padding-left: 14px; border-left: 2px solid var(--border); }
.product-points strong { display: block; }
.product-features { margin: 0 0 18px; padding-left: 1.2em; }
.product-features li { margin-bottom: 6px; }
.product-gallery { display: grid; gap: 24px; }
.product-shot { margin: 0; }
.product-new { vertical-align: middle; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 8px; margin-left: 6px; background: var(--accent); color: var(--bg); }
.product-app { display: flex; gap: 16px; align-items: flex-start; padding: 16px; border: 1px solid var(--border); border-radius: 12px; }
.product-app img { flex: none; width: 56px; height: 56px; border-radius: 13px; }
.product-app p { margin: 0; }
.product-cta { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }
.product-cta p { margin: 0 0 12px; color: var(--fg-muted); }
.prose a.cta-link {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border: 1px solid var(--fg-deep); border-radius: 8px;
  color: var(--fg-deep); text-decoration: none; transition: background-color .15s, color .15s;
}
.prose a.cta-link:hover { background: var(--fg-deep); color: var(--bg); }
.cta-link .cta-name { font-weight: 600; }
.cta-link .cta-url { color: inherit; opacity: .7; }
.cta-link .cta-arrow { transition: transform .15s; }
.cta-link:hover .cta-arrow { transform: translateX(3px); }

/* Contact, in the style of antfu.me: a row of icon links, then the email. */
.contact { margin-top: 48px; }
.contact p { margin: 0 0 14px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.prose .contact-links a {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500; padding-bottom: 1px;
}
.contact-links svg { width: 18px; height: 18px; }
.prose .contact-mail { color: var(--fg); }
.nav-links a[aria-current="page"] { color: var(--fg-deep); }

/* Terminal (CTF) */
.terminal {
  position: fixed; right: 24px; bottom: 24px; z-index: 10;
  width: min(560px, calc(100vw - 32px)); height: min(380px, calc(100vh - 120px));
  display: flex; flex-direction: column;
  background: #0b0b0b; color: #d4d4d4; border: 1px solid #2a2a2a; border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35); overflow: hidden;
}
.terminal[hidden] { display: none; }
.terminal-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid #2a2a2a; color: #8a8a8a; font-size: .85rem;
}
.terminal-bar .icon-btn { color: #8a8a8a; }
.terminal-bar .icon-btn:hover { color: #fff; }
.terminal-output { flex: 1; overflow-y: auto; padding: 10px 12px; font-size: .82rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.terminal-output .term-cmd { color: #5eead4; }
.terminal-form { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid #2a2a2a; font-size: .85rem; }
.terminal-form .prompt { color: #5eead4; }
.terminal-form input { flex: 1; background: none; border: 0; outline: 0; color: #fff; font: inherit; }

footer {
  max-width: 65ch; margin: 0 auto; padding: 0 24px 48px;
  color: var(--fg-muted);
}
/* Font size lives here so the footer's 65ch matches the main column's width. */
footer .rule { border-top: 1px solid var(--border); padding-top: 20px; font-size: .9rem; }

@media (max-width: 520px) {
  .nav { padding: 16px; }
  .nav-links { gap: 14px; }
  main { padding: 24px 16px 48px; }
  footer { padding: 0 16px 40px; }
  h1 { font-size: 1.75rem; }
  .fact-label { min-width: 100%; }
  /* Keep Blog and Projects reachable on phones; the social icons are repeated in the Contact section. */
  .nav-links a:not(.nav-text) { display: none; }
  .nav-links { gap: 12px; }
  .terminal { right: 16px; bottom: 16px; }
}
@media (max-width: 360px) {
  .signature { width: 76px; }
  .nav-links { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  main { animation: none; }
  * { transition: none !important; }
  .sig-reveal { animation: none; stroke-dashoffset: 0; }
}
