/* =========================================================
   Nicolas Brants — personal CV site
   ========================================================= */

:root {
  --bg: #060b14;
  --bg-alt: #0a111d;
  --surface: #0f1826;
  --surface-2: #142032;
  --border: rgba(150, 196, 214, 0.10);
  --border-strong: rgba(150, 196, 214, 0.18);

  --text: #eef2f8;
  --text-soft: #c2cad8;
  --muted: #8a96ab;

  --accent: #2a9db5;
  --accent-light: #63c8d9;
  --accent-grad: linear-gradient(135deg, #1c7f95 0%, #2fa6bd 100%);

  --purple: #63c8d9;
  --green: #34d399;
  --orange: #fbbf24;
  --pink: #f472b6;
  --blue: #60a5fa;

  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.65);
  --header-h: 76px;
  --container: 1180px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(42, 157, 181, 0.4); }

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

.icon {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.accent { color: var(--accent-light); }

.gradient-text {
  background: linear-gradient(135deg, #4fbdd0 0%, #9be3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

/* Colour tints shared by icon badges */
.tint-purple { background: rgba(42, 157, 181, 0.14); color: var(--purple); }
.tint-green  { background: rgba(52, 211, 153, 0.12); color: var(--green); }
.tint-orange { background: rgba(251, 191, 36, 0.12); color: var(--orange); }
.tint-pink   { background: rgba(244, 114, 182, 0.12); color: var(--pink); }
.tint-blue   { background: rgba(96, 165, 250, 0.12); color: var(--blue); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.95rem 1.6rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.98rem;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn .icon { width: 1.15em; height: 1.15em; transition: transform 0.2s; }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 12px 30px -10px rgba(42, 157, 181, 0.75);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -10px rgba(42, 157, 181, 0.9);
}
.btn-primary:hover .icon { transform: translateX(3px); }

.btn-outline {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
}
.btn-outline:hover {
  border-color: var(--accent);
  background: rgba(42, 157, 181, 0.08);
  transform: translateY(-2px);
}

.btn-sm { padding: 0.65rem 1.1rem; font-size: 0.88rem; border-radius: 10px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.site-header.is-scrolled,
.site-header.menu-open {
  background: rgba(6, 11, 20, 0.8);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.nav-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-mark {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  overflow: visible;
  filter: drop-shadow(0 4px 12px rgba(42, 157, 181, 0.45));
}

.nav-links { display: flex; gap: 2.1rem; }
.nav-links a {
  position: relative;
  display: inline-block;
  padding: 0.4rem 0;
  font-weight: 500;
  font-size: 0.97rem;
  color: var(--text-soft);
  transition: color 0.2s;
}
.nav-links a { white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-links a.is-active { color: var(--accent-light); }
.nav-links a::before,
.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
}
.nav-links a::after {
  bottom: -6px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-50%) scaleX(0.3);
}
.nav-links a::before {
  bottom: -8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
  transform: translateX(-50%);
  box-shadow: 0 0 10px var(--accent);
}
.nav-links a.is-active::after { opacity: 1; transform: translateX(-50%) scaleX(1); }
.nav-links a.is-active::before { opacity: 1; }

.nav-cv-mobile { display: none; }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.lang-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.lang-switch button {
  border: 0;
  background: none;
  padding: 0.35rem 0.6rem;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] { background: var(--accent-grad); color: #fff; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle .icon { width: 18px; height: 18px; }
.theme-toggle--menu { display: none; }

.menu-toggle {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
}
.menu-toggle .icon { width: 22px; height: 22px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 40px) 0 80px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(620px 420px at 78% 32%, rgba(42, 157, 181, 0.2), transparent 70%),
    radial-gradient(520px 320px at 8% 8%, rgba(42, 157, 181, 0.08), transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 48px;
  min-height: 580px;
}

.hello-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.95rem;
}
.wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 2.6s ease-in-out infinite;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

.hero-name {
  margin-top: 1.5rem;
  font-size: clamp(3rem, 7vw, 5.6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.hero-role {
  margin-top: 0.9rem;
  font-size: clamp(1.3rem, 2.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.hero-pitch {
  margin-top: 1.3rem;
  max-width: 35rem;
  color: var(--text-soft);
  font-size: 1.08rem;
  line-height: 1.75;
}
.hero-ctas { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 14px; }

.hero-social {
  margin-top: 2.2rem;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-soft);
  font-weight: 500;
}
.hero-social > span { margin-right: 6px; }
.social {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}
.social .icon { width: 20px; height: 20px; }
.social:hover {
  border-color: var(--accent);
  background: rgba(42, 157, 181, 0.12);
  transform: translateY(-2px);
}

/* Hero visual */
.hero-visual {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1 / 1;
  justify-self: end;
}

.dot-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 160px;
  height: 160px;
  background-image: radial-gradient(rgba(99, 200, 217, 0.4) 1.5px, transparent 1.7px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at center, #000 35%, transparent 75%);
  mask-image: radial-gradient(circle at center, #000 35%, transparent 75%);
}

.hero-orbit {
  position: absolute;
  top: 2%;
  left: 4%;
  width: 96%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px dashed rgba(99, 200, 217, 0.22);
  animation: spin 60s linear infinite;
}
.hero-orbit::after {
  content: "";
  position: absolute;
  top: 14.6%;
  left: 14.6%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 14px 2px var(--accent);
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero-circle {
  position: absolute;
  top: 10%;
  left: 12%;
  width: 80%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 30% 25%, #5cc4d6 0%, #2a9db5 45%, #17687c 100%);
  box-shadow:
    0 40px 90px -25px rgba(42, 157, 181, 0.7),
    inset 0 -30px 60px rgba(0, 0, 0, 0.25);
}
.hero-circle::before {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.monogram {
  position: relative;
  font-size: clamp(5rem, 11vw, 9rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 12px 40px rgba(8, 60, 75, 0.45);
}
/* Cut-out portrait standing in front of the circle, head rising above it */
.hero-photo {
  position: absolute;
  z-index: 1;
  bottom: 12%;
  left: 10%;
  width: 84%;
  height: auto;
  filter: drop-shadow(0 24px 40px rgba(2, 8, 18, 0.45));
  /* the fade into the circle is baked into the PNG */
}
.hero-visual:has(.hero-photo) .monogram { display: none; }

.float-card {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 158px;
  padding: 1.15rem 1.3rem;
  border-radius: 18px;
  background: rgba(15, 24, 38, 0.72);
  border: 1px solid var(--border-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
}
.float-card strong {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-light);
}
.float-card span {
  max-width: 9rem;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-soft);
}
.float-card .icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 20px;
  height: 20px;
  color: var(--accent-light);
  opacity: 0.85;
}
.float-card--left { left: -3%; top: 44%; }
.float-card--right { right: -3%; bottom: 8%; animation-delay: -3s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.status-pill {
  position: absolute;
  z-index: 2;
  top: 6%;
  right: 2%;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: rgba(15, 24, 38, 0.78);
  border: 1px solid var(--border-strong);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 0.82rem;
  font-weight: 600;
}
.pulse {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}
.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* Stats bar */
.stats-bar {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 28px 8px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(20, 32, 50, 0.75), rgba(15, 24, 38, 0.75));
  border: 1px solid var(--border);
}
.stat {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 28px;
  border-left: 1px solid var(--border);
}
.stat:first-child { border-left: 0; }
.stat-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
}
.stat-icon .icon { width: 26px; height: 26px; }
.stat-value {
  display: block;
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-soft);
}

/* ---------- Sections ---------- */
.section { padding: 110px 0; }
.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid rgba(150, 196, 214, 0.05);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-light);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.section-sub { margin-top: 0.8rem; max-width: 36rem; color: var(--text-soft); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--accent-light);
  white-space: nowrap;
}
.link-arrow .icon { transition: transform 0.2s; }
.link-arrow:hover .icon { transform: translateX(4px); }

.card {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.card-title { margin-bottom: 22px; font-size: 1.1rem; font-weight: 700; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 64px;
  align-items: center;
}
.about-text p {
  margin-top: 1.15rem;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-soft);
}
.about-text p strong { color: var(--text); font-weight: 600; }
.about-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 12px; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fact {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.25s, transform 0.25s;
}
.fact:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.fact-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 12px;
}
.fact-icon .icon { width: 22px; height: 22px; }
.fact-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.fact-value { margin-top: 0.3rem; font-size: 1.05rem; font-weight: 700; line-height: 1.4; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: start;
}
.expertise { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.skill-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  transition: border-color 0.25s, background 0.25s;
}
.skill-tile:hover { border-color: rgba(42, 157, 181, 0.45); background: rgba(42, 157, 181, 0.06); }
.tile-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.tile-icon .icon { width: 20px; height: 20px; }
.skill-tile h4 { font-size: 0.98rem; font-weight: 700; line-height: 1.3; }
.skill-tile p { margin-top: 0.2rem; font-size: 0.84rem; line-height: 1.45; color: var(--muted); }

.skills-side { display: flex; flex-direction: column; gap: 24px; }

.lang + .lang { margin-top: 22px; }
.lang-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 0.6rem;
}
.lang-name { font-weight: 600; }
.lang-level { font-size: 0.86rem; font-weight: 600; color: var(--muted); }
.lang-level b { color: var(--accent-light); }
.bar {
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-grad);
  box-shadow: 0 0 12px rgba(42, 157, 181, 0.6);
  transition: width 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s;
}
html:not(.js) .bar-fill,
.is-visible .bar-fill { width: var(--level); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #c9f0f6;
  background: rgba(42, 157, 181, 0.1);
  border: 1px solid rgba(42, 157, 181, 0.22);
}

.soft-skills { margin-top: 24px; }
.soft-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 32px;
}
.soft-skill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.95rem;
}
.dots { display: inline-flex; gap: 6px; flex-shrink: 0; }
.dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-grad);
  box-shadow: 0 0 8px rgba(42, 157, 181, 0.5);
}
.dots[data-level="4"] i:nth-child(n + 5) {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

/* ---------- Projects ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.project:hover {
  transform: translateY(-6px);
  border-color: rgba(42, 157, 181, 0.4);
  box-shadow: 0 30px 60px -30px rgba(42, 157, 181, 0.5);
}

.project-art {
  position: relative;
  height: 200px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.project-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.project:hover .project-img { transform: scale(1.05); }

/* Darkens the photo edges so the badges stay readable */
.project-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(6, 11, 20, 0.45) 0%, transparent 35%, transparent 60%, rgba(6, 11, 20, 0.55) 100%);
  pointer-events: none;
}
.project-art--1 { background: radial-gradient(circle at 25% 20%, rgba(120, 215, 230, 0.55), transparent 55%), linear-gradient(135deg, #1f8aa0, #0c3340); }
.project-art--2 { background: radial-gradient(circle at 75% 20%, rgba(110, 200, 255, 0.45), transparent 55%), linear-gradient(135deg, #1f77c4, #102a5c); }
.project-art--3 { background: radial-gradient(circle at 25% 80%, rgba(255, 190, 120, 0.4), transparent 55%), linear-gradient(135deg, #b8652f, #3d1d0e); }

.project-badge,
.project-metric {
  position: absolute;
  z-index: 2;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.project-badge { top: 16px; left: 16px; }
.project-metric { bottom: 16px; right: 16px; background: rgba(255, 255, 255, 0.92); color: #3d1d0e; border: 0; }

.project-body { display: flex; flex-direction: column; flex: 1; gap: 12px; padding: 24px; }
.project h3 { font-size: 1.2rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.project p { font-size: 0.95rem; line-height: 1.65; color: var(--text-soft); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }

/* Clickable cards: the title link stretches over the whole card */
.project--link { position: relative; }
.project-link { color: inherit; transition: color 0.2s; }
.project-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
}
.project-link:focus-visible { outline: none; }
.project--link:has(.project-link:focus-visible) {
  outline: 2px solid var(--accent-light);
  outline-offset: 4px;
}
.project--link:hover .project-link { color: var(--accent-light); }

.project-visit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-light);
}
.project-visit .icon { width: 1em; height: 1em; transition: transform 0.2s; }
.project--link:hover .project-visit .icon { transform: translate(2px, -2px); }
.project--flip:hover .project-visit .icon { transform: translateX(3px); }

/* Flip-card trigger is a button styled like the title link */
button.project-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* ---------- Story dialog (Charlemagne card flips open) ---------- */
.story-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: hidden;
}
.story-dialog::backdrop {
  background: rgba(3, 7, 12, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.45s;
}
.story-dialog.is-open::backdrop { opacity: 1; }

.flip {
  position: fixed;
  perspective: 1800px;
}
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}
.flip-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.flip-front {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
}
.flip-front .project-art { flex-shrink: 0; }
.flip-front.project,
.flip-front.project:hover { transform: none; box-shadow: none; transition: none; }
.flip-back {
  transform: rotateY(180deg);
  background:
    radial-gradient(560px 280px at 0% 0%, rgba(42, 157, 181, 0.22), transparent 70%),
    var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8), 0 0 60px -20px rgba(42, 157, 181, 0.35);
}

.story-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(6, 11, 20, 0.6);
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.story-close:hover { border-color: var(--accent); background: rgba(42, 157, 181, 0.15); }
.story-close .icon { width: 20px; height: 20px; }

.story-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 44px 48px 40px;
}
.story-scroll > .eyebrow { display: flex; margin-right: 52px; }  /* clear the close button */
.story-title {
  margin-top: 0.2rem;
  padding-right: 48px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.story-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0 26px;
}
.story-facts li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 16px;
  border-radius: 14px;
  background: rgba(42, 157, 181, 0.08);
  border: 1px solid rgba(42, 157, 181, 0.2);
}
.story-facts strong { font-size: 1.35rem; font-weight: 800; color: var(--accent-light); line-height: 1.1; }
.story-facts span { font-size: 0.82rem; line-height: 1.4; color: var(--text-soft); }
.story-scroll p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-soft);
}
.story-scroll p + p { margin-top: 1rem; }
.story-scroll p strong { color: var(--text); font-weight: 600; }
.tag {
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

/* ---------- Resume ---------- */
.resume-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: start;
}
.column-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 28px;
  font-size: 1.35rem;
  font-weight: 700;
}
.ct-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
}
.ct-icon .icon { width: 20px; height: 20px; }

.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--accent), rgba(42, 157, 181, 0.05));
}
.tl-item {
  position: relative;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.25s;
}
.tl-item + .tl-item { margin-top: 18px; }
.tl-item:hover { border-color: var(--border-strong); }
.tl-item::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 26px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(42, 157, 181, 0.15);
}
.tl-date {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-light);
  background: rgba(42, 157, 181, 0.12);
}
.tl-item h4 { font-size: 1.1rem; font-weight: 700; line-height: 1.35; }
.tl-org { margin-top: 0.2rem; font-size: 0.95rem; font-weight: 600; color: var(--text-soft); }
.tl-intro, .tl-desc { margin-top: 0.7rem; font-size: 0.93rem; line-height: 1.6; color: var(--muted); }
.tl-list { display: grid; gap: 0.5rem; margin-top: 0.9rem; }
.tl-list li {
  position: relative;
  padding-left: 1.35rem;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-soft);
}
.tl-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
}
.tl-list li strong { color: var(--text); font-weight: 600; }

/* ---------- Contact ---------- */
.contact-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 56px;
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(620px 320px at 0% 0%, rgba(42, 157, 181, 0.24), transparent 70%),
    var(--surface);
  border: 1px solid var(--border-strong);
}
.contact-card::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 220px;
  height: 220px;
  background-image: radial-gradient(rgba(99, 200, 217, 0.3) 1.5px, transparent 1.7px);
  background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(circle at center, #000 30%, transparent 70%);
  mask-image: radial-gradient(circle at center, #000 30%, transparent 70%);
  pointer-events: none;
}
.contact-text { margin-top: 1rem; font-size: 1.05rem; line-height: 1.75; color: var(--text-soft); }
.contact-ctas { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 12px; }

.contact-list { position: relative; z-index: 1; display: grid; gap: 14px; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(6, 11, 20, 0.45);
  border: 1px solid var(--border);
}
.ci-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
}
.ci-icon .icon { width: 22px; height: 22px; }
.ci-body { display: flex; flex-direction: column; min-width: 0; }
.ci-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.ci-value { font-weight: 600; overflow-wrap: break-word; }
a.ci-value:hover { color: var(--accent-light); }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  padding: 0.45rem 0.75rem;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
  transition: border-color 0.2s, color 0.2s;
}
.copy-btn:hover { border-color: var(--accent); color: var(--text); }
.copy-btn.is-copied { border-color: var(--green); color: var(--green); }

/* ---------- Footer ---------- */
.site-footer { padding: 32px 0; border-top: 1px solid var(--border); font-size: 0.9rem; color: var(--muted); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand--small { font-size: 1.05rem; color: var(--text); }
.brand--small .brand-mark { width: 32px; height: 32px; }

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 12px 30px -10px rgba(42, 157, 181, 0.8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top .icon { width: 20px; height: 20px; }

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================
   Light theme (html[data-theme="light"]); dark is the default above
   ========================================================= */

:root[data-theme="light"] {
  --bg: #f6f8f9;
  --bg-alt: #edf2f4;
  --surface: #ffffff;
  --surface-2: #f3f6f7;
  --border: rgba(16, 36, 44, 0.10);
  --border-strong: rgba(16, 36, 44, 0.18);

  --text: #10242c;
  --text-soft: #40565f;
  --muted: #687c84;

  --accent: #1f8aa0;
  --accent-light: #177287;
  --accent-grad: linear-gradient(135deg, #1c7f95 0%, #2a9db5 100%);

  --purple: #177287;
  --green: #0b8f63;
  --orange: #b9730a;
  --pink: #c93f85;
  --blue: #2a6bd0;

  --shadow: 0 24px 50px -24px rgba(16, 36, 44, 0.35);
}

:root[data-theme="light"] .gradient-text { background: linear-gradient(135deg, #177287 0%, #2fa6bd 100%); -webkit-background-clip: text; background-clip: text; }

/* Logo: darker strokes so it reads on a light page */
:root[data-theme="light"] #logo-nb path:first-child { stroke: #1f8aa0; }
:root[data-theme="light"] #logo-nb path:last-child { fill: #10242c; }
:root[data-theme="light"] .brand-mark { filter: none; }

/* Soft card shadows replace the dark theme's glow */
:root[data-theme="light"] .card, :root[data-theme="light"] .fact, :root[data-theme="light"] .project, :root[data-theme="light"] .tl-item, :root[data-theme="light"] .stats-bar, :root[data-theme="light"] .contact-card {
  box-shadow: 0 14px 34px -22px rgba(16, 36, 44, 0.28);
}

/* Header */
:root[data-theme="light"] .site-header.is-scrolled,
:root[data-theme="light"] .site-header.menu-open { background: rgba(246, 248, 249, 0.86); }
@media (max-width: 1100px) {
  :root[data-theme="light"] .nav { background: #f6f8f9; -webkit-backdrop-filter: none; backdrop-filter: none; }
  :root[data-theme="light"] .site-header.menu-open { background: #f6f8f9; }
}

/* Faint white fills become faint dark fills */
:root[data-theme="light"] .btn-outline, :root[data-theme="light"] .lang-switch, :root[data-theme="light"] .menu-toggle, :root[data-theme="light"] .hello-badge, :root[data-theme="light"] .social { background: #fff; }
:root[data-theme="light"] .skill-tile { background: rgba(16, 36, 44, 0.02); }
:root[data-theme="light"] .bar { background: rgba(16, 36, 44, 0.09); }
:root[data-theme="light"] .dots[data-level="4"] i:nth-child(n + 5) { background: rgba(16, 36, 44, 0.14); }
:root[data-theme="light"] .tag { background: rgba(16, 36, 44, 0.05); }
:root[data-theme="light"] .copy-btn { background: #fff; }
:root[data-theme="light"] .contact-item { background: rgba(16, 36, 44, 0.03); }
:root[data-theme="light"] .chip { color: #14687a; }

/* Hero */
:root[data-theme="light"] .dot-grid { background-image: radial-gradient(rgba(31, 138, 160, 0.5) 1.5px, transparent 1.7px); }
:root[data-theme="light"] .hero-orbit { border-color: rgba(31, 138, 160, 0.32); }
:root[data-theme="light"] .hero-photo { filter: drop-shadow(0 24px 34px rgba(16, 36, 44, 0.22)); }
:root[data-theme="light"] .float-card, :root[data-theme="light"] .status-pill { background: rgba(255, 255, 255, 0.86); }
:root[data-theme="light"] .stats-bar { background: #fff; }
:root[data-theme="light"] .contact-card::after { background-image: radial-gradient(rgba(31, 138, 160, 0.4) 1.5px, transparent 1.7px); }

/* Projects: badges sit on photos, so they keep white text */
:root[data-theme="light"] .project-badge { color: #fff; }

/* Story dialog */
:root[data-theme="light"] .story-dialog::backdrop { background: rgba(16, 36, 44, 0.55); }
:root[data-theme="light"] .story-close { background: #fff; }
:root[data-theme="light"] .flip-back { box-shadow: 0 40px 90px -30px rgba(16, 36, 44, 0.5); }
:root[data-theme="light"] .theme-toggle { background: #fff; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1240px) {
  .nav-links { gap: 1.4rem; }
  .nav-wrap { gap: 16px; }
}

@media (max-width: 1100px) {
  .menu-toggle { display: grid; }
  .cv-btn { display: none; }

  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    padding: 8px 24px 24px;
    background: rgba(6, 11, 20, 0.97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-links { flex-direction: column; gap: 0; }
  .nav-links a {
    display: block;
    padding: 0.95rem 0;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links a::before,
  .nav-links a::after { display: none; }
  .theme-toggle--menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    height: 46px;
    margin-top: 20px;
    font-weight: 600;
    font-size: 0.95rem;
  }
  .nav-cv-mobile { display: flex; width: 100%; margin-top: 12px; }
}

@media (max-width: 960px) {
  .hero { padding-bottom: 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 56px; min-height: 0; }
  .hero-visual { justify-self: center; max-width: 440px; }

  .stats-bar { grid-template-columns: 1fr 1fr; padding: 8px; }
  .stat { padding: 20px; }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--border); }

  .section { padding: 88px 0; }
  .about-grid,
  .skills-grid,
  .resume-grid,
  .contact-card { grid-template-columns: 1fr; }
  .about-grid { gap: 40px; }
  .resume-grid { gap: 56px; }
  .projects-grid { grid-template-columns: 1fr 1fr; }
  .soft-grid { grid-template-columns: 1fr 1fr; }
  .contact-card { padding: 40px; gap: 36px; }
}

@media (max-width: 640px) {
  .theme-toggle--header { display: none; }
  .container { padding-inline: 16px; }
  .brand { font-size: 1.12rem; }
  .brand-mark { width: 34px; height: 34px; }

  .hero { padding-top: calc(var(--header-h) + 24px); }
  .hero-ctas .btn { flex: 1 1 auto; }
  .hero-visual { max-width: 360px; }
  .float-card { min-width: 0; padding: 0.85rem 1rem; border-radius: 14px; }
  .float-card strong { font-size: 1.5rem; }
  .float-card span { font-size: 0.76rem; max-width: 7.5rem; }
  .float-card .icon { top: 10px; right: 10px; width: 16px; height: 16px; }
  .float-card--left { left: 0; }
  .float-card--right { right: 0; }
  .status-pill { font-size: 0.74rem; padding: 0.4rem 0.8rem; left: 0; right: auto; top: -9%; }

  .stats-bar { margin-top: 40px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 16px; }
  .stat-icon { width: 46px; height: 46px; }
  .stat-icon .icon { width: 22px; height: 22px; }
  .stat-value { font-size: 1.75rem; }
  .stat-label { font-size: 0.82rem; }

  .section { padding: 72px 0; }
  .section-head { flex-direction: column; align-items: flex-start; margin-bottom: 36px; }
  .card { padding: 22px; }
  .expertise,
  .projects-grid,
  .soft-grid { grid-template-columns: 1fr; }
  .soft-grid { gap: 0; }
  .facts { gap: 12px; }
  .fact { padding: 18px; }

  .timeline { padding-left: 26px; }
  .timeline::before { left: 5px; }
  .tl-item { padding: 18px; }
  .tl-item::before { left: -26px; width: 14px; height: 14px; }

  .contact-card { padding: 28px 20px; border-radius: 22px; }
  .contact-ctas .btn { flex: 1 1 auto; }
  .contact-item { padding: 14px; gap: 12px; }
  .ci-icon { width: 42px; height: 42px; }
  .copy-btn .copy-label { display: none; }

  .story-scroll { padding: 28px 22px 28px; }
  .story-facts { grid-template-columns: 1fr; gap: 8px; }
  .story-facts li { flex-direction: row; align-items: baseline; gap: 0.6rem; padding: 12px 14px; }
  .story-facts strong { font-size: 1.15rem; white-space: nowrap; }
  .story-scroll p { font-size: 0.95rem; }

  .footer-inner { flex-direction: column; text-align: center; }
  .site-footer { padding-bottom: 84px; }  /* keep the back-to-top button off the text */
  .to-top { right: 16px; bottom: 16px; }
}

@media (max-width: 400px) {
  .facts { grid-template-columns: 1fr; }

  /* Small phones: keep the logo, language switch and menu button on one row */
  .nav-wrap { gap: 10px; }
  .nav-actions { gap: 8px; }
  .brand { font-size: 1rem; gap: 0.5rem; }
  .brand-mark { width: 30px; height: 30px; }
  .lang-switch button { padding: 0.3rem 0.45rem; }
  .menu-toggle { width: 38px; height: 38px; }
}

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