/* ── Design tokens ─────────────────────────────────────── */
:root {
  --bg: #F7F8FC;
  --surface: #FFFFFF;
  --text: #111827;
  --muted: #6B7280;
  --subtle: #9CA3AF;
  --line: #E5E7EB;
  --accent: #0a66c2;
  --accent-2: #0077b5;
  --accent-hover: #084f95;
  --accent-tint: rgba(10, 102, 194, 0.07);
  --accent-glow: rgba(10, 102, 194, 0.18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --radius-sm: 12px;
  --header-h: 60px;
}

body[data-theme="dark"] {
  --bg: #0C0F1A;
  --surface: #131929;
  --text: #E8EDF5;
  --muted: #94A3B8;
  --subtle: #64748B;
  --line: #1E2D48;
  --accent: #1a73e8;
  --accent-2: #0077b5;
  --accent-hover: #1558b3;
  --accent-tint: rgba(26, 115, 232, 0.1);
  --accent-glow: rgba(26, 115, 232, 0.22);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.7);
}

/* ── Reset & base ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  margin: 0;
  font-family: "Space Grotesk", "Inter", sans-serif;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

p { margin: 0; }
a { color: inherit; }

/* ── Background texture ────────────────────────────────── */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: radial-gradient(circle, rgba(100, 116, 139, 0.09) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.04) 50%, transparent 100%);
}

/* ── Shell ──────────────────────────────────────────────── */
.shell {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

/* ── Site header ────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 max(calc((100vw - 1100px) / 2), 4vw);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex-shrink: 0;
}

.nav {
  display: flex;
  gap: 0.1rem;
  flex: 1;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 6px;
  padding: 0.38rem 0.7rem;
  position: relative;
  transition: color 0.2s;
}

.nav a::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: calc(100% - 1.4rem);
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform 0.22s ease;
  transform-origin: center;
}

.nav a:hover { color: var(--text); }
.nav a.is-active { color: var(--accent); }

.nav a:hover::after,
.nav a.is-active::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-controls {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
  flex-shrink: 0;
}

.control {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.control:hover {
  color: var(--text);
  border-color: var(--subtle);
  background: var(--accent-tint);
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(3rem, 8vw, 8rem);
  padding: calc(var(--header-h) + 3rem) max(calc((100vw - 1100px) / 2), 4vw) 4rem;
  flex-wrap: wrap;
}

.hero-visual {
  flex-shrink: 0;
}

/* Profile container */
.profile-container {
  position: relative;
  width: 220px;
  height: 220px;
  flex-shrink: 0;
}

/* Circular avatar */
.avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 128px;
  height: 128px;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  box-shadow: 0 8px 40px var(--accent-glow);
  border: 3px solid var(--surface);
  outline: 2px solid var(--line);
  transition: box-shadow 0.3s ease;
  display: block;
}

.avatar:hover {
  box-shadow: 0 10px 50px var(--accent-glow), 0 0 0 5px var(--accent-tint);
}

/* Orbit icons */
.orbit-icon {
  position: absolute;
  width: 36px;
  height: 36px;
  left: 50%;
  top: 50%;
  margin-left: -18px;
  margin-top: -18px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  cursor: default;
}

.orbit-icon img {
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  object-fit: contain;
  pointer-events: none;
  display: block;
}

@keyframes orbit1 {
  from { transform: rotate(0deg)   translateX(82px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(82px) rotate(-360deg); }
}
@keyframes orbit2 {
  from { transform: rotate(72deg)  translateX(82px) rotate(-72deg); }
  to   { transform: rotate(432deg) translateX(82px) rotate(-432deg); }
}
@keyframes orbit3 {
  from { transform: rotate(144deg) translateX(82px) rotate(-144deg); }
  to   { transform: rotate(504deg) translateX(82px) rotate(-504deg); }
}
@keyframes orbit4 {
  from { transform: rotate(216deg) translateX(82px) rotate(-216deg); }
  to   { transform: rotate(576deg) translateX(82px) rotate(-576deg); }
}
@keyframes orbit5 {
  from { transform: rotate(288deg) translateX(82px) rotate(-288deg); }
  to   { transform: rotate(648deg) translateX(82px) rotate(-648deg); }
}

.orbit-icon-1 { animation: orbit1 32s linear infinite; }
.orbit-icon-2 { animation: orbit2 40s linear infinite reverse; }
.orbit-icon-3 { animation: orbit3 48s linear infinite; }
.orbit-icon-4 { animation: orbit4 35s linear infinite reverse; }
.orbit-icon-5 { animation: orbit5 43s linear infinite; }

/* Hero text */
.hero-text {
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.hero-text h1 {
  font-size: clamp(2.6rem, 5.5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.08;
  color: var(--text);
  margin: 0;
}

.hero-line {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
  margin: -0.25rem 0 0;
}

.hero-sub {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 44ch;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  align-self: flex-start;
  transition: box-shadow 0.25s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.cta-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.12);
  opacity: 0;
  transition: opacity 0.2s;
}

.cta-btn:hover {
  box-shadow: 0 6px 24px var(--accent-glow);
  transform: translateY(-2px);
}

.cta-btn:hover::before { opacity: 1; }

/* ── Section tag label ───────────────────────────────────── */
.section-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtle);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

/* ── Projects ────────────────────────────────────────────── */
.section-projects {
  padding: 5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-header {
  margin-bottom: 1.5rem;
}

.project-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s, border-color 0.3s;
}

.project-item::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.3s;
}

.project-item:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(10, 102, 194, 0.2);
}

.project-item:hover::before { opacity: 1; }

/* Alternate layout on even items */
.project-item:nth-child(even) { direction: rtl; }
.project-item:nth-child(even) > * { direction: ltr; }

.project-visual {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--accent-tint), var(--line));
  position: relative;
}

.project-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.project-item:hover .project-visual img {
  transform: scale(1.03);
}

.project-visual.img-missing {
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-visual.img-missing::after {
  content: "Screenshot à venir";
  font-size: 0.78rem;
  color: var(--subtle);
  font-weight: 500;
}

.project-visual.img-missing img { display: none; }

/* Code preview for Cluedo */
.project-visual--code {
  background: #0d1117;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fira Code", "Cascadia Code", "Consolas", monospace;
}

.code-preview {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: clamp(0.72rem, 1.4vw, 0.875rem);
  line-height: 1.6;
  padding: 1.5rem;
  user-select: none;
}

.code-preview span   { color: #e6edf3; }
.code-preview em     { color: #7ee787; font-style: normal; }
.code-preview strong { color: #a5d6ff; font-weight: normal; }

.project-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-num {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.project-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
}

.project-desc {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
  max-width: 44ch;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-tags span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--subtle);
  background: var(--accent-tint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
  gap: 0.25rem;
  padding: 0.5rem 0;
  transition: gap 0.2s;
  align-self: flex-start;
}

.project-link:hover { gap: 0.5rem; }

/* ── About ───────────────────────────────────────────────── */
.section-about {
  padding: 0 0 5rem;
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  padding: 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.about-lead {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text);
  margin-top: 0.5rem;
}

.about-body {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

.about-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.about-meta span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--accent-tint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

/* Skills inside about */
.about-skills {
  display: flex;
  flex-direction: column;
}

.skill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: flex-start;
  padding: 0.9rem 0;
}

.skill-group + .skill-group {
  border-top: 1px solid var(--line);
}

.skill-label {
  width: 100%;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 0.2rem;
  display: block;
}

.skill-group span:not(.skill-label) {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  background: var(--surface);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  cursor: default;
}

.skill-group span:not(.skill-label):hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-tint);
}

/* ── Experience ──────────────────────────────────────────── */
.section-experience {
  padding: 0 0 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.xp-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.xp-item {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.4rem 1.75rem;
  transition: background 0.2s;
}

.xp-item + .xp-item {
  border-top: 1px solid var(--line);
}

.xp-item:hover { background: var(--accent-tint); }

.xp-left { display: flex; flex-direction: column; gap: 0.15rem; }

.xp-company {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin: 0;
}

.xp-role {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

.xp-period {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  margin: 0;
}

.xp-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* ── Contact ─────────────────────────────────────────────── */
.section-contact {
  padding: 5rem 0 6rem;
  text-align: center;
  border-top: 1px solid var(--line);
}

.contact-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.contact-heading {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 22ch;
  margin: 0;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.contact-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 1.15rem;
  background: var(--surface);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.contact-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-tint);
}

.contact-links a:first-child {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
  position: relative;
  overflow: hidden;
}

.contact-links a:first-child::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0;
  transition: opacity 0.2s;
}

.contact-links a:first-child:hover {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 18px var(--accent-glow);
}

.contact-links a:first-child:hover::before { opacity: 1; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 0.78rem;
}

/* ── Reveal animation ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 2.5rem;
    min-height: 100dvh;
    padding-top: calc(var(--header-h) + 2rem);
  }

  .hero-sub { max-width: 100%; }
  .cta-btn  { align-self: center; }

  .project-item {
    grid-template-columns: 1fr;
    direction: ltr !important;
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .project-item:nth-child(even) { direction: ltr; }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem;
  }

  .xp-item {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding: 1rem 1.25rem;
  }
}

@media (max-width: 560px) {
  .nav { gap: 0; }
  .nav a { font-size: 0.78rem; padding: 0.35rem 0.45rem; }

  .section-projects,
  .section-about,
  .section-experience {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}
