:root {
  --bg: #000;
  --fg: #fff;
  --muted: #8f8f8f;
  --line: #1d1d1d;
  --max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  /* Space Grotesk is loaded in the page head, the whole page shares the experience font */
  font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: 28px;
}

/* nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 28px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  display: block;
  height: 30px;
  width: auto;
}

.brand-name {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.menu {
  display: flex;
  gap: 30px;
}

.menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.menu a:hover,
.menu a:focus-visible {
  color: var(--fg);
  border-color: var(--fg);
  outline: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--fg);
  padding: 6px;
  cursor: pointer;
}

/* hero + sections */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  /* --vh is set once by the page script, so the hero does not grow when the mobile toolbars hide */
  height: calc(72 * var(--vh, 1svh));
  min-height: 460px;
  padding-block: 0 calc(7 * var(--vh, 1svh));
  border-top: 0;
  background: #fff;
  color: #0a0a0a;
  overflow: hidden;
}

/* white fade that separates the copy from the particle field */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 58%;
  pointer-events: none;
  background: linear-gradient(
    to top,
    #fff 0%,
    #fff 34%,
    rgba(255, 255, 255, 0.92) 58%,
    rgba(255, 255, 255, 0) 100%
  );
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero .claim {
  color: #5a5a5a;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

/* badges row over the name: work status and cv download, they wrap on narrow screens */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 1.2rem;
}

/* work status badge: green pill, pulsing dot and a shine that crosses it every few seconds */
.status-badge {
  --status: #16a34a;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 7px 16px 7px 12px;
  border: 1px solid rgba(22, 163, 74, 0.4);
  border-radius: 999px;
  /* nearly solid so the particles passing behind do not show through the text */
  background: rgba(236, 248, 240, 0.94);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #0f6e33;
  font-size: clamp(11px, 0.6rem + 0.3vw, 13px);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 0 18px rgba(22, 163, 74, 0.25);
  overflow: hidden;
  animation: status-glow 2.4s ease-in-out infinite;
}

.status-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--status);
  animation: status-pulse 2.4s ease-out infinite;
}

/* light band sweeping from left to right */
.status-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.85) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: status-shine 3.6s ease-in-out infinite;
  pointer-events: none;
}

/* cv badge: same pill as the status one in black and white, it inverts on hover */
.cv-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 12px;
  border: 1px solid rgba(10, 10, 10, 0.3);
  border-radius: 999px;
  /* nearly solid so the particles passing behind do not show through the text */
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #0a0a0a;
  font-size: clamp(11px, 0.6rem + 0.3vw, 13px);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cv-badge-icon {
  flex: none;
  width: 14px;
  height: 14px;
}

.cv-badge:hover,
.cv-badge:focus-visible {
  background: #0a0a0a;
  border-color: #0a0a0a;
  color: #fff;
}

/* double ring stays visible over the white hero and the particles */
.cv-badge:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0a0a0a;
}

@media (prefers-reduced-motion: reduce) {
  .cv-badge {
    transition: none;
  }
}

@keyframes status-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
}

@keyframes status-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(22, 163, 74, 0.18); }
  50% { box-shadow: 0 0 22px rgba(22, 163, 74, 0.4); }
}

@keyframes status-shine {
  0%, 55% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .status-badge,
  .status-dot,
  .status-badge::after {
    animation: none;
  }
}

.claim {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.35rem);
  max-width: 34ch;
  line-height: 1.5;
  margin: 0;
}

section {
  border-top: 1px solid var(--line);
  padding-block: calc(12 * var(--vh, 1svh));
}

section h2 {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 2rem;
}

/* about: lead on the left, background on the right, one column on narrow screens */

.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.about-lead {
  margin: 0;
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.85rem);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-wrap: balance;
}

.about-body {
  max-width: 60ch;
  color: var(--muted);
  font-size: clamp(0.98rem, 0.92rem + 0.25vw, 1.08rem);
  line-height: 1.7;
}

.about-body p {
  margin: 0 0 1.2em;
  text-wrap: pretty;
}

.about-body p:last-child {
  margin-bottom: 0;
}

/* links stand out from the muted body only by color and a thin underline */
.about-body a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.about-body a:hover,
.about-body a:focus-visible {
  text-decoration-color: var(--fg);
  outline: none;
}

/* education closes the block, set apart by a thin rule */
.about-education {
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
}

@media (max-width: 820px) {
  .about {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

/* experience: scene styles come from experiences.css, these adapt its panel to the dark page */

.experience {
  color: var(--fg);
}

.experience-panel {
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
  padding: 24px 28px 0;
}

.experience-period {
  color: var(--muted);
}

/* stack: one row per area, area name on the left and its tools on the right, stacked on narrow screens */

.stack-list {
  margin: 0;
  border-top: 1px solid var(--line);
}

.stack-group {
  display: grid;
  grid-template-columns: 14rem 1fr;
  align-items: baseline;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.stack-area {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.stack-group dd {
  margin: 0;
}

.stack-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 1.6em;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(1rem, 0.9rem + 0.45vw, 1.25rem);
  line-height: 1.4;
}

/* tools from personal projects are dimmed, so they read apart from the ones used at work */
.stack-group--learning .stack-items {
  color: var(--muted);
}

@media (max-width: 720px) {
  .stack-group {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* stack repos: items with github repositories become buttons with a dotted underline and a small count,
   hover or click opens a panel with the repositories under the item */

.stack-item--repos {
  position: relative;
}

.stack-tech {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline dotted;
  text-decoration-color: var(--muted);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-decoration-color 0.2s ease;
}

.stack-tech:hover,
.stack-tech[aria-expanded="true"] {
  text-decoration-color: currentColor;
}

.stack-tech:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 4px;
}

.stack-tech-count {
  margin-left: 0.3em;
  font-size: 0.6em;
  vertical-align: super;
  color: var(--muted);
}

/* text read by screen readers only */
.stack-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stack-repos {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 20;
  width: max-content;
  min-width: 14rem;
  max-width: min(22rem, calc(100vw - 56px));
  max-height: 18rem;
  overflow-y: auto;
  padding: 14px 18px;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.7);
  /* the learning row dims its items, the panel keeps full contrast */
  color: var(--fg);
  font-size: 0.95rem;
  line-height: 1.4;
}

.stack-repos--end {
  left: auto;
  right: 0;
}

.stack-repos-title {
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.stack-repos a {
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.stack-repos a:hover,
.stack-repos a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}

.stack-repos-arrow {
  color: var(--muted);
}

/* repositories from another account show the owner dimmed before the name */
.stack-repos-owner {
  color: var(--muted);
}

.stack-repos-all {
  display: inline-block;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  width: 100%;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .stack-tech {
    transition: none;
  }
}

/* courses: one row per course, name, where it was taken and the certificate link,
   the link column keeps its width so names line up even when a course has no certificate */

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

.course {
  display: grid;
  grid-template-columns: 1fr 14rem 8rem;
  align-items: baseline;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.course-name {
  font-size: clamp(1rem, 0.9rem + 0.45vw, 1.25rem);
  line-height: 1.4;
}

.course-source,
.course-link {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.course-link {
  justify-self: end;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding: 4px 0;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.course-link:hover,
.course-link:focus-visible {
  color: var(--fg);
  border-color: var(--fg);
  outline: none;
}

/* narrow screens put the source and the link in one line under the name */
@media (max-width: 720px) {
  .course {
    grid-template-columns: 1fr auto;
    gap: 8px 16px;
  }

  .course-name {
    grid-column: 1 / -1;
  }
}

/* contact: one row per link, icon, kind of link and value */

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

.contact-link {
  display: grid;
  grid-template-columns: auto 9rem 1fr;
  align-items: center;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.25s ease;
}

.contact-icon {
  display: block;
  width: 22px;
  height: 22px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.contact-type {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-value {
  font-size: clamp(1.05rem, 0.9rem + 0.8vw, 1.5rem);
  overflow-wrap: anywhere;
}

.contact-link:hover,
.contact-link:focus-visible {
  padding-left: 10px;
  outline: none;
}

.contact-link:hover .contact-icon,
.contact-link:focus-visible .contact-icon {
  color: var(--fg);
}

.contact-link:hover .contact-value,
.contact-link:focus-visible .contact-value {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* narrow screens put the kind of link above the value */
@media (max-width: 520px) {
  .contact-link {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 4px 16px;
  }

  .contact-icon {
    grid-row: span 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-link {
    transition: none;
  }
}

/* mobile */

@media (max-width: 720px) {
  .menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    background: #000;
    border-bottom: 1px solid var(--line);
    padding: 6px 28px 18px;
  }

  .menu.open { display: flex; }

  .menu a {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
  }

  .menu-toggle { display: block; }

  .hero { height: calc(68 * var(--vh, 1svh)); min-height: 400px; }
  section { padding-block: calc(9 * var(--vh, 1svh)); }
}

/* particle canvas */

.wide-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
}
