/* ── Tom Rouvier · portfolio ──────────────────────────────────────────────
   Thème « terminal / infra » : sombre, accent cyan, prompt ambre.
   Zéro dépendance externe : polices système uniquement. */

:root {
  --bg: #0a0e14;
  --bg-soft: #0f1520;
  --panel: #111927;
  --line: #1e2a3a;
  --text: #d7e1ee;
  --muted: #8fa1b8;
  --accent: #53e0c4;
  --accent-dim: #2a8f7d;
  --amber: #f2b25c;
  --danger: #f26d6d;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #05261f; }

code { font-family: var(--mono); color: var(--accent); font-size: 0.92em; }
.prompt { font-family: var(--mono); color: var(--amber); }

/* Canvas constellation en fond fixe */
#mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem clamp(1rem, 4vw, 3rem);
  background: rgba(10, 14, 20, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-brand {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
}
.nav nav { display: flex; gap: clamp(0.6rem, 2vw, 1.6rem); align-items: center; }
.nav nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav nav a:hover, .nav nav a:focus-visible { color: var(--accent); }
.nav-cta {
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  color: var(--accent) !important;
}
.nav-cta:hover { background: rgba(83, 224, 196, 0.1); }

/* ── Hero ── */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding: 6.5rem clamp(1rem, 5vw, 4rem) 3rem;
  max-width: 1200px;
  margin: 0 auto;
}
.hero-hello { margin: 0 0 0.3rem; color: var(--muted); font-size: 1.05rem; }
.hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.caret {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
  font-size: 0.8em;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-role {
  margin: 0.9rem 0 0;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--muted);
}
#typed { color: var(--accent); font-family: var(--mono); }
.hero-pitch {
  margin: 1.2rem 0 1.8rem;
  color: var(--muted);
  max-width: 34rem;
}
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #05261f;
}
.btn-primary:hover { box-shadow: 0 0 24px rgba(83, 224, 196, 0.35); }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent-dim); color: var(--accent); }
.btn-lg { padding: 0.85rem 1.7rem; font-size: 1.05rem; }

/* ── Terminal ── */
.term {
  background: #0b111b;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.88rem;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  background: #121a28;
  border-bottom: 1px solid var(--line);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.term-title { margin-left: 0.6rem; color: var(--muted); font-size: 0.78rem; }
.term-screen {
  height: 320px;
  overflow-y: auto;
  padding: 0.9rem 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: #c4d2e3;
}
.term-screen:focus-visible { outline: 1px solid var(--accent-dim); outline-offset: -1px; }
.term-screen .t-cmd { color: var(--text); }
.term-screen .t-accent { color: var(--accent); }
.term-screen .t-amber { color: var(--amber); }
.term-screen .t-err { color: var(--danger); }
.term-screen .t-dim { color: var(--muted); }
.term-screen a { color: var(--accent); }
.term-input-row {
  display: flex;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--line);
  background: #0d1420;
}
.term-input-row .prompt { flex-shrink: 0; }
#term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
  caret-color: var(--accent);
}
#term-input::placeholder { color: #4d5e73; }

/* ── Sections ── */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1rem, 5vw, 3rem);
}
.section-title {
  font-family: var(--mono);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  margin: 0 0 0.4rem;
}
.section-sub { color: var(--muted); margin: 0 0 2.2rem; max-width: 44rem; }

/* Cartes */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
}
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: linear-gradient(160deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.3rem;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-dim);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.card h3 { margin: 0.2rem 0 0.5rem; font-size: 1.12rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card-icon { font-size: 1.6rem; }
.card-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0.9rem 0 0;
}
.card-tags li {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  opacity: 0.85;
}
.proj-kind {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--amber);
  letter-spacing: 0.04em;
}

/* Pipeline animé */
.pipeline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2.5rem;
  padding: 1.1rem 1.2rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pipe-stage {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.pipe-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent-dim);
  box-shadow: 0 0 0 0 rgba(83, 224, 196, 0.5);
}
.pipeline.play .pipe-dot { animation: pulse 3.5s infinite; }
.pipeline.play .pipe-stage:nth-child(3) .pipe-dot { animation-delay: 0.7s; }
.pipeline.play .pipe-stage:nth-child(5) .pipe-dot { animation-delay: 1.4s; }
.pipeline.play .pipe-stage:nth-child(7) .pipe-dot { animation-delay: 2.1s; }
.pipeline.play .pipe-stage:nth-child(9) .pipe-dot { animation-delay: 2.8s; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(83, 224, 196, 0.55); background: var(--accent); }
  18%  { box-shadow: 0 0 0 8px rgba(83, 224, 196, 0); }
  36%, 100% { box-shadow: 0 0 0 0 rgba(83, 224, 196, 0); background: var(--accent-dim); }
}
.pipe-link {
  flex: 1;
  min-width: 18px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-dim), var(--line));
}
.pipe-ok code { color: var(--accent); }

/* Stack */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.6rem 2rem;
}
.stack-col h3 {
  font-size: 1rem;
  margin: 0 0 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.stack-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--amber);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
}
.chips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.chips li {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
}
.chips li:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Timeline */
.timeline {
  margin-top: 2rem;
  border-left: 1px solid var(--line);
  padding-left: 1.6rem;
  display: grid;
  gap: 1.8rem;
  max-width: 44rem;
}
.tl-item { position: relative; }
.tl-item::before {
  content: "";
  position: absolute;
  left: calc(-1.6rem - 5px);
  top: 0.45rem;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent-dim);
}
.tl-head::before { background: var(--accent); box-shadow: 0 0 12px rgba(83, 224, 196, 0.7); }
.tl-hash {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--amber);
}
.tl-head .tl-hash { color: var(--accent); font-weight: 700; }
.tl-item h3 { margin: 0.15rem 0 0.35rem; font-size: 1.08rem; }
.tl-item p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Contact */
.section-contact { text-align: center; }
.section-contact .section-sub { margin-inline: auto; }
.contact-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.4rem 0;
}
.contact-pong { color: var(--muted); }
.contact-pong code { color: var(--muted); }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 2rem clamp(1rem, 5vw, 3rem) 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}
.footer p { margin: 0.3rem 0; }
.footer-meta { max-width: 46rem; margin-inline: auto !important; }
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #35d07f;
  margin: 0 0.15rem 0 0.35rem;
  animation: blink 2.4s ease infinite;
}

/* Apparition au scroll */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.on { opacity: 1; transform: none; }

/* ── Responsive ── */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-top: 5.5rem; min-height: auto; }
  .term-screen { height: 260px; }
  .nav nav a:not(.nav-cta) { display: none; }
}

/* ── Accessibilité : mouvement réduit ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret, .status-dot { animation: none; }
  .pipeline.play .pipe-dot { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
