/* ============================================================
   Eric Morellini — CV en ligne
   Thème "opérateur / datacenter" — terminal noir & vert
   ============================================================ */

:root {
  --bg: #05100b;
  --bg-alt: #081712;
  --panel: #0b1f17;
  --panel-border: #14382a;
  --line: #17332686;

  --ink: #d6ffe9;
  --ink-dim: #7fae94;
  --ink-faint: #4c7161;

  --green: #3dff9a;
  --green-soft: #2ce583;
  --green-dim: #1c8f5b;
  --green-glow: #46ff9655;
  --amber: #ffcf6b;
  --cyan: #63e9ff;
  --red: #ff6b6b;

  --mono: "IBM Plex Mono", "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --radius: 10px;
  --maxw: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- texture de fond : scanlines + grille très discrètes ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 20, 12, 0.35) 3px
    );
  mix-blend-mode: overlay;
  opacity: 0.35;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    linear-gradient(rgba(61, 255, 154, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 255, 154, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
}

::selection { background: var(--green); color: #04140d; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--green-dim); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-soft); }

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--cyan); }

.mono { font-family: var(--mono); }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.6rem;
  position: relative;
  z-index: 3;
}

/* ---------- boutons / puces ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.75rem 1.3rem;
  border-radius: 6px;
  border: 1px solid var(--green-dim);
  color: var(--green);
  background: rgba(61, 255, 154, 0.06);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn:hover {
  color: #04140d;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 24px var(--green-glow);
}
.btn.ghost {
  background: transparent;
  color: var(--ink-dim);
  border-color: var(--panel-border);
}
.btn.ghost:hover {
  color: var(--green);
  background: rgba(61, 255, 154, 0.06);
  border-color: var(--green-dim);
  box-shadow: none;
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: 5px;
  border: 1px solid var(--panel-border);
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.015);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.tag:hover {
  border-color: var(--green-dim);
  color: var(--green);
  transform: translateY(-2px);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 var(--green-glow);
  animation: pulse-ring 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  flex: none;
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(61, 255, 154, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(61, 255, 154, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 255, 154, 0); }
}

/* ---------- header / nav ---------- */
header.site {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(5, 16, 11, 0.72);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.brand .bracket { color: var(--green-dim); }
nav.primary {
  display: flex;
  gap: 1.7rem;
  font-family: var(--mono);
  font-size: 0.82rem;
}
nav.primary a {
  color: var(--ink-dim);
  position: relative;
  padding: 0.3rem 0;
}
nav.primary a:hover { color: var(--green); }
nav.primary a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0%;
  height: 1px;
  background: var(--green);
  transition: width 0.25s ease;
}
nav.primary a:hover::after { width: 100%; }
.nav-status {
  display: none;
}
@media (min-width: 720px) {
  .nav-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--ink-faint);
    border: 1px solid var(--panel-border);
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
  }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
  overflow: hidden;
}

#fiber-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.75;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
  padding-top: 3rem;
  padding-bottom: 3rem;
}
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-photo { order: -1; max-width: 260px; margin: 0 auto; }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--green-soft);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 1.08;
  margin: 0 0 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.hero h1 .last { color: var(--green); }

.hero .role {
  font-family: var(--mono);
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--ink-dim);
  margin: 0 0 1.6rem;
  min-height: 1.6em;
}
.hero .role .cursor {
  display: inline-block;
  width: 0.55ch;
  background: var(--green);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero p.lede {
  max-width: 54ch;
  color: var(--ink-dim);
  font-size: 1.02rem;
  margin: 0 0 2rem;
}

.hero-cta {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 2.4rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 2.2rem;
  font-family: var(--mono);
}
.hero-stats .n {
  font-size: 1.6rem;
  color: var(--green);
  font-weight: 600;
  line-height: 1;
}
.hero-stats .l {
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-photo {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-photo .frame {
  position: relative;
  width: 100%;
  max-width: 420px;
}
.hero-photo .frame::before {
  /* halo doux derrière le sujet, remplace le cadre rectangulaire */
  content: "";
  position: absolute;
  inset: 6% 4%;
  background: radial-gradient(closest-side, rgba(61, 255, 154, 0.16), rgba(61, 255, 154, 0.04) 60%, transparent 78%);
  filter: blur(6px);
  z-index: 0;
  animation: halo-breathe 5s ease-in-out infinite;
}
@keyframes halo-breathe {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.035); }
}
.hero-photo img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 30px 45px rgba(0, 0, 0, 0.55));
}
.hero-photo .badge {
  position: relative;
  z-index: 1;
  display: flex;
  width: fit-content;
  margin: 0.9rem auto 0;
  background: var(--panel);
  border: 1px solid var(--green-dim);
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  white-space: nowrap;
  align-items: center;
  gap: 0.45rem;
}

.scroll-cue {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  z-index: 3;
}
.scroll-cue .bar {
  width: 1px;
  height: 26px;
  background: linear-gradient(to bottom, var(--green), transparent);
  animation: scrolldown 1.6s ease-in-out infinite;
}
@keyframes scrolldown {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0.2; }
  50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0.2; }
}

/* ---------- sections génériques ---------- */
section { position: relative; z-index: 3; padding: 6.5rem 0; }
section.alt { background: linear-gradient(to bottom, transparent, var(--bg-alt) 8%, var(--bg-alt) 92%, transparent); }

.section-head {
  margin-bottom: 3rem;
  max-width: 62ch;
}
.section-kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--green-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}
.section-kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--green-dim);
}
.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin: 0 0 0.7rem;
  letter-spacing: -0.01em;
}
.section-head p {
  color: var(--ink-dim);
  margin: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- à propos ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

.terminal {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px -25px rgba(0, 0, 0, 0.6);
}
.terminal .bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--panel-border);
}
.terminal .bar span {
  width: 10px; height: 10px; border-radius: 50%;
  background: #274436;
}
.terminal .bar span:nth-child(1) { background: #ff6b6b60; }
.terminal .bar span:nth-child(2) { background: #ffcf6b60; }
.terminal .bar span:nth-child(3) { background: #3dff9a60; }
.terminal .bar .path {
  margin-left: 0.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
}
.terminal .body {
  padding: 1.3rem 1.4rem 1.6rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--ink-dim);
}
.terminal .body .prompt { color: var(--green); }
.terminal .body .arg { color: var(--cyan); }
.terminal .body p { margin: 0 0 0.9rem; }
.terminal .body .out { color: var(--ink); }

.about-facts {
  display: grid;
  gap: 0.9rem;
}
.fact {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}
.fact .k {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--green-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: 9.5em;
  flex: none;
  padding-top: 0.15rem;
}
.fact .v { color: var(--ink); font-size: 0.94rem; }
.fact .v small { color: var(--ink-faint); }

/* ---------- expérience (timeline / trace réseau) ---------- */
.trace {
  position: relative;
  padding-left: 2.6rem;
}
.trace::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(to bottom, var(--green-dim), var(--panel-border) 90%);
}
.hop {
  position: relative;
  padding-bottom: 2.6rem;
}
.hop:last-child { padding-bottom: 0; }
.hop .node {
  position: absolute;
  left: -2.6rem;
  top: 0.35rem;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--green-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hop.current .node { border-color: var(--green); }
.hop.current .node::after {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-ring 2.4s cubic-bezier(0.4,0,0.2,1) infinite;
}
.hop-card {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.hop-card:hover {
  border-color: var(--green-dim);
  transform: translateX(4px);
  background: rgba(61,255,154,0.03);
}
.hop-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}
.hop-top h3 { margin: 0; font-size: 1.12rem; }
.hop-time {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
  white-space: nowrap;
}
.hop-status {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--green-dim);
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hop-org {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--green-soft);
  margin-bottom: 0.7rem;
}
.hop-org .loc { color: var(--ink-faint); }
.hop-card p.desc {
  color: var(--ink-dim);
  font-size: 0.92rem;
  margin: 0 0 0.8rem;
}
.hop-card ul {
  margin: 0 0 0.9rem;
  padding-left: 1.1rem;
  color: var(--ink-dim);
  font-size: 0.9rem;
}
.hop-card ul li { margin-bottom: 0.25rem; }
.hop-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.hop-skills .tag { font-size: 0.72rem; padding: 0.25rem 0.55rem; }

.trace-toggle {
  margin-top: 2rem;
  margin-left: 2.6rem;
}

.hop.hidden-hop { display: none; }

/* ---------- compétences ---------- */
.skills-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.4rem;
  margin-bottom: 3rem;
}
.skill-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.skill-card:hover { border-color: var(--green-dim); transform: translateY(-4px); }
.skill-card .icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(61,255,154,0.08);
  color: var(--green);
  margin-bottom: 1rem;
}
.skill-card h3 { margin: 0 0 0.4rem; font-size: 1.02rem; }
.skill-card p { margin: 0; color: var(--ink-dim); font-size: 0.88rem; }

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

/* ---------- certifications ---------- */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}
.cert-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 1.2rem 1.3rem;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.cert-card:hover { border-color: var(--green-dim); background: rgba(61,255,154,0.03); }
.cert-badge {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 9px;
  background: linear-gradient(160deg, rgba(61,255,154,0.16), rgba(61,255,154,0.02));
  border: 1px solid var(--green-dim);
  display: flex; align-items: center; justify-content: center;
  color: var(--green);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.78rem;
}
.cert-card h4 { margin: 0 0 0.2rem; font-size: 0.98rem; }
.cert-card .org { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-faint); margin-bottom: 0.35rem; }
.cert-card .meta { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); }
.cert-card .meta .exp { color: var(--amber); }
.cert-card .meta .ok { color: var(--green-soft); }

.cert-misc {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
}

/* ---------- formation + distinctions ---------- */
.edu-award-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
}
@media (max-width: 860px) { .edu-award-grid { grid-template-columns: 1fr; } }

.edu-item {
  border-left: 2px solid var(--panel-border);
  padding: 0 0 1.6rem 1.2rem;
  position: relative;
}
.edu-item::before {
  content: "";
  position: absolute;
  left: -6px; top: 3px;
  width: 10px; height: 10px;
  background: var(--bg);
  border: 2px solid var(--green-dim);
  border-radius: 2px;
  transform: rotate(45deg);
}
.edu-item h4 { margin: 0 0 0.15rem; font-size: 1rem; }
.edu-item .school { font-family: var(--mono); font-size: 0.8rem; color: var(--green-soft); }
.edu-item .yrs { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-faint); margin-left: 0.5rem; }
.edu-item p { margin: 0.4rem 0 0; color: var(--ink-dim); font-size: 0.88rem; }

.award-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
}
.award-card .trophy { color: var(--amber); margin-bottom: 0.7rem; }
.award-card h4 { margin: 0 0 0.3rem; font-size: 1rem; }
.award-card p { margin: 0; color: var(--ink-dim); font-size: 0.88rem; }

.easter {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  border: 1px dashed var(--panel-border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
}
.easter b { color: var(--ink-dim); }

/* ---------- contact ---------- */
.contact-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 3rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.contact-panel::before {
  content: "";
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(61,255,154,0.10), transparent 70%);
  top: -200px; left: 50%; transform: translateX(-50%);
  pointer-events: none;
}
.contact-panel h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  margin: 0 0 0.8rem;
  position: relative;
}
.contact-panel > p {
  color: var(--ink-dim);
  max-width: 50ch;
  margin: 0 auto 2rem;
  position: relative;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  position: relative;
}

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--line);
  padding: 2.2rem 0;
  position: relative;
  z-index: 3;
}
footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
}
footer.site .status {
  display: flex; align-items: center; gap: 0.5rem;
}

@media (max-width: 640px) {
  nav.primary { display: none; }
  section { padding: 4.5rem 0; }
  .contact-panel { padding: 2rem 1.4rem; }
}
