/* Direction visuelle du portfolio : typographie nette, surfaces calmes et accents bleus. */
:root {
  --bg: #090e19;
  --bg-2: #0b1220;
  --bg-elev: #141d2d;
  --card: #111a29;
  --text: #f3f6fc;
  --muted: #a4b0c2;
  --primary: #8aa7ff;
  --primary-700: #5373dd;
  --accent: #75dccd;
  --border: #273447;
  --radius: 20px;
  --container: 1240px;
  --header-h: 76px;
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .12);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, .18);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, .22);
}

:root[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-2: #edf1f8;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --text: #17253a;
  --muted: #5d6b7d;
  --primary: #395cc1;
  --primary-700: #2749ad;
  --accent: #087f77;
  --border: #dce4ee;
  --shadow-sm: 0 8px 24px rgba(32, 52, 90, .05);
  --shadow-md: 0 18px 48px rgba(32, 52, 90, .09);
  --shadow-lg: 0 28px 70px rgba(32, 52, 90, .12);
}

body {
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.7;
  background: var(--bg);
  background-attachment: scroll;
  padding-top: var(--header-h);
}
html.is-scrolling { scroll-behavior: auto !important; }

h1, h2, h3, h4, .logo, .btn, .nav-links, .stat-n {
  font-family: Manrope, "DM Sans", system-ui, sans-serif;
}

h1, h2, h3, h4 { letter-spacing: -.035em; }
p { color: var(--muted); }
strong, .gradient, .theme-title {
  background: none;
  color: inherit;
  -webkit-background-clip: initial;
  background-clip: initial;
}
strong { font-weight: 700; color: var(--text); }
::selection { background: var(--primary); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.fx-aurora {
  inset: 0;
  opacity: .55;
  background: radial-gradient(800px 560px at 92% 5%, rgba(78, 111, 205, .16), transparent 72%);
}
:root[data-theme="light"] .fx-aurora { opacity: .4; }

header {
  background: rgba(9, 14, 25, .88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
:root[data-theme="light"] header { background: rgba(255, 255, 255, .88); }
.navbar {
  max-width: var(--container);
  min-height: var(--header-h);
  margin: auto;
  padding: 0 28px;
  gap: 32px;
}
.logo { font-size: 15px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.logo::before {
  width: 9px;
  height: 9px;
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent);
}
.nav-links { gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
}
.nav-links a::after { display: none; }
.nav-links a:hover, .nav-links a.is-active {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--text);
}
.nav-links .icon { width: 16px; height: 16px; flex-basis: 16px; }
.theme-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border-color: var(--border);
  box-shadow: none;
}
.theme-toggle:hover { box-shadow: none; border-color: var(--primary); }

.hero--landing {
  min-height: min(760px, calc(100svh - var(--header-h)));
  padding: 104px max(28px, calc((100vw - var(--container) + 56px) / 2));
  align-items: flex-start;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 58% 80% at 100% 48%, rgba(69, 99, 188, .16), transparent 76%),
    linear-gradient(115deg, var(--bg), var(--bg-2));
}
.hero--landing::after {
  content: "";
  position: absolute;
  width: clamp(300px, 39vw, 580px);
  aspect-ratio: 1;
  right: max(-120px, calc((100vw - var(--container)) / 2 - 90px));
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid color-mix(in srgb, var(--primary) 24%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 68px color-mix(in srgb, var(--primary) 4%, transparent), inset 0 0 0 66px color-mix(in srgb, var(--accent) 3%, transparent);
  pointer-events: none;
  animation: orbit-arrive 1.5s cubic-bezier(.17, .67, .2, 1) both,
    orbit-breathe 14s ease-in-out 1.5s infinite;
}
.tux-scene {
  position: absolute;
  z-index: 0;
  width: clamp(300px, 39vw, 580px);
  aspect-ratio: 1;
  right: max(-120px, calc((100vw - var(--container)) / 2 - 90px));
  top: 50%;
  transform: translateY(-50%);
  overflow: hidden;
  border-radius: 50%;
  padding: 0;
  border: 0;
  color: inherit;
  cursor: pointer;
  background: radial-gradient(circle at 50% 48%, #1b3356 0%, #101f38 48%, transparent 74%);
  animation: tux-arrive 1.2s .25s both;
}
:root[data-theme="light"] .tux-scene {
  background: radial-gradient(circle at 50% 48%, #c5d9ed 0%, #e5eef9 48%, transparent 74%);
}
.tux-scene:hover { filter: drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 30%, transparent)); }
.tux-scene:focus-visible { outline: 2px solid var(--accent); outline-offset: -12px; }
.tux-fallback {
  position: absolute;
  width: 72%;
  height: 82%;
  left: 14%;
  top: 8%;
  object-fit: contain;
  opacity: .95;
  transform: perspective(700px) rotateY(-26deg);
  transition: opacity .25s ease;
  pointer-events: none;
}
.tux-scene.is-ready .tux-fallback { opacity: 0; }
.tux-scene.is-spinning .tux-fallback { opacity: 0; }
.tux-scene canvas { position: relative; display: block; width: 100%; height: 100%; }
.hero-halo {
  inset: 0;
  opacity: 1;
  background: radial-gradient(550px 400px at 75% 50%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 75%);
}
.hero-particles { display: none; }
.hero--landing .hero-inner {
  width: min(100%, 880px);
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 24px;
}
.hero-inner > * { animation: hero-enter .85s cubic-bezier(.2, .7, .2, 1) both; }
.hero-inner > :nth-child(1) { animation-delay: .16s; }
.hero-inner > :nth-child(2) { animation-delay: .3s; animation-duration: 1.05s; }
.hero-inner > :nth-child(3) { animation-delay: .55s; }
.hero-inner > :nth-child(4) { animation-delay: .72s; }
.hero-badge {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  letter-spacing: .03em;
}
.chip, .chip--accent {
  border: 1px solid color-mix(in srgb, var(--primary) 31%, var(--border));
  background: color-mix(in srgb, var(--primary) 9%, var(--card));
  box-shadow: none;
  font-weight: 700;
}
.chip .icon { color: var(--accent); }
.hero--landing .hero-title {
  max-width: 900px;
  font-size: clamp(54px, 8vw, 108px);
  line-height: 1.04;
  letter-spacing: -.075em;
  font-weight: 800;
}
.hero-title .gradient { color: var(--text); }
.hero--landing .subtitle {
  max-width: 710px;
  margin-top: 24px;
  color: var(--primary);
  font-size: clamp(19px, 2.4vw, 28px);
  line-height: 1.35;
  letter-spacing: -.035em;
  opacity: 1;
}
.hero--landing .hero-tagline {
  margin: 0;
  max-width: 560px;
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.7;
}
.hero-tagline strong { color: var(--text); }
.scroll-down {
  width: 48px;
  height: 48px;
  margin-top: 20px;
  border-color: var(--border);
  background: var(--card);
  box-shadow: none;
  animation: none;
}
.scroll-down:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

.section {
  max-width: var(--container);
  padding: 112px 28px;
}
.section + .section { border-top: 1px solid var(--border); }
.section > h2 {
  margin: 0 0 42px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.15;
  letter-spacing: -.055em;
  text-align: left;
  color: var(--text);
}
.section > h2::after {
  width: 42px;
  height: 4px;
  margin: 18px 0 0;
  background: var(--accent);
}
section[id] { scroll-margin-top: calc(var(--header-h) + 18px); }

.frame, .tech-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.frame::before, #contact .contact-item::after { display: none; }
.glow-boost:hover, .glow-boost:focus-within {
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
}
.card-glow { padding: 28px; }
.btn {
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--primary);
  color: var(--bg);
  font-size: 13px;
  font-weight: 800;
  box-shadow: none;
}
:root[data-theme="light"] .btn { color: #fff; }
.btn:hover { transform: translateY(-2px); background: var(--accent); box-shadow: var(--shadow-sm); }
.section--grid { gap: 24px; }
#about > .section--grid {
  grid-template-columns: minmax(280px, .82fr) minmax(0, 1.7fr);
  align-items: stretch;
}
#about > .section--grid > aside {
  padding: 32px;
  gap: 22px !important;
  height: 100%;
}
#about .avatar {
  width: 144px !important;
  height: 144px !important;
  object-fit: cover;
  border: 5px solid var(--bg-elev);
  box-shadow: 0 0 0 1px var(--border), var(--shadow-md);
}
#about aside h3 { font-size: 23px; }
#about .info-mini { gap: 10px; max-width: 100%; }
#about .info-mini li { justify-content: flex-start; min-width: 0; font-size: 13px; }
#about .info-mini a { overflow-wrap: anywhere; border: 0; }
.stat-tiles { gap: 8px; }
.stat-tile {
  min-height: 92px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  box-shadow: none;
}
.stat-tile:hover { transform: none; box-shadow: none; border-color: var(--primary); }
.stat-n { color: var(--text); font-size: 25px; letter-spacing: -.05em; }
.stat-l { font-size: 12px; line-height: 1.35; }
.about-right { gap: 18px; min-width: 0; }
.about-right .section--grid { gap: 18px !important; }
.about-right article h3 { font-size: 20px; }
.about-right article p { line-height: 1.8; }
.list-dot li { padding: 5px 0 5px 21px; color: var(--muted); }
.list-dot li::before { top: 15px; width: 6px; height: 6px; background: var(--accent); box-shadow: none; }
.cert-card { padding: 22px; }
.cert-main { grid-template-columns: 150px minmax(0, 1fr); gap: 24px; }
.cert-content { min-width: 0; }
.cert-visual { min-height: 160px; border-color: var(--border); background: var(--bg-elev); }
.cert-visual img { max-width: 120px; max-height: 120px; }
.cert-content { gap: 14px; }
.cert-head { justify-content: flex-start; gap: 12px; }
.cert-card .btn { justify-self: start; max-width: 100%; text-align: center; }

#skills { padding-bottom: 88px; }
.skill-theme {
  margin-bottom: 22px;
  padding: 32px;
}
.theme-title {
  margin-bottom: 24px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.theme-title .icon { width: 24px; height: 24px; color: var(--accent); }
.tech-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tech-card {
  min-height: 174px;
  padding: 20px;
  gap: 14px;
  background: var(--bg-elev);
  box-shadow: none;
}
.tech-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-sm); }
.tech-logo { transition: transform .3s ease, border-color .3s ease; }
.tech-card:hover .tech-logo { transform: rotate(-5deg) scale(1.06); border-color: var(--primary); }
.tech-header { align-items: flex-start; gap: 12px; }
.tech-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 12%, var(--card));
  border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
}
.tech-title { font-size: 14px; line-height: 1.4; letter-spacing: -.02em; }
.tech-desc { font-size: 13px; line-height: 1.65; }

#projects .explorer.skill-theme { overflow: hidden; }
.explorer-bar {
  padding: 18px 24px;
  background: var(--bg-elev);
}
#projects .explorer .explorer-bar { background: var(--bg-elev); }
.explorer-path .crumb { padding: 5px 10px; background: var(--card); border-radius: 7px; }
.x-btn {
  border-color: var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
}
.x-btn:hover { border-color: var(--primary); }
.explorer-body { padding: 20px 24px 30px; }
.explorer-note { margin: 0 4px 10px; }
.tree { padding: 0; }
.tree > .tree-node + .tree-node { margin-top: 6px; }
.node-row { padding: 11px 14px; border-radius: 9px; }
.tree .node-row:hover {
  transform: none;
  box-shadow: none;
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: color-mix(in srgb, var(--primary) 9%, var(--card));
}
.tree .node-row:hover .node-label,
.tree .node-row:hover .node-ico,
.tree .node-row:hover .node-meta { color: var(--text); }
.node-label { font-weight: 600; }
.node-ico { color: var(--primary); }

#contact { padding-bottom: 120px; }
#contact .contact-wrap {
  max-width: 760px;
  padding: 32px;
  border-radius: var(--radius);
}
#contact .contact-wrap:hover, #contact .contact-wrap:focus-within { box-shadow: var(--shadow-md); }
#contact .contact-intro { margin: 0 0 20px; text-align: left; font-size: 16px; }
#contact .contact-intro strong { color: var(--text); }
#contact .contact-panel { max-width: none; padding: 0; border: 0; background: transparent; }
#contact .contact-item {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 17px 10px;
  border-radius: 10px;
}
#contact .contact-item::before { display: none; }
#contact .contact-item:hover { transform: none; background: var(--bg-elev); box-shadow: none; }
#contact .contact-badge { width: 48px; height: 48px; border-color: var(--border); background: var(--bg-elev); color: var(--primary); }
#contact .contact-item:hover .contact-badge, #contact .contact-item:focus-within .contact-badge { box-shadow: none; border-color: var(--primary); }
#contact .contact-label { font-size: 15px; }
#contact .contact-sub { font-size: 13px; }
#contact .contact-action {
  min-width: 92px;
  padding: 9px 14px;
  text-align: center;
  border-color: var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
}
#contact .contact-item:hover .contact-label, #contact .contact-item:focus-within .contact-label { background: none; color: var(--text); }
#contact .contact-item:hover .contact-action { box-shadow: none; border-color: var(--primary); }
footer { padding: 32px 20px; border-top: 1px solid var(--border); text-align: center; }
footer p { margin: 0; font-size: 13px; }

.detail-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease var(--detail-delay, 0ms), transform .55s cubic-bezier(.2, .7, .2, 1) var(--detail-delay, 0ms);
}
.detail-reveal.is-visible { opacity: 1; transform: translateY(0); }
@keyframes hero-enter {
  from { opacity: 0; transform: translateY(32px); filter: blur(8px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes tux-arrive {
  from { opacity: 0; transform: translateY(-50%) scale(.72) rotate(-12deg); filter: blur(10px); }
  to { opacity: 1; transform: translateY(-50%) scale(1) rotate(0); filter: blur(0); }
}
@keyframes orbit-arrive {
  from { opacity: 0; transform: translateY(-50%) scale(.72); }
  to { opacity: .8; transform: translateY(-50%) scale(1); }
}
@keyframes orbit-breathe {
  0%, 100% { transform: translateY(-50%) scale(1); opacity: .8; }
  50% { transform: translateY(-50%) scale(1.035); opacity: 1; }
}

@media (max-width: 1050px) {
  .tech-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #about > .section--grid { grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); }
  .about-right .section--grid { grid-template-columns: 1fr; }
  .cert-main { grid-template-columns: 110px 1fr; }
}
@media (max-width: 760px) {
  :root { --header-h: 106px; }
  .navbar { padding: 10px 20px; gap: 8px; }
  .nav-links { margin-left: 0; gap: 5px; }
  .nav-links a { padding: 7px 5px; font-size: 11px; }
  .nav-links a .icon { display: none; }
  .hero--landing { min-height: 620px; padding: 84px 24px; }
  .hero--landing::after { opacity: .35; right: -220px; }
  .tux-scene { right: -160px; opacity: .6; }
  .hero--landing .hero-title { font-size: clamp(48px, 10vw, 72px); }
  .section { padding: 76px 24px; }
  #about > .section--grid { grid-template-columns: 1fr; align-items: start; }
  #about > .section--grid > aside { gap: 20px !important; height: auto; }
  .about-right .section--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cert-main { grid-template-columns: 140px 1fr; }
  .cert-visual { min-height: 140px; }
  #contact { padding-bottom: 80px; }
}
@media (max-width: 560px) {
  :root { --header-h: 104px; }
  .navbar { padding: 9px 16px; }
  .logo { font-size: 14px; }
  .nav-links a { padding: 7px 3px; font-size: 10px; }
  .hero--landing { min-height: 730px; padding: 72px 20px 250px; }
  .hero--landing::after { width: 310px; top: auto; bottom: -10px; right: -10px; transform: none; animation: none; }
  .tux-scene { width: 310px; top: auto; bottom: -10px; right: -10px; transform: none; opacity: .9; animation: none; }
  .hero--landing .hero-inner { gap: 20px; }
  .hero--landing .hero-title { font-size: clamp(45px, 12vw, 62px); }
  .hero--landing .subtitle { font-size: 19px; margin-top: 20px; }
  .hero-badge { font-size: 11px; line-height: 1.45; }
  .section { padding: 68px 18px; }
  .section > h2 { margin-bottom: 30px; }
  .card-glow, #about > .section--grid > aside { padding: 22px; }
  .about-right .section--grid, .tech-grid { grid-template-columns: 1fr; }
  .skill-theme { padding: 22px; }
  .tech-card { min-height: 0; }
  .cert-main { grid-template-columns: 1fr; }
  .cert-visual { min-height: 132px; }
  .explorer-bar { flex-wrap: wrap; padding: 16px; }
  .explorer-actions { width: 100%; }
  .explorer-actions .x-btn { flex: 1; }
  .explorer-body { padding: 18px 12px 24px; }
  .tree [role="group"] { padding-left: 12px; }
  .node-row { padding: 10px 8px; }
  #contact .contact-wrap { padding: 20px 14px; }
  #contact .contact-item { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; padding: 14px 5px; }
  #contact .contact-badge { width: 38px; height: 38px; }
  #contact .contact-action { min-width: 0; padding: 8px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .tech-card, .btn, .nav-links a, .theme-toggle, .detail-reveal { transition: none; }
  .hero-inner > *, .hero--landing::after, .tux-scene { animation: none; }
  .detail-reveal { opacity: 1; transform: none; }
}
