/* Blanc sur noir par défaut ; le bouton d'inversion pose data-theme="light" sur <html>. */
:root {
  --bg: #0c0c0c;
  --fg: #f0efec;
  --muted: #9a9893;
  --line: #262624;
  --accent: #9cc0e6;
  --w: 46rem;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
          "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fbfbfa;
  --fg: #1d1d1b;
  --muted: #6b6a66;
  --line: #e6e5e1;
  --accent: #2f5d8a;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

:lang(ja) body,
body:lang(ja) {
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  line-height: 1.8;
}

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

a { color: inherit; }

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

h1, h2, h3, p, ul { margin: 0; }

/* ---------- Mise en page ---------- */

.page,
.top {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Langues et inversion ---------- */

.top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .5rem;
  padding-top: 1.25rem;
}

.langs {
  display: flex;
  gap: .25rem;
}

.langs button,
.theme {
  font: inherit;
  font-size: .8rem;
  color: var(--muted);
  background: none;
  border: 0;
  padding: .25rem .5rem;
  cursor: pointer;
  border-radius: 4px;
}

.langs button:hover,
.theme:hover { color: var(--fg); }

.theme {
  display: grid;
  place-items: center;
  height: 1.75rem;
  padding: 0 .25rem 0 .75rem;
  border-left: 1px solid var(--line);
  border-radius: 0;
}

.theme svg {
  width: 1rem;
  height: 1rem;
  transition: transform .35s ease;
}

:root[data-theme="light"] .theme svg { transform: rotate(180deg); }

.langs button[aria-pressed="true"] {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: .3em;
}

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

.intro {
  display: grid;
  grid-template-columns: 6rem 1fr;
  align-items: center;
  gap: 1.75rem;
  padding: 3rem 0 2.75rem;
  border-bottom: 1px solid var(--line);
}

.portrait {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line);
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.015em;
}

h1 .alt {
  display: block;
  margin-top: .2rem;
  font-size: .95rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

.lead {
  margin-top: .35rem;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.25rem;
  margin-top: 1rem;
}

.links a {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: .3em;
  transition: color .15s, text-decoration-color .15s;
}

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

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

.block {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--line);
}

.block h2 {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: .3rem;
}

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

strong { font-weight: 600; }

/* ---------- Expérience, formation ---------- */

.entry + .entry { margin-top: 2rem; }

.when {
  font-size: .85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.entry h3 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.where {
  color: var(--muted);
  font-size: .95rem;
}

.entry > p:not(.when):not(.where):not(.aside) { margin-top: .4rem; }

.entry ul {
  margin-top: .6rem;
  padding-left: 1.1rem;
}

.entry li + li { margin-top: .3rem; }

.entry li::marker { color: var(--muted); }

.aside {
  margin-top: .8rem;
  font-size: .9rem;
  color: var(--muted);
}

/* ---------- Compétences ---------- */

.sub {
  font-size: .95rem;
  font-weight: 600;
  margin: 2rem 0 .5rem;
}

.sub:first-child { margin-top: 0; }

.rows {
  list-style: none;
  padding: 0;
}

.rows li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .1rem 1rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
}

.rows li:first-child { border-top: 1px solid var(--line); }

.rows strong { font-weight: 500; }

.rows span {
  margin-left: auto;
  color: var(--muted);
  text-align: right;
}

.sub + p { margin-bottom: .9rem; }

.tags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.tags li {
  font-size: .85rem;
  line-height: 1.4;
  padding: .3rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}

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

.foot {
  padding: 2rem 0 3rem;
  font-size: .85rem;
  color: var(--muted);
}

/* ---------- Petits écrans ---------- */

@media (max-width: 40rem) {
  .page,
  .top { padding-left: 1rem; padding-right: 1rem; }

  .intro {
    grid-template-columns: 4.5rem 1fr;
    align-items: start;
    gap: 1.1rem;
    padding: 2rem 0;
  }

  .portrait { width: 4.5rem; height: 4.5rem; }

  h1 { font-size: 1.6rem; }

  .block {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 2rem 0;
  }

  .block h2 { padding-top: 0; }
}

/* ---------- Impression ---------- */

@media print {
  :root, :root[data-theme="light"] { --bg: #fff; --fg: #000; --muted: #555; --line: #ddd; color-scheme: light; }
  .top { display: none; }
  .intro { padding-top: 0; }
  .block { break-inside: avoid; padding: 1.25rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
