:root {
  --bg: #202630;
  color-scheme: dark;
  --nav-bg: rgba(32, 38, 48, 0.96);
  --track: #4b5565;
  --surface: #2a3240;
  --border: #465164;
  --text: #f3f5f8;
  --muted: #c1cad7;
  --dim: #a8b4c5;
  --green: #28c840;
  --interaction-accent: #7b9cc8;
  --interaction-border: #526b8c;
  --yellow: #febc2e;
  --red: #ff5f57;
  --font: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: auto;
}

a { color: inherit; text-decoration: none; }

.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  background: var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.06s linear;
}

.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  width: 28px; height: 28px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transition: transform 0.14s ease;
}

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 3rem;
  transition: background 0.3s, border-bottom 0.3s;
}

.navbar.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(1px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.nav-logo span { color: var(--text); }

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.78rem;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px; height: 1px;
  background: var(--muted);
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  gap: 5rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 8rem 3rem 4rem;
}

.hero-left {
  flex: 1;
  animation: fadeup 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: blink-dot 2.5s ease infinite;
}

@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-name {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 1.4rem;
}

.hero-name em {
  font-style: normal;
  color: var(--muted);
}

.hero-desc {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 360px;
  line-height: 1.85;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.btn-main {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--bg);
  background: var(--text);
  padding: 0.6rem 1.4rem;
  border-radius: 100px;
  letter-spacing: 0.04em;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-main:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-ghost {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.btn-ghost:hover { color: var(--text); }

.hero-terminal {
  flex: 0 0 290px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  animation: fadeup 0.85s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.dot-r { width: 11px; height: 11px; border-radius: 50%; background: var(--red); }
.dot-y { width: 11px; height: 11px; border-radius: 50%; background: var(--yellow); }
.dot-g { width: 11px; height: 11px; border-radius: 50%; background: var(--green); }

.t-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--dim);
  margin: 0 auto;
}

.terminal-body {
  padding: 1.2rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 2;
}

.t-line { display: flex; }
.t-prompt { color: var(--muted); margin-right: 0.5rem; }
.t-cmd { color: var(--text); }
.t-out { color: var(--muted); padding-left: 1rem; display: block; font-size: 0.72rem; }
.t-cursor { color: var(--muted); animation: blink 1.6s ease-in-out 3; }

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.section { padding: 5rem 3rem; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.wrap { max-width: 1000px; margin: 0 auto; }

.section-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
}

.about-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.3rem; }
.about-role { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); margin-bottom: 1.5rem; }

.about-meta { display: flex; flex-direction: column; gap: 0.5rem; }
.about-meta span {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.about-meta span::before { content: '—'; color: var(--dim); }

.about-text { font-size: 0.88rem; color: var(--muted); line-height: 1.95; }
.about-text + .about-text { margin-top: 1rem; }

.activities-list {
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.95;
}

.activities-list li + li { margin-top: 0.75rem; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.skill-category {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem;
}

.skill-cat-title {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.4rem;
  color: var(--text);
}

.skill-list { display: flex; flex-direction: column; gap: 1rem; }
.skill-item { display: flex; flex-direction: column; gap: 0.35rem; }
.skill-name { font-size: 0.72rem; color: var(--muted); }

.skill-bar {
  height: 3px;
  background: var(--track);
  border-radius: 100px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0;
  background: var(--text);
  border-radius: 100px;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

.projects-list { display: flex; flex-direction: column; }

.project-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 2rem;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.2s;
}

.project-item:first-child { border-top: 1px solid var(--border); }

.project-num { font-family: var(--mono); font-size: 0.65rem; color: var(--dim); margin-bottom: 0.4rem; }
.project-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; letter-spacing: -0.02em; }
.project-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.7; max-width: 500px; }

.project-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  padding-top: 0.2rem;
}

.project-tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.15rem 0.6rem;
}

.project-status { font-family: var(--mono); font-size: 0.65rem; color: var(--yellow); }
.project-link { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }

.contact-intro { font-size: 0.88rem; color: var(--muted); line-height: 1.9; margin-bottom: 2.5rem; }

.contact-list { display: flex; flex-direction: column; }

.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  transition: opacity 0.2s;
}

.contact-item:first-child { border-top: 1px solid var(--border); }

.contact-name { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.contact-val { color: var(--text); font-size: 0.85rem; }
.contact-arrow { color: var(--dim); font-size: 0.8rem; transition: transform 0.2s; }

.footer {
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--dim);
}

@keyframes fadeup {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 800px) {
  .hero { flex-direction: column; gap: 3rem; padding-top: 6rem; }
  .hero-terminal { flex: none; width: 100%; }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer { flex-direction: column; gap: 0.5rem; text-align: center; }
}

@media (max-width: 640px) {
  .navbar { padding: 1.1rem 1.5rem; }
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    width: 220px; height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 2rem;
    gap: 1.8rem;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.35s;
  }
  .nav-links.open { transform: translateX(0); visibility: visible; }
  .nav-toggle { display: flex; z-index: 200; }
  .section { padding: 4rem 1.5rem; }
  /* Sur mobile, la section suit son contenu pour rapprocher le terminal. */
  .hero {
    min-height: auto;
    align-items: stretch;
    gap: 2.25rem;
    padding: 5rem 1.5rem 2.5rem;
  }
  .hero-left { width: 100%; }
  .project-item { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
}
/* Shared themes and controls. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #ccd3de;
  --text: #202938;
  --muted: #4c5b70;
  --dim: #59677a;
  --green: #187436;
  --interaction-accent: #3c638f;
  --interaction-border: #92a8c2;
  --yellow: #8a5900;
  --red: #c93830;
  --nav-bg: rgba(247, 248, 250, 0.96);
  --track: #d3dae4;
}
.navbar { gap: 1rem; background: var(--nav-bg); }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; z-index: 201; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.75rem;
  white-space: nowrap;
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { border-color: var(--muted); }
.theme-icon { font-size: 1.1rem; line-height: 1; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 5px; }
.nav-toggle { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.cursor, .cursor-ring { display: none; }
section[id] { scroll-margin-top: 6rem; }
/* Quiet, consistent feedback for the terminal and interactive cards. */
.hero-terminal, .project-item, .contact-item {
  position: relative;
  isolation: isolate;
  transition: translate 320ms cubic-bezier(0.22, 1, 0.36, 1),
    rotate 400ms ease, border-color 250ms ease, box-shadow 320ms ease,
    background-color 250ms ease;
}
.hero-terminal::before, .project-item::before, .contact-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--pointer-x, 50%) var(--pointer-y, 50%),
    color-mix(in srgb, var(--interaction-accent) 3%, transparent), transparent 75%);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity 300ms ease;
}
.project-item, .contact-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding-inline: 1.25rem;
}
.projects-list, .contact-list { gap: 0.75rem; }
.project-link {
  display: inline-block;
  transition: translate 250ms ease, color 250ms ease;
}
.contact-arrow { transition: translate 250ms ease, color 250ms ease; }
.terminal-bar { transition: border-color 250ms ease; }
.terminal-bar a {
  display: grid;
  place-items: center;
  min-width: 24px;
  min-height: 24px;
  border-radius: 50%;
}
.terminal-bar a .dot-r { transition: box-shadow 250ms ease; }
.hero-terminal:focus-within, .project-item:focus-visible, .contact-item:focus-visible {
  border-color: var(--interaction-border);
  box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
}
.hero-terminal:focus-within::before, .project-item:focus-visible::before,
.contact-item:focus-visible::before { opacity: 1; }
.project-item:focus-visible .project-link, .contact-item:focus-visible .contact-arrow {
  color: var(--interaction-accent);
}
@media (hover: hover) and (pointer: fine) {
  .hero-terminal:hover, .project-item:hover, .contact-item:hover {
    border-color: var(--interaction-border);
    box-shadow: 0 12px 28px rgb(0 0 0 / 16%);
    translate: 0 -3px;
  }
  .hero-terminal:hover { rotate: var(--terminal-tilt, 0deg); }
  .hero-terminal:hover::before, .project-item:hover::before,
  .contact-item:hover::before { opacity: 1; }
  .hero-terminal:hover .terminal-bar { border-color: var(--interaction-border); }
  .terminal-bar a:hover .dot-r { box-shadow: 0 0 0 4px rgb(255 95 87 / 15%); }
  .project-item:hover .project-link { translate: 4px 0; color: var(--interaction-accent); }
  .contact-item:hover .contact-arrow { translate: 3px -3px; color: var(--interaction-accent); }
}
.project-item:active, .contact-item:active {
  translate: 0 0;
  box-shadow: none;
  border-color: var(--interaction-border);
  background-color: var(--surface);
}
.comp-row { display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
@media (min-width: 641px) and (max-width: 1000px) {
  .navbar { padding-inline: 1.5rem; }
  .nav-links { gap: 1rem; }
}
@media (max-width: 640px) {
  .nav-links:not(.open) { visibility: hidden; }
  .nav-links.open { visibility: visible; }
  .contact-item { flex-wrap: wrap; gap: 0.4rem 1rem; }
  .contact-val { overflow-wrap: anywhere; }
  .comp-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-terminal, .project-item, .contact-item, .project-link, .contact-arrow {
    translate: none !important;
    rotate: none !important;
  }
}
