/* ==========================================================================
   Portfolio – Laël Rooman · thème "cyber"
   Surcharge du thème hugo-profile (le thème n'est pas modifié).
   ========================================================================== */

:root {
  --accent: #00f0b5;
  --accent-2: #5b8cff;
  --accent-3: #b36bff;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-hover: rgba(0, 240, 181, 0.35);
  --radius: 18px;
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
body:not(.dark) {
  --accent: #00875f;
  --accent-2: #3b63d6;
  --accent-3: #8a3fe0;
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(20, 30, 60, 0.09);
  --glass-hover: rgba(0, 135, 95, 0.4);
}

html { scroll-behavior: smooth; }
body, .secondary-font, #secondary-font, .default-font, #default-font {
  font-family: var(--font-body) !important;
  -webkit-font-smoothing: antialiased;
}
.primary-font, #primary-font { font-family: var(--font-head) !important; }
h1, h2, h3, h4, h5, h6, .navbar-brand { font-family: var(--font-head); }
::selection { background: var(--accent); color: #04110d; }

/* Fond global : fine grille + halos, uniquement en mode sombre */
body.dark #content {
  background-image:
    radial-gradient(ellipse at 15% -10%, rgba(0, 240, 181, 0.07), transparent 50%),
    radial-gradient(ellipse at 100% 30%, rgba(91, 140, 255, 0.07), transparent 45%);
}

/* ---------- Barre de navigation ---------- */
header .navbar,
header nav.navbar {
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in srgb, var(--background-color) 72%, transparent) !important;
  border-bottom: 1px solid var(--glass-border);
}
header .navbar-brand {
  font-weight: 700;
  letter-spacing: -0.02em;
}
header .nav-link { position: relative; font-weight: 500; }
header .nav-link::after {
  content: "";
  position: absolute; left: 50%; bottom: 2px;
  width: 0; height: 2px; background: var(--accent);
  transition: width .25s ease, left .25s ease;
}
header .nav-link:hover::after { width: 60%; left: 20%; }

/* ---------- Boutons ---------- */
.btn-cta {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.5rem;
  border-radius: 999px;
  font-weight: 600; font-size: .95rem;
  text-decoration: none !important;
  border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease, border-color .25s;
  cursor: pointer;
}
.btn-cta.btn-sm { padding: .5rem 1.1rem; font-size: .85rem; }
.btn-cta-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04110d !important;
  box-shadow: 0 8px 30px -8px var(--accent);
}
body:not(.dark) .btn-cta-primary { color: #fff !important; }
.btn-cta-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px -8px var(--accent); }
.btn-cta-ghost {
  background: transparent;
  color: var(--text-color) !important;
  border-color: var(--glass-border);
  backdrop-filter: blur(6px);
}
.btn-cta-ghost:hover { border-color: var(--accent); color: var(--accent) !important; transform: translateY(-2px); }

/* ---------- Glass + spotlight ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px -20px rgba(0, 0, 0, .5);
}
.spotlight { position: relative; overflow: hidden; transition: transform .3s ease, border-color .3s ease; }
.spotlight::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 240, 181, .12), transparent 45%);
  opacity: 0; transition: opacity .3s;
}
body:not(.dark) .spotlight::before {
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 135, 95, .10), transparent 45%);
}
.spotlight:hover { border-color: var(--glass-hover); }
.spotlight:hover::before { opacity: 1; }

/* ---------- Révélation au scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- HERO ---------- */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 7rem 0 5rem;
  overflow: hidden;
  background: transparent !important;
}
#matrix {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .4;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
}
body:not(.dark) #matrix { opacity: .18; }
.hero-glow { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; }
.hero-glow-a { width: 420px; height: 420px; left: -120px; top: 10%; background: rgba(0, 240, 181, .14); animation: float 14s ease-in-out infinite; }
.hero-glow-b { width: 380px; height: 380px; right: -100px; bottom: 5%; background: rgba(91, 140, 255, .16); animation: float 18s ease-in-out infinite reverse; }
body:not(.dark) .hero-glow-a { background: rgba(0, 200, 150, .18); }
body:not(.dark) .hero-glow-b { background: rgba(91, 140, 255, .2); }
@keyframes float { 50% { transform: translate(30px, -30px); } }

.hero-inner { position: relative; z-index: 2; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-mono); font-size: .9rem;
  color: var(--accent);
  padding: .35rem .9rem; border-radius: 999px;
  border: 1px solid var(--glass-border); background: var(--glass-bg);
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

#hero .hero-name {
  font-size: clamp(3.6rem, 11vw, 7.5rem);
  font-weight: 700; line-height: 1; letter-spacing: -0.04em;
  margin: 1.2rem 0 .4rem;
  background: linear-gradient(120deg, var(--text-color) 10%, var(--accent) 55%, var(--accent-2) 95%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent !important;
  background-size: 200% auto;
  animation: shine 7s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

#hero .hero-role {
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 3.2vw, 1.9rem);
  font-weight: 500; opacity: 1;
  min-height: 2.4rem;
  color: var(--text-secondary-color);
}
.hero-role .typed { color: var(--text-color); }
.hero-role .caret { color: var(--accent); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

#hero .hero-lead { max-width: 560px; opacity: .85; font-size: 1.1rem; margin: 1.2rem 0 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.hero-social { display: flex; gap: .6rem; margin-left: .4rem; }
.hero-social a {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--glass-border);
  color: var(--text-color) !important; background: var(--glass-bg);
  transition: all .25s ease; font-size: 1.1rem; text-decoration: none;
}
.hero-social a:hover { color: var(--accent) !important; border-color: var(--accent); transform: translateY(-3px) rotate(-6deg); }

/* Terminal */
.terminal {
  border-radius: 14px; overflow: hidden;
  background: #0a0f1c; color: #cfe3ff;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 30px 80px -30px rgba(0, 240, 181, .35), 0 0 0 1px rgba(0, 240, 181, .06);
  font-family: var(--font-mono); font-size: .88rem;
  transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
  transition: transform .5s ease;
}
.terminal:hover { transform: perspective(1200px) rotateY(0) rotateX(0); }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: .7rem 1rem; background: #121a2d; border-bottom: 1px solid rgba(255,255,255,.06); }
.terminal-bar .dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #ff5f57; } .dot-y { background: #febc2e; } .dot-g { background: #28c840; }
.terminal-title { margin: 0 auto; transform: translateX(-26px); color: #7d8aa6; font-size: .78rem; }
.terminal-body { padding: 1.2rem 1.2rem 1.4rem; min-height: 290px; line-height: 1.7; text-align: left; }
.terminal-body .t-prompt { color: #00f0b5; font-weight: 700; }
.terminal-body .t-out { color: #8fa4c8; padding-left: 1.1rem; margin-bottom: .55rem; }
.terminal-body .t-out::before { content: ""; }
.t-block { display: inline-block; width: 9px; height: 1.05em; background: #00f0b5; vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem; margin-top: 4.5rem;
  padding: 1.4rem 1rem;
  border-radius: var(--radius); border: 1px solid var(--glass-border);
  background: var(--glass-bg); backdrop-filter: blur(10px);
}
.stat { text-align: center; padding: .4rem 1rem; }
.stat + .stat { border-left: 1px solid var(--glass-border); }
.stat-value { font-family: var(--font-head); font-size: 2.4rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.stat-label { font-size: .85rem; color: var(--text-secondary-color); margin-top: .2rem; }
@media (max-width: 640px) { .stat + .stat { border-left: 0; border-top: 1px solid var(--glass-border); padding-top: 1rem; } }

.scroll-hint { position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%); color: var(--text-secondary-color) !important; animation: bounce 2s infinite; z-index: 2; }
@keyframes bounce { 50% { transform: translate(-50%, 8px); } }

/* ---------- Sections ---------- */
.section { padding: 6rem 0; position: relative; background: transparent !important; }
.section-head { text-align: center; margin-bottom: 3.5rem; }
.section-kicker { font-family: var(--font-mono); color: var(--accent); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.section-head h3, .contact-card h3 {
  font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; letter-spacing: -0.03em; margin: .4rem 0 0;
}
.section-head h3::after {
  content: ""; display: block; width: 64px; height: 4px; margin: 1rem auto 0;
  border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.subhead { font-size: 1.3rem; margin-bottom: 1.2rem; font-weight: 600; }

/* About */
.about-text p { font-size: 1.08rem; opacity: .88; margin-bottom: 1.1rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; margin-top: 1.8rem; }
.fact { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; }
.fact i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: rgba(0, 240, 181, .1); color: var(--accent); font-size: 1.1rem; flex: none; }
.fact small { display: block; color: var(--text-secondary-color); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.fact strong { font-size: .95rem; font-weight: 600; }

.skill-groups { display: grid; gap: 1rem; }
.skill-group { padding: 1.2rem 1.3rem; }
.skill-group-title { font-weight: 600; margin-bottom: .8rem; display: flex; align-items: center; gap: .6rem; }
.skill-group-title i { color: var(--accent); width: 1.2em; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  font-family: var(--font-mono); font-size: .82rem;
  padding: .32rem .8rem; border-radius: 999px;
  border: 1px solid var(--glass-border); background: rgba(127, 127, 127, .08);
  transition: all .2s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* Timeline */
.timeline { position: relative; max-width: 780px; margin: 0 auto; padding-left: 2.2rem; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), var(--accent-2), transparent); }
.timeline-item { position: relative; margin-bottom: 1.6rem; }
.timeline-dot { position: absolute; left: -2.2rem; top: 1.6rem; width: 16px; height: 16px; border-radius: 50%; background: var(--background-color); border: 3px solid var(--accent-2); }
.timeline-dot.is-current { border-color: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2s infinite; }
.timeline-card { padding: 1.5rem 1.7rem; }
.timeline-date { font-family: var(--font-mono); font-size: .8rem; color: var(--accent); background: rgba(0,240,181,.08); padding: .2rem .7rem; border-radius: 999px; }
.timeline-card h5 { font-size: 1.2rem; font-weight: 600; margin: .8rem 0 .4rem; }
.timeline-school { color: var(--text-secondary-color); font-size: .95rem; }
.timeline-school i { color: var(--accent-2); margin-right: .4rem; }
.timeline-school a { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
.timeline-school a:hover { color: var(--accent); }
.timeline-content p { margin: .8rem 0 0; opacity: .85; }

/* Projects */
.project-card { display: flex; flex-direction: column; height: 100%; text-decoration: none !important; color: inherit !important; }
.project-card:hover { transform: translateY(-6px); }
.project-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, #0d1424, #16233f); }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.project-card:hover .project-thumb img { transform: scale(1.08); }
.project-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(7, 11, 20, .55), transparent 55%); }
.project-thumb-fallback { height: 100%; display: grid; place-items: center; font-size: 3rem; color: var(--accent); }
.project-date { position: absolute; z-index: 1; top: .8rem; right: .8rem; font-family: var(--font-mono); font-size: .75rem; padding: .25rem .65rem; border-radius: 999px; background: rgba(7,11,20,.7); color: #e6edf7; backdrop-filter: blur(6px); }
.project-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; position: relative; }
.project-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.tag { font-family: var(--font-mono); font-size: .72rem; padding: .18rem .6rem; border-radius: 999px; color: var(--accent); background: rgba(0, 240, 181, .09); border: 1px solid rgba(0, 240, 181, .22); }
.project-body h5 { font-size: 1.25rem; font-weight: 600; margin-bottom: .5rem; }
.project-body p { color: var(--text-secondary-color); font-size: .94rem; flex: 1; }
.project-more { color: var(--accent); font-weight: 600; font-size: .9rem; }
.project-more i { transition: transform .25s; }
.project-card:hover .project-more i { transform: translateX(5px); }
.project-card-soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: .6rem; padding: 2rem 1.5rem; min-height: 320px; height: 100%;
  border: 2px dashed var(--glass-border); border-radius: var(--radius); color: var(--text-secondary-color);
}
.project-card-soon > i { font-size: 2.2rem; color: var(--accent); opacity: .8; }
.project-card-soon h5 { color: var(--text-color); margin: 0; }

/* Contact */
.contact-card { text-align: center; padding: 4rem 2rem; position: relative; overflow: hidden; }
.contact-card::before { content: ""; position: absolute; inset: -40% -10% auto -10%; height: 80%; background: radial-gradient(ellipse, rgba(0,240,181,.14), transparent 65%); pointer-events: none; }
.contact-card > * { position: relative; }
.contact-card p { max-width: 560px; margin: 1.2rem auto 2rem; font-size: 1.1rem; opacity: .85; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .9rem; justify-content: center; }
.contact-mail { margin-top: 1.6rem; font-family: var(--font-mono); color: var(--text-secondary-color); font-size: .9rem; }
.contact-mail i { color: var(--accent); margin-right: .3rem; }

/* Retour en haut */
.to-top { position: fixed; right: 1.4rem; bottom: 1.4rem; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04110d !important; box-shadow: 0 10px 30px -8px var(--accent); opacity: 0; transform: translateY(20px); pointer-events: none; transition: all .3s ease; z-index: 50; text-decoration: none; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Pages internes (liste & articles) ---------- */
body.dark .card, body.dark .list-item, body.dark .single-page .card { border-color: var(--glass-border); }
.single-page pre, .content pre, article pre {
  background: #0a0f1c !important; color: #cfe3ff;
  border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 1rem 1.2rem;
  font-family: var(--font-mono); font-size: .88rem;
}
article code, .content code, .single-page code { font-family: var(--font-mono); }
article h2, .single-page h2, .content h2 { margin-top: 2.2rem; font-weight: 700; letter-spacing: -0.02em; }
article img, .single-page img { border-radius: 14px; }

/* Accessibilité : réduire les animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media (max-width: 991px) {
  #hero { padding-top: 6rem; text-align: left; }
  .terminal { transform: none; }
}

/* Titres de section : forcer la couleur du texte (le thème les grise) */
.section-head h3, .contact-card h3, .subhead, .project-body h5, .timeline-card h5 {
  color: var(--text-color) !important;
}

/* Le thème colore #about/#projects/#contact h3 avec un sélecteur d'id : on le dépasse */
body #about .section-head h3,
body #education .section-head h3,
body #projects .section-head h3,
body #contact .contact-card h3 {
  color: var(--text-color) !important;
}
