/* Canvas design: shared base for the homepage and the case study pages.
 * Fonts, colour tokens (light and dark), base elements, buttons, section headings, the project card,
 * the properties panel, process steps, links, social list and footer. Page files add their own layout.
 */

@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/be-vietnam-pro/be-vietnam-pro-vietnamese-400-normal.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; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/be-vietnam-pro/be-vietnam-pro-latin-400-normal.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: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/be-vietnam-pro/be-vietnam-pro-vietnamese-500-normal.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; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/be-vietnam-pro/be-vietnam-pro-latin-500-normal.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: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/be-vietnam-pro/be-vietnam-pro-vietnamese-600-normal.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; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/be-vietnam-pro/be-vietnam-pro-latin-600-normal.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: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/be-vietnam-pro/be-vietnam-pro-vietnamese-700-normal.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; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/be-vietnam-pro/be-vietnam-pro-latin-700-normal.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: "Be Vietnam Pro"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/be-vietnam-pro/be-vietnam-pro-vietnamese-800-normal.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; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/be-vietnam-pro/be-vietnam-pro-latin-800-normal.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; }

:root {
  --canvas: #e8e8e5;
  --dot: #bdbdb7;
  --frame: #ffffff;
  --ink: #17171a;
  --muted: #5f5f5a;
  --faint: #66665f;
  --line: #dadad6;
  --control: #8f8f88;
  --hover: #efefec;
  --selection: #2f6bff;
  --on-selection: #ffffff;
  --accent: #7a1020;
  --accent-hover: #5f0c18;
  --on-accent: #ffffff;
  --link: #7a1020;
  --success: #1d7348;
  --shadow: 0 2px 8px rgba(23, 23, 26, 0.08);
  --gutter: clamp(20px, 6.9vw, 100px);
  --section-gap: clamp(112px, 12vw, 180px);
  --radius-card: clamp(16px, 1.6vw, 20px);
  --font: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #1c1c1e;
    --dot: #3a3a3e;
    --frame: #2a2a2e;
    --ink: #f2f2ef;
    --muted: #b8b8b1;
    --faint: #a3a39c;
    --line: #3d3d42;
    --control: #808088;
    --hover: #36363b;
    --selection: #5b8cff;
    --on-selection: #0d1120;
    --accent: #8f1628;
    --accent-hover: #a41c31;
    --link: #ff9fae;
    --success: #6fd19c;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background-color: var(--canvas);
  background-image: radial-gradient(circle, var(--dot) 1.25px, transparent 1.5px);
  background-size: 24px 24px;
  background-position: 12px 12px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: -0.01em; /* Be Vietnam Pro is wide: text sizes read loose without this */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--selection); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: var(--frame); color: var(--ink); font-weight: 500; }
.skip-link:focus { top: 12px; }
.wrap { width: min(1240px, 100% - 2 * var(--gutter)); margin-inline: auto; }

/* Buttons and section headings */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: 600 16px/1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn--primary { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { border-color: var(--control); background: var(--frame); color: var(--ink); font-weight: 500; }
.btn--secondary:hover { background: var(--hover); }
.btn--small { min-height: 40px; padding: 0 16px; border-radius: 9px; font-size: 14px; font-weight: 500; }
.section { padding-top: var(--section-gap); }
.section__head { max-width: 620px; padding-bottom: 48px; }
.section__head--split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; max-width: none; }
.section__title { font-size: clamp(36px, 4.2vw, 52px); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; }
.section__lead { max-width: 560px; margin-top: 12px; color: var(--muted); font-size: 18px; line-height: 1.6; }

/* Project card (homepage work, "next project") */
.work-card { display: flex; flex-direction: column; }
.frame { display: flex; flex: 1; flex-direction: column; overflow: hidden; border-radius: var(--radius-card); background: var(--frame); color: inherit; text-decoration: none; outline: 1.5px solid transparent; outline-offset: 0; transition: outline-color 0.15s ease; }
.frame:hover, .frame:focus-visible { outline-color: var(--selection); }
/* AI video projects: a small "Video" label on the card image */
.frame { position: relative; }
.frame__badge { position: absolute; top: 14px; left: 14px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 10px; border-radius: 999px; background: rgba(23, 23, 26, 0.78); color: #ffffff; font-size: 13px; font-weight: 600; line-height: 1; letter-spacing: 0; }
.frame__image { display: block; width: 100%; aspect-ratio: 608 / 440; object-fit: cover; background: var(--hover); }
.frame__caption { display: flex; flex: 1; flex-direction: column; gap: 18px; padding: 24px 28px 28px; }
.frame__title { font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.frame__summary { margin-top: 10px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.frame__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; color: var(--faint); font-size: 14px; line-height: 1.4; }
.frame__cta { margin-top: auto; color: var(--link); font-size: 15px; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.frame__props { display: grid; margin: 28px 0 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.4; }
.frame__props div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.frame__props dt { color: var(--muted); }
.frame__props dd { font-weight: 500; text-align: right; overflow-wrap: anywhere; }

/* Large project card: image beside the caption */
.work-card--large .frame { flex-direction: row; }
.work-card--large .frame__image { width: 66%; aspect-ratio: 820 / 560; }
.work-card--large .frame__caption { justify-content: space-between; padding: 40px; }
.work-card--large .frame__title { font-size: 36px; letter-spacing: -0.025em; }
.work-card--large .frame__summary { font-size: 18px; }

/* Properties panel */
.inspector__panel { padding: 8px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--frame); }
.inspector__panel div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.4; }
.inspector__panel div:last-child { border-bottom: 0; }
.inspector__panel dt { color: var(--muted); }
.inspector__panel dd { font-weight: 500; text-align: right; }

/* Process: steps joined by prototype connections */
.steps { --step-gap: 72px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--step-gap); counter-reset: step; }
.step { position: relative; padding: 28px; border-radius: var(--radius-card); background: var(--frame); }
.step__number { color: var(--selection); font-size: 13px; font-weight: 500; }
.step h3 { margin-top: 8px; font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
.step p { margin-top: 10px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.step__link { position: absolute; left: 100%; top: 46px; display: flex; align-items: center; width: var(--step-gap); color: var(--selection); }
.step__link i { flex: 0 0 auto; width: 8px; height: 8px; margin-left: -4px; border: 1px solid var(--frame); border-radius: 50%; background: currentColor; }
.step__link b { flex: 1; height: 1.5px; background: currentColor; }
.step__link svg { flex: 0 0 auto; margin-left: -6px; }

/* Links and social */
.link-strong { color: var(--link); text-underline-offset: 4px; overflow-wrap: anywhere; }
.link-plain { color: var(--ink); text-underline-offset: 4px; }
.social { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 28px; font-size: 15px; }
.social a { color: var(--muted); text-decoration: none; }
.social a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
/* Footer */
.footer { padding: var(--section-gap) 0 48px; }
.footer__big { font-size: clamp(48px, 7.4vw, 104px); font-weight: 800; line-height: 1; letter-spacing: -0.035em; }
.footer__email { display: inline-block; margin: 28px 0 120px; color: var(--link); font-size: clamp(20px, 2vw, 26px); font-weight: 500; letter-spacing: -0.01em; text-underline-offset: 6px; overflow-wrap: anywhere; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 24px; border-top: 1px solid var(--control); color: var(--muted); font-size: 14px; }
.social--footer { margin-top: 0; font-size: 14px; }

/* Social links as icons. The icons are a 41-glyph subset of Remix Icon v4.2.0
   (Apache License 2.0, https://remixicon.com), so the page loads 6 KB instead of the whole set. */
@font-face { font-family: "social-icons"; font-style: normal; font-weight: 400; font-display: block; src: url("/assets/fonts/social-icons.woff2") format("woff2"); }
.social-icon { font-family: "social-icons"; font-style: normal; font-weight: 400; line-height: 1; -webkit-font-smoothing: antialiased; }
.social-icon.ri-facebook-circle-fill::before { content: "\ecba"; }
.social-icon.ri-facebook-circle-line::before { content: "\ecbb"; }
.social-icon.ri-facebook-fill::before { content: "\ecbc"; }
.social-icon.ri-facebook-line::before { content: "\ecbd"; }
.social-icon.ri-instagram-fill::before { content: "\ee65"; }
.social-icon.ri-instagram-line::before { content: "\ee66"; }
.social-icon.ri-tiktok-fill::before { content: "\f372"; }
.social-icon.ri-tiktok-line::before { content: "\f373"; }
.social-icon.ri-linkedin-fill::before { content: "\eeb5"; }
.social-icon.ri-linkedin-line::before { content: "\eeb6"; }
.social-icon.ri-linkedin-box-fill::before { content: "\eeb3"; }
.social-icon.ri-linkedin-box-line::before { content: "\eeb4"; }
.social-icon.ri-github-fill::before { content: "\edca"; }
.social-icon.ri-github-line::before { content: "\edcb"; }
.social-icon.ri-behance-fill::before { content: "\eab9"; }
.social-icon.ri-behance-line::before { content: "\eaba"; }
.social-icon.ri-dribbble-fill::before { content: "\ec63"; }
.social-icon.ri-dribbble-line::before { content: "\ec64"; }
.social-icon.ri-youtube-fill::before { content: "\f2d4"; }
.social-icon.ri-youtube-line::before { content: "\f2d5"; }
.social-icon.ri-twitter-x-fill::before { content: "\f3e6"; }
.social-icon.ri-twitter-x-line::before { content: "\f3e7"; }
.social-icon.ri-threads-fill::before { content: "\f3e0"; }
.social-icon.ri-threads-line::before { content: "\f3e1"; }
.social-icon.ri-pinterest-fill::before { content: "\efff"; }
.social-icon.ri-pinterest-line::before { content: "\f000"; }
.social-icon.ri-telegram-fill::before { content: "\f1ef"; }
.social-icon.ri-telegram-line::before { content: "\f1f0"; }
.social-icon.ri-whatsapp-fill::before { content: "\f2bb"; }
.social-icon.ri-whatsapp-line::before { content: "\f2bc"; }
.social-icon.ri-discord-fill::before { content: "\ec37"; }
.social-icon.ri-discord-line::before { content: "\ec38"; }
.social-icon.ri-medium-fill::before { content: "\ef2b"; }
.social-icon.ri-medium-line::before { content: "\ef2c"; }
.social-icon.ri-messenger-fill::before { content: "\ef49"; }
.social-icon.ri-messenger-line::before { content: "\ef4a"; }
.social-icon.ri-global-line::before { content: "\edcf"; }
.social-icon.ri-global-fill::before { content: "\edce"; }
.social-icon.ri-mail-line::before { content: "\eef6"; }
.social-icon.ri-mail-fill::before { content: "\eef3"; }
.social-icon.ri-link::before { content: "\eeb2"; }
.social--icons { gap: 10px; margin-top: 32px; }
.social--icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-size: 20px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.social--icons a:hover { border-color: var(--ink); background: var(--ink); color: var(--canvas); text-decoration: none; }

/* Placeholders while content loads for the first time */
.is-loading { min-height: 120px; background: var(--hover); }

/* Continuous scrolling strip (marquee.js). Pauses on hover or keyboard focus; still with "reduce motion". */
.marquee {
  --marquee-gap: 12px;
  position: relative;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent);
}
.marquee__track { display: flex; flex-wrap: wrap; gap: var(--marquee-gap); width: auto; padding: 2px 0; }
.marquee.is-running .marquee__track, .marquee.is-measuring .marquee__track { flex-wrap: nowrap; width: max-content; }
.marquee.is-running .marquee__track { animation: marquee var(--marquee-duration, 30s) linear infinite; }
.marquee:not(.is-running) { -webkit-mask-image: none; mask-image: none; }
.marquee:hover .marquee__track, .marquee:focus-within .marquee__track { animation-play-state: paused; }
.marquee__track > li { flex: 0 0 auto; }
@keyframes marquee { to { transform: translateX(calc(-50% - var(--marquee-gap) / 2)); } }

/* Company logos sit on white tiles in both themes, so dark wordmarks stay readable. */
.logo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 156px;
  height: 72px;
  padding: 0 28px;
  border-radius: 14px;
  background: #ffffff;
}
.logo-tile img { width: auto; max-width: 168px; height: 34px; object-fit: contain; }
.logo-tile__name { color: #17171a; font-size: 18px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  .logo-tile { background: #f2f2ef; }
}

/* Timeline rows (experience, education) */
.timeline { padding: 4px clamp(20px, 4vw, 40px); border-radius: var(--radius-card); background: var(--frame); }
.timeline__item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  gap: 8px 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.timeline__item:last-child { border-bottom: 0; }
.timeline__date { color: var(--muted); font-size: 15px; font-weight: 500; line-height: 1.6; font-variant-numeric: tabular-nums; }
.timeline__body :is(h2, h3) { font-size: 20px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
.timeline__org { margin-top: 4px; font-size: 16px; font-weight: 500; line-height: 1.5; }
.timeline__text { max-width: 62ch; margin-top: 10px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.timeline__link {
  align-self: start;
  color: var(--link);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.timeline__link::after { content: ""; display: inline-block; width: 0.8em; height: 0.8em; margin-left: 4px; vertical-align: -0.05em; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 11 11 5M6 5h5v5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 11 11 5M6 5h5v5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .steps { --step-gap: 40px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(2) .step__link { display: none; }
}
@media (max-width: 900px) {
  .timeline__item { grid-template-columns: 110px minmax(0, 1fr); }
  .timeline__link { grid-column: 2; }
  .work-card--large .frame { flex-direction: column; }
  .work-card--large .frame__image { width: 100%; aspect-ratio: 608 / 440; }
  .work-card--large .frame__caption { padding: 24px 28px 28px; }
  .work-card--large .frame__title { font-size: 28px; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .section__head--split { flex-direction: column; align-items: flex-start; }
  .frame__caption { padding: 20px 20px 24px; }
  .frame__title { font-size: 24px; }
  .work-card--large .frame__caption { padding: 20px 20px 24px; }
  .work-card--large .frame__title { font-size: 24px; }
  .step { padding: 24px; }
  .steps { --step-gap: 40px; grid-template-columns: minmax(0, 1fr); }
  .step .step__link, .step:nth-child(2) .step__link { left: 44px; top: 100%; display: flex; flex-direction: column; width: auto; height: var(--step-gap); }
  .step__link i { margin: -4px 0 0; }
  .step__link b { width: 1.5px; height: auto; }
  .step__link svg { margin: -6px 0 0; transform: rotate(90deg); }
  .footer__email { margin-bottom: 80px; }
  .timeline__item { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 24px 0; }
  .timeline__link { grid-column: auto; margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .frame, .social--icons a { transition: none; }
}
