* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #050605;
  --panel: #090c0a;
  --ink: #d9e0db;
  --muted: #8f9b93;
  --quiet: #536058;
  --green: #65f58b;
  --rule: rgba(101, 245, 139, 0.2);
  --rule-strong: rgba(101, 245, 139, 0.45);
  --measure: 46rem;
  --font: "DejaVu Sans Mono", "Liberation Mono", "Nimbus Mono PS", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html {
  min-width: 20rem;
  background: var(--bg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  scroll-behavior: smooth;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 52% 35% at 50% 45%, rgba(35, 99, 53, 0.08), transparent 72%),
    var(--bg);
  color: var(--ink);
  text-rendering: optimizeLegibility;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
}

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

::selection {
  background: var(--green);
  color: var(--bg);
}

[hidden] {
  display: none !important;
}

html[data-lang="fr"] [data-en],
html[data-lang="en"] [data-fr] {
  display: none !important;
}

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

.language-switch {
  position: fixed;
  z-index: 20;
  top: max(1.35rem, env(safe-area-inset-top));
  right: max(1.5rem, env(safe-area-inset-right));
  display: inline-flex;
  align-items: baseline;
  gap: 0.44rem;
  color: var(--quiet);
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  line-height: 1;
}

.language-switch button {
  width: max-content;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  line-height: 1.6;
}

.language-switch button[aria-pressed="true"] {
  color: var(--green);
}

.language-switch button:hover {
  color: var(--ink);
}

.language-switch button:focus-visible,
.robot-canvas:focus-visible,
a:focus-visible {
  outline: 1px solid var(--green);
  outline-offset: 0.38rem;
}

body.home {
  height: 100svh;
  min-height: 31rem;
  overflow: hidden;
}

.home-main {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 3.6rem 1.5rem;
}

.home-stack {
  display: flex;
  width: max-content;
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.robot-stage {
  position: relative;
  width: min(50rem, calc(100vw - 3rem));
  height: min(23rem, 48svh);
  min-height: 17rem;
  isolation: isolate;
}

.robot-stage::after {
  position: absolute;
  z-index: -1;
  right: 13%;
  bottom: 0.5rem;
  left: 13%;
  height: 1.5rem;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(101, 245, 139, 0.13), transparent 70%);
  content: "";
  filter: blur(0.45rem);
}

.robot-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: manipulation;
}

.robot-canvas[role="img"] {
  cursor: default;
}

.robot-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.route-list {
  display: flex;
  width: max-content;
  margin: 0;
  padding: 0;
  flex-direction: column;
  align-items: center;
  gap: 0;
  list-style: none;
  text-align: center;
}

.route-list a {
  display: block;
  width: max-content;
  color: var(--ink);
  font-size: clamp(0.96rem, 1.6vw, 1.08rem);
  line-height: 1.72;
  text-decoration: none;
}

.route-list a:hover,
.route-list a:focus-visible {
  color: var(--green);
}

.page-header {
  position: relative;
  z-index: 10;
  width: min(100% - 3rem, 64rem);
  margin: 0 auto;
  padding-top: max(1.25rem, env(safe-area-inset-top));
}

.home-link {
  display: inline-block;
  width: max-content;
  color: var(--green);
  font-size: 1rem;
  line-height: 1.6;
  text-decoration: none;
}

.content-shell {
  width: min(100% - 3rem, var(--measure));
  margin: 0 auto;
  padding: 6.5rem 0 7rem;
}

.page-title {
  margin: 0 0 3.5rem;
  color: var(--ink);
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.content-section {
  margin-top: 3.75rem;
}

.content-section:first-of-type {
  margin-top: 0;
}

.content-section > h2,
.project-block > h2 {
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  line-height: 1.45;
  text-transform: uppercase;
}

.content-section p,
.project-block p,
.work-entry p,
.legal-copy p,
.legal-copy li {
  color: var(--ink);
  font-size: 0.94rem;
}

.content-section p,
.project-block p,
.work-entry p {
  margin: 0 0 1.25rem;
}

.lead {
  color: var(--ink) !important;
  font-size: clamp(1rem, 2.1vw, 1.13rem) !important;
  line-height: 1.8;
}

.muted {
  color: var(--muted) !important;
}

.fact-list,
.meta-list,
.download-list,
.skill-list,
.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fact-list {
  border-top: 1px solid var(--rule);
}

.fact-list li {
  display: grid;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
  grid-template-columns: 9rem 1fr;
  gap: 1.2rem;
  font-size: 0.85rem;
}

.fact-list strong {
  color: var(--muted);
  font-weight: 400;
}

.skill-columns {
  display: grid;
  border-top: 1px solid var(--rule);
  grid-template-columns: repeat(3, 1fr);
}

.skill-group {
  padding: 1.15rem 1.25rem 0 0;
  border-right: 1px solid var(--rule);
}

.skill-group + .skill-group {
  padding-left: 1.25rem;
}

.skill-group:last-child {
  border-right: 0;
}

.skill-group h3 {
  min-height: 2.6em;
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.skill-list li {
  margin-bottom: 0.45rem;
  color: var(--ink);
  font-size: 0.77rem;
  line-height: 1.45;
}

.work-list {
  border-top: 1px solid var(--rule-strong);
}

.work-entry {
  display: grid;
  padding: 2.15rem 0 2.4rem;
  border-bottom: 1px solid var(--rule);
  grid-template-columns: 11rem 1fr;
  gap: 2rem;
}

.work-meta {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.6;
}

.work-meta time,
.work-meta span {
  display: block;
}

.work-entry h2,
.work-entry h3 {
  margin: 0 0 0.9rem;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.5;
}

.project-block {
  padding: 2.5rem 0 3rem;
  border-bottom: 1px solid var(--rule);
}

.project-block:first-child {
  padding-top: 2rem;
}

.project-name-line {
  display: flex;
  margin-bottom: 1.25rem;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.project-name-line h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  text-transform: none;
}

.project-state {
  color: var(--green);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.meta-list {
  display: grid;
  margin: 1.8rem 0;
  border-top: 1px solid var(--rule);
  grid-template-columns: repeat(3, 1fr);
}

.meta-list li {
  padding: 0.85rem 0.8rem 0.85rem 0;
  border-right: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.55;
}

.meta-list li + li {
  padding-left: 0.8rem;
}

.meta-list li:last-child {
  border-right: 0;
}

.meta-list strong,
.meta-list span {
  display: block;
}

.meta-list strong {
  margin-bottom: 0.2rem;
  color: var(--ink);
  font-weight: 400;
}

.text-action,
.download-list a {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  color: var(--green);
  font-size: 0.83rem;
  text-decoration: none;
}

.text-action::after {
  content: " ↗";
}

.download-list {
  border-top: 1px solid var(--rule-strong);
}

.download-list li {
  border-bottom: 1px solid var(--rule);
}

.download-list a {
  display: flex;
  width: 100%;
  padding: 1rem 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.download-list a::after {
  color: var(--muted);
  content: "↓ PDF";
  font-size: 0.7rem;
}

.cv-summary {
  display: grid;
  border-top: 1px solid var(--rule);
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.cv-summary section {
  padding: 1.3rem 1.5rem 0 0;
  border-right: 1px solid var(--rule);
}

.cv-summary section + section {
  padding-right: 0;
  padding-left: 1.5rem;
  border-right: 0;
}

.cv-summary h3 {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.cv-summary li {
  margin-bottom: 0.35rem;
  color: var(--ink);
  font-size: 0.78rem;
}

.contact-block {
  padding-top: 0.5rem;
}

.email-link {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  color: var(--green);
  font-size: clamp(0.9rem, 2.8vw, 1.3rem);
  overflow-wrap: anywhere;
}

.contact-list {
  display: flex;
  margin-top: 2rem;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  color: var(--muted);
  font-size: 0.77rem;
}

.legal-copy h2 {
  margin: 3rem 0 1rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.legal-copy h3 {
  margin: 2rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.legal-copy ul {
  padding-left: 1.3rem;
}

.error-page .content-shell {
  display: grid;
  min-height: 100svh;
  padding-top: 5rem;
  place-content: center;
}

.error-code {
  margin: 0;
  color: var(--green);
  font-size: clamp(4rem, 20vw, 9rem);
  font-weight: 400;
  letter-spacing: -0.12em;
  line-height: 0.85;
}

.error-page h1 {
  margin: 1.75rem 0 0.7rem;
  font-size: 1rem;
  font-weight: 500;
}

.error-page p {
  max-width: 36rem;
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer {
  width: min(100% - 3rem, var(--measure));
  margin: 0 auto;
  padding: 1.3rem 0 2rem;
  color: var(--quiet);
  font-size: 0.69rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
}

.site-footer a {
  width: max-content;
}

@media (max-width: 43rem) {
  .language-switch {
    top: max(1.1rem, env(safe-area-inset-top));
    right: max(1.1rem, env(safe-area-inset-right));
  }

  .home-main {
    padding: 3.1rem 1rem;
  }

  .home-stack {
    gap: 0.8rem;
  }

  .robot-stage {
    width: calc(100vw - 1.5rem);
    height: min(20rem, 46svh);
    min-height: 14.5rem;
  }

  .route-list a {
    font-size: 0.93rem;
    line-height: 1.58;
  }

  .page-header,
  .content-shell,
  .site-footer {
    width: min(100% - 2rem, var(--measure));
  }

  .content-shell {
    padding: 5.25rem 0 5.5rem;
  }

  .page-title {
    margin-bottom: 2.7rem;
  }

  .fact-list li,
  .work-entry {
    grid-template-columns: 1fr;
  }

  .fact-list li,
  .work-entry {
    gap: 0.55rem;
  }

  .work-entry {
    padding: 1.65rem 0 1.9rem;
  }

  .skill-columns,
  .meta-list,
  .cv-summary {
    grid-template-columns: 1fr;
  }

  .skill-group,
  .skill-group + .skill-group,
  .meta-list li,
  .meta-list li + li,
  .cv-summary section,
  .cv-summary section + section {
    padding: 1rem 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .skill-group h3 {
    min-height: 0;
  }

  .meta-list li:last-child,
  .cv-summary section:last-child {
    border-bottom: 0;
  }
}

@media (max-height: 39rem) and (orientation: landscape) {
  .home-stack {
    flex-direction: row;
    gap: 1.2rem;
  }

  .robot-stage {
    width: min(18rem, 48vw);
    height: calc(100svh - 4rem);
    min-height: 14rem;
  }
}

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