/* ============ maloware.dev — feuille de style ============ */

:root {
  --bg: #0a0e14;
  --bg-alt: #0e131c;
  --surface: #131a26;
  --surface-2: #18202e;
  --border: #223047;
  --text: #dbe4f0;
  --text-dim: #8b98ab;
  --accent: #4ade80;
  --accent-dim: rgba(74, 222, 128, 0.12);
  --accent-2: #38bdf8;
  --radius: 12px;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }

/* ============ Navigation ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.logo:hover { text-decoration: none; }
.logo { display: inline-flex; align-items: center; }
.logo-mark { display: block; border-radius: 7px; margin-right: 10px; }
.logo-accent { color: var(--accent); }
.logo-bracket { color: var(--text-dim); opacity: 0.6; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-cta {
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent) !important;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--accent-dim); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.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); }

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 160px 0 90px;
  overflow: hidden;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.18;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 75%);
}

.hero-inner { position: relative; }

.hero-kicker {
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  font-weight: 800;
}
.hero-sub {
  display: block;
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--text-dim);
  margin-top: 8px;
}

.hero-lede {
  max-width: 620px;
  margin: 28px 0 36px;
  font-size: 1.1rem;
  color: var(--text-dim);
}
.hero-lede strong { color: var(--text); font-weight: 600; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Boutons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #05240f;
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(74, 222, 128, 0.25); }

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-small { padding: 8px 16px; font-size: 0.85rem; }
.btn-large { padding: 15px 30px; font-size: 1.05rem; }

/* Terminal */
.hero-terminal {
  margin-top: 56px;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
.terminal-bar {
  display: flex;
  gap: 7px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.terminal-bar span {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--border);
}
.terminal-bar span:nth-child(1) { background: #f87171; }
.terminal-bar span:nth-child(2) { background: #fbbf24; }
.terminal-bar span:nth-child(3) { background: #4ade80; }

.terminal-body {
  padding: 18px 20px;
  font-size: 0.88rem;
  line-height: 1.9;
}
.t-prompt { color: var(--accent); }
.t-cmd { color: var(--accent-2); }
.t-out { color: var(--text-dim); }
.t-ok { color: var(--accent); }

.cursor {
  animation: blink 1.1s steps(1) infinite;
  color: var(--accent);
}
@keyframes blink { 50% { opacity: 0; } }

/* ============ Sections ============ */
.section { padding: 90px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 40px;
}
.section-num {
  color: var(--accent);
  font-size: 0.7em;
  font-weight: 500;
  margin-right: 10px;
}

.section-lede {
  color: var(--text-dim);
  max-width: 640px;
  margin: -24px 0 44px;
}

/* ============ À propos ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text p { margin-bottom: 18px; color: var(--text-dim); }
.about-text strong { color: var(--text); }

.about-facts { display: grid; gap: 16px; }
.fact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.fact-num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}
.fact-label { color: var(--text-dim); font-size: 0.9rem; }

/* ============ Compétences ============ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.25s, transform 0.25s;
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.skill-icon { font-size: 1.8rem; margin-bottom: 14px; }
.skill-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.skill-card p { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 16px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}
.tags li {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(74, 222, 128, 0.2);
}

/* ============ Projets ============ */
.featured-projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.featured-card {
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.featured-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.featured-thumb {
  display: block;
  margin: -32px -32px 6px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.featured-thumb img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: top;
  transition: transform 0.35s ease;
}
.featured-card:hover .featured-thumb img { transform: scale(1.03); }
.featured-thumb-mobile img { object-position: center 12%; }

.featured-label {
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.featured-card h3 { font-size: 1.5rem; }
.featured-desc { color: var(--text-dim); font-size: 0.98rem; flex-grow: 1; }
.card-links { margin-top: 6px; }

.private-note {
  font-size: 0.82rem;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  display: inline-block;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.25s, transform 0.25s;
}
.project-card:hover { border-color: var(--accent-2); transform: translateY(-4px); }

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.folder { color: var(--accent); font-size: 1.3rem; }
.lang { font-size: 0.75rem; padding: 3px 10px; border-radius: 99px; }
.lang.js   { background: rgba(250, 204, 21, 0.12); color: #facc15; }
.lang.ts   { background: rgba(56, 189, 248, 0.12); color: #38bdf8; }
.lang.py   { background: rgba(96, 165, 250, 0.12); color: #60a5fa; }
.lang.dart { background: rgba(45, 212, 191, 0.12); color: #2dd4bf; }
.lang.html { background: rgba(251, 146, 60, 0.12); color: #fb923c; }

.project-card h3 { font-size: 1.1rem; }
.project-card > p { color: var(--text-dim); font-size: 0.9rem; flex-grow: 1; }

.projects-more {
  margin-top: 36px;
  text-align: center;
  color: var(--text-dim);
}

/* ============ Méthode ============ */
.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  list-style: none;
  counter-reset: step;
}

.process-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.25s;
}
.process-step:hover { border-color: var(--accent); }
.step-num { color: var(--accent); font-size: 0.85rem; margin-bottom: 10px; }
.process-step h3 { font-size: 1.05rem; margin-bottom: 8px; }
.process-step p { color: var(--text-dim); font-size: 0.9rem; }

/* ============ Contact ============ */
.contact-inner { text-align: center; }
.contact-inner .section-title { justify-content: center; }
.contact-lede {
  color: var(--text-dim);
  font-size: 1.15rem;
  margin: -16px 0 36px;
}
.contact-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============ Footer ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-dim);
  font-size: 0.82rem;
}
.footer a { color: var(--text-dim); }
.footer a:hover { color: var(--accent); }

/* ============ Animations reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cursor { animation: none; }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .skills-grid,
  .featured-projects { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .process-steps { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .about-facts { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 130px 0 60px; }
  .section { padding: 64px 0; }
  .projects-grid { grid-template-columns: 1fr; }
  .process-steps { grid-template-columns: 1fr; }
  .about-facts { grid-template-columns: 1fr; }

  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    display: none;
    padding: 12px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 10px 24px; }
  .nav-cta { display: inline-block; text-align: center; }
}
