/* ==========================================================
   Eliot Su portfolio
   ========================================================== */

/* ---------- Fonts ----------
   Noto Sans TC is self-hosted as a subset of the characters this site uses
   (see scripts/subset-fonts.mjs). Latin text uses Inter from Google Fonts. */
@font-face {
  font-family: "Noto Sans TC";
  src: url("../fonts/noto-sans-tc-400.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+2E80-2FFF, U+3000-303F, U+3100-312F, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF;
}
@font-face {
  font-family: "Noto Sans TC";
  src: url("../fonts/noto-sans-tc-700.woff2") format("woff2");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+2E80-2FFF, U+3000-303F, U+3100-312F, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF;
}
@font-face {
  font-family: "Noto Sans TC";
  src: url("../fonts/noto-sans-tc-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+2E80-2FFF, U+3000-303F, U+3100-312F, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF;
}

/* Arial tuned to Inter's metrics, so the swap to Inter does not reflow text */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 107.12%;
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #fafaf7;
  --bg-alt: #f2f3ee;
  --surface: #ffffff;
  --surface-2: #f6f7f3;
  --text: #14171c;
  --text-2: #3d4450;
  --muted: #646b78;
  --line: #e2e4dc;
  --line-strong: #cfd3c8;
  --accent: #0f766e;
  --accent-strong: #0b5c56;
  --accent-soft: #dcf1ec;
  --accent-ink: #0b5c56;
  --on-accent: #ffffff;
  --lime: #c6f432;
  --hl-bg: linear-gradient(transparent 60%, rgba(198, 244, 50, 0.75) 60%);
  --hl-text: inherit;
  --ink: #12161c;
  --ink-2: #1a2028;
  --ink-line: #262e38;
  --ink-text: #e8ebef;
  --ink-muted: #98a2b0;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px -8px rgba(16, 24, 40, 0.1);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, 0.04), 0 24px 48px -12px rgba(16, 24, 40, 0.18);
  --font: "Inter", "Inter Fallback", "Noto Sans TC", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --nav-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0f13;
    --bg-alt: #11151b;
    --surface: #151a21;
    --surface-2: #1a2029;
    --text: #e9ecf0;
    --text-2: #c3c9d2;
    --muted: #949eab;
    --line: #242b35;
    --line-strong: #323b47;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: #11352f;
    --accent-ink: #7cf0dc;
    --on-accent: #06201c;
    --hl-bg: none;
    --hl-text: #c6f432;
    --mock-lime: 8%;
    --ink: #090c10;
    --ink-2: #11161c;
    --ink-line: #222a33;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0c0f13;
  --bg-alt: #11151b;
  --surface: #151a21;
  --surface-2: #1a2029;
  --text: #e9ecf0;
  --text-2: #c3c9d2;
  --muted: #949eab;
  --line: #242b35;
  --line-strong: #323b47;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-soft: #11352f;
  --accent-ink: #7cf0dc;
  --on-accent: #06201c;
  --hl-bg: none;
  --hl-text: #c6f432;
  --mock-lime: 8%;
  --ink: #090c10;
  --ink-2: #11161c;
  --ink-line: #222a33;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-ink);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.015em;
  color: var(--text);
}

p {
  margin: 0;
  text-wrap: pretty;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--lime);
  color: #12161c;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 200;
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.skip:focus {
  left: 12px;
}

/* ---------- Progress ---------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 120;
  pointer-events: none;
}

.progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--lime));
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn:hover {
  color: var(--text);
  border-color: var(--text-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn--primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--on-accent);
}

.btn--sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.btn--sm .i {
  width: 16px;
  height: 16px;
}

.btn--lg {
  min-height: 52px;
  padding: 0 24px;
  font-size: 16px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line-strong);
}

.icon-btn--lg {
  width: 52px;
  height: 52px;
  border-color: var(--line-strong);
  background: var(--surface);
}

.icon-btn--lg:hover {
  transform: translateY(-1px);
}

.lang {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, background-color 0.25s;
}

.nav.is-scrolled {
  border-bottom-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--nav-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
  margin-right: auto;
}

.brand:hover {
  color: var(--text);
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--ink);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 0.3s var(--ease);
}

.brand:hover .brand__mark {
  transform: rotate(-6deg);
}

.brand__name {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-size: 16px;
}

.brand__name small {
  font-weight: 500;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__links a {
  position: relative;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s, background-color 0.2s;
}

.nav__links a:hover {
  color: var(--text);
}

.nav__links a[aria-current="true"] {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
}

.nav__tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__cta {
  margin-left: 4px;
}

[data-theme-toggle] .i--moon {
  display: none;
}

:root[data-theme="dark"] [data-theme-toggle] .i--sun {
  display: none;
}

:root[data-theme="dark"] [data-theme-toggle] .i--moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-theme-toggle] .i--sun {
    display: none;
  }
  :root:not([data-theme="light"]) [data-theme-toggle] .i--moon {
    display: block;
  }
}

.nav__toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  border-radius: 10px;
}

.nav__toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.25s var(--ease);
}

.nav__toggle span:first-child {
  top: 15px;
}

.nav__toggle span:last-child {
  top: 23px;
}

.nav__toggle[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav__toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 96px 0 56px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: -80px 0 0 0;
  z-index: -1;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 20%, transparent 75%);
  opacity: 0.7;
}

.hero__bg::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: 6%;
  top: 0;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  filter: blur(20px);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 28px;
}

.status__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.status__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #22c55e;
  animation: ping 2s var(--ease) infinite;
}

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  80%,
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

.hero h1 {
  font-size: clamp(38px, 5.6vw, 66px);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.03em;
}

.hl {
  background: var(--hl-bg);
  color: var(--hl-text);
  padding: 0 2px;
}

.lead {
  font-size: 18.5px;
  color: var(--text-2);
  margin: 26px 0 36px;
  max-width: 34em;
  line-height: 1.8;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Stats */
.stats {
  list-style: none;
  padding: 0;
  margin: 72px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stats li {
  padding: 22px 24px;
}

.stats li + li {
  border-left: 1px solid var(--line);
}

.stats strong {
  display: block;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stats span {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 6px;
}

.stats strong span {
  display: inline;
  font-size: inherit;
  color: inherit;
  margin: 0;
  line-height: inherit;
}

/* ---------- Sections ---------- */
.section {
  padding: 112px 0;
}

.section--alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section__head {
  margin-bottom: 56px;
  max-width: 680px;
}

.section__head--row {
  max-width: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.section__head h2 {
  font-size: clamp(30px, 3.8vw, 44px);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.section__head > p:not(.eyebrow) {
  color: var(--muted);
  margin-top: 14px;
  font-size: 17px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-ink);
  margin-bottom: 14px;
}

.eyebrow span {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.subhead {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  margin: 64px 0 24px;
  letter-spacing: 0.02em;
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 64px;
  align-items: start;
}

.about__story p {
  font-size: 18px;
  color: var(--text-2);
  line-height: 1.9;
}

.about__story p + p {
  margin-top: 18px;
}

.about__story strong {
  color: var(--text);
  font-weight: 700;
}

.facts {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.facts li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--text-2);
}

.facts .i {
  color: var(--accent);
}

.pillars {
  display: grid;
  gap: 16px;
}

.pillar {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 18px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.3s var(--ease);
}

.pillar:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.pillar__icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.pillar__icon .i {
  width: 22px;
  height: 22px;
}

.pillar h3 {
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
}

.pillar p {
  font-size: 15px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.7;
}

/* ---------- Experience ---------- */
.job {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 36px;
  box-shadow: var(--shadow);
}

.job__head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.job__logo {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--ink)));
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  flex-shrink: 0;
}

.job__title {
  flex: 1;
  min-width: 220px;
}

.job__title h3 {
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.job__title p {
  color: var(--accent-ink);
  font-weight: 600;
  margin-top: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, #22c55e 15%, transparent);
  color: #15803d;
  letter-spacing: 0.02em;
}

:root[data-theme="dark"] .badge {
  color: #4ade80;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge {
    color: #4ade80;
  }
}

.job__when {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.job__summary {
  margin: 24px 0 28px;
  font-size: 17px;
  color: var(--text-2);
  max-width: 52em;
}

.job__areas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.area {
  padding: 22px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.area h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.area h4 .i {
  color: var(--accent);
}

.area ul {
  margin: 0;
  padding-left: 1.1em;
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.7;
}

.area li + li {
  margin-top: 8px;
}

.area li::marker {
  color: var(--accent);
}

/* Timeline */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.timeline > li {
  position: relative;
  padding: 24px 22px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.timeline > li::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 22px;
  right: 22px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--line-strong);
}

.timeline__edu::before {
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 10px) !important;
}

.timeline__when {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

.timeline h4 {
  font-size: 17px;
  font-weight: 700;
}

.timeline__org {
  color: var(--accent-ink);
  font-weight: 500;
  font-size: 14.5px;
  margin: 2px 0 10px;
}

.timeline__org + p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

/* ---------- Featured ---------- */
.feature {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 56px 0;
}

.feature + .feature {
  border-top: 1px solid var(--line);
}

.feature:first-of-type {
  padding-top: 0;
}

.feature--flip .feature__media {
  order: 2;
}

.feature__media {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  aspect-ratio: 16 / 11;
}

.feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.7s var(--ease);
}

a.feature__media:hover img {
  transform: scale(1.04);
}

.feature__media--mock {
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 55%),
    radial-gradient(circle at 90% 90%, color-mix(in srgb, var(--lime) var(--mock-lime, 30%), transparent), transparent 50%),
    var(--surface-2);
}

.mock {
  display: grid;
  grid-template-columns: 0.85fr 1fr 1fr;
  gap: 12px;
  width: 100%;
  align-items: stretch;
}

.mock__screen {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.mock__screen--phone {
  border-radius: 20px;
  padding-top: 18px;
}

.mock__screen b {
  font-size: 12.5px;
  color: var(--accent-ink);
}

.mock__row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border-radius: 7px;
  padding: 5px 8px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock__row i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.mock__pill {
  margin-top: auto;
  text-align: center;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 5px;
  font-weight: 600;
}

.mock__ticket {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.mock__ticket em {
  font-style: normal;
  color: var(--accent-ink);
  font-family: var(--font);
}

.mock__bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 64px;
  padding: 6px;
  background: var(--surface-2);
  border-radius: 8px;
}

.mock__bars i {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 40%, transparent));
}

.feature__kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.feature__num {
  font-weight: 500;
  color: var(--accent-ink);
}

.feature__num::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--line-strong);
  vertical-align: middle;
  margin-left: 12px;
}

.feature h3 {
  font-size: clamp(26px, 2.8vw, 34px);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.feature__tagline {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-2);
  margin: 12px 0 22px;
  line-height: 1.6;
}

.metrics {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metrics li {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.metrics strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-ink);
}

.metrics span {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
  display: block;
  margin-top: 2px;
}

.bullets {
  padding-left: 1.1em;
  margin: 0 0 22px;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.75;
}

.bullets li + li {
  margin-top: 8px;
}

.bullets li::marker {
  color: var(--accent);
}

.tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags li,
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  line-height: 1.5;
}

.feature .tags li,
.job > .tags li {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.tags li.core,
.tag--core {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent-ink);
  font-weight: 500;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
}

/* ---------- Cards ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-2);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.chip:hover {
  border-color: var(--text-2);
  color: var(--text);
}

.chip[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 22px 24px;
  color: var(--text);
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s, border-color 0.35s;
}

.card:hover {
  color: var(--text);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.card[hidden] {
  display: none;
}

.card.is-entering {
  animation: card-in 0.45s var(--ease) both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.card__cover {
  display: grid;
  place-items: center;
  margin: 0 -22px 20px;
  aspect-ratio: 16 / 8;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.6s var(--ease);
}

.card:hover .card__cover img {
  transform: scale(1.05);
}

.card__cover--code {
  background:
    radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    linear-gradient(135deg, var(--ink-2), var(--ink));
}

.card__cover--code code {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--lime);
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.4s var(--ease);
}

.card:hover .card__cover--code code {
  transform: scale(1.06);
}

.card__meta {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent-ink);
  margin-bottom: 6px;
}

.card h3 {
  font-size: 19px;
  font-weight: 700;
}

.card h3 + p {
  color: var(--muted);
  font-size: 14.5px;
  margin-top: 8px;
  line-height: 1.7;
}

.more-link {
  text-align: center;
  margin-top: 44px;
}

/* ---------- Skills ---------- */
.legend {
  display: flex;
  gap: 8px;
}

.skills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.skill {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.skill:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.skill h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}

.skill .tags {
  gap: 6px;
}

/* ---------- Certificates ---------- */
.certs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.certs .is-extra {
  display: none;
}

.certs.is-open .is-extra {
  display: block;
  animation: card-in 0.4s var(--ease) both;
}

.certs a,
.certs__nolink {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  height: 100%;
  transition: border-color 0.2s, transform 0.3s var(--ease), box-shadow 0.3s;
}

.certs a:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.certs b {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.45;
}

.certs__issuer {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Contact ---------- */
.contact {
  position: relative;
  background: var(--ink);
  color: var(--ink-text);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 50% 60% at 50% 0%, rgba(45, 212, 191, 0.18), transparent 70%),
    radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: auto, 24px 24px;
}

.contact__inner {
  max-width: 1040px;
}

.contact .lead {
  max-width: 36em;
}

.contact .eyebrow {
  color: #5eead4;
}

.contact .eyebrow span {
  background: rgba(45, 212, 191, 0.12);
  color: #5eead4;
}

.contact h2 {
  color: #fff;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.contact .lead {
  color: var(--ink-muted);
  margin: 22px auto 36px;
}

.contact__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn--accent {
  background: var(--lime);
  border-color: var(--lime);
  color: #12161c;
}

.btn--accent:hover {
  background: #d6fb62;
  border-color: #d6fb62;
  color: #12161c;
}

.btn--dark {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: #e8ebef;
}

.btn--dark:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.contact__links {
  list-style: none;
  padding: 0;
  margin: 56px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  text-align: left;
}

.contact__links a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-muted);
  font-size: 13.5px;
  transition: border-color 0.2s, background-color 0.2s, transform 0.3s var(--ease);
  min-width: 0;
}

.contact__links a:hover {
  border-color: rgba(94, 234, 212, 0.5);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
  color: var(--ink-muted);
}

.contact__links .i {
  width: 22px;
  height: 22px;
  color: #e8ebef;
}

.contact__links span {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact__links b {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: #7d8794;
  font-size: 14px;
  border-top: 1px solid var(--ink-line);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.footer__name {
  color: #e8ebef;
  font-weight: 600;
}

.footer__icons {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 6px;
}

.footer__icons a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: #98a2b0;
  transition: color 0.2s, background-color 0.2s;
}

.footer__icons a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Floating ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
}

.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover {
  color: var(--text);
  border-color: var(--text-2);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.35s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav__links a {
    padding: 8px 10px;
  }
  .skills {
    grid-template-columns: repeat(2, 1fr);
  }
  .timeline {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 960px) {
  .hero__grid,
  .feature,
  .about {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero__card {
    max-width: 560px;
  }
  .feature--flip .feature__media {
    order: 0;
  }
  .grid,
  .certs {
    grid-template-columns: repeat(2, 1fr);
  }
  .job__areas {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats li:nth-child(3) {
    border-left: 0;
  }
  .stats li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .contact__links {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .nav__toggle {
    display: block;
  }
  .nav__cta {
    display: none;
  }
  .nav__links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s;
  }
  .nav__links.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
  }
  .nav__links a {
    padding: 12px 14px;
    font-size: 16px;
    border-radius: 12px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }
  .container {
    padding: 0 16px;
  }
  .nav__inner {
    gap: 12px;
  }
  .brand__name small {
    display: none;
  }
  .hero {
    padding: 48px 0 40px;
  }
  .status {
    font-size: 13px;
    margin-bottom: 22px;
  }
  .lead {
    font-size: 17px;
  }
  .hero__actions .btn--lg {
    flex: 1 1 auto;
  }
  .stats {
    margin-top: 48px;
  }
  .stats li {
    padding: 18px 16px;
  }
  .stats strong {
    font-size: 24px;
  }
  .section {
    padding: 72px 0;
  }
  .section__head {
    margin-bottom: 40px;
  }
  .about__story p {
    font-size: 16.5px;
  }
  .pillar {
    padding: 20px;
    column-gap: 14px;
  }
  .job {
    padding: 22px 18px;
  }
  .job__when {
    order: 3;
  }
  .area {
    padding: 18px;
  }
  .timeline,
  .grid,
  .certs,
  .skills,
  .contact__links {
    grid-template-columns: 1fr;
  }
  .feature {
    padding: 40px 0;
    gap: 28px;
  }
  .metrics {
    gap: 8px;
  }
  .metrics li {
    padding: 10px;
  }
  .metrics strong {
    font-size: 17px;
  }
  .mock {
    grid-template-columns: 1fr 1fr;
  }
  .mock__screen:last-child {
    display: none;
  }
  .filters {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar {
    display: none;
  }
  .chip {
    flex-shrink: 0;
  }
  .contact__actions .btn {
    flex: 1 1 100%;
  }
  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .to-top {
    right: 16px;
    bottom: 16px;
  }
}

/* ---------- Print ---------- */
@media print {
  :root {
    --bg: #fff;
    --bg-alt: #fff;
    --surface: #fff;
    --surface-2: #fff;
    --text: #000;
    --text-2: #222;
    --muted: #444;
    --ink: #fff;
    --ink-text: #000;
    --ink-muted: #333;
  }
  .nav,
  .progress,
  .to-top,
  .toast,
  .hero__card,
  .hero__bg,
  .hero__actions,
  .filters,
  .links,
  .more-link,
  .contact__actions,
  .feature__media,
  .card__cover,
  .footer__icons {
    display: none !important;
  }
  .section,
  .hero {
    padding: 24px 0;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .feature,
  .about,
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .feature,
  .job,
  .card,
  .area {
    break-inside: avoid;
    box-shadow: none;
  }
  .certs .is-extra {
    display: block;
  }
  .contact,
  .contact h2,
  .contact__links b,
  .contact__links .i,
  .footer,
  .footer__name {
    color: #000 !important;
  }
}

/* Grid children may shrink below their content (code blocks, long tags) */
.hero__grid > *,
.about > *,
.feature > *,
.job__areas > *,
.grid > *,
.skills > * {
  min-width: 0;
}

/* English headlines are longer than the Chinese ones */
:lang(en) .hero h1 {
  font-size: clamp(36px, 4.6vw, 56px);
  letter-spacing: -0.028em;
}

/* ==========================================================
   Motion & interaction layer
   ========================================================== */

@view-transition {
  navigation: auto;
}

html {
  scrollbar-gutter: stable;
}

:root.theme-vt::view-transition-old(root),
:root.theme-vt::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* ---------- Hero entrance ---------- */
html.js [data-enter] {
  animation: enter 0.9s var(--ease) both;
  animation-delay: var(--d, 0s);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

.hero h1 .line {
  display: inline-block;
}

html.js .hl {
  background-repeat: no-repeat;
  background-size: 0% 100%;
  animation: hl-sweep 0.9s var(--ease) 0.9s forwards;
}

@keyframes hl-sweep {
  to {
    background-size: 100% 100%;
  }
}

/* Cursor spotlight on the hero dot grid */
.hero__spot {
  position: absolute;
  inset: -80px 0 0 0;
  z-index: -1;
  background-image: radial-gradient(var(--accent) 1.3px, transparent 1.3px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(220px circle at var(--hx, 50%) var(--hy, 50%), #000, transparent 70%);
  mask-image: radial-gradient(220px circle at var(--hx, 50%) var(--hy, 50%), #000, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

.hero.is-lit .hero__spot {
  opacity: 1;
}

/* ---------- Marquee ---------- */
.marquee {
  margin-top: 48px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 48s linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.marquee ul {
  display: flex;
  gap: 12px;
  padding: 0 6px;
  margin: 0;
  list-style: none;
}

.marquee li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text-2);
  white-space: nowrap;
}

.marquee li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Pointer glow on cards ---------- */
:is(.card, .pillar, .skill, .area, .timeline > li, .certs a, .contact__links a, .metrics li, .compose, .decision) {
  position: relative;
}

:is(.card, .pillar, .skill, .area, .timeline > li, .certs a, .contact__links a, .metrics li, .compose, .decision)::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 11%, transparent), transparent 45%);
  opacity: 0;
  transition: opacity 0.35s;
}

:is(.card, .pillar, .skill, .area, .timeline > li, .certs a, .contact__links a, .metrics li, .compose, .decision):hover::after {
  opacity: 1;
}

.contact :is(.card, .pillar, .skill, .area, .timeline > li, .certs a, .contact__links a, .metrics li, .compose, .decision)::after {
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(94, 234, 212, 0.14), transparent 50%);
}

/* ---------- Tilt on featured media ---------- */
.feature__media {
  transition: transform 0.7s var(--ease), box-shadow 0.5s;
  will-change: transform;
}

.feature__media.is-tilting {
  transition: transform 0.12s linear, box-shadow 0.5s;
}

.feature__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.22), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s;
}

.feature__media.is-tilting::after {
  opacity: 1;
}

/* ---------- Current-role animated border ---------- */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.job {
  position: relative;
}

.job::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--angle), transparent 0 62%, var(--accent) 80%, var(--lime) 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin-border 7s linear infinite paused;
  pointer-events: none;
}

.job.is-onscreen::before {
  animation-play-state: running;
}

@keyframes spin-border {
  to {
    --angle: 360deg;
  }
}

/* ---------- Button micro-interactions ---------- */
.btn .i,
.icon-btn .i {
  transition: transform 0.3s var(--ease);
}

.btn:hover .i--arrow {
  transform: translate(2px, -2px);
}

.btn:hover .i--down {
  transform: translateY(3px);
}

.btn:hover .i--send {
  transform: translate(3px, -2px) rotate(-8deg);
}

.icon-btn--lg:hover .i {
  transform: scale(1.12);
}

.chip:active,
.btn:active {
  transform: scale(0.97);
}

/* ---------- Palette trigger ---------- */
.kbd-btn {
  width: auto;
  padding: 0 10px 0 12px;
  gap: 8px;
  display: inline-flex;
  align-items: center;
}

.kbd-btn .i {
  width: 16px;
  height: 16px;
}

kbd {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: 0 1px 0 var(--line-strong);
}

/* ---------- Command palette ---------- */
.palette {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 12vh 16px 16px;
}

.palette[hidden] {
  display: none;
}

.palette__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease both;
}

.palette__panel {
  position: relative;
  width: 100%;
  max-width: 600px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  animation: pop-in 0.28s var(--ease) both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.palette__search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.palette__search .i {
  color: var(--muted);
}

.palette__search input {
  flex: 1;
  min-width: 0;
  height: 58px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16.5px;
}

.palette__search input::placeholder {
  color: var(--muted);
}

.palette__list {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: min(56vh, 440px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.palette__group {
  padding: 12px 12px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.palette__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-2);
}

.palette__item .i {
  color: var(--muted);
}

.palette__item[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--text);
}

.palette__item[aria-selected="true"] .i {
  color: var(--accent-ink);
}

.palette__label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.palette__label small {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette__empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
}

.palette__foot {
  display: flex;
  gap: 18px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-2);
}

.palette__foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Project search ---------- */
.project-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search .i {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search input {
  width: 240px;
  height: 40px;
  padding: 0 14px 0 38px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search input:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.grid-status {
  margin: -32px 0 20px;
  font-size: 13.5px;
  color: var(--muted);
}

.grid-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

/* ---------- GitHub activity ---------- */
.activity {
  margin-top: 56px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

.activity__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.activity__head h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.live .status__dot {
  width: 7px;
  height: 7px;
}

.activity__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity__row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 14px 22px;
  color: var(--text-2);
  transition: background-color 0.2s;
}

.activity__list li + li .activity__row {
  border-top: 1px solid var(--line);
}

.activity__row:hover {
  background: var(--surface-2);
  color: var(--text);
}

.activity__name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity__name::before {
  content: "";
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c, var(--muted));
}

.activity__desc {
  font-size: 14px;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.activity__meta .i {
  width: 13px;
  height: 13px;
}

.activity__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.activity__foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  text-align: center;
}

.activity__foot a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14.5px;
}

/* ---------- Section head with action ---------- */
.section__head .btn {
  flex-shrink: 0;
}

/* ---------- Contact composer ---------- */
.contact__grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  text-align: left;
  margin-top: 8px;
}

.contact__grid > * {
  min-width: 0;
}

.compose {
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.compose__title {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
}

.compose__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  border: 0;
  padding: 0;
}

.compose__topics legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.compose__topics label {
  position: relative;
}

.compose__topics input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.compose__topics span {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--ink-muted);
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.compose__topics span:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.compose__topics input:checked + span {
  background: var(--lime);
  border-color: var(--lime);
  color: #12161c;
  font-weight: 600;
}

.compose__topics input:focus-visible + span {
  outline: 2px solid #5eead4;
  outline-offset: 2px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.field input,
.field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font: inherit;
  font-size: 15.5px;
  padding: 11px 14px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #6b7480;
}

.field input:focus,
.field textarea:focus {
  outline: 0;
  border-color: #5eead4;
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.15);
}

.field [aria-invalid="true"] {
  border-color: #f87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.15);
}

.compose__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.compose__hint {
  font-size: 13px;
  color: #7d8794;
  max-width: 24em;
}

.compose__hint.is-error {
  color: #fca5a5;
}

.contact__side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact__side .contact__links {
  margin: 0;
  grid-template-columns: 1fr;
}

.contact__side .btn {
  width: 100%;
}

/* ---------- Back to top with progress ring ---------- */
.to-top svg.ring {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  transform: rotate(-90deg);
  pointer-events: none;
}

.to-top .ring circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 138.2;
  stroke-dashoffset: 138.2;
}

/* ---------- Language hint ---------- */
.lang-hint {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 110px);
  padding: 10px 10px 10px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  color: var(--text-2);
  animation: pop-in 0.4s var(--ease) both;
}

.lang-hint a {
  font-weight: 600;
  white-space: nowrap;
}

.lang-hint button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.lang-hint button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.lang-hint .i {
  width: 16px;
  height: 16px;
}

/* ---------- Footer hint ---------- */
.footer__hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: #7d8794;
  font-size: 13px;
}

.footer kbd {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  color: #c4ccd6;
}

.print-only {
  display: none;
}

/* ---------- Responsive (interaction layer) ---------- */
@media (max-width: 960px) {
  .contact__grid {
    grid-template-columns: 1fr;
  }
  .activity__row {
    grid-template-columns: 1fr auto;
    gap: 4px 16px;
  }
  .activity__desc {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 820px) {
  .kbd-btn {
    width: 40px;
    padding: 0;
    justify-content: center;
  }
  .kbd-btn kbd {
    display: none;
  }
  .footer__hint {
    display: none;
  }
}

@media (max-width: 640px) {
  .project-tools {
    width: 100%;
  }
  .search,
  .search input {
    width: 100%;
  }
  .grid-status {
    margin-top: -20px;
  }
  .activity__head,
  .activity__row {
    padding-left: 16px;
    padding-right: 16px;
  }
  .compose {
    padding: 20px 16px;
  }
  .lang-hint {
    left: 16px;
    bottom: 16px;
    max-width: calc(100vw - 92px);
  }
  .marquee {
    margin-top: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track {
    animation: none;
    width: auto;
  }
  .marquee__track ul[aria-hidden="true"] {
    display: none;
  }
  .marquee ul {
    flex-wrap: wrap;
    justify-content: center;
  }
  .marquee {
    -webkit-mask-image: none;
    mask-image: none;
  }
  .job::before {
    animation: none;
  }
  @view-transition {
    navigation: none;
  }
}

/* ---------- Print: résumé layout ---------- */
@media print {
  @page {
    margin: 13mm 14mm 13mm;
  }
  body {
    font-size: 11.5pt;
    line-height: 1.55;
  }
  .print-only {
    display: block;
  }
  .print-header {
    border-bottom: 2px solid #000;
    padding: 0 0 10px;
    margin: 0 auto 8px;
  }
  .print-header h2 {
    font-size: 22pt;
  }
  .print-header p {
    margin-top: 4px;
    font-size: 10pt;
  }
  .marquee,
  .hero__spot,
  .activity,
  .compose,
  .contact__side .btn,
  .project-tools,
  .grid-status,
  .grid-empty,
  .palette,
  .lang-hint,
  .kbd-btn,
  .section__head .btn,
  .job::before,
  :is(.card, .pillar, .skill, .area, .timeline > li, .certs a, .contact__links a, .metrics li, .compose, .decision)::after,
  .feature__media::after {
    display: none !important;
  }
  .stats {
    margin-top: 12px;
  }
  .hero h1 {
    font-size: 20pt;
  }
  .lead {
    margin: 8px 0;
  }
  .contact__grid {
    grid-template-columns: 1fr;
  }
  .contact__links {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .contact__links a {
    border-color: #ccc !important;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .card[hidden] {
    display: flex !important;
  }
  html.js [data-enter],
  html.js .hl {
    animation: none !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    background-size: 100% 100% !important;
  }
}

.section__sub {
  color: var(--muted);
  margin-top: 14px;
  font-size: 17px;
  max-width: 640px;
}

/* ---------- How I work ---------- */
.process {
  margin-top: 16px;
}

.steps {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.steps::before,
.steps::after {
  content: "";
  position: absolute;
  top: 21px;
  left: 22px;
  right: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
}

.steps::after {
  background: linear-gradient(90deg, var(--accent), var(--lime));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1.6s var(--ease) 0.2s;
}

.steps.is-drawn::after {
  transform: scaleX(1);
}

.steps li {
  position: relative;
}

.steps__num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 18px;
  transition: background-color 0.3s, color 0.3s, transform 0.4s var(--ease);
}

.steps li:hover .steps__num {
  background: var(--accent);
  color: var(--on-accent);
  transform: scale(1.08);
}

.steps h4 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.steps p {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 960px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 36px;
  }
  .steps::before,
  .steps::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .steps {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }
  .steps li {
    padding-left: 62px;
  }
  .steps__num {
    position: absolute;
    left: 0;
    top: -6px;
    margin: 0;
  }
}

@media print {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps::before,
  .steps::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .card__cover {
    aspect-ratio: 16 / 6;
  }
}

/* ==========================================================
   Case studies, diagrams, résumé
   ========================================================== */

.nav__links a[aria-current="page"] {
  color: var(--text);
}

/* ---------- Case hero ---------- */
.case-hero {
  position: relative;
  padding: 56px 0 40px;
  overflow: hidden;
  isolation: isolate;
}

.case-hero .hero__bg {
  inset: -40px 0 0 0;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
}

.crumbs a {
  color: var(--muted);
}

.crumbs a:hover {
  color: var(--text);
}

.crumbs [aria-current] {
  color: var(--text-2);
}

.case-hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  max-width: 16em;
}

.case-hero .lead {
  max-width: 40em;
  margin: 20px 0 30px;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 44px 0 0;
  border-top: 1px solid var(--line);
}

.case-meta > div {
  padding: 18px 20px 0 0;
}

.case-meta dt {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.case-meta dd {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.55;
}

.case-cover {
  margin: 8px 0 0;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 16 / 8;
  background: var(--surface);
}

.case-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.case-cover--mock {
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 64px);
  background:
    radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 55%),
    radial-gradient(circle at 90% 90%, color-mix(in srgb, var(--lime) var(--mock-lime, 30%), transparent), transparent 50%),
    var(--surface-2);
}

.case-cover--mock .mock {
  max-width: 760px;
}

.case-metrics {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.case-metrics li {
  padding: 22px 24px;
}

.case-metrics li + li {
  border-left: 1px solid var(--line);
}

.case-metrics strong {
  display: block;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--accent-ink);
}

.case-metrics span {
  display: block;
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Layout with table of contents ---------- */
.case-layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 48px;
  margin: 72px 0 40px;
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--nav-h) + 28px);
}

.toc__title {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.toc a {
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.45;
  transition: color 0.2s, border-color 0.2s;
}

.toc a:hover {
  color: var(--text);
}

.toc a[aria-current="true"] {
  color: var(--text);
  border-left-color: var(--accent);
  font-weight: 600;
}

.prose {
  max-width: 880px;
}

.prose > .case-section > p,
.prose > .case-section > .prose-list {
  max-width: 760px;
}

.case-section + .case-section {
  margin-top: 72px;
}

.case-section > h2 {
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.case-section {
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.prose p {
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.9;
}

.prose p + p,
.prose p + .prose-list,
.prose .prose-list + p,
.prose .table-wrap + p,
.prose .callout + p,
.prose p + .callout,
.prose .diagram + p {
  margin-top: 16px;
}

.prose strong {
  color: var(--text);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
}

.prose-list {
  margin: 12px 0 0;
  padding-left: 1.2em;
  color: var(--text-2);
  font-size: 16.5px;
  line-height: 1.85;
}

.prose-list li + li {
  margin-top: 6px;
}

.prose-list li::marker {
  color: var(--accent);
}

/* ---------- Content blocks ---------- */
.decisions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.decision {
  position: relative;
  padding: 22px 22px 22px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.decision__num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.decision h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.prose .decision p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
}

.feature-list {
  display: grid;
  gap: 12px;
}

.feature-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.feature-item:last-child {
  border-bottom: 1px solid var(--line);
}

.feature-item h3 {
  font-size: 16px;
  font-weight: 700;
}

.prose .feature-item p {
  font-size: 15.5px;
  line-height: 1.75;
}

.callout {
  margin-top: 20px;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
}

.callout__title {
  font-weight: 700;
  color: var(--accent-ink) !important;
  margin-bottom: 6px;
  font-size: 15px !important;
}

.prose .callout p {
  font-size: 15.5px;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 560px;
}

.data th,
.data td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data tbody th {
  white-space: normal;
  font-weight: 500;
  color: var(--text);
  min-width: 220px;
}

.data thead th {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  background: var(--surface-2);
}

.data td {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.data tfoot th,
.data tfoot td {
  border-bottom: 0;
  font-weight: 700;
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface));
}

.data tbody tr:hover {
  background: var(--surface-2);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.gallery figure {
  margin: 0;
}

.gallery a {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
  background: var(--surface);
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.6s var(--ease);
}

.gallery a:hover img {
  transform: scale(1.04);
}

.gallery figcaption {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.code-block {
  margin: 16px 0 0;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #d6dde6;
  font-family: var(--mono);
  font-size: 13.5px;
  overflow-x: auto;
}

/* ---------- Diagrams ---------- */
.diagram {
  margin: 8px 0 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(var(--line) 1px, transparent 1px) 0 0 / 20px 20px,
    var(--surface);
  overflow-x: auto;
}

.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 720px;
  font-family: var(--font);
  overflow: visible;
}

.diagram figcaption {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.diagram__hint {
  display: none;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

.dg-box rect {
  fill: var(--surface);
  stroke: var(--line-strong);
  stroke-width: 1.5;
}

.dg-box--accent rect {
  fill: var(--accent-soft);
  stroke: var(--accent);
}

.dg-label {
  fill: var(--text);
  font-size: 17px;
  font-weight: 700;
}

.dg-sub {
  fill: var(--muted);
  font-size: 14px;
}

.dg-box--accent .dg-label {
  fill: var(--accent-ink);
}

.dg-group rect {
  fill: color-mix(in srgb, var(--surface-2) 60%, transparent);
  stroke: var(--line-strong);
  stroke-width: 1.2;
  stroke-dasharray: 6 5;
}

.dg-group-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.dg-edge {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.dg-edge--accent {
  stroke: var(--accent);
  stroke-width: 2;
}

.dg-edge--dashed {
  stroke-dasharray: 5 5;
}

.dg-arrowhead {
  fill: var(--muted);
}

.dg-arrowhead--accent {
  fill: var(--accent);
}

.dg-edge-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 6px;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: no-preference) {
  .diagram.is-flowing .dg-edge--accent {
    stroke-dasharray: 7 6;
    animation: dg-flow 1.1s linear infinite;
  }
}

@keyframes dg-flow {
  to {
    stroke-dashoffset: -13;
  }
}

/* Experience: architecture disclosure */
.arch {
  margin-bottom: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.arch summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
}

.arch summary::-webkit-details-marker {
  display: none;
}

.arch summary .i {
  color: var(--accent);
  transition: transform 0.3s var(--ease);
}

.arch[open] summary .i--chev {
  transform: rotate(180deg);
}

.arch summary span {
  flex: 1;
}

.arch .diagram {
  margin: 0 14px 14px;
}

/* ---------- Case navigation ---------- */
.case-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 16px;
  padding-top: 40px;
  padding-bottom: 96px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

.case-nav__link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s, transform 0.3s var(--ease), box-shadow 0.3s;
}

.case-nav__link:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.case-nav__link span {
  font-size: 13px;
  color: var(--muted);
}

.case-nav__link strong {
  font-size: 18px;
}

.case-nav__link--next {
  text-align: right;
}

.case-nav__all {
  align-self: center;
  font-weight: 600;
  font-size: 14.5px;
  padding: 10px 16px;
}

/* ---------- Résumé ---------- */
.resume-page {
  padding: 32px 0 96px;
  background: var(--bg-alt);
}

.resume-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 900px;
  margin-bottom: 20px;
}

.resume-toolbar__actions {
  display: flex;
  gap: 8px;
}

.resume {
  max-width: 852px;
  margin: 0 auto;
  padding: 56px 60px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  font-size: 14.5px;
  line-height: 1.65;
}

.resume__head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--text);
}

.resume h1 {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.resume h1 span {
  margin-left: 12px;
  font-size: 18px;
  font-weight: 500;
  color: var(--muted);
}

.resume__role {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-ink);
}

.resume__contact {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: right;
  font-size: 13px;
  line-height: 1.7;
}

.resume__contact a {
  color: var(--text-2);
}

.resume__summary {
  margin: 18px 0 0;
  color: var(--text-2);
}

.resume__section {
  margin-top: 24px;
}

.resume h2 {
  font-size: 12.5px;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  padding-bottom: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.resume__section h2 + h2,
.resume__certs + h2,
.resume__edu + h2 {
  margin-top: 20px;
}

.resume__job + .resume__job {
  margin-top: 16px;
}

.resume__job-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.resume__job-head h3 {
  font-size: 15.5px;
  font-weight: 700;
}

.resume__job-head h3 span {
  margin-left: 10px;
  font-weight: 500;
  color: var(--text-2);
}

.resume__job-head p {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.resume__job ul {
  margin: 6px 0 0;
  padding-left: 1.15em;
  color: var(--text-2);
}

.resume__job li + li {
  margin-top: 3px;
}

.resume__projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.resume__projects li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  color: var(--text-2);
}

.resume__projects a {
  color: var(--text);
}

.resume__cols {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 32px;
}

.resume__skills {
  margin: 0;
  display: grid;
  gap: 6px;
}

.resume__skills div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
}

.resume__skills dt {
  font-weight: 600;
  color: var(--text);
}

.resume__skills dd {
  margin: 0;
  color: var(--text-2);
}

.resume__edu {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-2);
}

.resume__edu span {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.resume__certs {
  color: var(--text-2);
  font-size: 13.5px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .case-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 48px;
  }
  .toc {
    position: static;
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
  }
  .case-meta,
  .case-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .case-metrics li:nth-child(3) {
    border-left: 0;
  }
  .case-metrics li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .resume {
    padding: 40px 32px;
  }
}

@media (max-width: 720px) {
  .diagram__hint {
    display: block;
  }
}

@media (max-width: 640px) {
  .case-hero {
    padding: 32px 0 24px;
  }
  .case-cover {
    aspect-ratio: 4 / 3;
  }
  .case-meta {
    grid-template-columns: 1fr 1fr;
  }
  .case-metrics li {
    padding: 16px;
  }
  .decisions,
  .gallery {
    grid-template-columns: 1fr;
  }
  .feature-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .diagram {
    padding: 16px;
  }
  .case-section + .case-section {
    margin-top: 52px;
  }
  .prose p {
    font-size: 16px;
  }
  .case-nav {
    grid-template-columns: 1fr;
  }
  .case-nav__link--next {
    text-align: left;
  }
  .case-nav__all {
    order: 3;
    justify-self: center;
  }
  .resume {
    padding: 28px 18px;
    border-radius: 0;
  }
  .resume__contact {
    text-align: left;
  }
  .resume__job-head {
    flex-direction: column;
    gap: 2px;
  }
  .resume__projects li,
  .resume__cols {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .resume__cols {
    gap: 0;
  }
}

/* ---------- Print ---------- */
@media print {
  .toc,
  .case-nav,
  .crumbs,
  .resume-toolbar,
  .diagram__hint {
    display: none !important;
  }
  .case-layout {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }
  .case-cover {
    aspect-ratio: auto;
    max-height: 90mm;
  }
  .diagram {
    break-inside: avoid;
  }
  .diagram svg {
    min-width: 0;
  }
  .resume-body .footer {
    display: none !important;
  }
  .resume-page {
    padding: 0;
    background: #fff;
  }
  .resume {
    max-width: none;
    padding: 0;
    border: 0;
    box-shadow: none;
    font-size: 9.6pt;
    line-height: 1.5;
  }
  .resume h1 {
    font-size: 22pt;
  }
  .resume__job,
  .resume__projects li {
    break-inside: avoid;
  }
  .resume a {
    color: inherit;
    text-decoration: none;
  }
  .arch:not([open]) {
    display: none;
  }
}

.skill__proof {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.feature__title {
  color: inherit;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size 0.35s var(--ease);
}

.feature__title:hover {
  color: inherit;
  background-size: 100% 2px;
}

.btn--case {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.btn--case:hover {
  background: var(--text-2);
  border-color: var(--text-2);
  color: var(--bg);
}

.head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media print {
  .resume {
    font-size: 8.7pt;
    line-height: 1.45;
  }
  .resume h1 {
    font-size: 20pt;
  }
  .resume__head {
    padding-bottom: 12px;
  }
  .resume__contact {
    font-size: 8.4pt;
    line-height: 1.55;
  }
  .resume__summary {
    margin-top: 10px;
  }
  .resume__section {
    margin-top: 12px;
  }
  .resume h2 {
    margin-bottom: 7px;
    padding-bottom: 4px;
  }
  .resume__job + .resume__job {
    margin-top: 7px;
  }
  .resume__job ul {
    margin-top: 3px;
  }
  .resume__job li + li {
    margin-top: 1px;
  }
  .resume__projects {
    gap: 4px;
  }
  .resume__projects li {
    grid-template-columns: 112px 1fr;
  }
  .resume__cols {
    break-inside: avoid;
    gap: 24px;
  }
  .resume__skills {
    gap: 3px;
  }
  .resume__section h2 + h2,
  .resume__certs + h2,
  .resume__edu + h2 {
    margin-top: 12px;
  }
}

@media print {
  .resume__certs {
    font-size: inherit;
  }
}

@media print {
  :lang(en) .resume {
    font-size: 8.6pt;
    line-height: 1.42;
  }
}

.case .container {
  max-width: 1240px;
}

.diagram {
  padding: 20px;
}

.case-layout > * {
  min-width: 0;
}

.case .prose {
  max-width: none;
}

/* Responsive images: <picture> is a transparent wrapper */
picture {
  display: contents;
}


/* ---------- Rendering performance ----------
   During the first load, sections below the fold skip layout and paint until needed.
   site.js renders them one by one once the page is idle (html.cv-done), so in-page
   navigation and scroll positions are exact afterwards. Heights are measured estimates. */
@media screen {
  html:not(.cv-done) :is(#about, #experience, #work, #more, #skills, #certificates, .case-layout):not(.cv-ready) {
    content-visibility: auto;
    contain-intrinsic-size: auto var(--cis, 1200px);
  }
  #about { --cis: 1150px; }
  #experience { --cis: 1550px; }
  #work { --cis: 3450px; }
  #more { --cis: 1950px; }
  #skills { --cis: 980px; }
  #certificates { --cis: 750px; }
  .case-layout { --cis: 3300px; }
}

@media screen and (max-width: 640px) {
  #about { --cis: 1850px; }
  #experience { --cis: 2950px; }
  #work { --cis: 5150px; }
  #more { --cis: 3850px; }
  #skills { --cis: 2200px; }
  #certificates { --cis: 1060px; }
  .case-layout { --cis: 4700px; }
}

/* Comfortable touch targets for the résumé contact links */
.resume__contact a {
  display: inline-block;
  padding: 4px 0;
}

@media print {
  .resume__contact a {
    padding: 0;
  }
}

/* ---------- Hero: role first ---------- */
.hero__title .line {
  display: block;
}

.hero__sub {
  margin-top: 14px;
  font-size: clamp(22px, 2.7vw, 34px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text-2);
}

:lang(en) .hero__sub {
  font-size: clamp(20px, 2.3vw, 28px);
}

/* "Where I fit" card */
.fit {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.fit__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.fit__head h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.fit__role {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.fit__list {
  margin: 0;
  padding: 6px 22px 12px;
}

.fit__row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}

.fit__row:last-child {
  border-bottom: 0;
}

.fit__row dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.fit__row dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fit__row dd span {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
}

.fit__row--edge dt {
  color: var(--accent-ink);
}

.fit__row--edge dd span {
  font-family: var(--font);
  font-weight: 600;
  background: color-mix(in srgb, var(--lime) 28%, var(--surface));
  border-color: color-mix(in srgb, var(--lime) 55%, var(--line));
}

:root[data-theme="dark"] .fit__row--edge dd span {
  background: color-mix(in srgb, var(--lime) 14%, var(--surface));
  color: var(--lime);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fit__row--edge dd span {
    background: color-mix(in srgb, var(--lime) 14%, var(--surface));
    color: var(--lime);
  }
}

@media (max-width: 640px) {
  .fit__head,
  .fit__list {
    padding-left: 16px;
    padding-right: 16px;
  }
  .fit__row {
    grid-template-columns: 64px 1fr;
  }
}

@media print {
  .hero__card {
    display: none !important;
  }
}

/* ---------- Volunteer entry ---------- */
.job--volunteer .job__logo {
  background: linear-gradient(135deg, #f59e0b, color-mix(in srgb, #f59e0b 55%, var(--ink)));
}

.job--volunteer .job__summary {
  margin-bottom: 22px;
}

.job__source {
  margin-top: 18px;
  font-size: 14px;
}

.job__source a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-ink);
  font-weight: 600;
}

.job__source .i {
  width: 14px;
  height: 14px;
}

/* ---------- Press mention ---------- */
.press {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -6px 0 22px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, #f59e0b 35%, var(--line));
  background: color-mix(in srgb, #f59e0b 9%, var(--surface));
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-2);
}

.press .i {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  color: #d97706;
}

.press a {
  color: var(--accent-ink);
  font-weight: 600;
}
