/* ==========================================================================
   Manuel David Maya Rosero — Portfolio / Virtual CV
   Design system: cool neutral surfaces, deep teal, Sora + Inter,
   consistent cards and restrained motion. Shared light and dark tokens.
   ========================================================================== */

/* Fonts load via a <link> in index.html <head> now, not @import here —
   @import is render-blocking and serializes behind this file's own fetch. */

/* ---- Reset --------------------------------------------------------------*/
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img, picture { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { border: none; background: none; cursor: pointer; }

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

/* ---- Design tokens ------------------------------------------------------*/
:root {
  color-scheme: light;
  --page: #f4f7f9;          /* cool neutral canvas */
  --surface: #ffffff;       /* card paper */
  --surface-2: #edf2f5;     /* nested / tag fill */
  --ink: #172b36;           /* deep blue charcoal */
  --ink-2: #445866;
  --muted: #566b79;
  --gridline: #dce5ea;
  --border: #dce5ea;
  --border-strong: #b8cbd3;

  --primary: #116b67;       /* accessible deep teal */
  --primary-ink: #ffffff;
  --primary-tint: #e4f2ef;
  --accent: #8b571f;        /* warm muted terracotta */
  --accent-tint: #f7efdf;
  --violet: #6a518b;        /* muted plum */
  --violet-tint: #ece8f2;
  --aqua: #326d50;          /* muted sage */
  --aqua-tint: #e6f0ea;
  --rose: #994846;          /* muted brick */
  --rose-tint: #f3e5e3;
  --good: #326d50;
  --shadow: 0 2px 4px rgba(20,50,65,.025), 0 8px 28px -16px rgba(20,50,65,.14);
  --shadow-lg: 0 4px 12px rgba(20,50,65,.04), 0 18px 48px -24px rgba(20,50,65,.22);

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --container: 1160px;
  --ease-out-soft: cubic-bezier(.22, 1, .36, 1);

  --font-head: 'Sora', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--font-head);
}

/* Dark-mode overrides are grouped below; components share the same tokens. */

/* ---- Base -----------------------------------------------------------*/
body {
  font-family: var(--font-body);
  background: var(--page);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-weight: 800; }
p { color: var(--ink-2); }
strong { color: var(--ink); font-weight: 600; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: 24px; }

section { padding-block: 64px; position: relative; }
section[id] { scroll-margin-top: 88px; }
@media (max-width: 720px) { section { padding-block: 48px; } }

.section-head { max-width: 720px; margin-bottom: 30px; }
.section-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-size: 12.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-2);
  margin-bottom: 12px;
}
.section-eyebrow::before { content: ""; width: 16px; height: 2px; background: var(--primary); display: inline-block; border-radius: 2px; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(27px, 3.5vw, 36px); letter-spacing: -.04em; margin-bottom: 12px; }
.section-head p { font-size: 17px; max-width: 60ch; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ---- Buttons --------------------------------------------------------*/
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-family: var(--font-head); font-weight: 600; font-size: 14.5px;
  padding: 12px 22px; border-radius: var(--radius-m); transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
  min-height: 46px; white-space: normal; text-align: center;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-ghost { border: 1.5px solid var(--border-strong); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--primary); outline-offset: 4px;
}

/* ---- Navbar -----------------------------------------------------------*/
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  background: color-mix(in srgb, var(--page) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background-color .25s ease;
}
.navbar.is-scrolled { border-bottom-color: var(--border); }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; flex-wrap: nowrap; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 15.5px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border);
  transition: opacity .25s ease, transform .25s ease;
}
.brand-text-full { display: block; }
.brand-text-sub { display: block; font-family: var(--font-body); font-weight: 500; font-size: 11.5px; color: var(--muted); }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  font-size: 14px; font-weight: 500; padding: 9px 14px; border-radius: var(--radius-m); color: var(--ink-2);
  transition: background-color .16s ease, color .16s ease;
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a.is-active { background: var(--primary-tint); color: var(--primary); box-shadow: inset 0 -2px var(--primary); }

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

.lang-switch { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: var(--radius-m); border: 1px solid var(--border); }
.lang-switch button {
  font-family: var(--font-head); font-size: 12.5px; font-weight: 700; min-width: 40px; min-height: 38px; padding: 6px 9px; border-radius: var(--radius-s); color: var(--muted);
  transition: background-color .16s ease, color .16s ease;
}
.lang-switch button.is-active { background: var(--primary); color: var(--primary-ink); }
.lang-switch button:not(.is-active):hover { color: var(--ink); }

.nav-burger { display: none; width: 40px; height: 40px; border-radius: 10px; place-items: center; border: 1px solid var(--border); background: var(--surface-2); }
.nav-burger svg { width: 18px; height: 18px; }

@media (max-width: 1240px) {
  .nav-links { position: fixed; inset: 76px 0 0 0; height: calc(100dvh - 76px); background: var(--page); flex-direction: column; align-items: stretch; padding: 18px; gap: 4px; visibility: hidden; pointer-events: none; transform: translateX(100%); transition: transform .28s ease, visibility 0s linear .28s; overflow-y: auto; }
  .nav-links.is-open { visibility: visible; pointer-events: auto; transform: translateX(0); transition-delay: 0s; }
  .nav-links a { padding: 14px 16px; font-size: 16px; }
  .nav-burger { display: grid; }
}
@media (max-width: 560px) {
  .brand-text-sub { display: none; }
  .navbar-inner { gap: 8px; }
  .lang-switch { padding: 2px; }
  .lang-switch button { padding: 6px 8px; font-size: 12px; }
}
@media (max-width: 420px) {
  .brand-text-full { display: none; }
}

/* ---- Hero: one unified "CV header" card on the gray canvas -------------*/
.hero { padding-top: 116px; padding-bottom: 48px; }
.hero-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 40px; box-shadow: var(--shadow-lg); }
.hero-card-top { display: flex; gap: 30px; align-items: flex-start; }
.hero-photo { width: 108px; height: 108px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 4px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong), 0 8px 24px -12px rgba(20,50,65,.25); }
.hero-id { flex: 1; min-width: 0; }

.hero h1 { font-family: var(--font-display); font-size: clamp(30px, 3.5vw, 46px); font-weight: 600; letter-spacing: -.05em; line-height: 1.14; margin-bottom: 14px; text-wrap: balance; }
.hero-role { font-family: var(--font-head); font-size: clamp(15px, 1.5vw, 18px); color: var(--primary); font-weight: 600; margin-bottom: 14px; }
.hero-lede { font-size: 16px; max-width: 64ch; margin-bottom: 24px; line-height: 1.75; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-card-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--border); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.hero-meta-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.hero-meta-item svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
a.hero-meta-item:hover { color: var(--primary); }

.hero-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; width: 100%; }
.hero-fact { padding-left: 12px; border-left: 2px solid var(--border); }
.hero-fact dt { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hero-fact dd { font-size: 14px; font-weight: 500; color: var(--ink); margin-top: 4px; }
.hero-status { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--primary-tint); font-size: 12px; font-weight: 600; color: var(--primary); }
.hero-status-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

@media (max-width: 700px) {
  .hero { padding-top: 96px; }
  .hero-card { padding: 24px 20px; }
  .hero-photo { width: 80px; height: 80px; }
  .hero-card-top { flex-direction: column; align-items: center; gap: 20px; text-align: center; }
  .hero-status { margin-bottom: 14px; text-align: left; }
  .hero h1 { font-size: clamp(28px, 6vw, 38px); }
  .hero-cta { justify-content: center; }
  .hero-card-bottom { flex-direction: column; align-items: center; text-align: center; }
  .hero-meta { justify-content: center; }
  .hero-facts { grid-template-columns: 1fr; text-align: left; gap: 16px; }
}

/* ---- About / summary chips ---------------------------------------------*/
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: start; }
.about-text p { font-size: 16.5px; margin-bottom: 16px; }
.about-highlights { display: grid; gap: 12px; }
.about-highlight { display: flex; gap: 14px; align-items: flex-start; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); }
.about-highlight .ic { width: 38px; height: 38px; border-radius: 6px; border: 1px solid var(--border); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.about-highlight .ic svg { width: 19px; height: 19px; }
.about-highlight h3 { font-size: 14.5px; margin-bottom: 2px; }
.about-highlight p { font-size: 13.5px; margin: 0; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* ---- Timeline (education & experience) ---------------------------------*/
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 1px; background: var(--gridline); }
.tl-item { position: relative; padding-left: 48px; padding-bottom: 24px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: 0; top: 22px; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; box-shadow: var(--shadow); z-index: 1; }
.tl-dot svg { width: 16px; height: 16px; color: var(--primary); }
.tl-item.is-current .tl-dot { background: var(--primary); border-color: var(--primary); }
.tl-item.is-current .tl-dot svg { color: var(--primary-ink); }
.tl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 26px 28px; box-shadow: var(--shadow); transition: box-shadow .2s ease; }
.tl-card:hover { box-shadow: var(--shadow); }
.tl-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-bottom: 6px; }
.tl-title { font-family: var(--font-head); font-size: 19px; font-weight: 600; line-height: 1.35; }
.tl-org { font-size: 15px; color: var(--primary); font-weight: 600; margin-top: 6px; }
.tl-date { max-width: 100%; font-size: 12px; font-weight: 500; color: var(--muted); white-space: normal; padding: 5px 11px; background: var(--surface-2); border-radius: var(--radius-s); height: fit-content; }
.tl-item.is-current .tl-date { background: var(--aqua-tint); color: var(--aqua); }
.tl-live { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: middle; }
.tl-logo { height: 46px; width: auto; min-width: 46px; max-width: 132px; flex-shrink: 0; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: #ffffff; object-fit: contain; }
.tl-logo.is-dark { background: #172b36; border-color: #172b36; }
.tl-head-copy { flex: 1 1 260px; min-width: 0; }
@media (max-width: 480px) { .tl-logo { height: 38px; min-width: 38px; max-width: 110px; padding: 4px 6px; } }
.tl-place { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.tl-bullets { display: grid; gap: 9px; margin-bottom: 14px; }
.tl-bullets li { position: relative; padding-left: 17px; font-size: 14.5px; color: var(--ink-2); }
.tl-bullets li::before { content: ""; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { max-width: 100%; overflow-wrap: anywhere; font-size: 11.5px; font-weight: 500; padding: 4px 9px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent; }

/* ---- Projects: institution → course → work ------------------------------*/
.project-catalog { display: grid; gap: 18px; }
.project-institution, .project-course { padding-block: 0; }
.project-institution { --project-color: var(--primary); --project-tint: var(--primary-tint); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface); }
.project-institution[data-c="1"] { --project-color: var(--violet); --project-tint: var(--violet-tint); }
.project-institution[data-c="2"] { --project-color: var(--aqua); --project-tint: var(--aqua-tint); }

.project-institution-head { display: grid; grid-template-columns: 88px minmax(0, 1fr) 20px; gap: 18px; align-items: center; padding: 22px 24px; cursor: pointer; list-style: none; transition: background-color .18s ease; }
.project-institution-head::-webkit-details-marker { display: none; }
.project-institution-head:hover { background: var(--surface-2); }
.project-institution-head:focus-visible { outline: 3px solid color-mix(in srgb, var(--project-color) 40%, transparent); outline-offset: -3px; }
.project-institution[open] .project-institution-head { border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--project-tint) 36%, var(--surface)); }
.project-institution-icon { width: 88px; height: 88px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); color: var(--project-color); }
.project-institution-copy { min-width: 0; }
.project-institution-title { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.project-institution-title h3 { font-family: var(--font-head); font-size: clamp(22px, 3vw, 29px); line-height: 1.15; }
.project-institution-copy > p { max-width: 78ch; margin: 7px 0 0; font-size: 14px; color: var(--muted); }
.project-institution-toggle { width: 11px; height: 11px; border-right: 2px solid var(--project-color); border-bottom: 2px solid var(--project-color); transform: rotate(45deg); transition: transform .2s ease; }
.project-institution[open] .project-institution-toggle { transform: rotate(225deg); }

.project-courses { display: grid; gap: 30px; padding: 28px 24px 30px; }
.project-course { min-width: 0; }
.project-course-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.project-course-head::after { content: ""; min-width: 20px; height: 1px; flex: 1; background: var(--border); }
.project-course-head h4 { font-family: var(--font-head); font-size: 17px; line-height: 1.3; }
.project-course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.project-card { position: relative; min-width: 0; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface); transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.project-card::before { content: ""; position: absolute; inset: 24px auto 24px 0; width: 2px; background: var(--project-color); opacity: .7; border-radius: 2px; }
.project-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.project-card-featured { grid-column: 1 / -1; }
.project-card-compact { box-shadow: none; }
.project-content { width: 100%; padding: 24px 25px 23px 28px; display: flex; flex-direction: column; }
.project-card-featured .project-content { padding: 28px 30px; }
.project-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 16px; margin-bottom: 10px; }
.project-kicker { max-width: 100%; color: var(--project-color); font-size: 10.5px; font-weight: 800; letter-spacing: .07em; line-height: 1.4; text-transform: uppercase; }
.project-card h5 { margin-bottom: 10px; font-family: var(--font-head); font-size: 19px; line-height: 1.25; }
.project-card-featured h5 { font-size: clamp(21px, 2.4vw, 25px); }
.project-intro { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.project-card-featured .project-intro { max-width: 88ch; font-size: 14.5px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.project-card .stat-row { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-top: 2px; }
.stat-tile { background: var(--surface-2); border-radius: var(--radius-s); padding: 12px 10px; text-align: center; }
.project-card .stat-tile { border: 1px solid var(--border); background: color-mix(in srgb, var(--project-tint) 45%, var(--surface)); }
.stat-tile b { display: block; font-family: var(--font-head); font-size: 19px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-tile span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }

.project-bullets { display: grid; gap: 7px; margin: 0 0 16px; }
.project-bullets li { position: relative; padding-left: 17px; color: var(--ink-2); font-size: 13.5px; }
.project-bullets li::before { content: "→"; position: absolute; left: 0; top: 0; color: var(--project-color); font-size: 12px; }
.project-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; }
.project-note svg { flex: 0 0 auto; margin-top: 1px; color: var(--project-color); }
.project-tags { margin-top: auto; }

.project-links { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.project-links a { display: inline-flex; align-items: center; gap: 7px; width: fit-content; padding: 8px 11px; border: 1px solid var(--project-color); border-radius: 8px; background: var(--surface); color: var(--project-color); font-size: 12.5px; font-weight: 750; transition: background .16s ease, color .16s ease; }
.project-links a:hover { background: var(--project-color); color: var(--primary-ink); }
.project-links a svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---- Project card media: real chart/figure images, styled like .cert-item-media
   but sized for chart legibility (these PNGs carry axis labels/legends, not
   square logos) rather than the badge strip's compact 174px height. -------- */
.project-card-media { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--border); border-bottom: 1px solid var(--border); }
.project-card-media figure { margin: 0; display: flex; flex-direction: column; background: #fff; }
.project-card-media a { display: flex; align-items: center; justify-content: center; height: 240px; padding: 18px; overflow: hidden; cursor: zoom-in; }
.project-card-featured .project-card-media a { height: 280px; }
.project-card-media img { width: auto; height: 100%; max-width: 100%; object-fit: contain; object-position: center; display: block; transition: transform .3s ease; }
.project-card-media a:hover img { transform: scale(1.02); }
.project-card-media figcaption { padding: 8px 14px 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; text-align: center; line-height: 1.35; }
@media (max-width: 560px) {
  .project-card-media a { height: 190px; padding: 12px; }
}

/* ---- Institution photo (replaces the generic cap-icon glyph when available) */
.project-institution-photo { width: 88px; height: 88px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }

@media (max-width: 820px) {
  .project-course-grid { grid-template-columns: 1fr; }
  .project-card-featured { grid-column: auto; }
}
@media (max-width: 560px) {
  .project-institution-head { grid-template-columns: 60px minmax(0, 1fr) 18px; gap: 12px; padding: 17px 16px; }
  .project-institution-icon, .project-institution-photo { width: 60px; height: 60px; border-radius: 8px; }
  .project-institution-title { align-items: flex-start; }
  .project-institution-copy > p { font-size: 12.5px; }
  .project-courses { gap: 26px; padding: 22px 16px 24px; }
  .project-course-head { align-items: flex-start; }
  .project-course-head::after { display: none; }
  .project-content, .project-card-featured .project-content { padding: 21px 19px 20px 22px; }
  .project-card-top { flex-direction: column; }
  .project-kicker { max-width: none; }
  .project-card .stat-row { grid-template-columns: 1fr; }
}

/* ---- Skills ---------------------------------------------------------------*/
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-bottom: 56px; }
@media (max-width: 800px) { .skills-grid { grid-template-columns: 1fr; } }
.skill-card { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 24px; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.skill-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.skill-card.is-wide { grid-column: 1 / -1; }
.subsection-title { font-family: var(--font-head); font-size: 19px; margin-bottom: 18px; }
.skill-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.skill-card-head .ic { width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--border); display: grid; place-items: center; flex-shrink: 0; }
.skill-card-head .ic svg { width: 18px; height: 18px; }
.skill-card-head h3 { font-size: 15.5px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tags .tag { background: var(--surface-2); }
.skill-card[data-c="0"] .ic { color: var(--primary); }
.skill-card[data-c="1"] .ic { color: var(--accent); }
.skill-card[data-c="2"] .ic { color: var(--aqua); }
.skill-card[data-c="3"] .ic { color: var(--violet); }
.skill-card[data-c="4"] .ic { color: var(--rose); }

/* ---- Certifications: type → provider → credential -------------------------*/
.certs-stats { grid-template-columns: repeat(4, 1fr); margin-bottom: 52px; }
@media (max-width: 800px) { .certs-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .certs-stats { grid-template-columns: 1fr; } }

.certs-catalog { display: grid; gap: 18px; }
.cert-type-section { --cert-color: var(--primary); --cert-tint: var(--primary-tint); overflow: hidden; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface); }
.cert-type-section.cert-type-micro { --cert-color: var(--violet); --cert-tint: var(--violet-tint); }
.cert-type-section.cert-type-knowledge { --cert-color: var(--accent); --cert-tint: var(--accent-tint); }
.cert-type-head { display: grid; grid-template-columns: 48px minmax(0, 1fr) 18px; align-items: center; gap: 16px; padding: 20px 22px; cursor: pointer; list-style: none; transition: background-color .18s ease; }
.cert-type-head::-webkit-details-marker { display: none; }
.cert-type-head:hover { background: var(--surface-2); }
.cert-type-head:focus-visible { outline: 3px solid color-mix(in srgb, var(--cert-color) 40%, transparent); outline-offset: -3px; }
.cert-type-section[open] .cert-type-head { border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--cert-tint) 36%, var(--surface)); }
.cert-type-icon { width: 48px; height: 48px; display: grid; place-items: center; flex-shrink: 0; border-radius: 8px; border: 1px solid var(--border); color: var(--cert-color); }
.cert-type-copy { min-width: 0; }
.cert-type-title-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cert-type-title-line h3 { font-family: var(--font-head); font-size: clamp(18px, 2.5vw, 23px); overflow-wrap: anywhere; }
.cert-type-count { flex-shrink: 0; min-width: 29px; height: 29px; padding-inline: 8px; display: inline-grid; place-items: center; border-radius: var(--radius-s); background: var(--cert-tint); color: var(--cert-color); font-size: 12px; font-weight: 800; }
.cert-type-copy p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }
.cert-type-toggle { width: 11px; height: 11px; border-right: 2px solid var(--cert-color); border-bottom: 2px solid var(--cert-color); transform: rotate(45deg); transition: transform .2s ease; }
.cert-type-section[open] .cert-type-toggle { transform: rotate(225deg); }

.cert-providers { display: grid; gap: 24px; padding: 24px; }
.cert-provider { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface-2); }
.cert-provider-head { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.cert-provider-head .ic { width: 38px; height: 38px; display: grid; place-items: center; flex-shrink: 0; border-radius: 6px; border: 1px solid var(--border); }
.cert-provider-head h4 { font-family: var(--font-head); font-size: 17px; line-height: 1.2; }
.cert-provider-head span { color: var(--muted); font-size: 12px; }
.cert-provider[data-c="0"] .cert-provider-head .ic { color: var(--primary); }
.cert-provider[data-c="1"] .cert-provider-head .ic { color: var(--accent); }
.cert-provider[data-c="2"] .cert-provider-head .ic { color: var(--aqua); }
.cert-provider[data-c="3"] .cert-provider-head .ic { color: var(--violet); }
.cert-provider[data-c="4"] .cert-provider-head .ic { color: var(--rose); }

.cert-items-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .cert-items-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) {
  .cert-type-head { grid-template-columns: 42px minmax(0, 1fr) 18px; gap: 12px; padding: 17px 16px; }
  .cert-type-icon { width: 42px; height: 42px; border-radius: 7px; }
  .cert-type-title-line h3 { font-size: 20px; }
  .cert-type-copy p { font-size: 12.5px; }
  .cert-providers { gap: 18px; padding: 16px; }
  .cert-provider { padding: 16px; }
  .cert-items-grid { grid-template-columns: 1fr; }
}

.cert-item { min-width: 0; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.cert-item:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.cert-item-media { height: 174px; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 13px; border-bottom: 1px solid var(--border); background: #fff; }
.cert-item-media img { width: auto; height: 100%; max-width: 100%; display: block; object-fit: contain; object-position: center; }
.cert-item-media-fallback { color: var(--cert-color); background: var(--cert-tint); }
.cert-item-content { min-height: 238px; padding: 17px; display: flex; flex-direction: column; }
.cert-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.cert-item-issuer { min-width: 0; color: var(--muted); font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.cert-kind { flex-shrink: 0; padding: 4px 7px; border-radius: var(--radius-s); background: var(--cert-tint); color: var(--cert-color); font-size: 9.5px; font-weight: 800; line-height: 1; }
.cert-item-title { min-height: 3.8em; margin-bottom: 10px; font-family: var(--font-head); font-size: 15px; line-height: 1.27; }
.cert-item-dates { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.cert-item-dates b { color: var(--ink-2); font-weight: 700; }
.cert-skills { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 15px; }
.cert-skill { padding: 4px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 10px; line-height: 1.2; }
.cert-skill-more { color: var(--muted); }
.cert-verify { width: fit-content; margin-top: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--cert-color); font-size: 12.5px; font-weight: 800; text-decoration: none; }
.cert-verify:hover { text-decoration: underline; text-underline-offset: 3px; }
.cert-verify:focus-visible { outline: 2px solid var(--cert-color); outline-offset: 4px; border-radius: 3px; }
.cert-verify.is-disabled { color: var(--muted); cursor: default; }

.lang-meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 700px) { .lang-meters { grid-template-columns: 1fr; } }
.lang-meter { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 20px; }
.lang-meter-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.lang-meter-top h4 { font-size: 16px; }
.lang-meter-top span { font-family: var(--font-head); font-size: 12.5px; font-weight: 700; color: var(--primary); }
.lang-meter-bar { display: flex; gap: 4px; }
.lang-meter-bar i { flex: 1; height: 8px; border-radius: 4px; background: var(--gridline); }
.lang-meter-bar i.is-filled { background: var(--primary); }

/* ---- Contact / footer -----------------------------------------------------*/
#contact { text-align: left; }
/* Contact: a closing band in the brand gradient, copy + CTAs left, link tiles right. */
.contact-card { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px 56px; align-items: center; padding: 56px; border-radius: 24px; border: 1px solid rgba(126,244,230,.28); background: linear-gradient(135deg, #0b2f2d 0%, #11605b 52%, #148a80 100%); color: #ffffff; box-shadow: var(--shadow-lg); }
.contact-graph { position: absolute; right: -60px; top: -70px; width: 560px; height: 420px; pointer-events: none; }
.contact-copy { position: relative; min-width: 0; }
.contact-eyebrow { color: #7ef4e6; }
.contact-eyebrow::before { background: #7ef4e6; }
.contact-card h2 { font-family: var(--font-display); font-size: clamp(30px, 4vw, 44px); letter-spacing: -.04em; line-height: 1.05; margin-bottom: 14px; color: #ffffff; }
.contact-copy > p { font-size: 17px; line-height: 1.65; margin-bottom: 28px; max-width: 46ch; color: rgba(255,255,255,.85); }
.contact-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.contact-card .btn-primary { background: #ffffff; color: #0b2f2d; box-shadow: 0 8px 24px -10px rgba(0,0,0,.5); }
.contact-card .btn-ghost { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.06); color: #ffffff; }
.contact-card .btn-ghost:hover { border-color: #7ef4e6; color: #7ef4e6; }
.contact-card #copyEmailBtn.is-done { color: #7ef4e6; border-color: #7ef4e6; }
.contact-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: rgba(255,255,255,.72); }
.contact-meta span { display: inline-flex; align-items: center; gap: 6px; }
.contact-links { position: relative; display: grid; gap: 10px; min-width: 0; }
.contact-tile { display: grid; grid-template-columns: 42px minmax(0, 1fr) 16px; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,.14); background: rgba(6,32,30,.38); color: #ffffff; transition: transform .18s ease, background-color .18s ease, border-color .18s ease; }
.contact-tile:hover { transform: translateY(-2px); background: rgba(6,32,30,.55); border-color: rgba(126,244,230,.65); }
.contact-tile-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: rgba(126,244,230,.16); color: #7ef4e6; }
.contact-tile-label { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.62); }
.contact-tile-value { display: block; font-size: 15px; font-weight: 600; color: #ffffff; overflow-wrap: anywhere; }
.contact-tile-arrow { color: rgba(255,255,255,.55); }
@media (max-width: 920px) { .contact-card { grid-template-columns: 1fr; gap: 28px; padding: 40px 28px; } .contact-graph { right: -120px; top: -110px; opacity: .6; } }
@media (max-width: 480px) { .contact-card { padding: 32px 20px; border-radius: 18px; } .contact-tile { grid-template-columns: 38px minmax(0, 1fr) 14px; padding: 10px 12px; } }

.site-footer { padding: 36px 0; border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-inner p { font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 18px; }
.footer-links a { font-size: 13px; color: var(--muted); }
.footer-links a:hover { color: var(--primary); }

/* Content is visible by default. Motion Mini enhances individual cards
   with temporary Web Animations, without a hidden CSS prerequisite. */

/* ---- Back to top ---------------------------------------------------------------*/
.back-top { position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: grid; place-items: center; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; z-index: 60; }
.back-top.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); transition-delay: 0s; }
.back-top svg { width: 18px; height: 18px; color: var(--ink-2); }

/* ---- Section rhythm / skip link / noscript --------------------------------*/
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 300; background: var(--primary); color: var(--primary-ink);
  padding: 12px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; transition: top .2s ease;
}
.skip-link:focus { top: 12px; }
.noscript-banner { max-width: var(--container); margin: 16px auto; padding: 16px 20px; background: var(--accent-tint); border: 1px solid var(--border); border-radius: var(--radius-m); font-size: 14px; }

/* ---- Misc ---------------------------------------------------------------*/
::selection { background: color-mix(in srgb, var(--primary) 30%, transparent); }
.divider-note { text-align: center; font-size: 13px; color: var(--muted); margin-top: 28px; }

/* ---- Dark theme tokens ------------------------------------------------------*/
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e171e;
  --surface: #15232d;
  --surface-2: #1c2e39;
  --ink: #edf4f7;
  --ink-2: #c0cfd7;
  --muted: #a5b9c5;
  --gridline: #304652;
  --border: rgba(230,234,236,0.10);
  --border-strong: rgba(230,234,236,0.18);
  --primary: #7edbd0;
  --primary-ink: #102c2b;
  --primary-tint: #193b3b;
  --accent: #d99a5b;
  --accent-tint: #2b2118;
  --violet: #a695c7;
  --violet-tint: #221e2c;
  --aqua: #99d1ad;
  --aqua-tint: #17261d;
  --rose: #d38782;
  --rose-tint: #2b1c1b;
  --good: #99d1ad;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 16px -8px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 28px -10px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.3);
}

/* ---- Navbar tools: theme toggle + command palette trigger ---------------------*/
.theme-toggle, .palette-trigger { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px; border-radius: var(--radius-m); border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2); }
.theme-toggle { width: 44px; justify-content: center; padding: 0; }
.theme-toggle:hover, .palette-trigger:hover { color: var(--ink); border-color: var(--border-strong); }
.theme-toggle:focus-visible, .palette-trigger:focus-visible, .filter-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); }
@media (max-width: 1080px) { .palette-trigger kbd { display: none; } }
@media (max-width: 560px) { .palette-trigger { display: none; } }

/* ---- Systems: case studies with architecture diagrams --------------------------*/
.work-list { display: grid; gap: 22px; }
.work-item { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: start; padding: 32px; box-shadow: var(--shadow); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); scroll-margin-top: 96px; }
.work-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.work-num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--primary); font-weight: 600; }
.work-kind { padding: 2px 8px; border-radius: var(--radius-s); background: var(--primary-tint); color: var(--primary); font-weight: 600; font-size: 11.5px; }
.work-kind-academic { background: var(--accent-tint); color: var(--accent); }
.work-item h3 { font-size: clamp(21px, 2.2vw, 25px); line-height: 1.25; letter-spacing: -.025em; margin-bottom: 8px; }
.work-tagline { font-size: 15px; color: var(--ink); margin-bottom: 12px; }
.work-summary { font-size: 15px; line-height: 1.75; margin-bottom: 18px; }
.work-points { display: grid; gap: 10px; margin-bottom: 16px; }
.work-points li { position: relative; padding-left: 16px; font-size: 14px; color: var(--ink-2); }
.work-points li::before { content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 1.5px; background: var(--primary); }
@media (max-width: 920px) { .work-item { grid-template-columns: 1fr; gap: 24px; padding: 24px 20px; } }

.work-copy, .work-figure { min-width: 0; }
.dg { margin: 0; }
.dg-canvas { position: relative; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 32px 28px; padding: 24px 16px; border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--surface-2); }
.dg.is-transposed .dg-canvas { grid-template-columns: repeat(var(--rows), minmax(0, 1fr)); gap: 30px 16px; padding: 18px 12px; }
.dg-node { min-width: 0; position: relative; z-index: 1; grid-column: calc(var(--col) + 1); grid-row: calc(var(--row) + 1); display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 64px; padding: 10px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-m); background: var(--surface); text-align: center; }
.dg.is-transposed .dg-node { grid-column: calc(var(--row) + 1); grid-row: calc(var(--col) + 1); }
.dg-label { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.25; overflow-wrap: anywhere; }
.dg-sub { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10.5px; color: var(--ink-2); line-height: 1.4; overflow-wrap: anywhere; }
.dg-node.is-primary { border-color: var(--primary); background: var(--primary-tint); box-shadow: inset 0 0 0 1px var(--primary); }
.dg-kind-store { border-radius: 12px / 8px; border-color: var(--border-strong); background: var(--primary-tint); }
.dg-kind-external, .dg-kind-source { border-style: dashed; }
.dg-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; color: var(--muted); pointer-events: none; }
.dg-wire { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.dg-wire.is-dashed { stroke-dasharray: 4 4; }
.dg-edge-label { position: absolute; z-index: 2; transform: translate(-50%, -50%); padding: 1px 4px; border-radius: 4px; background: var(--surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9.5px; line-height: 1.3; color: var(--ink-2); max-width: 66px; white-space: normal; text-align: center; overflow-wrap: anywhere; }
.dg figcaption { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.dg-fig { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; color: var(--ink-2); margin-right: 4px; }

/* ---- Project filter -----------------------------------------------------------*/
.project-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: var(--radius-m); border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 600; transition: background-color .16s ease, color .16s ease, border-color .16s ease; }
.filter-chip:hover { border-color: var(--primary); color: var(--ink); }
.filter-chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.filter-count { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; opacity: 1; }

/* ---- Command palette ---------------------------------------------------------*/
.palette[hidden] { display: none; }
.palette { position: fixed; inset: 0; z-index: 400; display: flex; align-items: flex-start; justify-content: center; padding: 14vh 16px 16px; background: rgba(12, 16, 19, 0.45); }
.palette-panel { width: min(560px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow-lg); }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15.5px; color: var(--ink); }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.palette-item.is-active { background: var(--surface-2); color: var(--ink); }
.palette-item svg { flex-shrink: 0; color: var(--muted); }
.palette-label { flex: 1; min-width: 0; }
.palette-item-hint { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--muted); }
.palette-empty { padding: 22px 12px; text-align: center; font-size: 14px; color: var(--muted); }
.palette-foot { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }
.has-palette, .has-menu { overflow: hidden; }

#copyEmailBtn.is-done { color: var(--good); border-color: var(--good); }

/* ---- Navbar fit: eight links plus tools ------------------------------------------*/
.navbar .container { max-width: 1320px; }
.brand { flex-shrink: 0; white-space: nowrap; }
.nav-links a { padding: 8px 11px; font-size: 13.5px; white-space: nowrap; }
@media (max-width: 1240px) { .brand-text-sub { display: none; } .palette-trigger kbd { display: none; } }
@media (max-width: 1100px) and (min-width: 901px) { .nav-links a { padding: 8px 8px; font-size: 13px; } }

/* ---- Shared finishing details and compact layouts ---------------------------*/
.about-highlight .ic, .skill-card-head .ic, .cert-provider-head .ic { border-radius: 10px; background: var(--surface-2); }
.project-card, .lang-meter { box-shadow: var(--shadow); }
.work-meta { margin-bottom: 16px; }
.work-num { font-size: 11px; border-bottom: 1px solid var(--border-strong); padding-bottom: 2px; }
.work-tagline { color: var(--primary); font-weight: 500; line-height: 1.6; }
.nav-burger { width: 44px; height: 44px; }
.nav-links a { display: flex; align-items: center; min-height: 44px; }
.hero-meta-item, .contact-links a, .project-links a, .cert-verify { min-height: 32px; }
.icon { flex-shrink: 0; }
.lang-switch button:hover { background: var(--primary-tint); }
.lang-switch button.is-active:hover { background: var(--primary); }
.filter-chip, .project-links a { min-height: 44px; }
.hero-cta .btn-primary { box-shadow: 0 4px 12px -6px var(--primary); }
.tl-top > div { min-width: 0; }
.tl-title, .project-card h5, .skill-card-head h3 { overflow-wrap: anywhere; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }
@media (min-width: 1241px) {
  .nav-links a { padding-inline: 8px; font-size: 12.5px; }
  .brand { font-size: 14px; }
  .navbar-inner { gap: 14px; }
}
@media (max-width: 1240px) {
  .navbar-inner { gap: 12px; }
  .nav-links a { padding: 12px 16px; font-size: 16px; }
  .nav-links a.is-active { box-shadow: inset 3px 0 var(--primary); }
}
@media (max-width: 700px) {
  .hero-cta { gap: 10px; }
  .hero-cta .btn { padding: 11px 14px; }
  .hero-card-bottom { margin-top: 24px; padding-top: 20px; }
  .hero-meta { gap: 6px 18px; }
  .work-item { padding: 24px; gap: 24px; }
  .contact-card { padding: 32px 24px; }
}
@media (max-width: 480px) {
  .container { padding-inline: 16px; }
  .navbar-actions { gap: 6px; }
  .brand-text-full { display: none; }
  .lang-switch button { min-width: 36px; min-height: 38px; padding: 5px 6px; }
  .hero-card { padding: 22px 18px; }
  .hero-lede { font-size: 15px; line-height: 1.65; }
  .hero-meta-item { font-size: 12.5px; }
  .tl-item { padding-left: 28px; }
  .timeline::before { left: 7px; }
  .tl-dot { width: 16px; height: 16px; top: 25px; box-shadow: 0 0 0 4px var(--page); }
  .tl-dot svg { display: none; }
  .tl-card { padding: 20px; }
  .work-item { padding: 22px 18px; }
  .work-points li { font-size: 14px; }
  .work-meta { gap: 8px 12px; }
  .cert-providers { padding: 12px; }
  .cert-provider { padding: 12px; }
  .cert-item-top { flex-wrap: wrap; }
  .project-institution-head { grid-template-columns: 52px minmax(0, 1fr) 14px; padding: 18px 16px; gap: 12px; }
  .project-institution-photo { width: 52px; height: 52px; }
  .project-courses { padding: 20px 12px; }
  .contact-links { gap: 10px; }
  .contact-links a { font-size: 12.5px; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:hover, .project-card:hover, .cert-item:hover { transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---- Architecture case studies: header, two-column body, full-width figure ----*/
.work-item { grid-template-columns: 1fr; gap: 26px; }
.work-head { max-width: 860px; }
.work-head h3 { margin-bottom: 8px; }
.work-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 26px 40px; align-items: start; }
.work-summary { max-width: 72ch; }
.work-points { margin-bottom: 0; }
.work-side { display: grid; gap: 20px; min-width: 0; }
.work-side-title { font-family: var(--font-head); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.work-qualities { display: grid; gap: 6px; }
.work-qualities li { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; align-items: start; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface-2); font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.wq-key { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.wq-key svg { flex-shrink: 0; color: var(--primary); }
.work-figure { padding-top: 4px; border-top: 1px solid var(--border); }
@media (max-width: 920px) {
  .work-body { grid-template-columns: 1fr; gap: 22px; }
  .work-qualities li { grid-template-columns: 130px minmax(0, 1fr); }
}
@media (max-width: 480px) { .work-qualities li { grid-template-columns: 1fr; gap: 3px; } }

/* Figure head: architecture style + languages used in the diagram */
.dg-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px; margin: 14px 0 12px; }
.dg-style { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 9px; border-radius: 999px; background: var(--primary-tint); color: var(--primary); font-family: var(--font-head); font-size: 12px; font-weight: 600; }
.dg-techs { display: flex; flex-wrap: wrap; gap: 6px; }
.dg-tech { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10.5px; color: var(--ink-2); white-space: nowrap; }
.dg-tech i { width: 7px; height: 7px; border-radius: 50%; background: var(--tone, var(--muted)); flex-shrink: 0; }
.dg-tone-primary { --tone: var(--primary); --tone-tint: var(--primary-tint); }
.dg-tone-accent { --tone: var(--accent); --tone-tint: var(--accent-tint); }
.dg-tone-violet { --tone: var(--violet); --tone-tint: var(--violet-tint); }
.dg-tone-aqua { --tone: var(--aqua); --tone-tint: var(--aqua-tint); }
.dg-tone-rose { --tone: var(--rose); --tone-tint: var(--rose-tint); }
.dg-tone-muted, .dg-tone-neutral { --tone: var(--muted); --tone-tint: var(--surface-2); }

/* Canvas, groups and richer nodes */
.dg-canvas { gap: 44px 64px; padding: 30px 22px 24px; max-width: calc(var(--cols) * 230px); margin-inline: auto; }
.dg.is-transposed .dg-canvas { max-width: none; gap: 44px 22px; padding: 24px 14px 20px; }
.dg-group { position: relative; z-index: 0; grid-column: calc(var(--col) + 1) / span var(--cs); grid-row: calc(var(--row) + 1) / span var(--rs); margin: -17px -13px -13px; border: 1px dashed color-mix(in srgb, var(--tone) 55%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--tone-tint) 60%, transparent); }
.dg.is-transposed .dg-group { grid-column: calc(var(--row) + 1) / span var(--rs); grid-row: calc(var(--col) + 1) / span var(--cs); margin: -16px -8px -10px; }
.dg-group-label { position: absolute; top: -9px; left: 10px; max-width: calc(100% - 20px); display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent); background: var(--surface); color: var(--tone); font-family: var(--font-head); font-size: 10.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.dg-group-label > span { overflow: hidden; text-overflow: ellipsis; }
.dg-group-label svg { flex-shrink: 0; }
.dg-node { gap: 3px; min-height: 78px; padding: 10px 9px 9px; }
.dg-ic { display: inline-flex; margin-inline: auto; color: var(--muted); }
.dg-node.is-primary .dg-ic, .dg-kind-gateway .dg-ic { color: var(--primary); }
.dg-node .dg-tech { margin: 3px auto 0; }
.dg-replicas { position: absolute; top: -8px; right: -7px; z-index: 2; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--page); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; font-weight: 600; line-height: 16px; }
.dg-node.has-replicas { box-shadow: 4px 4px 0 -1px var(--surface-2), 4px 4px 0 0 var(--border-strong); }
.dg-node.is-primary.has-replicas { box-shadow: inset 0 0 0 1px var(--primary), 4px 4px 0 -1px var(--surface-2), 4px 4px 0 0 var(--primary); }
.dg-kind-queue { border-radius: 999px; border-color: var(--accent); background: var(--accent-tint); }
.dg-kind-queue .dg-ic { color: var(--accent); }
.dg-kind-cache { border-style: dotted; }
.dg-kind-llm { border-color: var(--violet); background: var(--violet-tint); }
.dg-kind-llm .dg-ic { color: var(--violet); }
.dg-kind-gateway { border-width: 1.5px; border-color: var(--ink-2); }
.dg-kind-ops, .dg-kind-check { border-style: dashed; }
.dg-kind-ops .dg-ic, .dg-kind-check .dg-ic { color: var(--aqua); }
.dg-kind-app { background: var(--surface); }
.dg-wire.is-async { stroke: var(--accent); stroke-dasharray: 5 4; }
.dg-wire.is-repl { stroke-dasharray: 1.5 3.5; stroke-linecap: round; }
.dg-edge-label.is-async { color: var(--accent); }

/* Delivery strip under the canvas */
.dg-pipeline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--surface); }
.dg-pipeline-title { display: inline-flex; align-items: center; gap: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--primary); }
.dg-pipeline ol { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; flex: 1; min-width: 0; }
.dg-pipeline li { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 5px 10px; border-radius: var(--radius-s); background: var(--surface-2); font-size: 11.5px; line-height: 1.35; }
.dg-pipeline li b { font-family: var(--font-head); font-weight: 600; font-size: 12px; color: var(--ink); }
.dg-pipeline li span { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; color: var(--muted); }
.dg-pipeline li + li { margin-left: 12px; }
.dg-pipeline li + li::before { content: ""; position: absolute; left: -12px; top: 50%; width: 6px; height: 6px; border-top: 1.5px solid var(--border-strong); border-right: 1.5px solid var(--border-strong); transform: translateY(-50%) rotate(45deg); }


/* Narrow (transposed) diagrams: group labels run vertically along the left edge,
   clear of the edge labels that now cross the top borders. */
.dg.is-transposed .dg-group { margin: -14px -10px -12px -14px; }
.dg.is-transposed .dg-group-label { top: 12px; left: -10px; bottom: auto; max-width: none; max-height: calc(100% - 24px); padding: 7px 1px; writing-mode: vertical-rl; transform: rotate(180deg); }
.dg.is-transposed .dg-group-label > span { max-height: 100%; }
.dg.is-transposed .dg-node { padding-left: 12px; }
