:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --surface-hover: #0f3460;
  --accent: #e94560;
  --text: #e0e0e0;
  --muted: #9aa0b5;
  --faint: #7f8598;
  --border: #2a2f4a;
  --radius: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  font-family: system-ui, sans-serif;
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.masthead {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.35rem;
}

.identity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.identity-row h1 {
  margin: 0;
  min-width: 0;
}

.lang-toggle {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex-shrink: 0;
  width: 5.7rem;
  height: 2.05rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #12122a;
  box-shadow: inset 0 0 0 1px rgba(233, 69, 96, 0.28);
  cursor: pointer;
}

.lang-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.lang-toggle-knob {
  position: absolute;
  z-index: 0;
  top: 3px;
  left: 3px;
  width: calc(50% - 4px);
  height: calc(100% - 6px);
  border-radius: 999px;
  background: linear-gradient(180deg, #ff7a8c, var(--accent));
  box-shadow: 0 4px 16px rgba(233, 69, 96, 0.4);
  transition: transform 0.32s cubic-bezier(.22, 1.15, .36, 1);
}

html[data-lang="fr"] .lang-toggle-knob {
  transform: translateX(calc(100% + 2px));
}

.lang-toggle-opt {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--muted);
  transition: color 0.2s ease;
  user-select: none;
}

html:not([data-lang="fr"]) .lang-toggle-opt:nth-child(2),
html[data-lang="fr"] .lang-toggle-opt:nth-child(3) {
  color: #fff;
}

h1 {
  color: var(--accent);
  margin: 0 0 0.35rem;
  font-size: 1.85rem;
}

.sub {
  color: var(--muted);
  margin: 0;
}

h2.section {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

h2.section a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
}

h2.section a:hover {
  color: var(--accent);
}

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

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.15rem;
  margin: 0.7rem 0;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem 1rem;
}

.card-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--accent);
}

.card-head h3 .emoji {
  margin-right: 0.35rem;
  font-size: 1.05rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  font-size: 0.9rem;
}

.note {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

details {
  margin-top: 0.65rem;
  border-top: 1px solid var(--border);
  padding-top: 0.45rem;
}

summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.88rem;
  list-style: none;
  user-select: none;
}

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

summary::before {
  content: "▸ ";
  color: var(--accent);
}

details[open] summary::before { content: "▾ "; }

details[open] summary .closed { display: none; }
details:not([open]) summary .open { display: none; }

.detail {
  margin: 0.65rem 0 0;
  font-size: 0.92rem;
  color: #c5c9d8;
}

.detail p { margin: 0 0 0.65rem; }
.detail p:last-of-type { margin-bottom: 0; }

.stack {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: var(--faint);
}

footer {
  margin-top: 2.5rem;
  font-size: 0.82rem;
  color: var(--faint);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 1.75rem;
}

.quick-links-row {
  display: grid;
  gap: 0.55rem;
}

.quick-links-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-links-row.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  color: var(--text);
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-right: 3px solid var(--accent);
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  text-decoration: none;
  min-height: 3.05rem;
  text-align: center;
}

.contact-item:hover {
  background: var(--surface-hover);
  color: #fff;
  text-decoration: none;
}

.contact-item .picto {
  font-size: 1.2rem;
  line-height: 1;
  width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.contact-item .item-text {
  font-size: 0.84rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.picto-svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  fill: currentColor;
}

.picto-svg.linkedin { fill: #0a66c2; }
.picto-svg.forgejo { fill: #fb923c; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .quick-links-row.three,
  .quick-links-row.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  body { padding: 1.4rem 1rem 2.5rem; }
  h1 { font-size: 1.45rem; }
  .card-head { flex-direction: column; align-items: flex-start; }
}
