/* ============================================================
   HIEUBT — retro 8-bit theme
   Pixel panels, Press Start 2P display type, Space Mono body.
   Light + dark, drawn from the 8-BitQuest token set.
   ============================================================ */

/* Self-hosted fonts, SIL Open Font License 1.1 — see assets/fonts/ */
@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/press-start-2p-latin-400.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: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/space-mono-latin-400.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: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-mono-latin-700.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: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/space-mono-vietnamese-400.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: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-mono-vietnamese-700.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;
}

*, *::before, *::after { box-sizing: border-box; }

:root {
  color-scheme: light;

  /* palette */
  --background: #d6e3f4;
  --foreground: #101222;
  --card: #ffffff;
  --card-foreground: #101222;
  --primary: #1f6cc0;
  --primary-foreground: #ffffff;
  --secondary: #ffb2ba;
  --secondary-foreground: #670120;
  --muted: #c3d5ef;
  --muted-foreground: #323445;
  --accent: #c3d5ef;
  --accent-foreground: #101222;
  --info: #114e90;
  --info-foreground: #eaf4ff;
  --success: #176133;
  --success-foreground: #ffffff;
  --warning: #b8760a;
  --warning-foreground: #101222;
  --error: #892037;
  --error-foreground: #fff1f3;
  --border: #6a769a;
  --input: #ffffff;
  --outline: #114e90;
  --pixel-shadow: #6a769a;
  --base-200: #bfc7d3;
  --base-300: #89919c;
  --base-400: #5c6377;
  --base-700: #272939;

  /* pixel button faces */
  --btn-pink-face: #ffb2ba;
  --btn-pink-hover: #ff9da8;
  --btn-pink-ink: #670120;
  --btn-pink-depth: #f4677a;
  --btn-blue-face: #41a6f6;
  --btn-blue-hover: #62b4f8;
  --btn-blue-ink: #00395e;
  --btn-blue-depth: #1f6cc0;
  --btn-green-face: #63de86;
  --btn-green-hover: #7be89a;
  --btn-green-ink: #00401b;
  --btn-green-depth: #2f9e57;

  /* CRT screen (radar / code) */
  --screen: #0b0d1c;
  --screen-ink: #e1e1f7;
  --screen-dim: #89919c;
  /* radar is a green phosphor CRT screen in both themes; amber contacts tie
     it to the warning accent used across the covers */
  --radar-bg: #0b120e;
  --radar-ring: rgba(99, 222, 134, .24);
  --radar-tick: rgba(99, 222, 134, .55);
  --radar-sweep: #63de86;
  --radar-blip: #ffd166;
  --radar-scan: rgba(225, 225, 247, .045);

  /* type */
  --font-display: "Press Start 2P", "Space Mono", ui-monospace, monospace;
  --font-sans: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* geometry */
  --header-h: 64px;
  --shell: 1100px;
  --shadow-pixel: 4px 4px 0 0 var(--pixel-shadow);
  --shadow-pixel-lg: 8px 8px 0 0 var(--pixel-shadow);
}

html.dark {
  color-scheme: dark;
  --background: #101222;
  --foreground: #e1e1f7;
  --card: #1c1e2f;
  --card-foreground: #e1e1f7;
  --primary: #41a6f6;
  --primary-foreground: #00395e;
  --secondary: #ffb2ba;
  --secondary-foreground: #670120;
  --muted: #272939;
  --muted-foreground: #bfc7d3;
  --accent: #323445;
  --accent-foreground: #e1e1f7;
  --info: #99cbff;
  --info-foreground: #003354;
  --success: #63de86;
  --success-foreground: #00401b;
  --warning: #ffd166;
  --warning-foreground: #2a1c00;
  --error: #ff9da8;
  --error-foreground: #2c000d;
  --border: #000000;
  --input: #272939;
  --outline: #62b4f8;
  --pixel-shadow: #000000;
  --base-300: #5c6377;
  --base-400: #89919c;
  --radar-bg: #0b120e;
  --radar-ring: rgba(99, 222, 134, .22);
  --radar-tick: rgba(99, 222, 134, .50);
  --radar-sweep: #63de86;
  --radar-blip: #ffd166;
  --radar-scan: rgba(225, 225, 247, .04);
}

/* ---------------------------------------------------------- base */
html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--background);
  color: var(--foreground);
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--background);
  color: var(--foreground);
  background-image: radial-gradient(rgba(16, 18, 34, .07) 1px, transparent 1px);
  background-size: 16px 16px;
}

html.dark body {
  background-image: radial-gradient(rgba(225, 225, 247, .045) 1px, transparent 1px);
}

img, svg { max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
h1, h2, h3, h4, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

::selection { background: var(--primary); color: var(--primary-foreground); }

:focus-visible {
  outline: 3px solid var(--outline);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--card);
  color: var(--foreground);
  border: 4px solid var(--border);
  box-shadow: var(--shadow-pixel);
  font-family: var(--font-display);
  font-size: 10px;
  text-transform: uppercase;
  text-decoration: none;
  transition: top .12s steps(2, end);
}
.skip-link:focus { top: 12px; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 16px;
}

/* ---------------------------------------------------------- pixel button */
.pixel-btn {
  --btn-face: var(--btn-pink-face);
  --btn-face-hover: var(--btn-pink-hover);
  --btn-ink: var(--btn-pink-ink);
  --btn-depth: var(--btn-pink-depth);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border: 0;
  background-color: var(--btn-face);
  color: var(--btn-ink);
  box-shadow: inset -4px -4px 0 0 var(--btn-depth);
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1.4;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .12s steps(2, end), box-shadow .1s steps(2, end);
  -webkit-tap-highlight-color: transparent;
}

.pixel-btn::before,
.pixel-btn::after {
  content: "";
  position: absolute;
  pointer-events: none;
  box-sizing: content-box;
  width: 100%;
  height: 100%;
}
.pixel-btn::before {
  top: -4px;
  left: 0;
  border-top: 4px solid var(--border);
  border-bottom: 4px solid var(--border);
}
.pixel-btn::after {
  top: 0;
  left: -4px;
  border-left: 4px solid var(--border);
  border-right: 4px solid var(--border);
}

.pixel-btn:hover,
.pixel-btn:focus-visible {
  background-color: var(--btn-face-hover);
  box-shadow: inset -6px -6px 0 0 var(--btn-depth);
}
.pixel-btn:active {
  box-shadow: inset 4px 4px 0 0 var(--btn-depth);
}

.pixel-btn--blue {
  --btn-face: var(--btn-blue-face);
  --btn-face-hover: var(--btn-blue-hover);
  --btn-ink: var(--btn-blue-ink);
  --btn-depth: var(--btn-blue-depth);
}
.pixel-btn--green {
  --btn-face: var(--btn-green-face);
  --btn-face-hover: var(--btn-green-hover);
  --btn-ink: var(--btn-green-ink);
  --btn-depth: var(--btn-green-depth);
}

.pixel-btn--lg { padding: 16px 24px; font-size: 13px; }

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  flex-shrink: 0;
}
.icon-btn svg { width: 16px; height: 16px; display: block; }

/* ---------------------------------------------------------- badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 2px solid var(--border);
  background: var(--info);
  color: var(--info-foreground);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge--success { background: var(--success); color: var(--success-foreground); }
.badge--primary { background: var(--primary); color: var(--primary-foreground); }
.badge--secondary { background: var(--secondary); color: var(--secondary-foreground); }
.badge--warning { background: var(--warning); color: var(--warning-foreground); }

/* ---------------------------------------------------------- panel */
.panel {
  background: var(--card);
  color: var(--card-foreground);
  border: 4px solid var(--border);
  box-shadow: var(--shadow-pixel);
}
.panel--lg { box-shadow: var(--shadow-pixel-lg); }

/* ---------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--background);
  border-bottom: 4px solid var(--border);
  box-shadow: 4px 4px 0 0 var(--pixel-shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; image-rendering: pixelated; }

.brand-word {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -.06em;
  text-transform: uppercase;
  color: var(--info);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-word span { color: var(--success); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* nav */
.nav { display: flex; align-items: center; gap: 24px; }
.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 8px 6px 24px;
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: -.03em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--foreground);
  transition: color .12s steps(2, end);
}
.nav a::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--success);
  opacity: 0;
  transition: opacity .1s steps(2, end);
}
.nav a:hover { color: var(--success); }
.nav a:hover::before,
.nav a[aria-current="page"]::before { opacity: 1; }
.nav a[aria-current="page"] { color: var(--success); }

.menu-btn { display: none; }

/* theme toggle icons */
.theme-toggle .icon-sun { display: none; }
html.dark .theme-toggle .icon-sun { display: block; }
html.dark .theme-toggle .icon-moon { display: none; }

/* ---------------------------------------------------------- mobile drawer */
.mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(11, 13, 28, .68);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s steps(3, end);
}
.mobile-backdrop[data-open="true"] { opacity: 1; pointer-events: auto; }

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: min(320px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  background: var(--card);
  color: var(--card-foreground);
  border-left: 4px solid var(--border);
  box-shadow: -4px 0 0 0 var(--pixel-shadow);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform .18s steps(4, end), visibility 0s linear .18s;
  overflow-y: auto;
}
.mobile-menu[data-open="true"] {
  transform: translateX(0);
  visibility: visible;
  transition: transform .18s steps(4, end), visibility 0s;
}

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 4px dashed var(--base-300);
}
.mobile-menu-title {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--info);
}
.mobile-menu .nav-stack { display: flex; flex-direction: column; gap: 6px; }
.mobile-menu .nav-stack a {
  position: relative;
  padding: 10px 8px 10px 26px;
  font-family: var(--font-display);
  font-size: 12px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--foreground);
  border: 2px solid transparent;
}
.mobile-menu .nav-stack a::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--success);
  opacity: 0;
}
.mobile-menu .nav-stack a:hover { border-color: var(--border); background: var(--accent); }
.mobile-menu .nav-stack a[aria-current="page"] { color: var(--success); border-color: var(--border); background: var(--accent); }
.mobile-menu .nav-stack a[aria-current="page"]::before { opacity: 1; }

.mobile-menu-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 4px dashed var(--base-300);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.mobile-menu-foot a { color: var(--info); text-decoration: none; font-weight: 700; }
.mobile-menu-foot a:hover { color: var(--success); }

/* ---------------------------------------------------------- page rhythm */
.page {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vw, 48px);
  padding-block: clamp(24px, 4vw, 44px) 56px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1rem, .9rem + .5vw, 1.3rem);
  line-height: 1.7;
  letter-spacing: -.03em;
  text-transform: uppercase;
  color: var(--info);
}
.section-head::after {
  content: "";
  flex: 1;
  border-bottom: 4px dashed var(--base-300);
}

/* ---------------------------------------------------------- hero */
.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(24px, 3.4vw, 40px);
  align-items: center;
  padding: clamp(20px, 3.2vw, 36px);
}

.hero-copy { min-width: 0; }

.hero-title {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1.02rem + 1.8vw, 2rem);
  line-height: 1.5;
  letter-spacing: -.04em;
  text-transform: uppercase;
  color: var(--info);
  text-wrap: balance;
}
.hero-title .accent { color: var(--success); display: block; }

.hero-lede {
  margin-top: 16px;
  max-width: 56ch;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted-foreground);
}
.hero-lede + .hero-lede { margin-top: 10px; }
.hero-lede a {
  color: var(--info);
  font-weight: 700;
  text-decoration: none;
}
.hero-lede a:hover {
  color: var(--success);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

.hero-visual { min-width: 0; }

.radar-frame {
  position: relative;
  aspect-ratio: 1.15 / 1;
  border: 4px solid var(--border);
  background: var(--radar-bg);
  box-shadow: var(--shadow-pixel);
  overflow: hidden;
}
#radar { display: block; width: 100%; height: 100%; }
.radar-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, var(--radar-scan) 0 1px, transparent 1px 3px);
}
.interest-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 640px;
  margin: 8px auto 0;
  padding: 0;
  list-style: none;
}
.interest-chip {
  --chip-face: var(--btn-blue-face);
  --chip-ink: var(--btn-blue-ink);
  --chip-depth: var(--btn-blue-depth);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 10px;
  background-color: var(--chip-face);
  color: var(--chip-ink);
  box-shadow: inset -4px -4px 0 0 var(--chip-depth);
  font-family: var(--font-display);
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: -.02em;
  text-transform: uppercase;
  text-align: center;
  cursor: default;
}
.interest-chip::before,
.interest-chip::after {
  content: "";
  position: absolute;
  pointer-events: none;
  box-sizing: content-box;
  width: 100%;
  height: 100%;
}
.interest-chip::before {
  top: -4px;
  left: 0;
  border-top: 4px solid var(--border);
  border-bottom: 4px solid var(--border);
}
.interest-chip::after {
  top: 0;
  left: -4px;
  border-left: 4px solid var(--border);
  border-right: 4px solid var(--border);
}
.interest-chip--pink {
  --chip-face: var(--btn-pink-face);
  --chip-ink: var(--btn-pink-ink);
  --chip-depth: var(--btn-pink-depth);
}
.interest-chip--green {
  --chip-face: var(--btn-green-face);
  --chip-ink: var(--btn-green-ink);
  --chip-depth: var(--btn-green-depth);
}

/* ---------------------------------------------------------- profile */
.profile-row {
  display: flex;
  align-items: flex-start;
  gap: clamp(20px, 3vw, 32px);
}

.avatar-tile {
  width: 168px;
  flex-shrink: 0;
  border: 4px solid var(--border);
  background: var(--accent);
  box-shadow: var(--shadow-pixel);
}
.avatar-tile img { display: block; width: 100%; }

.profile-card {
  flex: 1;
  min-width: 0;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dl-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.dl-row + .dl-row { border-top: 2px dashed var(--base-300); }
.dl-row dt { color: var(--info); }
.dl-row dd { color: var(--card-foreground); text-align: right; text-transform: none; }

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 16px;
  border-top: 4px solid var(--border);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 2px solid var(--border);
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  text-decoration: none;
  transition: background-color .1s steps(2, end), color .1s steps(2, end);
}
.link-btn:hover { background: var(--success); color: var(--success-foreground); border-color: var(--border); }
.link-btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  gap: 0;
  border: 0;
  background: transparent;
}
.link-btn--icon img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}
.link-btn--icon:hover {
  background: transparent;
  border-color: transparent;
  opacity: .7;
}
.link-btn--cv img {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 1px 0 rgba(16, 18, 34, .28));
}

/* ---------------------------------------------------------- grids + cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 24px);
}
.grid-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 4px;
  background: var(--card);
  color: var(--card-foreground);
  border: 4px solid var(--border);
  box-shadow: var(--shadow-pixel);
  transition: transform .12s steps(2, end), box-shadow .12s steps(2, end);
}
a.card { text-decoration: none; color: inherit; }
a.card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-pixel-lg); }
/* keeps the hover lift working after the reveal rule pins transform:none */
.app-ready a.card.reveal.is-visible:hover { transform: translate(-2px, -2px); }

.card-media {
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--accent);
  border-bottom: 4px solid var(--border);
}
.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  padding: 16px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1.75;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--card-foreground);
}
a.card:hover .card-title { color: var(--info); }

.card-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted-foreground);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--info);
  transition: color .1s steps(2, end);
}
a.card:hover .card-link { color: var(--success); }
.card-link::after {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid currentColor;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  padding: 3px 7px;
  border: 2px solid var(--border);
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* ---------------------------------------------------------- research folders */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 24px);
  align-items: start;
}

.folder {
  --folder-paper: #eef3ff;
  background: var(--card);
  color: var(--card-foreground);
  border: 4px solid var(--border);
  box-shadow: var(--shadow-pixel);
}
.folder:only-child { grid-column: 1 / -1; }
.folder--blue { --folder-face: #2f7fd0; --folder-front: #55aef5; --folder-line: #a8c9ec; --folder-star: #ffd23f; }
.folder--green { --folder-face: #2f9e57; --folder-front: #63de86; --folder-line: #b8ecc6; --folder-star: #ffd23f; }
.folder--orange { --folder-face: #c97716; --folder-front: #ffb45e; --folder-line: #ffe0b3; --folder-star: #101222; }
.folder--purple { --folder-face: #6b4bc4; --folder-front: #a98bff; --folder-line: #d9ccff; --folder-star: #ffd23f; }
.folder--red { --folder-face: #b83b32; --folder-front: #ff6b5e; --folder-line: #ffc2bc; --folder-star: #ffd23f; }
.folder--teal { --folder-face: #117a74; --folder-front: #3fd6c6; --folder-line: #b6f2ec; --folder-star: #101222; }
.folder--pink { --folder-face: #b83f76; --folder-front: #ff8fc0; --folder-line: #ffd1e5; --folder-star: #101222; }
.folder--yellow { --folder-face: #a97a08; --folder-front: #ffd23f; --folder-line: #fff0b3; --folder-star: #101222; }
.folder--indigo { --folder-face: #3949ab; --folder-front: #7986cb; --folder-line: #c5cae9; --folder-star: #ffd23f; }
.folder--lime { --folder-face: #5f8f1f; --folder-front: #a8e05f; --folder-line: #e0f5bd; --folder-star: #101222; }
.folder--cyan { --folder-face: #0e7490; --folder-front: #4dd8f0; --folder-line: #c2f1fb; --folder-star: #101222; }
.folder--magenta { --folder-face: #9c27b0; --folder-front: #e070f0; --folder-line: #f4c7fa; --folder-star: #ffd23f; }
.folder--sky { --folder-face: #1f6fa8; --folder-front: #7cd3ff; --folder-line: #d1f0ff; --folder-star: #101222; }
.folder--brown { --folder-face: #7a4a21; --folder-front: #c98a4b; --folder-line: #f0d2b0; --folder-star: #ffd23f; }
.folder--olive { --folder-face: #6b7a1f; --folder-front: #c8d65a; --folder-line: #eef5bd; --folder-star: #101222; }
.folder--slate { --folder-face: #4b5c78; --folder-front: #8fa3c4; --folder-line: #d5deea; --folder-star: #ffd23f; }
html.dark .folder { --folder-paper: #dfe5f7; }

.folder-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
  cursor: pointer;
  list-style: none;
  transition: background-color .12s steps(2, end);
}
.folder-summary::-webkit-details-marker { display: none; }
.folder-summary:hover,
.folder[open] .folder-summary { background: var(--accent); }
.folder-summary:focus-visible { outline: 4px solid var(--outline); outline-offset: 4px; }

.folder-art { flex: 0 0 96px; }
.folder-svg {
  display: block;
  width: 96px;
  height: 72px;
  filter: drop-shadow(3px 3px 0 var(--border));
  transition: transform .12s steps(2, end);
}
.folder-summary:hover .folder-svg { transform: translateY(-2px); }
.folder-back, .folder-paper, .folder-front { stroke: var(--border); stroke-width: 4; }
.folder-back { fill: var(--folder-face); }
.folder-paper { fill: var(--folder-paper); }
.folder-front { fill: var(--folder-front); }
.folder-line { fill: var(--folder-line); }
.folder-glint { fill: rgba(255, 255, 255, .4); }
.folder-tab-shade, .folder-shade { fill: rgba(0, 0, 0, .16); }
.folder-star { fill: var(--folder-star); }
.folder-lid { transition: transform .14s steps(2, end); }
.folder[open] .folder-lid { transform: translateY(6px); }

.folder-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.folder-title {
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--primary);
}
.folder-title--vi {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
}
.folder-meta { font-size: 12px; line-height: 1.6; color: var(--muted-foreground); }
.folder-toggle {
  flex-shrink: 0;
  margin-left: auto;
  padding: 4px 7px;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--info);
  font-family: var(--font-display);
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: .04em;
}
.folder-toggle-close { display: none; }
.folder[open] .folder-toggle-open { display: none; }
.folder[open] .folder-toggle-close { display: inline; }
.folder[open] .folder-toggle { background: var(--info); color: var(--info-foreground); }

.folder-body {
  margin: 0 18px;
  padding: 6px 0 16px;
  border-top: 4px dashed var(--base-300);
  animation: folder-open .14s steps(2, end);
}
@keyframes folder-open {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.note-list { list-style: none; margin: 0; padding: 0; }
.note-row + .note-row { border-top: 2px dashed var(--base-200); }
.note-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 16px;
  padding: 13px 4px;
  color: inherit;
  text-decoration: none;
  transition: transform .12s steps(2, end);
}
.note-link:hover { transform: translateX(3px); }
.note-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.note-date {
  font-family: var(--font-display);
  font-size: 8px;
  line-height: 1.6;
  color: var(--muted-foreground);
}
.note-title {
  font-family: var(--font-display);
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--card-foreground);
}
.note-title--vi {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: 0;
  text-transform: none;
}
.note-link:hover .note-title { color: var(--success); }
.note-desc { font-size: 13px; line-height: 1.65; color: var(--muted-foreground); }
.note-read {
  align-self: center;
  font-family: var(--font-display);
  font-size: 8px;
  line-height: 1.6;
  color: var(--info);
  white-space: nowrap;
}

/* tech stack */
.tech-groups { display: flex; flex-direction: column; gap: 28px; }
.tech-group-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.tech-group-head h3 {
  font-family: var(--font-display);
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--info);
}
.tech-group-head::after {
  content: "";
  flex: 1;
  border-bottom: 2px dashed var(--base-300);
}
.tech-list { display: flex; flex-wrap: wrap; gap: 14px; }
.tech-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 104px;
  min-height: 104px;
  padding: 12px 8px;
  background: var(--card);
  color: var(--card-foreground);
  border: 4px solid var(--border);
  box-shadow: var(--shadow-pixel);
  text-align: center;
}
.tech-tile img { width: 44px; height: 44px; display: block; object-fit: contain; }
html.dark .tech-tile--plate img {
  background: #e1e1f7;
  box-shadow: 0 0 0 4px #e1e1f7;
}
.tech-tile > span:last-child {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  font-family: var(--font-display);
  font-size: 8px;
  line-height: 1.7;
  letter-spacing: -.02em;
  text-transform: uppercase;
}

/* credential cards */
.cred-card { padding: 4px; }
.cred-card .card-body { gap: 10px; }
.cred-issuer { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted-foreground); }
.cred-name { font-family: var(--font-display); font-size: 11px; line-height: 1.8; text-transform: uppercase; text-decoration: none; color: var(--card-foreground); }
.cred-name a { color: inherit; text-decoration: none; }
.cred-name a:hover, .cred-name:hover { color: var(--info); }

/* award cards */
.award-media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-bottom: 4px solid var(--border);
  background: #1c1e2f;
}
.award-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ribbon / trophy pixel svgs */
/* ---------------------------------------------------------- page hero */
.page-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: clamp(20px, 3.2vw, 36px);
}
.page-hero .hero-title { margin-top: 4px; }
.page-hero .hero-lede { margin-top: 0; max-width: 72ch; }

/* ---------------------------------------------------------- article */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}
.article-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(20px, 3vw, 32px);
  min-width: 0;
}
/* flex/grid children must be allowed to shrink, or long list/code content forces overflow on narrow screens */
.article-panel > *,
.article-panel .prose,
.article-panel .prose li,
.article-panel .prose ul,
.article-panel .prose ol { min-width: 0; max-width: 100%; }
/* content inside prose (code, long words) must not widen the page; code blocks still scroll inside themselves */
.article-panel .prose { overflow-x: clip; }
.article-title {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, .96rem + 1.25vw, 1.75rem);
  line-height: 1.55;
  letter-spacing: -.03em;
  text-transform: uppercase;
  color: var(--card-foreground);
  text-wrap: balance;
}
.article-title--vi {
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 700;
}
.article-dek { font-size: 15px; line-height: 1.7; color: var(--muted-foreground); max-width: 65ch; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 18px;
  padding: 12px 0;
  border-top: 4px solid var(--border);
  border-bottom: 4px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.article-meta .dot { color: var(--base-300); }
.avatar-sm {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--accent);
  image-rendering: pixelated;
}
.byline { display: inline-flex; align-items: center; gap: 10px; color: var(--foreground); }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-foreground); }
.breadcrumb a { text-decoration: none; font-weight: 700; }
.breadcrumb a:hover { color: var(--foreground); }
.breadcrumb .sep { color: var(--base-300); }
.breadcrumb [aria-current="page"] { color: var(--foreground); font-weight: 700; }

.article-cover {
  border: 4px solid var(--border);
  background: var(--accent);
  overflow: hidden;
  flex-shrink: 0;
}
.article-cover img { display: block; width: 100%; height: auto; image-rendering: pixelated; }

/* prose */
.prose { max-width: 68ch; }
.prose > :first-child { margin-top: 0; }
.prose p { font-size: 16px; line-height: 1.8; margin: 0 0 18px; }
.prose h2 {
  margin: 38px 0 14px;
  padding-bottom: 10px;
  border-bottom: 4px dashed var(--base-300);
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--info);
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose h3 {
  margin: 28px 0 10px;
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1.8;
  text-transform: uppercase;
  color: var(--card-foreground);
}
.prose ul { margin: 0 0 20px; display: flex; flex-direction: column; gap: 10px; }
.prose li { position: relative; padding-left: 26px; font-size: 16px; line-height: 1.7; }
.prose li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .58em;
  width: 10px;
  height: 10px;
  background: var(--info);
  box-shadow: 3px -3px 0 0 var(--base-300);
}
/* nested list items: pixel "+" marker in green, indented under the parent */
.prose li > ul { margin: 8px 0 0; gap: 6px; }
.prose li li::before {
  top: .6em;
  left: 4px;
  width: 9px;
  height: 9px;
  background:
    linear-gradient(var(--success), var(--success)) center / 100% 3px no-repeat,
    linear-gradient(var(--success), var(--success)) center / 3px 100% no-repeat;
  border: 0;
  box-shadow: none;
}
/* third level: short amber pixel dash */
.prose li li li::before {
  top: .75em;
  left: 4px;
  width: 9px;
  height: 3px;
  background: var(--warning);
  border: 0;
  box-shadow: none;
}
.prose strong { color: var(--card-foreground); }
.prose code {
  padding: 1px 5px;
  border: 2px solid var(--border);
  background: var(--muted);
  color: var(--info);
  font-family: var(--font-sans);
  font-size: .875em;
  white-space: nowrap;
}
html.dark .prose code { background: var(--accent); color: var(--info); }

/* code window */
.code-window {
  margin: 24px 0;
  border: 4px solid var(--border);
  box-shadow: var(--shadow-pixel);
  background: var(--screen);
  color: var(--screen-ink);
  overflow: hidden;
}
.code-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: #1c1e2f;
  border-bottom: 4px solid var(--border);
}
.code-dots { display: flex; gap: 6px; flex-shrink: 0; }
.code-dots span { width: 9px; height: 9px; display: block; }
.code-dots span:nth-child(1) { background: #f4677a; }
.code-dots span:nth-child(2) { background: #ffd166; }
.code-dots span:nth-child(3) { background: #63de86; }
.code-file {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: #bfc7d3;
  letter-spacing: .03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-btn {
  flex-shrink: 0;
  padding: 5px 9px;
  border: 2px solid #6a769a;
  background: #272939;
  color: #e1e1f7;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
.copy-btn:hover { background: #3f4358; }
.code-body {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.85;
  tab-size: 2;
  color: #e1e1f7;
}
.code-body .k { color: #62b4f8; }
.code-body .s { color: #63de86; }
.code-body .c { color: #89919c; }
.code-body .t { color: #ffd166; }
.code-body .v { color: #ff9da8; }

/* toc */
.toc {
  padding: 16px;
  align-self: start;
}
.toc-title {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 4px dashed var(--base-300);
  font-family: var(--font-display);
  font-size: 9px;
  line-height: 1.8;
  text-transform: uppercase;
  color: var(--info);
}
.toc a {
  position: relative;
  display: block;
  padding: 7px 8px 7px 20px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted-foreground);
}
.toc a::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  background: var(--base-300);
}
.toc a:hover { color: var(--info); }
.toc a.active { color: var(--success); }
.toc a.active::before { background: var(--success); }


.project-details { padding: 18px; align-self: start; }
.project-details .toc-title { font-size: 10px; }
@media (min-width: 1024px) {
  .project-details {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(var(--header-h) + 20px);
  }
}

.next-note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 40px;
  padding-top: 18px;
  border-top: 4px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.next-note a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1.8;
  color: var(--info);
  text-decoration: none;
}
.next-note a:hover { color: var(--success); }
.next-note a span { font-family: var(--font-sans); font-size: 16px; }

/* reading progress */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  height: 4px;
  width: 0;
  background: var(--success);
}

/* ---------------------------------------------------------- search */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(20px, 8vh, 96px) 16px;
  background: rgba(11, 13, 28, .75);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity .12s steps(3, end), visibility 0s linear .12s;
}
.search-overlay[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity .12s steps(3, end), visibility 0s;
}

.search-panel {
  width: 100%;
  max-width: 620px;
  padding: 16px;
  background: var(--card);
  border: 4px solid var(--border);
  box-shadow: var(--shadow-pixel-lg);
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--input);
  border: 2px solid var(--border);
}
html.dark .search-input-row { border-color: #6a769a; }
.search-input-row:focus-within { outline: 3px solid var(--outline); outline-offset: 3px; }
.search-input-row svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--info); }
.search-input-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: 0;
}
.search-input-row input::placeholder { color: var(--muted-foreground); }
.search-esc {
  flex-shrink: 0;
  padding: 4px 6px;
  border: 2px solid var(--border);
  font-family: var(--font-display);
  font-size: 8px;
  color: var(--muted-foreground);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(50vh, 380px);
  margin-top: 12px;
  overflow-y: auto;
}
.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 2px solid transparent;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.search-item small { flex-shrink: 0; font-size: 9px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-foreground); }
.search-item:hover { background: var(--muted); }
.search-item[aria-selected="true"] { background: var(--accent); border-color: var(--border); }
.search-empty { padding: 18px 8px; text-align: center; font-size: 13px; color: var(--muted-foreground); }

.search-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px dashed var(--base-300);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.search-foot span { display: inline-flex; align-items: center; gap: 4px; }
kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 2px solid var(--border);
  background: var(--muted);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 10px;
  line-height: 1.4;
}

/* ---------------------------------------------------------- footer */
.site-footer {
  margin-top: 40px;
  border-top: 4px solid var(--border);
  background: var(--background);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}
.footer-note {
  font-family: var(--font-display);
  font-size: 9px;
  line-height: 1.9;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--info);
}
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.footer-links img { width: 18px; height: 18px; display: block; object-fit: contain; }
.footer-links a[href$=".pdf"] img { filter: drop-shadow(0 1px 0 rgba(16, 18, 34, .28)); }
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--info);
}
.footer-links a:hover { color: var(--success); }

/* ---------------------------------------------------------- utilities */
.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;
}

/* ---------------------------------------------------------- motion */
.app-ready .reveal {
  opacity: 0;
  transform: translateY(14px);
}
.app-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
  animation: reveal-in .38s ease-out backwards;
  animation-delay: var(--reveal-delay, 0ms);
}
@keyframes reveal-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .app-ready .reveal,
  .app-ready .reveal.is-visible { opacity: 1; transform: none; animation: none; }
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .app-ready .nav { display: none; }
  .app-ready .menu-btn { display: inline-flex; }

  /* no-JS / failed-script fallback: keep navigation reachable in the header */
  html:not(.app-ready) .site-header { height: auto; }
  html:not(.app-ready) .header-inner { flex-wrap: wrap; padding-block: 8px; row-gap: 4px; }
  html:not(.app-ready) .nav { display: flex; flex-wrap: wrap; width: 100%; order: 3; gap: 8px 16px; }
  html:not(.app-ready) .header-actions { display: none; }

  .hero-panel { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { order: 2; }
  .interest-row { order: 3; }
  .radar-frame { aspect-ratio: 1.45 / 1; }
}

@media (min-width: 1024px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 250px; align-items: start; }
  .article-panel { grid-column: 1; grid-row: 1; }
  .toc {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(var(--header-h) + 20px);
    max-height: calc(100vh - var(--header-h) - 40px);
    overflow-y: auto;
  }
}

@media (max-width: 760px) {
  .grid-cards, .grid-cards--3 { grid-template-columns: minmax(0, 1fr); }
  .profile-row { flex-direction: column; }
  .avatar-tile { width: 128px; }
  .profile-card { width: 100%; }
  .brand-word { font-size: 13px; }
  .brand-mark { width: 36px; height: 36px; }
  .page-hero .hero-title { font-size: clamp(1.3rem, 1rem + 2vw, 1.7rem); }
}

@media (min-width: 641px) and (max-width: 760px) {
  .grid-cards--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .interest-row { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .hero-actions .pixel-btn { width: 100%; }
  .search-foot { gap: 10px; font-size: 9px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .article-meta { font-size: 10px; }
}

/* Awards gallery: keep the portrait photos compact and centred */
.awards-grid {
  max-width: 680px;
  margin-inline: auto;
}
@media (max-width: 760px) {
  .awards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 640px;
  }
}
@media (max-width: 640px) {
  .awards-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
  }
}

/* ---------------------------------------------------------- OpenDLP file browser */
.project-hero .article-meta,
.project-hero .article-cover { width: 100%; }
.project-hero .article-cover { margin-top: 4px; }
.project-hero { gap: 18px; }
.project-github {
  flex-shrink: 0;
  margin-left: auto;
  padding: 6px 10px;
  font-size: 8px;
  white-space: nowrap;
  box-shadow: inset -3px -3px 0 0 var(--btn-depth);
}
.meta-link { color: var(--primary); font-weight: 700; text-decoration: none; }
.meta-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.prose--vi h2 {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: 0;
  font-weight: 700;
  text-transform: none;
}
.prose--vi h3 {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--info);
  margin: 26px 0 10px;
}
.prose--vi h4 {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  font-weight: 700;
  text-transform: none;
  color: var(--card-foreground);
  margin: 22px 0 8px;
}
.prose--vi h5 {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--info);
  margin: 18px 0 6px;
}
.prose--vi table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13px;
}
.prose--vi th,
.prose--vi td {
  border: 2px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.prose--vi th {
  background: var(--muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
}
.prose--vi td code { white-space: normal; }
.prose--vi img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px 0;
  border: 4px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-pixel);
}
.prose--vi table img {
  display: inline;
  max-height: 48px;
  width: auto;
  margin: 0;
  border: 0;
  box-shadow: none;
}
.prose--vi pre:not(.code-body) {
  margin: 22px 0;
  padding: 16px;
  overflow-x: auto;
  background: var(--screen);
  color: var(--screen-ink);
  border: 4px solid var(--border);
  box-shadow: var(--shadow-pixel);
  font-size: 13px;
  line-height: 1.7;
}
.prose--vi pre:not(.code-body) code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  white-space: pre;
  font-size: inherit;
}
.prose--vi ol { list-style: decimal; padding-left: 26px; margin: 0 0 20px; }
.prose--vi ol > li { padding-left: 3px; }
.prose--vi ol > li::before { content: none; }
.prose--vi hr { border: 0; border-top: 4px dashed var(--base-300); margin: 32px 0; }
.prose--vi blockquote {
  margin: 20px 0;
  padding: 10px 16px;
  border-left: 4px solid var(--info);
  background: var(--muted);
  color: var(--muted-foreground);
}
.prose--vi blockquote p:last-child { margin-bottom: 0; }

.file-label {
  display: inline-block;
  margin: 34px 0 10px;
  padding: 4px 8px;
  border: 2px solid var(--border);
  background: var(--accent);
  color: var(--accent-foreground);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.project-file { scroll-margin-top: calc(var(--header-h) + 20px); }
.project-file + .project-file { margin-top: 30px; }
.source-file { margin-top: 26px; }
.source-file .code-window { margin: 0 0 8px; }

.file-tree { font-size: 10px; }
.file-tree ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 10px;
  border-left: 2px dashed var(--base-300);
}
.file-tree > ul { padding-left: 0; border-left: 0; }
.file-tree li { margin: 2px 0; }
.file-tree a {
  display: block;
  padding: 3px 4px;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.5;
  text-decoration: none;
  word-break: break-word;
  border-left: 2px solid transparent;
}
.file-tree a:hover { color: var(--info); background: var(--accent); }
.file-tree details { margin: 2px 0; }
.file-tree summary {
  list-style: none;
  cursor: pointer;
  padding: 3px 0;
  color: var(--info);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.file-tree summary::-webkit-details-marker { display: none; }
.file-tree summary::before {
  content: "▸";
  display: inline-block;
  width: 12px;
  color: var(--base-400);
}
.file-tree details[open] > summary::before { content: "▾"; }
.file-tree details > ul { margin-top: 2px; }

@media (min-width: 1024px) {
  .project-details {
    max-height: calc(100vh - var(--header-h) - 40px);
    overflow-y: auto;
  }
}

.project-file[hidden] { display: none; }
.file-tree a.active {
  color: var(--info);
  background: var(--accent);
  border-left-color: var(--success);
}
.article-panel { scroll-margin-top: calc(var(--header-h) + 20px); }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 20px 0; }
.table-scroll table { margin: 0; }
@media (max-width: 640px) {
  .prose code { white-space: normal; overflow-wrap: anywhere; }
}

.tags--chips { gap: 12px; }
.tags--chips .tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 0;
  background: var(--btn-green-face);
  color: var(--btn-green-ink);
  box-shadow: inset -4px -4px 0 0 var(--btn-green-depth);
  font-family: var(--font-display);
  font-size: 9px;
  line-height: 1.5;
  text-transform: uppercase;
  cursor: default;
}
.tags--chips .tag::before,
.tags--chips .tag::after {
  content: "";
  position: absolute;
  pointer-events: none;
  box-sizing: content-box;
  width: 100%;
  height: 100%;
}
.tags--chips .tag::before {
  top: -4px;
  left: 0;
  border-top: 4px solid var(--border);
  border-bottom: 4px solid var(--border);
}
.tags--chips .tag::after {
  top: 0;
  left: -4px;
  border-left: 4px solid var(--border);
  border-right: 4px solid var(--border);
}
.file-tree a { font-size: 11px; padding: 4px 5px; }
.file-tree summary { font-size: 11px; padding: 4px 0; }
@media (min-width: 1024px) {
  .project-layout { grid-template-columns: minmax(0, 1fr) 320px; }
}

/* OpenDLP README tech tiles + project meta */
.project-stack { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.prose--vi { max-width: none; }
.project-meta { gap: 14px; }
.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 2px solid var(--border);
  background: var(--accent);
  color: var(--accent-foreground);
  font-family: var(--font-display);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.project-stack { gap: 10px; }
.project-stack .tech-tile { width: 99px; min-height: 99px; }

/* Tech tiles inside the README must keep the About-tab frame, not prose image borders */
.prose--vi .tech-tile img {
  width: 44px;
  height: 44px;
  max-width: none;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
}

/* Markdown code blocks (research/prose pages) */
.prose pre:not(.code-body) {
  margin: 22px 0;
  padding: 16px;
  overflow-x: auto;
  background: var(--screen);
  color: var(--screen-ink);
  border: 4px solid var(--border);
  box-shadow: var(--shadow-pixel);
  font-size: 13px;
  line-height: 1.7;
}
.prose pre:not(.code-body) code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  white-space: pre;
  font-size: inherit;
}

/* Research folder view — small screens */
@media (max-width: 760px) {
  .folder-grid { grid-template-columns: 1fr; }
  .folder-summary { gap: 14px; padding: 14px; }
  .folder-art { flex-basis: 76px; }
  .folder-svg { width: 76px; height: 57px; }
  .folder-title { font-size: 10px; }
  .note-link { grid-template-columns: 1fr; gap: 6px; }
  .note-read { align-self: start; }
}
@media (max-width: 520px) {
  .folder-summary { flex-wrap: wrap; }
  .folder-info { flex: 1 1 130px; }
}
