/* ==========================================================================
   KAURI — feuille de style
   Thème sombre, une seule couleur d’accent, polices système.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Couleurs */
  --bg: #0b0d0d;
  --line: #1d2221;
  --line-strong: #2c3331;
  --text: #ecebe6;
  --text-2: #bcbfba;
  --text-3: #878c88;
  --accent: #5fc4b0;            /* bleu-vert « kauri » : liens, repères, animation */
  --accent-wash: rgba(95, 196, 176, 0.1);

  /* Typographie */
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text",
    "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", "JetBrains Mono", "Roboto Mono",
    Menlo, Consolas, "Liberation Mono", monospace;

  /* Mise en page */
  --maxw: 74rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --header-h: 3.75rem;
  --section-y: clamp(3.5rem, 7vw, 5.5rem);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.2s, text-decoration-color 0.2s;
}

a:hover {
  text-decoration-color: var(--accent);
}

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

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

address {
  font-style: normal;
}

.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;
}

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

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.6rem 0.9rem;
  background: var(--text);
  color: var(--bg);
  font: 500 0.875rem/1 var(--font-mono);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Étiquettes en chasse fixe, utilisées dans toute la page */
.eyebrow,
.section-label,
.site-nav a,
.lang-switch,
.nav-toggle,
.button,
.link-arrow,
.domain-num,
.stack dt,
.legal summary,
.legal dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Boutons et liens d’action
   -------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.75rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.button:hover {
  background: var(--accent-wash);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: 2.75rem;
  color: var(--text-2);
  text-decoration: none;
}

.link-arrow:hover {
  color: var(--text);
}

.link-arrow .arrow {
  color: var(--accent);
  transition: transform 0.2s;
}

@media (prefers-reduced-motion: no-preference) {
  .link-arrow:hover .arrow {
    transform: translateX(3px);
  }
}

/* --------------------------------------------------------------------------
   En-tête
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem 2.5rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding-block: 0.5rem;
  text-decoration: none;
}

.brand-symbol {
  width: 28px;
  height: 28px;
}

.brand-word {
  width: auto;
  height: 15px;
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
}

.site-nav a {
  display: inline-block;
  padding-block: 0.5rem;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a[aria-current="true"] {
  color: var(--text);
}

.site-nav a[aria-current="true"] {
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.6em;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--text-3);
}

.lang-switch button {
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.25rem;
  border: 0;
  background: none;
  color: var(--text-3);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: color 0.2s;
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button[aria-pressed="true"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.45em;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.5rem;
  padding: 0.25rem 0;
  border: 0;
  background: none;
  color: var(--text-2);
  cursor: pointer;
}

.nav-toggle-icon,
.nav-toggle-icon::before {
  display: block;
  width: 14px;
  height: 1px;
  background: currentColor;
  transition: transform 0.2s;
}

.nav-toggle-icon {
  position: relative;
  transform: translateY(-3px);
}

.nav-toggle-icon::before {
  content: "";
  position: absolute;
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  top: 0;
  transform: rotate(-90deg);
}

/* Sans JavaScript, le sélecteur de langue n’a pas d’effet : on le masque. */
html:not(.js) .lang-switch {
  display: none;
}

@media (max-width: 54em) {
  .lang-switch {
    margin-left: auto;
  }

  /* Sans JavaScript : la navigation passe simplement sous la marque. */
  html:not(.js) .header-inner {
    flex-wrap: wrap;
    padding-bottom: 0.5rem;
  }

  html:not(.js) .site-nav {
    width: 100%;
    margin-left: 0;
  }

  .js .nav-toggle {
    display: inline-flex;
  }

  .js .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .js .site-nav.is-open {
    display: block;
  }

  .js .site-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .js .site-nav li + li {
    border-top: 1px solid var(--line);
  }

  .js .site-nav a {
    display: block;
    padding-block: 0.9rem;
    font-size: 0.8125rem;
  }

  .js .site-nav a[aria-current="true"] {
    text-decoration: none;
  }
}

/* --------------------------------------------------------------------------
   Accueil
   -------------------------------------------------------------------------- */

.hero {
  padding-top: clamp(3.5rem, 8vw, 6rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.75rem;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: currentColor;
}

.hero-title {
  max-width: 24ch;
  font-size: clamp(2rem, 1.25rem + 3vw, 3.5rem);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.hero-title-muted {
  color: var(--text-3);
}

.lead {
  max-width: 62ch;
  margin-top: 2rem;
  color: var(--text-2);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  margin-top: 2.5rem;
}

/* Figure animée */
.flow {
  margin-top: clamp(2.25rem, 4vw, 3rem);
}

.flow-frame {
  border-block: 1px solid var(--line);
  padding-block: 0.75rem;
}

.flow-svg {
  width: 100%;
  height: 220px;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 40em) {
  .flow-svg {
    height: 270px;
  }
}

@media (min-width: 64em) {
  .flow-svg {
    height: 300px;
  }
}

/* La figure est entièrement dessinée par script.js. */
html:not(.js) .flow {
  display: none;
}

.flow-edge {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1;
  transition: stroke 0.25s, opacity 0.25s;
}

.flow-node {
  transition: opacity 0.25s;
}

.flow-node .dot {
  fill: var(--bg);
  stroke: var(--text-3);
  stroke-width: 1.25;
  transition: fill 0.25s, stroke 0.25s;
}

.flow-node.is-sink .dot {
  fill: var(--text-3);
}

.flow-node .halo {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0;
}

.flow-node .hit {
  fill: transparent;
  pointer-events: all;
}

.flow-svg text {
  fill: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  text-anchor: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 4px;
  stroke-linejoin: round;
  transition: fill 0.25s;
}

.flow-svg .flow-col {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.flow-svg:not(.has-labels) text {
  display: none;
}

.flow-packet {
  fill: var(--accent);
  transition: opacity 0.25s;
}

/* Survol d’un nœud : on isole son lignage (amont et aval). */
.is-tracing .flow-edge {
  opacity: 0.3;
}

.is-tracing .flow-edge.is-lit {
  stroke: var(--accent);
  opacity: 1;
}

.is-tracing .flow-node {
  opacity: 0.35;
}

.is-tracing .flow-node.is-lit {
  opacity: 1;
}

.is-tracing .flow-node.is-lit .dot {
  stroke: var(--accent);
}

.is-tracing .flow-node.is-lit text {
  fill: var(--text);
}

.flow-node.is-origin .dot {
  fill: var(--accent);
}

.is-tracing .flow-packet {
  opacity: 0.15;
}

.is-tracing .flow-packet.is-lit {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
  padding-block: var(--section-y);
  border-top: 1px solid var(--line);
}

.section-grid {
  display: grid;
  gap: 1.5rem 3rem;
}

.section-label {
  display: flex;
  gap: 0.9rem;
  color: var(--text-3);
}

.section-num {
  color: var(--accent);
}

@media (min-width: 60em) {
  .section-grid {
    grid-template-columns: 11rem minmax(0, 1fr);
  }

  .section-label {
    position: sticky;
    top: calc(var(--header-h) + 2.5rem);
    align-self: start;
    padding-top: 0.75rem;
  }
}

.section h2 {
  max-width: 26ch;
  margin-bottom: 1.25rem;
  font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.5rem);
  font-weight: 300;
  line-height: 1.18;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

.section h3 {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.005em;
}

.prose p,
.intro {
  max-width: 66ch;
  color: var(--text-2);
  text-wrap: pretty;
}

.prose p + p {
  margin-top: 0.85rem;
}

.intro {
  margin-bottom: 2.25rem;
}

/* Expertise ------------------------------------------------------------- */

.domain {
  display: grid;
  gap: 0.75rem 3rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}

.domain:last-child {
  border-bottom: 1px solid var(--line);
}

@media (min-width: 48em) {
  .domain {
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  }
}

.domain-num {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.domain-body p {
  max-width: 64ch;
  color: var(--text-2);
  text-wrap: pretty;
}

.domain-body .tags {
  margin-top: 1rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.8;
}

/* Technologies ---------------------------------------------------------- */

.stack-row {
  display: grid;
  gap: 0.35rem 2rem;
  padding-block: 0.95rem;
  border-top: 1px solid var(--line);
}

.stack-row:last-child {
  border-bottom: 1px solid var(--line);
}

@media (min-width: 40em) {
  .stack-row {
    grid-template-columns: 13rem minmax(0, 1fr);
  }
}

.stack dt {
  padding-top: 0.25rem;
  color: var(--text-3);
}

.inline-list {
  display: flex;
  flex-wrap: wrap;
  color: var(--text);
  font-size: 0.96875rem;
}

/* Le séparateur suit l’élément : au retour à la ligne, il reste en fin de ligne. */
.inline-list li:not(:last-child)::after {
  content: "·";
  margin-inline: 0.6em;
  color: var(--text-3);
}

/* Approche -------------------------------------------------------------- */

.principle {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}

.principle:last-child {
  border-bottom: 1px solid var(--line);
}

@media (min-width: 48em) {
  .principle {
    grid-template-columns: 5rem minmax(0, 1fr);
  }
}

.principle-num {
  color: var(--accent);
  font-size: 1.75rem;
  font-weight: 200;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.principle h3 {
  margin-bottom: 0.6rem;
  font-size: 1.25rem;
  font-weight: 400;
}

.principle p {
  max-width: 64ch;
  color: var(--text-2);
  text-wrap: pretty;
}

/* Contact --------------------------------------------------------------- */

.section-contact .intro {
  margin-bottom: 2.25rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
}

.contact-address {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-decoration: none;
}

.contact-address:hover {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Pied de page
   -------------------------------------------------------------------------- */

.site-footer {
  padding-block: 3.5rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

@media (min-width: 48em) {
  .footer-address {
    text-align: right;
  }
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.footer-brand img {
  width: 32px;
  height: 32px;
  opacity: 0.85;
}

.footer-name {
  color: var(--text);
  letter-spacing: 0.08em;
}

.site-footer a {
  color: var(--text-2);
}

.site-footer a:hover {
  color: var(--text);
}

.legal {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.legal summary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.25rem;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
}

.legal summary::-webkit-details-marker {
  display: none;
}

.legal summary::before {
  content: "+";
  width: 0.75rem;
  color: var(--accent);
}

.legal[open] summary::before {
  content: "−";
}

.legal summary:hover {
  color: var(--text);
}

.legal-body {
  display: grid;
  gap: 1.25rem 3rem;
  max-width: 60rem;
  margin-top: 1.25rem;
}

@media (min-width: 48em) {
  .legal-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.legal dt {
  margin-bottom: 0.35rem;
  color: var(--text-2);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   Page 404
   -------------------------------------------------------------------------- */

.notfound {
  display: grid;
  align-content: center;
  min-height: 100vh;
  min-height: 100svh;
  gap: 1.5rem;
  padding-block: 4rem;
}

.notfound h1 {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  font-weight: 300;
  line-height: 1.2;
}

.notfound p {
  color: var(--text-2);
}

/* --------------------------------------------------------------------------
   Réduction des animations
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
