/* ==========================================================
   Vianney Gauvrit — portfolio
   ========================================================== */

:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --ink: #18181a;
  --ink-2: #3d3c40;
  --muted: #74717a;
  --line: #e7e3dc;
  --pill: #f0ede7;
  --accent: #3456a3;
  --accent-ink: #ffffff;
  --accent-soft: #e6ecf8;
  --green: #2f9e62;
  --shadow: 0 1px 2px rgb(20 20 30 / .04), 0 8px 24px -12px rgb(20 20 30 / .12);
  --radius: 14px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113;
    --surface: #19191c;
    --ink: #f3f2ef;
    --ink-2: #cfcdc8;
    --muted: #96939b;
    --line: #2a2a2f;
    --pill: #222226;
    --accent: #8aa6ec;
    --accent-ink: #0f1424;
    --accent-soft: #1d2540;
    --green: #4cc584;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111113;
  --surface: #19191c;
  --ink: #f3f2ef;
  --ink-2: #cfcdc8;
  --muted: #96939b;
  --line: #2a2a2f;
  --pill: #222226;
  --accent: #8aa6ec;
  --accent-ink: #0f1424;
  --accent-soft: #1d2540;
  --green: #4cc584;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { color: var(--ink); font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- Layout ---------- */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 96px 20px 160px;
}
.block { margin-top: 64px; }
.block > h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 14px; }
.hint { color: var(--muted); font-size: .85rem; margin: -8px 0 12px; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.4rem, 7vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 16px 0 4px;
}
.hero .title {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  line-height: 1.2;
  color: var(--accent);
  margin-bottom: 14px;
}
.hero h1 em, .display em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 32em; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 500; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
  padding: 5px 12px 5px 10px; border-radius: 999px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); position: relative; }
.dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green);
  animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }

.avatar { margin: 0; }
.avatar img {
  width: 132px; height: 132px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
}

.prose { color: var(--muted); font-size: 1rem; }
.prose strong { color: var(--ink); }

/* ---------- Chips & buttons ---------- */
.chip {
  display: inline-block; font-size: .78rem; font-weight: 600;
  padding: 4px 10px; border-radius: 8px;
}
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.chip-dark { background: var(--ink); color: var(--bg); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.actions.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 .92rem/1 var(--sans);
  padding: 12px 18px; border-radius: 12px; text-decoration: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn svg, .dock-btn svg {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.btn svg.fill, .dock-btn svg.fill { fill: currentColor; stroke: none; }

/* ---------- Callout ---------- */
.callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.callout::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), #6f8fd8 60%, var(--green));
}
.callout h2 { font-size: 1.35rem; font-weight: 700; margin-top: 10px; }
.facts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 20px 0 0;
}
.facts div { background: var(--pill); border-radius: 12px; padding: 12px 14px; }
.facts dt { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-weight: 600; font-size: .95rem; }

/* ---------- Lists (experience / education) ---------- */
.list { display: flex; flex-direction: column; gap: 4px; }
.list summary, .list .row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 10px;
  margin: 0 -10px;
  border-radius: 12px;
  cursor: pointer;
  list-style: none;
  transition: background-color .2s ease;
}
.list .row { cursor: default; }
.list summary::-webkit-details-marker { display: none; }
.list summary:hover { background: var(--pill); }
.logo {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 .8rem/1 var(--sans); letter-spacing: .02em;
  color: #fff;
  background: var(--c, var(--accent));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .15);
}
.logo-img { background: #fff; box-shadow: 0 0 0 1px var(--line); }
.logo-img img { width: 34px; height: auto; }
.meta { display: flex; flex-direction: column; min-width: 0; }
.name { font-weight: 600; font-size: .95rem; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.name::after {
  content: "›"; color: var(--muted); font-weight: 500;
  transition: transform .2s ease, opacity .2s ease; opacity: 0;
}
.list summary:hover .name::after { opacity: 1; transform: translateX(2px); }
details[open] .name::after { opacity: 1; transform: rotate(90deg); }
.tag {
  font-size: .68rem; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px;
}
.role { font-size: .82rem; color: var(--muted); }
.date { font-size: .82rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.more {
  padding: 4px 0 14px 58px;
  color: var(--ink-2);
  font-size: .9rem;
  display: grid; gap: 8px;
}
details[open] .more { animation: open .35s ease; }
@keyframes open { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Skills ---------- */
.skills { display: grid; gap: 18px; }
.skill-row { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: start; }
.skill-row h3 {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding-top: 8px;
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills li {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .84rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line);
  padding: 5px 12px 5px 9px; border-radius: 999px;
  transition: transform .15s ease, border-color .2s ease;
}
.pills li:hover { transform: translateY(-1px); border-color: var(--muted); }
.e { font-size: .95rem; line-height: 1; }
.code {
  font: 700 .62rem/1 var(--sans); letter-spacing: .04em;
  background: var(--accent-soft); color: var(--accent);
  padding: 4px 5px; border-radius: 5px;
}

/* ---------- Feature (engagements) ---------- */
.feature { margin-top: 112px; }
.feature-head { text-align: center; max-width: 560px; margin: 0 auto 40px; }
.display, .block > h2.display {
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 800; letter-spacing: -0.045em;
  margin: 14px 0 14px;
}
.feature-head p { color: var(--muted); font-size: 1.05rem; }

.timeline { position: relative; display: grid; gap: 24px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px;
  background: var(--line);
}
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: 20px; position: relative; }
.t-dot {
  width: 12px; height: 12px; border-radius: 50%; margin-top: 5px;
  background: var(--bg); border: 2px solid var(--accent);
  position: relative; z-index: 1;
}
.timeline li:first-child .t-dot { background: var(--accent); }
.t-date { font-size: .8rem; color: var(--muted); font-weight: 500; }
.t-body h3 { font-size: 1.02rem; font-weight: 650; margin: 2px 0 6px; }
.t-body p:last-child { color: var(--ink-2); font-size: .92rem; }

/* ---------- Cards (interests) ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-ico { font-size: 1.6rem; display: block; margin-bottom: 10px; }
.card h3 { font-size: 1rem; font-weight: 650; margin-bottom: 4px; }
.card p { color: var(--muted); font-size: .88rem; }

/* ---------- Contact ---------- */
.contact > p { color: var(--muted); max-width: 34em; }

.foot { margin-top: 80px; text-align: center; color: var(--muted); font-size: .8rem; }

/* ---------- Dock ---------- */
.dock {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 6px; border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / .25);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  z-index: 50;
}
.dock-btn {
  position: relative;
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--ink); background: transparent; border: 0; cursor: pointer; text-decoration: none;
  transition: background-color .2s ease, transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.dock-btn:hover { background: var(--pill); transform: translateY(-4px) scale(1.12); }
.dock-btn::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translate(-50%, 4px);
  background: var(--ink); color: var(--bg); font: 500 .72rem/1 var(--sans);
  padding: 6px 8px; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease;
}
.dock-btn:hover::after, .dock-btn:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.dock-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* ---------- Reveal animation ---------- */
.js .reveal {
  opacity: 0; filter: blur(6px); transform: translateY(8px);
  transition: opacity .6s ease, filter .6s ease, transform .6s ease;
  transition-delay: var(--d, 0s);
}
.js .reveal.in { opacity: 1; filter: none; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; filter: none; transform: none; transition: none; }
  .dot::after { animation: none; }
  .dock-btn:hover, .btn:hover, .card:hover, .pills li:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .page { padding: 56px 16px 140px; }
  .block { margin-top: 52px; }
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .avatar { order: -1; }
  .avatar img { width: 96px; height: 96px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .callout { padding: 22px 18px; }
  .list summary, .list .row { grid-template-columns: 40px 1fr; gap: 2px 12px; align-items: start; }
  .list .logo { width: 40px; height: 40px; grid-row: span 2; }
  .date { grid-column: 2; font-size: .78rem; }
  .name::after { display: none; }
  .more { padding-left: 52px; }
  .skill-row { grid-template-columns: 1fr; gap: 8px; }
  .skill-row h3 { padding-top: 0; }
  .cards { grid-template-columns: 1fr; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
}
