/* Portfolio Dorian Cavoit — CSS sans framework, mobile d'abord, thème clair/sombre automatique */

:root {
  --navy: #1e2a4f;
  --navy-2: #2b3a67;
  --crimson: #c8324f;
  --crimson-soft: #f7dfe4;
  --bg: #f7f8fc;
  --bg-alt: #eef1f8;
  --surface: #ffffff;
  --text: #171a2c;
  --muted: #5d637c;
  --border: #dde1ee;
  --chip: #e9ecf6;
  --chip-text: #2b3a67;
  --shadow: 0 1px 2px rgb(20 24 60 / 6%), 0 12px 32px rgb(20 24 60 / 7%);
  --radius: 18px;
  --container: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1222;
    --bg-alt: #131833;
    --surface: #181d38;
    --text: #e9ecf8;
    --muted: #a2a8c4;
    --border: #2a3156;
    --chip: #232a4d;
    --chip-text: #c9d1f5;
    --crimson: #ff5a78;
    --crimson-soft: #3a1a24;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 1.25rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.muted { color: var(--muted); font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.top-anchor { position: absolute; top: 0; left: 0; width: 1px; height: 1px; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--navy); color: #fff; border-radius: 10px; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--crimson); outline-offset: 3px; border-radius: 6px; }

/* En-tête */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark { width: 22px; fill: var(--crimson); }
.nav-menu { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-menu a { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav-menu a:hover, .nav-menu a.active { color: var(--text); background: var(--chip); }
.nav-menu .nav-cta { background: var(--navy); color: #fff; }
.nav-menu .nav-cta:hover { background: var(--navy-2); color: #fff; }
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-toggle { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
  .nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; position: relative; transition: transform .2s; }
  .nav-toggle-bar::before, .nav-toggle-bar::after { content: ''; position: absolute; left: 0; }
  .nav-toggle-bar::before { top: -6px; }
  .nav-toggle-bar::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }
  .nav-menu {
    position: absolute; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 16px 18px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    display: none;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 12px 14px; }
}

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 12px; font-weight: 600; text-decoration: none;
  border: 1.5px solid transparent; transition: transform .15s, background-color .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--crimson); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--crimson) 88%, #000); }
.btn-ghost { border-color: var(--border); background: var(--surface); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-light { background: #fff; color: var(--navy); }
.btn-outline-light { border-color: rgb(255 255 255 / 45%); color: #fff; }
.btn-outline-light:hover { border-color: #fff; }

/* Accueil */
.hero { padding: clamp(48px, 9vw, 110px) 0 clamp(56px, 8vw, 96px); position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -40% -20% auto auto; width: 70vw; height: 70vw; max-width: 820px; max-height: 820px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--navy-2) 22%, transparent), transparent);
  pointer-events: none; z-index: -1;
}
.hero-grid { display: grid; grid-template-columns: 1.75fr 1fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .88rem; font-weight: 600; color: var(--muted); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #1fa971; box-shadow: 0 0 0 4px rgb(31 169 113 / 18%); }
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.5rem); margin: 22px 0 18px; }
.accent { color: var(--crimson); }
.lead { font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--muted); max-width: 52ch; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 22px 0 30px; color: var(--muted); font-size: .95rem; }
.hero-facts strong { color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-photo { justify-self: center; position: relative; }
.hero-photo::before { content: ''; position: absolute; inset: -14px; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--crimson) 45%, transparent); }
.hero-photo img { width: min(320px, 70vw); aspect-ratio: 1; object-fit: cover; border-radius: 50%; box-shadow: var(--shadow); }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-photo { order: -1; }
  .hero-photo img { width: 180px; }
}

/* Sections */
.section { padding: clamp(64px, 9vw, 104px) 0; }
.section-alt { background: var(--bg-alt); }
.section-kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--crimson); margin-bottom: .6rem; }
.section-intro { color: var(--muted); max-width: 62ch; margin-bottom: 2.5rem; }

.about-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; align-items: start; }
.about-text p { font-size: 1.05rem; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; gap: 8px; } }

/* Compétences */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.skill-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.skill-card h3 { margin-bottom: 14px; }
.skill-card-highlight { border-color: color-mix(in srgb, var(--crimson) 45%, var(--border)); background: linear-gradient(160deg, var(--crimson-soft), var(--surface) 60%); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li { padding: 5px 12px; border-radius: 999px; background: var(--chip); color: var(--chip-text); font-size: .88rem; font-weight: 600; }
.chips-small li { font-size: .8rem; padding: 4px 10px; }

/* Parcours */
.timeline { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 2px solid var(--border); }
.timeline-item { position: relative; padding: 0 0 34px; }
.timeline-item::before { content: ''; position: absolute; left: -36px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--navy-2); box-shadow: 0 0 0 5px var(--bg); }
.timeline-item:first-child::before { background: var(--crimson); }
.timeline-item-edu::before { background: var(--muted); }
.timeline-date { font-size: .85rem; font-weight: 700; color: var(--crimson); margin-bottom: .3rem; }
.timeline-item h3 { margin-bottom: .45rem; }
.timeline-item p:last-child { color: var(--muted); max-width: 72ch; margin: 0; }

/* Projets */
.projects { display: grid; gap: 28px; }
.project {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0; align-items: stretch;
  background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); overflow: hidden; box-shadow: var(--shadow);
}
.project-reverse .project-visual { order: 2; }
.project-visual { position: relative; background: linear-gradient(140deg, var(--navy), var(--navy-2)); display: grid; place-items: center; min-height: 260px; }
.project-visual picture, .project-visual img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.project-visual-screen img { object-position: top left; }
.project-visual-rafy { background: linear-gradient(140deg, #26205e, #6d5dfc); }
.project-visual-rafy img { object-position: center; }
/* Mention honnête sur les captures réalisées avec des données fictives */
.demo-badge {
  position: absolute; left: 12px; bottom: 12px; padding: 4px 10px; border-radius: 999px;
  background: rgb(10 12 28 / 78%); color: #fff; font-size: .74rem; font-weight: 600; letter-spacing: .02em;
  backdrop-filter: blur(4px);
}
.project-body { padding: clamp(22px, 3vw, 34px); }
.project-tag { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--crimson); margin-bottom: .5rem; }
.project-body h3 { font-size: 1.5rem; margin-bottom: .6rem; }
.project-pitch { color: var(--muted); }
.project-points { margin: 0 0 1.2rem; padding-left: 1.1rem; font-size: .95rem; }
.project-points li { margin-bottom: .35rem; }
.project-points li::marker { color: var(--crimson); }

@media (max-width: 860px) {
  .project { grid-template-columns: 1fr; }
  .project-reverse .project-visual { order: 0; }
  .project-visual { min-height: 200px; }
}

/* Offres */
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.offer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.offer h3 { margin-bottom: .6rem; }
.offer p { color: var(--muted); margin: 0; font-size: .97rem; }
.offer-highlight { background: linear-gradient(160deg, var(--navy), var(--navy-2)); border-color: transparent; color: #fff; }
.offer-highlight p { color: rgb(255 255 255 / 80%); }

/* Contact */
.contact { background: linear-gradient(140deg, var(--navy), var(--navy-2)); color: #fff; text-align: center; }
.contact-inner h2 { margin-bottom: .6rem; }
.contact-inner p { color: rgb(255 255 255 / 78%); font-size: 1.1rem; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }

/* Pied de page */
.site-footer { padding: 26px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.footer-inner p { margin: 0; }
.back-to-top { text-decoration: none; font-weight: 600; }

/* Apparition au défilement (désactivée si l'utilisateur préfère moins d'animations) */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}

@media print {
  .site-header, .hero-actions, .contact-actions, .back-to-top { display: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
