/* =====================================================================
   AfriCode — Site vitrine · Claude TCHAMI
   Thème : terminal / tech · police monospace (Consolas comme le logo)
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Fonds */
  --bg:        #0a0e14;
  --bg-elev:   #0d1117;
  --surface:   #10161f;
  --surface-2: #141c27;
  --border:    #212b38;
  --border-lit:#2d3a4d;

  /* Texte */
  --text:      #c9d1d9;
  --text-dim:  #8b949e;
  --text-bright:#e9f0f7;

  /* Accents terminal */
  --green:     #3fb950;
  --green-lit: #56d364;
  --cyan:      #39d0d8;
  --amber:     #e3b341;
  --magenta:   #bc8cff;
  --red:       #ff7b72;

  --prompt:    var(--green-lit);
  --ring:      rgba(63, 185, 80, .45);

  /* Police : Consolas d'abord (identique au logo sur Windows), sinon JetBrains Mono */
  --font-mono: "Consolas", "JetBrains Mono", "Cascadia Code", ui-monospace,
               "SF Mono", "Menlo", "Monaco", "Liberation Mono", monospace;

  --radius:    14px;
  --radius-sm: 9px;
  --maxw:      1160px;
  --ease:      cubic-bezier(.22, 1, .36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  letter-spacing: .1px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; }
code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .08em .4em;
  font-size: .85em;
  color: var(--cyan);
}

/* Couleurs utilitaires terminal */
.c-green { color: var(--green-lit); }
.c-cyan  { color: var(--cyan); }
.c-dim   { color: var(--text-dim); }
.prompt  { color: var(--prompt); font-weight: 700; }
.hl      { color: var(--cyan); }
.grad {
  background: linear-gradient(105deg, var(--green-lit), var(--cyan) 60%, var(--magenta));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px); }

/* =====================================================================
   Arrière-plan animé (grille + halos + scanlines)
   ===================================================================== */
.fx-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.fx-grid {
  position: absolute; inset: -2px;
  background-image:
    linear-gradient(rgba(63,185,80,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63,185,80,.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
.fx-glow {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .4;
  will-change: transform;
}
.fx-glow--1 { width: 34vw; height: 34vw; top: -10vw; left: -6vw;
  background: radial-gradient(circle, rgba(63,185,80,.28), transparent 70%);
  animation: float1 18s ease-in-out infinite; }
.fx-glow--2 { width: 32vw; height: 32vw; bottom: -12vw; right: -6vw;
  background: radial-gradient(circle, rgba(57,208,216,.22), transparent 70%);
  animation: float2 22s ease-in-out infinite; }
.fx-scanlines {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(transparent 0 2px, rgba(0,0,0,.16) 2px 4px);
  mix-blend-mode: multiply;
}
@keyframes float1 { 50% { transform: translate(6vw, 5vw); } }
@keyframes float2 { 50% { transform: translate(-5vw, -4vw); } }

/* =====================================================================
   Navbar
   ===================================================================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(10,14,20,.72);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--maxw); margin-inline: auto;
  padding: 12px clamp(20px, 5vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

/* Logo — recréé fidèlement : bloc noir arrondi, "AfriCode" blanc monospace */
.logo {
  display: inline-flex; align-items: center; gap: 2px;
  background: #000; color: #fff;
  border: 1px solid var(--border-lit);
  border-radius: 12px;
  padding: 8px 16px;
  font-weight: 700; font-size: 1.15rem; letter-spacing: .5px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.03) inset, 0 6px 20px rgba(0,0,0,.5);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.logo:hover { box-shadow: 0 0 0 1px var(--ring), 0 0 26px rgba(63,185,80,.35); transform: translateY(-1px); }
.logo__text { line-height: 1; }
.logo__cursor {
  width: .55ch; height: 1.05em; margin-left: 3px;
  background: var(--green-lit); display: inline-block;
  animation: blink 1.05s steps(1) infinite;
}
.logo--sm { font-size: 1rem; padding: 6px 13px; }

@keyframes blink { 50% { opacity: 0; } }

.nav__links { display: flex; align-items: center; gap: 6px; }
.nav__links a {
  color: var(--text-dim); font-size: .92rem;
  padding: 8px 12px; border-radius: 8px;
  transition: color .2s, background .2s;
}
.nav__links a:hover { color: var(--text-bright); background: var(--surface); }
.nav__cta {
  color: var(--bg) !important; background: var(--green);
  font-weight: 700;
}
.nav__cta:hover { background: var(--green-lit) !important; box-shadow: 0 0 18px rgba(63,185,80,.5); }

.nav__toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav__toggle span { width: 24px; height: 2px; background: var(--text-bright); border-radius: 2px; transition: .3s var(--ease); }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =====================================================================
   Boutons
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: 10px;
  font-weight: 700; font-size: .95rem;
  transition: transform .2s var(--ease), box-shadow .3s var(--ease), background .2s;
  border: 1px solid transparent; white-space: nowrap;
}
.btn--primary { background: var(--green); color: #04170a; }
.btn--primary:hover { background: var(--green-lit); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(63,185,80,.35); }
.btn--primary .prompt { color: #04170a; }
.btn--ghost { border-color: var(--border-lit); color: var(--text-bright); background: var(--surface); }
.btn--ghost:hover { border-color: var(--green); color: var(--green-lit); transform: translateY(-2px); }
.btn--block { width: 100%; justify-content: center; }

/* =====================================================================
   Terminal (composant réutilisable)
   ===================================================================== */
.terminal {
  background: linear-gradient(180deg, #0c121b, #0a0e15);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(63,185,80,.05) inset;
}
.terminal__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  background: #0e141d; border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot--red { background: #ff5f56; } .dot--amber { background: #ffbd2e; } .dot--green { background: #27c93f; }
.terminal__title {
  margin-left: 10px; color: var(--text-dim); font-size: .82rem; letter-spacing: .3px;
}
.terminal__body {
  padding: 20px; font-size: .92rem; line-height: 1.9;
  min-height: 60px;
}
.terminal__body p { white-space: pre-wrap; word-break: break-word; }
.terminal__body--scroll { height: 320px; overflow-y: auto; }
.terminal__body--scroll::-webkit-scrollbar { width: 10px; }
.terminal__body--scroll::-webkit-scrollbar-thumb { background: var(--border-lit); border-radius: 10px; }

/* Curseur de frappe */
.type-cursor {
  display: inline-block; width: .55ch; height: 1.05em;
  background: var(--green-lit); vertical-align: text-bottom;
  animation: blink 1.05s steps(1) infinite; margin-left: 1px;
}

/* =====================================================================
   Hero
   ===================================================================== */
.hero { position: relative; padding: clamp(48px, 9vw, 100px) 0 90px; }
.hero__grid {
  max-width: var(--maxw); margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(30px, 5vw, 64px);
  align-items: center;
}
.hero__eyebrow {
  color: var(--text-dim); font-size: .95rem; margin-bottom: 18px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  display: inline-block; background: var(--surface);
}
.hero__title {
  font-size: clamp(2.1rem, 5.2vw, 3.7rem); line-height: 1.08;
  font-weight: 800; color: var(--text-bright); letter-spacing: -.5px;
  margin-bottom: 22px;
}
.hero__lead { color: var(--text-dim); font-size: 1.06rem; max-width: 46ch; margin-bottom: 30px; }
.hero__lead strong { color: var(--text-bright); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }

.hero__stats {
  display: flex; gap: clamp(20px, 4vw, 44px); list-style: none; flex-wrap: wrap;
}
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats b { font-size: 1.9rem; color: var(--green-lit); font-weight: 800; line-height: 1; }
.hero__stats span { color: var(--text-dim); font-size: .82rem; margin-top: 6px; }

.terminal--hero .terminal__body { min-height: 300px; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--border-lit); border-radius: 14px;
  display: grid; place-items: start center; padding-top: 7px;
}
.hero__scroll span { width: 4px; height: 8px; background: var(--green-lit); border-radius: 4px; animation: scrolly 1.6s ease-in-out infinite; }
@keyframes scrolly { 50% { transform: translateY(9px); opacity: .3; } }

/* =====================================================================
   Sections génériques
   ===================================================================== */
.section { padding: clamp(60px, 9vw, 110px) 0; position: relative; }
.section--alt { background: linear-gradient(180deg, rgba(13,17,23,.6), rgba(13,17,23,.2)); border-block: 1px solid var(--border); }
.section__head { margin-bottom: 46px; max-width: 640px; }
.section__kicker { color: var(--text-dim); font-size: .92rem; margin-bottom: 12px; }
.section__title { font-size: clamp(1.7rem, 4vw, 2.6rem); color: var(--text-bright); font-weight: 800; letter-spacing: -.5px; }
.section__sub { color: var(--text-dim); margin-top: 12px; font-size: 1.02rem; }

/* Révélation au scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* =====================================================================
   À propos
   ===================================================================== */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 52px); align-items: start; }
.about__text p { margin-bottom: 16px; color: var(--text); }
.about__text strong { color: var(--text-bright); }
.about__text em { color: var(--cyan); font-style: normal; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px; border-radius: 999px; font-size: .85rem;
  border: 1px solid var(--green); color: var(--green-lit); background: rgba(63,185,80,.08);
}
.badge--live { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(63,185,80,.06); } }

.about__values { list-style: none; margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.about__values li { color: var(--text); font-size: .95rem; }
.about__values .prompt { margin-right: 6px; }

/* =====================================================================
   Compétences
   ===================================================================== */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.skill-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 24px;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.skill-card:hover {
  transform: translateY(-6px); border-color: var(--green);
  box-shadow: 0 18px 40px -18px rgba(63,185,80,.35);
}
.skill-card__icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(63,185,80,.1); color: var(--green-lit);
  font-size: 1.25rem; font-weight: 700; margin-bottom: 16px;
  border: 1px solid rgba(63,185,80,.25);
}
.skill-card h3 { color: var(--text-bright); font-size: 1.12rem; margin-bottom: 8px; }
.skill-card p { color: var(--text-dim); font-size: .92rem; margin-bottom: 16px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  font-size: .78rem; color: var(--cyan);
  border: 1px solid var(--border-lit); background: var(--surface-2);
  padding: 4px 10px; border-radius: 7px;
}

/* =====================================================================
   Réalisations
   ===================================================================== */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 22px; }
.project {
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
  position: relative; overflow: hidden;
}
.project::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--green), var(--cyan), transparent);
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease);
}
.project:hover { transform: translateY(-6px); border-color: var(--border-lit); box-shadow: 0 22px 50px -22px rgba(0,0,0,.8); }
.project:hover::before { transform: scaleX(1); }
.project__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.project__folder { color: var(--text-dim); font-size: .85rem; }
.project__year { color: var(--amber); font-size: .82rem; border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.project__name { color: var(--text-bright); font-size: 1.18rem; margin-bottom: 10px; }
.project__desc { color: var(--text-dim); font-size: .93rem; margin-bottom: 16px; flex: 1; }
.project .tags { margin-bottom: 16px; }
.project__links { display: flex; gap: 16px; }
.project__link { color: var(--green-lit); font-size: .88rem; transition: color .2s, letter-spacing .2s; }
.project__link:hover { color: var(--cyan); letter-spacing: .4px; }
.project__link--highlight { color: var(--cyan); font-weight: 700; }

/* Projet mis en avant (Fierté / Flagship) */
.project--featured {
  border-color: rgba(86, 211, 100, 0.45);
  background: linear-gradient(180deg, #131c26, #0e141c);
  box-shadow: 0 0 25px -5px rgba(63, 185, 80, 0.18), 0 18px 40px -15px rgba(0, 0, 0, 0.7);
}
.project--featured::before {
  transform: scaleX(1);
  background: linear-gradient(90deg, var(--green-lit), var(--cyan), var(--amber));
  height: 3px;
}
.project--featured:hover {
  border-color: var(--green-lit);
  box-shadow: 0 0 35px -4px rgba(63, 185, 80, 0.32), 0 25px 50px -15px rgba(0, 0, 0, 0.85);
}
.project__featured-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #0a0e14;
  background: linear-gradient(90deg, var(--green-lit), var(--cyan));
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.project__year--featured {
  color: var(--green-lit);
  border-color: rgba(86, 211, 100, 0.4);
  background: rgba(63, 185, 80, 0.08);
}

.projects__note { margin-top: 26px; color: var(--text-dim); font-size: .88rem; }

/* =====================================================================
   Services
   ===================================================================== */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.service {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 26px; background: var(--surface); position: relative;
  transition: transform .3s var(--ease), border-color .3s;
}
.service:hover { transform: translateY(-5px); border-color: var(--green); }
.service__num { font-size: 2.4rem; font-weight: 800; color: rgba(63,185,80,.28); display: block; margin-bottom: 8px; }
.service h3 { color: var(--text-bright); font-size: 1.15rem; margin-bottom: 10px; }
.service p { color: var(--text-dim); font-size: .95rem; }

/* =====================================================================
   Console interactive
   ===================================================================== */
.terminal--live .terminal__body { line-height: 1.75; }
.terminal__input {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-top: 1px solid var(--border); background: #0b1119;
}
.terminal__input .prompt { font-size: .9rem; white-space: nowrap; }
.terminal__input input {
  flex: 1; background: none; border: none; color: var(--text-bright);
  font-size: .95rem; outline: none;
}
.terminal__input input::placeholder { color: #47525f; }
#consoleOut p { margin-bottom: 2px; }
#consoleOut .cmd-echo { color: var(--text-bright); }
#consoleOut .cmd-err { color: var(--red); }
#consoleOut .cmd-ok { color: var(--green-lit); }
#consoleOut a { color: var(--cyan); text-decoration: underline; }

/* =====================================================================
   Contact
   ===================================================================== */
.contact { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(28px, 4vw, 48px); align-items: start; }
.contact__info { display: flex; flex-direction: column; gap: 14px; }
.contact__row {
  display: flex; flex-direction: column; gap: 3px;
  padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .2s, transform .2s, background .2s;
}
.contact__row:hover { border-color: var(--green); transform: translateX(4px); background: var(--surface-2); }
.contact__label { color: var(--text-dim); font-size: .82rem; }
.contact__value { color: var(--text-bright); font-size: .98rem; word-break: break-all; }
.contact__ps { color: var(--text-dim); font-size: .9rem; margin-top: 6px; }

.contact__form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(22px, 3vw, 32px); }
.field { margin-bottom: 18px; }
.field label { display: block; color: var(--text-dim); font-size: .85rem; margin-bottom: 7px; }
.field label::before { content: "> "; color: var(--prompt); }
.field input, .field textarea {
  width: 100%; background: var(--bg); color: var(--text-bright);
  border: 1px solid var(--border-lit); border-radius: 9px;
  padding: 12px 14px; font-size: .95rem; resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--ring); outline: none; }
.contact__status { margin-top: 14px; font-size: .9rem; min-height: 1.2em; }
.contact__status.ok { color: var(--green-lit); }
.contact__status.err { color: var(--red); }

/* =====================================================================
   Footer
   ===================================================================== */
.footer { border-top: 1px solid var(--border); padding: 40px 0; background: var(--bg-elev); }
.footer__inner { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.footer__tag { color: var(--text-dim); font-size: .92rem; }
.footer__meta { color: var(--text-dim); font-size: .85rem; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .terminal--hero { order: -1; }
  .about { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }

  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed; inset: 62px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: rgba(10,14,20,.97); backdrop-filter: blur(14px);
    padding: 16px clamp(20px, 5vw, 40px) 24px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%); transition: transform .35s var(--ease);
    max-height: calc(100vh - 62px); overflow-y: auto;
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links a { padding: 14px 12px; font-size: 1rem; }
  .nav__cta { text-align: center; margin-top: 6px; }
}

@media (max-width: 520px) {
  .hero__stats { gap: 22px; }
  .hero__stats b { font-size: 1.55rem; }
  .about__values { grid-template-columns: 1fr; }
  .terminal__body { padding: 16px; font-size: .86rem; }
  .terminal__title { display: none; }
}

/* Accessibilité : mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
