/* ==========================================================================
   Shift CV — design system
   Light, card-based CV layout with coloured section markers and a rainbow rail.
   ========================================================================== */

:root {
  --font-display: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --bg: #eef0f4;
  --bg-2: #f6f7fa;
  --bg-3: #eceef3;
  --card: #ffffff;
  --ink: #12141a;
  --ink-2: #3b414f;
  --muted: #7f8797;
  --line: rgba(18, 20, 26, 0.085);
  --line-strong: rgba(18, 20, 26, 0.16);

  --blue: #2f5bff;
  --teal: #0fb6a6;
  --amber: #f0a020;
  --coral: #ef5340;
  --pink: #e8497a;
  --violet: #7a5cf0;
  --green: #17a673;

  --radius: 16px;
  --radius-sm: 11px;
  --wrap: 1180px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 10px 22px -18px rgba(16, 24, 40, 0.45);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 26px 50px -34px rgba(16, 24, 40, 0.45);
  --shadow-lg: 0 48px 90px -40px rgba(8, 12, 24, 0.45);
  --ring: 0 0 0 3px rgba(47, 91, 255, 0.22);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 64px;
}

[data-theme='dark'] {
  --bg: #0b0d11;
  --bg-2: #14171e;
  --bg-3: #1a1e26;
  --card: #14171e;
  --ink: #f2f4f9;
  --ink-2: #c6ccd9;
  --muted: #8a92a3;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.17);

  --blue: #5b7cff;
  --teal: #21cfbd;
  --amber: #ffb43a;
  --coral: #ff6b58;
  --pink: #ff6f9c;
  --violet: #9b83ff;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 24px -18px rgba(0, 0, 0, 0.8);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 30px 60px -36px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 50px 100px -40px rgba(0, 0, 0, 0.9);
  --ring: 0 0 0 3px rgba(91, 124, 255, 0.35);
}

/* ------------------------------------------------------------------ reset */

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

html {
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 34px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(900px 520px at 8% -6%, rgba(47, 91, 255, 0.12), transparent 62%),
    radial-gradient(760px 480px at 92% 2%, rgba(240, 160, 32, 0.13), transparent 60%),
    radial-gradient(700px 500px at 70% 100%, rgba(232, 73, 122, 0.07), transparent 65%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* `clip` (not `hidden`) so the sticky header keeps working */
  overflow-x: clip;
}

[data-theme='dark'] body {
  background-image: radial-gradient(900px 520px at 8% -6%, rgba(47, 91, 255, 0.22), transparent 62%),
    radial-gradient(760px 480px at 92% 2%, rgba(240, 160, 32, 0.12), transparent 60%),
    radial-gradient(700px 500px at 70% 100%, rgba(232, 73, 122, 0.1), transparent 65%);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(47, 91, 255, 0.2);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 0 0 10px 10px;
  background: var(--ink);
  color: var(--card);
  font-size: 14px;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 0;
}

.wrap {
  width: min(var(--wrap), 100% - 40px);
  margin-inline: auto;
}

/*
 * The database is down and the page came from the local snapshot: say so once,
 * at the top of the content, in the amber the site already uses for notices.
 */
.contact-closed {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}

.contact-closed p {
  margin: 0;
}

.degraded-banner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 18px 0 0;
  padding: 12px 15px;
  border: 1px solid color-mix(in srgb, var(--amber) 42%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--amber) 10%, var(--card));
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
}

.degraded-banner p {
  margin: 0;
}

.degraded-banner strong {
  color: var(--ink);
}

.degraded-banner-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(140deg, color-mix(in srgb, var(--amber) 78%, #fff), var(--amber) 60%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.icon {
  flex: none;
  display: block;
}

/* -------------------------------------------------------------- rainbow rail */

.rainbow {
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  z-index: 120;
  background: linear-gradient(90deg, var(--blue), var(--teal), var(--amber), var(--coral), var(--pink), var(--violet));
  opacity: 0.32;
  pointer-events: none;
}

.rainbow-progress {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--teal), var(--amber), var(--coral), var(--pink), var(--violet));
  box-shadow: 0 0 12px rgba(47, 91, 255, 0.55);
  transition: width 0.1s linear;
}

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky;
  top: 10px;
  z-index: 90;
  padding-top: 14px;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header-h);
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 78%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 4px;
  border-radius: 999px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: linear-gradient(140deg, #4a72ff, var(--blue) 55%, #1f3ee0);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px -10px rgba(47, 91, 255, 0.9);
  transition: transform 0.4s var(--ease);
}

.brand:hover .brand-mark {
  transform: rotate(-6deg) scale(1.04);
}

.brand-text {
  display: grid;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-text small {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-inline: auto;
}

.nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav a:hover {
  color: var(--ink);
  background: var(--bg-2);
}

.nav a.is-active {
  color: var(--ink);
  background: var(--bg-3);
  font-weight: 600;
}

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

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.icon-btn:hover {
  background: var(--bg-2);
  color: var(--ink);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
}

/* theme icon swap */
.theme-icon--moon {
  display: none;
}

[data-theme='dark'] .theme-icon--sun {
  display: none;
}

[data-theme='dark'] .theme-icon--moon {
  display: block;
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), background 0.2s var(--ease),
    color 0.2s var(--ease), border-color 0.2s var(--ease);
}

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

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

.btn-primary {
  background: linear-gradient(135deg, #4a72ff, var(--blue) 60%, #2445e8);
  color: #fff;
  box-shadow: 0 12px 26px -14px rgba(47, 91, 255, 0.95);
}

.btn-primary:hover {
  box-shadow: 0 16px 30px -14px rgba(47, 91, 255, 1);
}

.btn-dark {
  background: var(--ink);
  color: var(--bg);
}

.btn-dark:hover {
  background: var(--ink-2);
}

.btn-outline {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--bg-2);
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* -------------------------------------------------------------------- cards */

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

/* --------------------------------------------------------------------- hero */

.hero {
  margin-top: 26px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--teal), var(--amber), var(--coral), var(--pink), var(--violet));
  opacity: 0.9;
}

.hero-main {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 46px;
  align-items: center;
  padding: 52px 46px 42px;
}

.hero-photo {
  position: relative;
  justify-self: center;
  width: 200px;
}

.hero-photo img {
  position: relative;
  z-index: 1;
  display: block;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 22%;
  border: 6px solid var(--card);
  box-shadow: 0 26px 50px -22px rgba(16, 24, 40, 0.55);
}

.hero-photo-glow {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: conic-gradient(from 150deg, var(--blue), var(--teal), var(--amber), var(--coral), var(--pink), var(--blue));
  filter: blur(20px);
  opacity: 0.42;
  z-index: 0;
}

/*
 * The blog is its own page, so the hero carries a single floating button into
 * it — top right corner of the card, above the copy, opening in a new tab.
 * The dashboard decides where it points; the accent comes from the blog
 * section colour in Appearance.
 */
.hero-blog {
  --accent: var(--violet);
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  text-decoration: none;
}

.hero-blog[data-accent='blue'] {
  --accent: var(--blue);
}

.hero-blog[data-accent='teal'] {
  --accent: var(--teal);
}

.hero-blog[data-accent='amber'] {
  --accent: var(--amber);
}

.hero-blog[data-accent='coral'] {
  --accent: var(--coral);
}

.hero-blog[data-accent='pink'] {
  --accent: var(--pink);
}

.hero-blog[data-accent='violet'] {
  --accent: var(--violet);
}

/* The blog mark is the resume heading's tile — the same 44px square, 13px
   radius, gradient and inner highlight — and nothing else: no pill, border,
   label or arrow wrapped around it. */
.hero-blog-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent) 60%);
  box-shadow: 0 12px 22px -14px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease), filter 0.24s var(--ease);
}

.hero-blog:hover .hero-blog-icon {
  transform: translateY(-1px) scale(1.04);
  filter: brightness(1.05);
  box-shadow: 0 16px 26px -14px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.hero-blog:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 15px;
}

@media (max-width: 520px) {
  .hero-blog {
    top: 10px;
    right: 12px;
  }

  .hero-blog-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-blog:hover {
    transform: none;
  }
}

.availability {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--green);
  opacity: 0;
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.5);
    opacity: 0.8;
  }
  70%,
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow-line {
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
}

.hero-copy h1 {
  font-size: clamp(2.5rem, 5.6vw, 4rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: 18px;
}

.accent-dot {
  color: var(--blue);
}

.hero-bio {
  max-width: 64ch;
  font-size: 15px;
  line-height: 1.78;
  color: var(--ink-2);
}

.hero-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 22px;
  margin-top: 26px;
}

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

.socials a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.socials a:hover {
  transform: translateY(-3px);
  background: var(--ink);
  border-color: var(--ink);
  color: var(--card);
  box-shadow: 0 12px 22px -14px rgba(16, 24, 40, 0.8);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}

.stat {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  padding: 24px 26px;
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: 0;
}

.stat-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-suffix {
  color: var(--blue);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------------------------------------------------------- sections */

.section {
  --accent: var(--blue);
  margin-top: 20px;
  overflow: hidden;
}

.section[data-accent='blue'] {
  --accent: var(--blue);
}

.section[data-accent='teal'] {
  --accent: var(--teal);
}

.section[data-accent='amber'] {
  --accent: var(--amber);
}

.section[data-accent='coral'] {
  --accent: var(--coral);
}

.section[data-accent='pink'] {
  --accent: var(--pink);
}

.section[data-accent='violet'] {
  --accent: var(--violet);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 26px;
  cursor: pointer;
  user-select: none;
  transition: background 0.25s var(--ease);
}

.section-head:hover {
  background: color-mix(in srgb, var(--accent) 3.5%, var(--card));
}

.section-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent) 60%);
  box-shadow: 0 12px 22px -14px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.section-titles h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-titles p {
  margin-top: 2px;
  font-size: 12.8px;
  color: var(--muted);
}

/* The optional paragraph at the top of a section, written in the dashboard. */
.section-intro {
  max-width: 62ch;
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
}

.section-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: auto;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.section-toggle svg {
  transition: transform 0.4s var(--ease);
}

.section:not(.is-collapsed) .section-toggle svg {
  transform: rotate(180deg);
}

.section-head:hover .section-toggle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.section-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.42s var(--ease);
}

.section.is-collapsed .section-body {
  grid-template-rows: 0fr;
}

.section-inner {
  min-height: 0;
  overflow: hidden;
  padding: 0 26px;
}

/* Bottom breathing room lives inside the clipped area so the accordion can
   collapse to a true zero height. */
.section-inner::after {
  content: '';
  display: block;
  height: 30px;
}

.section.is-collapsed .section-head:hover {
  background: color-mix(in srgb, var(--accent) 5%, var(--card));
}

/* --------------------------------------------------------------- resume */

.resume-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 46px;
  padding-top: 12px;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
}

.group-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.group-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--accent);
}

.group-title + .timeline + .group-title,
.resume-col .group-title:not(:first-child),
.resume-aside .group-title:not(:first-child) {
  margin-top: 30px;
}

.timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 26px;
  list-style: none;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 7px;
  bottom: 10px;
  width: 1.5px;
  background: linear-gradient(var(--line-strong), transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: 22px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

.timeline-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.timeline-period {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.badge-current {
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 14%, transparent);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.timeline-item h4 {
  margin: 5px 0 3px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.timeline-role {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.timeline-desc {
  margin-top: 8px;
  font-size: 13.8px;
  line-height: 1.72;
  color: color-mix(in srgb, var(--ink-2) 82%, var(--muted));
}

/* Mockup-approved Toolkit: a single outlined sidebar panel, with category
   rows that can collapse independently using native keyboard-friendly details. */
.toolkit-panel {
  padding: 18px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
  box-shadow: 0 12px 34px rgba(24, 39, 64, 0.035);
}

.toolkit-panel > .group-title {
  margin-bottom: 10px;
  font-size: 13px;
  letter-spacing: 0.045em;
  text-transform: none;
}

.toolkit-panel > .group-title::after { display: none; }
.toolkit-group { border-top: 1px solid var(--line); }
.toolkit-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 8px 2px;
  cursor: pointer;
  list-style: none;
  border-radius: 6px;
  font-size: 11.9px;
  font-weight: 650;
  line-height: 1.3;
}
.toolkit-group-head::-webkit-details-marker { display: none; }
.toolkit-group-head::marker { content: ''; }
.toolkit-group-head:hover { color: var(--category-color); }
.toolkit-group-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.toolkit-category-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--category-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--category-color) 10%, transparent);
}
.toolkit-group-label { min-width: 0; flex: 1; }
.toolkit-group-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.toolkit-chevron { display: grid; place-items: center; color: var(--muted); transition: transform 0.2s var(--ease); }
.toolkit-group:not([open]) .toolkit-chevron { transform: rotate(-90deg); }
.toolkit-group .tools { margin: 0 0 12px; }

/* Each tool keeps its own logo and brand colour, not a skill percentage. */
.tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tool {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 9px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-2);
  transition: border-color 0.24s var(--ease), transform 0.24s var(--ease), background 0.24s var(--ease);
}

.tool:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand, var(--accent)) 45%, var(--line));
  background: color-mix(in srgb, var(--brand, var(--accent)) 6%, var(--card));
}

.tool-logo {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand, var(--accent)) 13%, transparent);
  color: var(--brand, var(--accent));
}

.tool-logo svg {
  display: block;
}

.tool-initials {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand, var(--accent));
}

.tool-name {
  min-width: 0;
  font-size: 11.7px;
  font-weight: 550;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

@media (max-width: 420px) {
  .tools {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

.language {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 10px;
}

.language-name {
  font-size: 13px;
  font-weight: 500;
}

.language-level {
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
}

.dots {
  grid-column: 1 / -1;
  display: flex;
  gap: 5px;
  margin-top: 5px;
}

.dot {
  width: 22px;
  height: 5px;
  border-radius: 999px;
  background: var(--bg-3);
}

.dot.is-on {
  background: var(--accent);
}

.resume-actions {
  display: grid;
  gap: 10px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed var(--line-strong);
}

/* ------------------------------------------------------------- portfolio */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 0 22px;
}

.filters-label {
  margin-right: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.filter:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  color: var(--ink);
  transform: translateY(-1px);
}

.filter.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--card);
}

.filter-count {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 16%, transparent);
  font-variant-numeric: tabular-nums;
}

.filter.is-active .filter-count {
  background: rgba(255, 255, 255, 0.18);
}

.masonry {
  columns: 3;
  column-gap: 14px;
}

.work {
  break-inside: avoid;
  margin-bottom: 14px;
  border-radius: 13px;
  background: var(--bg-3);
}

.work.is-hidden {
  display: none;
}

.work.animate-in {
  animation: workIn 0.45s var(--ease) both;
}

@keyframes workIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.work-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
}

.work-btn img {
  display: block;
  width: 100%;
  transition: transform 0.75s var(--ease), filter 0.4s var(--ease);
}

.work-btn:hover img,
.work-btn:focus-visible img {
  transform: scale(1.055);
  filter: saturate(1.05);
}

.work-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 7px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(to top, rgba(7, 9, 15, 0.88), rgba(7, 9, 15, 0.28) 52%, rgba(7, 9, 15, 0));
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.work-btn:hover .work-overlay,
.work-btn:focus-visible .work-overlay {
  opacity: 1;
}

.work-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.work-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.work-meta {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.75);
}

.work-plus {
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #12141a;
  opacity: 0;
  transform: scale(0.8) rotate(-45deg);
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease);
}

.work-btn:hover .work-plus,
.work-btn:focus-visible .work-plus {
  opacity: 1;
  transform: none;
}

.masonry-empty {
  padding: 24px 0 8px;
  font-size: 14px;
  color: var(--muted);
}

/* ---------------------------------------------------------- testimonials */

.quotes {
  position: relative;
  padding: 30px 32px 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-2));
  overflow: hidden;
}

.quotes::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -30px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  pointer-events: none;
}

.quotes-viewport {
  overflow: hidden;
}

.quotes-track {
  display: flex;
  transition: transform 0.6s var(--ease);
  will-change: transform;
}

.quote-slide {
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
}

.quote-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.quote-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}

.stars {
  display: inline-flex;
  gap: 3px;
}

.stars .star-on {
  color: var(--amber);
}

.stars .star-off {
  color: var(--line-strong);
}

blockquote {
  margin: 0;
  padding: 0;
}

blockquote p {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.7vw, 1.32rem);
  font-weight: 500;
  line-height: 1.62;
  letter-spacing: -0.01em;
  color: var(--ink);
}

blockquote p::before {
  content: '\201C';
}

blockquote p::after {
  content: '\201D';
}

.quote-slide figcaption {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed color-mix(in srgb, var(--accent) 25%, var(--line-strong));
}

.quote-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent));
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
}

.quote-person {
  display: grid;
  line-height: 1.35;
}

.quote-person strong {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
}

.quote-person span {
  font-size: 12.5px;
  color: var(--muted);
}

.quote-date {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.quotes-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
}

.quotes-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.quotes-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 40%, transparent);
  cursor: pointer;
  transition: width 0.3s var(--ease), background 0.3s var(--ease);
}

.quotes-dots button.is-active {
  width: 26px;
  background: var(--accent);
}

.quotes-arrows {
  display: flex;
  gap: 8px;
}

.round-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.round-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------- contact */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: 44px;
  padding-top: 10px;
}

.contact-info h3 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.contact-lead {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-2);
}

.contact-list {
  display: grid;
  gap: 4px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.contact-list li > a,
.contact-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.contact-list li > a:hover {
  background: var(--bg-2);
  border-color: var(--line);
  transform: translateX(2px);
}

.contact-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--accent);
}

.contact-text {
  display: grid;
  min-width: 0;
  line-height: 1.4;
}

.contact-text small {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-text strong {
  font-size: 13.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.contact-arrow {
  margin-left: auto;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.contact-list li > a:hover .contact-arrow {
  opacity: 1;
  transform: none;
}

.contact-note {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-2));
}

.contact-note-icon {
  color: var(--accent);
  flex: none;
}

.contact-note p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.contact-note a {
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

/* form */

.contact-form {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.field textarea {
  resize: vertical;
  min-height: 118px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}

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

.field.has-error input,
.field.has-error textarea {
  border-color: var(--coral);
  background: color-mix(in srgb, var(--coral) 5%, var(--card));
}

.field-error {
  display: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--coral);
}

.field.has-error .field-error {
  display: block;
}

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

.form-status {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
}

.form-status.is-success {
  color: var(--green);
}

.form-status.is-error {
  color: var(--coral);
}

.form-privacy {
  font-size: 11.5px;
  color: var(--muted);
}

/* spinner while submitting */
.btn.is-loading .btn-label {
  opacity: 0.7;
}

.btn.is-loading svg {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  margin-top: 34px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 55%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.footer-inner {
  width: min(var(--wrap), 100% - 40px);
  margin-inline: auto;
}

.footer-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
  align-items: start;
  gap: clamp(20px, 2.6vw, 36px);
  padding: 42px 0 36px;
}

.footer-main > * { min-width: 0; }

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.footer-brand .brand-mark { flex: none; }

.footer-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
}

.footer-brand p,
.footer-brand small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

.footer-label {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px 12px;
}

.footer-nav .footer-label,
.footer-nav .custom-block { grid-column: 1 / -1; }

.footer-nav a {
  width: fit-content;
  max-width: 100%;
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.5;
  color: var(--ink-2);
  overflow-wrap: anywhere;
  transition: color 0.2s var(--ease);
}

.footer-nav a:hover,
.footer-nav a:focus-visible { color: var(--blue); }

.footer-contact { overflow-wrap: anywhere; }

.footer-mail {
  display: inline-block;
  max-width: 100%;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  overflow-wrap: anywhere;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.footer-mail:hover,
.footer-mail:focus-visible {
  color: var(--blue);
  border-color: var(--blue);
}

.footer-aside {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
}

.footer-quote { margin: 0; }
.footer-quote--picasso { display: flex; align-items: center; gap: 14px; }
.footer-quote-copy { min-width: 0; }
.footer-portrait {
  display: block;
  flex: none;
  width: clamp(80px, 8.3vw, 108px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--blue) 36%, var(--line-strong));
  border-radius: 50%;
  background: #f5f0e7;
  box-shadow: 0 4px 14px rgba(18, 20, 26, 0.12);
}
.footer-quote blockquote { margin: 0; }

.footer-quote p {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.65;
  color: var(--ink-2);
}

/* The testimonial quotes draw their marks in CSS; this one carries real
   quotation marks in the markup, so the decorations are switched off. */
.footer-quote blockquote p::before,
.footer-quote blockquote p::after { content: none; }

.footer-quote figcaption {
  margin-top: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.footer-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 18px 0 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.footer-bottom a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom a:hover,
.footer-bottom a:focus-visible { color: var(--blue); }

@media (max-width: 1080px) {
  .footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 40px; }
  /* With only three enabled groups, the last one gets a full row instead of
     leaving a blank cell beside the quote or contact details. */
  .footer-main > :last-child:nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 540px) {
  .footer-main { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 32px 0 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

.footer-bar {
  display: flex;
  height: 4px;
}

.footer-bar span {
  flex: 1;
}

.footer-bar span:nth-child(1) {
  background: var(--blue);
}
.footer-bar span:nth-child(2) {
  background: var(--teal);
}
.footer-bar span:nth-child(3) {
  background: var(--amber);
}
.footer-bar span:nth-child(4) {
  background: var(--coral);
}
.footer-bar span:nth-child(5) {
  background: var(--pink);
}

.footer-bar span:nth-child(6) {
  background: var(--violet);
}

/* --------------------------------------------------------------- to top */

.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--card);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  box-shadow: 0 18px 30px -14px rgba(8, 12, 24, 0.8);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  transform: translateY(-2px);
}

/* ------------------------------------------------------------ certifications */

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

.cert {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.cert::before {
  content: '';
  position: absolute;
  inset: 0 18px auto 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 25%, transparent));
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.cert:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 22px 40px -28px color-mix(in srgb, var(--accent) 55%, #0b1020);
}

.cert:hover::before {
  opacity: 1;
}

.cert-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.cert-badge {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 72%, #fff), var(--accent));
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 18px -12px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.cert-date {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.cert-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.cert-issuer {
  margin-top: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}

.cert-sep {
  margin: 0 6px;
  color: color-mix(in srgb, var(--accent) 45%, var(--muted));
}

.cert-note {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* ------------------------------------------------------------ expertise */

.expertise {
  display: grid;
  gap: 16px;
  margin-bottom: 8px;
}

.expertise-title {
  margin-bottom: 9px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.expertise-tags li {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-2));
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
}

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

.cert-tags li {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.cert-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.cert-id {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.cert-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.cert-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.certs-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-2));
  font-size: 12px;
  color: var(--ink-2);
}

.certs-note svg {
  color: var(--accent);
}

/* ---------------------------------------------------------------- profiles */

.profiles {
  margin-top: 24px;
}

.profiles-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.profiles-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.profiles-list a:hover {
  transform: translateX(2px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 16px 30px -26px color-mix(in srgb, var(--accent) 60%, #0b1020);
}

.profile-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
}

.profile-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.profile-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-head strong {
  font-size: 13.5px;
  font-weight: 600;
}

.profile-head small {
  font-size: 11.5px;
  color: var(--muted);
}

.profile-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.profile-arrow {
  margin-left: auto;
  color: var(--muted);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}

.profiles-list a:hover .profile-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* --------------------------------------------------------------- lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 14, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.25s var(--ease);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  width: min(1060px, 100%);
  height: min(88vh, 720px);
  max-height: 88vh;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: panelIn 0.38s var(--ease);
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.lightbox-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  height: 100%;
  background: #0b0d11;
}

.lightbox-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #12141a;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}

.lightbox-nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.06);
}

.lightbox-prev {
  left: 14px;
}

.lightbox-next {
  right: 14px;
}

.lightbox-info {
  height: 100%;
  padding: 52px 32px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lightbox-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}

.lightbox-info h3 {
  margin-top: 6px;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.lightbox-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.lightbox-chips .chip {
  background: color-mix(in srgb, var(--amber) 14%, transparent);
  color: color-mix(in srgb, var(--amber) 70%, var(--ink));
  backdrop-filter: none;
}

[data-theme='dark'] .lightbox-chips .chip {
  color: var(--amber);
}

.lightbox-desc {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-2);
}

.lightbox-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.lightbox-meta dt {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.lightbox-meta dd {
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 600;
}

body.is-locked {
  overflow: hidden;
}

/* ------------------------------------------------------------ error pages */

.error-page {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  min-height: 100vh;
  padding: 40px 22px;
  text-align: center;
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 14vw, 8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  background: linear-gradient(120deg, var(--blue), var(--teal), var(--amber), var(--coral));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-page h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.error-page p {
  max-width: 46ch;
  color: var(--muted);
}

.error-page .btn {
  margin-top: 10px;
}

/* --------------------------------------------------------------------- blog */

.nav a.is-active {
  color: var(--ink);
  background: var(--bg-3);
  font-weight: 600;
}

.blog-page {
  padding-top: 34px;
  padding-bottom: 70px;
}

.blog-head {
  max-width: 760px;
  margin: 0 0 30px;
}

.blog-head h1 {
  margin: 10px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.05rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.blog-lede {
  margin: 0 0 24px;
  color: var(--ink-2);
  font-size: 1.02rem;
  line-height: 1.65;
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 0.83rem;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.filter:hover {
  transform: translateY(-1px);
  border-color: var(--ink-2);
  color: var(--ink);
}

.filter.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--card);
}

.blog-count {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 550;
  letter-spacing: 0.01em;
}

.blog-empty,
.blog-none {
  padding: 34px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.post-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(47, 91, 255, 0.14), rgba(122, 92, 240, 0.12));
}

.post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.post-card:hover .post-media img {
  transform: scale(1.04);
}

.post-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #12141a;
  font-size: 0.71rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.post-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 22px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 550;
}

.post-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.16rem;
  line-height: 1.32;
  letter-spacing: -0.012em;
}

.post-title a {
  color: var(--ink);
  text-decoration: none;
}

.post-title a:hover {
  color: var(--blue);
}

.post-excerpt {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.62;
}

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

.post-tags li {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--ink-2);
  font-size: 0.72rem;
  font-weight: 550;
}

.post-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.post-link svg {
  transition: transform 0.22s var(--ease);
}

.post-link:hover svg {
  transform: translateX(3px);
}

/* article */

.article-wrap {
  padding-top: 30px;
  padding-bottom: 70px;
}

/* only ever shown on /admin/posts/:id/preview, never on a public article */
.preview-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 11px 14px;
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
  color: var(--ink-2);
  font-size: 0.82rem;
}

.preview-strip svg {
  color: var(--accent);
}

.preview-strip-link {
  margin-left: auto;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.preview-strip-link:hover {
  text-decoration: underline;
}

.article-crumbs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 550;
}

.article-crumbs a {
  color: var(--ink-2);
  text-decoration: none;
}

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

.article {
  padding: 0 0 8px;
  overflow: hidden;
}

.article-head {
  max-width: 760px;
  margin: 0 auto;
  padding: 42px 40px 26px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 550;
}

.article-cat {
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(122, 92, 240, 0.12);
  color: var(--violet);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.article-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.8vw, 2.6rem);
  line-height: 1.14;
  letter-spacing: -0.026em;
}

.article-excerpt {
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: 1.06rem;
  line-height: 1.65;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-byline img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
}

.article-byline strong {
  display: block;
  font-size: 0.92rem;
}

.article-byline span {
  color: var(--muted);
  font-size: 0.8rem;
}

.article-cover {
  margin: 8px 0 0;
}

.article-cover img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: cover;
}

.article-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 34px 40px 10px;
}

/* prose */

.prose {
  color: var(--ink-2);
  font-size: 1.02rem;
  line-height: 1.78;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2,
.prose h3,
.prose h4 {
  margin-top: 1.9em;
  margin-bottom: 0.55em;
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.28;
  letter-spacing: -0.015em;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.prose h2 {
  font-size: 1.45rem;
}

.prose h3 {
  font-size: 1.17rem;
}

.prose h4 {
  font-size: 1.02rem;
}

.prose p {
  margin: 0;
}

.prose strong {
  color: var(--ink);
  font-weight: 650;
}

.prose em {
  font-style: italic;
}

.prose a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.prose a:hover {
  text-decoration-thickness: 2px;
}

.prose ul,
.prose ol {
  margin: 0;
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 0.4em;
}

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

.prose blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--violet);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-style: italic;
  line-height: 1.6;
}

.prose blockquote p {
  margin: 0;
}

.prose code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-3);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.87em;
}

.prose pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  border: 1px solid var(--line);
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: 0.85rem;
  line-height: 1.65;
}

.prose hr {
  height: 1px;
  margin: 2em 0;
  border: 0;
  background: var(--line-strong);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.prose figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.prose th {
  color: var(--ink);
  font-weight: 650;
}

.article-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 760px;
  margin: 30px auto 0;
  padding: 22px 40px 30px;
  border-top: 1px solid var(--line);
}

.article-share {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 550;
}

.article-share a {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.article-share a:hover {
  border-color: var(--ink-2);
  color: var(--ink);
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 840px;
  margin: 26px auto 0;
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.post-nav-item:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.post-nav-item span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-nav-item strong {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.4;
}

.post-nav-item--next {
  text-align: right;
}

.related {
  display: grid;
  gap: 12px;
  max-width: 840px;
  margin: 40px auto 0;
}

.related-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.related-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  text-decoration: none;
  transition: border-color 0.2s var(--ease);
}

.related-item:hover {
  border-color: var(--line-strong);
}

.related-cat {
  color: var(--violet);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.related-item strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.related-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.article-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 840px;
  margin: 34px auto 0;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(47, 91, 255, 0.1), rgba(122, 92, 240, 0.1));
  border: 1px solid var(--line);
}

.article-cta-text {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.94rem;
}

.article-cta-text strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
}

@media (max-width: 900px) {
  .post-grid,
  .post-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-nav-item--next {
    text-align: left;
  }

  .article-head,
  .article-body,
  .article-foot {
    padding-left: 24px;
    padding-right: 24px;
  }

}

@media (max-width: 620px) {
  .article-head {
    padding-top: 28px;
  }

  .article-foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ------------------------------------------------- certificate documents */

/* The tile is a real preview of the document — a photo as itself, a PDF as its
   first page rendered on the server. It is always a plain <img>, so there is no
   PDF viewer chrome to fight: nothing to download, nothing to scroll, no icons,
   and the page itself is centred in the tile. The full-tile button on top is the
   only click target. */

.cert-doc {
  --doc-height: 184px;
  position: relative;
  display: block;
  width: 100%;
  height: var(--doc-height);
  margin: 0 0 14px;
  /* a little breathing room so the page never butts against the border */
  padding: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-2);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

/*
 * A blurred copy of the same page sits behind the fitted one and fills the
 * space a portrait (or any off-ratio) document leaves empty, so the tile reads
 * as a document on a soft surface instead of a page marooned in a grey box.
 */
.cert-doc-blur {
  position: absolute;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  object-fit: cover;
  object-position: center center;
  filter: blur(18px) saturate(1.15);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

.cert-doc-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  /* the whole page fits inside the tile, centred, with even margins */
  object-fit: contain;
  object-position: center center;
  pointer-events: none;
  transition: transform 0.45s var(--ease);
}

.cert-doc-btn {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
}

.cert-doc-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.cert-doc:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -24px color-mix(in srgb, var(--accent) 60%, #0b1020);
}

.cert-doc:hover .cert-doc-img {
  transform: scale(1.03);
}

.cert-doc-cta {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
  transition: background 0.2s var(--ease);
}

.cert-doc:hover .cert-doc-cta,
.cert-doc-btn:focus-visible .cert-doc-cta {
  background: var(--accent);
}

/* the document viewer */

.doc-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  padding: 24px;
}

.doc-modal[hidden] {
  display: none;
}

.doc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 14, 0.74);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.25s var(--ease);
}

.doc-modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  /* the certificate is the point of the popup, so give it the room */
  width: min(1080px, 100%);
  height: min(90vh, 900px);
  overflow: hidden;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  animation: panelIn 0.34s var(--ease);
}

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

.doc-modal-title-wrap {
  min-width: 0;
}

.doc-modal-eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc-modal-head h2 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.3;
  letter-spacing: -0.012em;
}

.doc-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-modal-close {
  flex: none;
}

.doc-modal-body {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg-3);
}

/*
 * The document is fitted to the dialog instead of being sized by its own
 * intrinsic width. A `max-height: 100%` inside a shrinking flex/grid box is
 * resolved differently across engines — and when it does not resolve at all, a
 * tall page keeps its natural width, grows past the dialog and has its feet cut
 * off by the panel's `overflow: hidden`. An absolutely positioned box with a
 * definite width and height cannot do that: `object-fit: contain` letterboxes
 * the whole document inside it, however tall the page is.
 */
.doc-image {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  display: block;
  object-fit: contain;
  object-position: center center;
  transition: opacity 0.2s var(--ease);
}

/* The same page, blurred and cropped to the dialog, behind the fitted one —
   the empty space above and below a portrait certificate is filled with its
   own colours instead of a flat panel. Bleeds past the edges so the blur has
   no hard rim; the body clips it. */
.doc-image-blur {
  position: absolute;
  inset: -32px;
  z-index: 0;
  width: calc(100% + 64px);
  height: calc(100% + 64px);
  object-fit: cover;
  object-position: center center;
  filter: blur(28px) saturate(1.15);
  opacity: 0.6;
  pointer-events: none;
}

/* the tile thumbnail is on screen while the full render is drawn */
.doc-modal-body.is-loading .doc-image {
  opacity: 0.6;
}

.doc-modal-body.is-loading::after {
  content: '';
  z-index: 2;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 2px solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* A rendered PDF page is opaque and already white at the edges, so it reads as
   paper on the viewer's surface without a background of its own — the image box
   is the whole dialog now, and a background here would paint all of it. */

body.doc-modal-open {
  overflow: hidden;
}

@media (max-width: 620px) {
  .doc-modal {
    padding: 0;
  }

  .doc-modal-panel {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }

  .doc-modal-head {
    padding: 12px 14px;
  }

  .doc-modal-head h2 {
    font-size: 0.92rem;
  }

  .cert-doc {
    --doc-height: 152px;
  }
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 1080px) {

  .header-inner {
    gap: 12px;
  }

  .nav a {
    padding: 8px 11px;
    font-size: 13px;
  }

  .brand-text {
    display: none;
  }

  .hero-main {
    gap: 34px;
    padding: 42px 32px 34px;
    grid-template-columns: 178px minmax(0, 1fr);
  }

  .hero-photo,
  .hero-photo img {
    width: 168px;
    height: 168px;
  }

  .resume-grid {
    gap: 32px;
  }

  .contact-grid {
    gap: 30px;
  }
}

@media (max-width: 900px) {
  .nav {
    position: absolute;
    top: calc(var(--header-h) + 16px);
    left: 20px;
    right: 20px;
    display: grid;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav a {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14.5px;
  }

  .nav-toggle {
    display: grid;
  }

  .header-cv span {
    display: none;
  }

  .header-cv {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
  }

  .site-header {
    top: 6px;
  }

  .hero-main {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 30px;
    padding: 34px 26px 30px;
  }

  .hero-photo {
    justify-self: start;
    margin-left: 4px;
  }

  .hero-photo,
  .hero-photo img {
    width: 136px;
    height: 136px;
  }

  .availability {
    left: 0;
    transform: none;
    bottom: -16px;
    font-size: 10.5px;
    padding: 5px 10px;
  }

  .hero-copy h1 {
    font-size: clamp(2.3rem, 9vw, 3rem);
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat {
    border-bottom: 1px solid var(--line);
  }

  .stat:nth-child(2n) {
    border-right: 0;
  }

  .stat:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .resume-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .certs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resume-aside {
    padding-top: 26px;
    border-top: 1px dashed var(--line-strong);
  }

  .resume-aside .group-title:first-child {
    margin-top: 0;
  }

  .masonry {
    columns: 2;
  }

  .quotes {
    padding: 24px 22px 22px;
  }

  .lightbox {
    padding: 14px;
  }

  .lightbox-panel {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    max-height: 92vh;
    overflow-y: auto;
  }

  .lightbox-media {
    height: auto;
    min-height: 0;
  }

  .lightbox-media img {
    height: auto;
    max-height: 42vh;
    object-fit: cover;
    aspect-ratio: 16 / 10;
  }

  .lightbox-info {
    height: auto;
    padding: 22px 22px 26px;
    overflow: visible;
  }
}

@media (max-width: 620px) {
  .wrap {
    width: min(var(--wrap), 100% - 26px);
  }

  .footer-inner {
    width: min(var(--wrap), 100% - 26px);
  }

  .site-header {
    padding-top: 10px;
  }

  .header-inner {
    height: 58px;
    padding: 0 8px 0 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .hero {
    margin-top: 18px;
  }

  .hero-main {
    padding: 28px 20px 26px;
    gap: 26px;
  }

  .hero-bio {
    font-size: 14px;
  }

  .hero-row {
    gap: 14px;
  }

  .socials a {
    width: 38px;
    height: 38px;
    font-size: 11.5px;
  }

  .stat {
    padding: 18px 16px;
  }

  .section-head {
    padding: 16px 16px;
    gap: 12px;
  }

  .section-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  .section-titles h2 {
    font-size: 1.12rem;
  }

  .section-titles p {
    font-size: 11.5px;
  }

  .section-toggle {
    width: 34px;
    height: 34px;
  }

  .section-inner {
    padding: 0 18px;
  }

  .section-inner::after {
    height: 22px;
  }

  .masonry {
    columns: 1;
  }

  .certs {
    grid-template-columns: minmax(0, 1fr);
  }

  .cert-foot {
    flex-wrap: wrap;
  }

  blockquote p {
    font-size: 1.02rem;
  }

  .quote-slide figcaption {
    flex-wrap: wrap;
    gap: 10px;
  }

  .quote-date {
    width: 100%;
    margin-left: 0;
  }

  .contact-form {
    padding: 18px;
  }

  .form-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-footer .btn {
    width: 100%;
  }

  .quotes-controls {
    gap: 12px;
  }

  .lightbox-meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .to-top {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
  }
}

/* Touch devices: keep project meta readable without hover. */
@media (hover: none) {
  .work-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(7, 9, 15, 0.85), rgba(7, 9, 15, 0.12) 55%, rgba(7, 9, 15, 0));
  }

  .work-plus {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------------- printing */

@media print {
  :root {
    --shadow: none;
    --shadow-sm: none;
    --bg: #fff;
    --card: #fff;
    --ink: #000;
    --ink-2: #333;
    --muted: #555;
    --line: #ddd;
    --line-strong: #ccc;
  }

  body {
    background: #fff !important;
    font-size: 11pt;
  }

  .site-header,
  .site-footer,
  .to-top,
  .rainbow,
  .lightbox,
  .section-toggle,
  #portfolio,
  #testimonials,
  #contact,
  .hero::before,
  .hero-photo-glow,
  .availability,
  .hero-blog,
  .degraded-banner,
  .socials,
  .hero-row .btn,
  .stats,
  /* a PDF viewer has nothing to print — drop the document tiles */
  .cert-doc {
    display: none !important;
  }

  .wrap {
    width: 100%;
  }

  .card {
    border: 0;
    box-shadow: none;
    break-inside: avoid;
  }

  .hero {
    margin: 0 0 12mm;
  }

  .hero-main {
    display: flex;
    align-items: center;
    gap: 10mm;
    padding: 0;
  }

  .hero-photo,
  .hero-photo img {
    width: 32mm;
    height: 32mm;
  }

  .hero-copy h1 {
    font-size: 24pt;
  }

  .section {
    margin-top: 8mm;
  }

  .section-head {
    padding: 0 0 4mm;
    break-after: avoid;
  }

  .section-icon {
    display: none;
  }

  .section-body {
    display: block !important;
  }

  .section-inner {
    padding: 0;
    overflow: visible;
  }

  .section-inner::after {
    height: 0;
  }

  .section.is-collapsed .section-body {
    display: block !important;
  }

  .resume-grid {
    gap: 10mm;
  }

  .resume-actions {
    display: none;
  }

  a {
    text-decoration: none;
    color: #000;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
/* Custom page components */
.custom-block { padding: 18px 0; min-width: 0; }
.custom-block h3 { margin: 0 0 8px; }
.custom-block p, .custom-block blockquote { white-space: pre-line; }
.custom-block img, .custom-block video { display: block; max-width: 100%; max-height: 520px; border-radius: 12px; }
.custom-links { display: flex; gap: 10px; flex-wrap: wrap; }
.contact-map { margin-top: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; }
.contact-map-copy { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 22px; flex-wrap: wrap; }
.contact-map-copy h3, .contact-map-copy p { margin: 0; }
.contact-map-copy a { font-size: .87rem; }
.contact-map-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.contact-map-credits { color: var(--muted); font-size: 10px; line-height: 1.4; text-align: right; }
.contact-map-credits a { color: inherit; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.contact-map-credits a:hover, .contact-map-credits a:focus-visible { color: var(--ink); }
/* OSM Liberty (light) and Dark Matter-derived (dark) vector basemaps.
   MapLibre positions the red dot geographically, so it moves with the map. */
.contact-map-stage {
  --map-ground: #eaf3ec;
  position: relative;
  min-height: 330px;
  background: var(--map-ground);
}
[data-theme='dark'] .contact-map-stage { --map-ground: #1b1410; }
.contact-map-canvas { position: absolute; inset: 0; }
.contact-map-stage .maplibregl-map { background: var(--map-ground); font-family: var(--font-body); }
/* Older cached map scripts may still add a duplicate MapLibre attribution box.
   The required linked credits remain visible beside Open location above. */
.contact-map-stage .maplibregl-ctrl-attrib { display: none !important; }
.contact-map-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}
.contact-map-city-label {
  max-width: min(220px, 70vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 8px;
  border: 1px solid rgba(18, 20, 26, .14);
  border-radius: 6px;
  background: rgba(255, 255, 255, .95);
  color: #202837;
  font-size: 12px;
  font-weight: 650;
  line-height: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .13);
}
[data-theme='dark'] .contact-map-city-label {
  border-color: rgba(193, 152, 111, .4);
  background: rgba(36, 27, 21, .96);
  color: #f7e6d2;
}
/* The basemap's own city name takes precedence when it is rendered. */
.contact-map-city-label[hidden] { display: none; }
.contact-map-marker-dot {
  width: 30px;
  height: 30px;
  flex: none;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #da5b50;
  box-shadow: 0 3px 7px rgba(0, 0, 0, .35);
}
.contact-map-stamen { display: none; }
[data-theme='dark'] .contact-map-stamen { display: inline; }
.contact-map-unavailable { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 6px 10px; border-radius: 6px; background: var(--card); color: var(--ink); font-size: .8rem; }
.contact-map-error { position: absolute; z-index: 2; top: 10px; left: 10px; padding: 4px 10px; border-radius: 6px; background: var(--card); color: var(--ink); font-size: .8rem; }
.contact-map-error[hidden] { display: none; }
