/* ============================================================================
 * PRAXIS // TERMINAL DESIGN SYSTEM
 * Palette stricte : Noir Pur (#000000), Blanc Optique (#F4F4F6), Rouge Vif (#FF1E2D)
 * ============================================================================ */

:root {
  --bg: #000000;
  --bg-elevated: #050505;
  --fg: #f4f4f6;
  --fg-muted: #9a9aa2;
  --fg-dim: #52525b;
  --red: #ff1e2d;
  --red-bright: #ff3b47;
  --red-dark: #5c080f;
  --red-glow: rgba(255, 30, 45, 0.24);
  --border: #242429;
  --border-red: #8f0f1a;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

::selection {
  background: var(--red);
  color: var(--bg);
}

html {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtile trame scanline façon moniteur de laboratoire */
.crt-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0px,
    rgba(255, 255, 255, 0) 2px,
    rgba(255, 255, 255, 0.018) 3px,
    rgba(0, 0, 0, 0.14) 4px
  );
}

.terminal-shell {
  max-width: 920px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 2rem 1.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

/* ============================================================================
 * EN-TÊTE & MARQUE PRAXIS
 * ============================================================================ */

.sys-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.sys-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--fg);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.brand-title:hover {
  color: #ffffff;
}

.red-glyph {
  color: var(--red);
  text-shadow: 0 0 12px var(--red-glow);
}

.cursor-blink {
  color: var(--red);
  font-size: 1.2rem;
  margin-left: 0.15rem;
  animation: blinkStep 1.05s steps(2, start) infinite;
}

@keyframes blinkStep {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.sys-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  display: inline-block;
}

.sys-sep {
  color: var(--fg-dim);
}

.sys-clock {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

/* ============================================================================
 * BOUTONS & LIENS INTERACTIFS /[...]
 * ============================================================================ */

.cmd-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.bracket-cmd {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.35rem 0.7rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease, transform 0.1s ease;
  user-select: none;
}

.bracket-cmd .br-slash,
.bracket-cmd .br-open,
.bracket-cmd .br-close {
  color: var(--red);
  font-weight: 700;
}

.bracket-cmd .br-text {
  color: var(--fg);
  padding: 0 0.12rem;
}

.bracket-cmd:hover,
.bracket-cmd:focus-visible {
  outline: none;
  border-color: var(--red);
  background: rgba(255, 30, 45, 0.1);
  box-shadow: 0 0 14px rgba(255, 30, 45, 0.18);
}

.bracket-cmd:active {
  transform: translateY(1px);
}

.bracket-cmd.active {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 16px var(--red-glow);
}

.bracket-cmd.active .br-slash,
.bracket-cmd.active .br-open,
.bracket-cmd.active .br-close,
.bracket-cmd.active .br-text {
  color: var(--bg);
  font-weight: 800;
}

/* Bouton spécial rouge /[avent] */
.bracket-cmd.cmd-red-special {
  border-color: var(--red);
  background: rgba(255, 30, 45, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 30, 45, 0.2);
}

.bracket-cmd.cmd-red-special .br-text {
  color: var(--red-bright);
  font-weight: 700;
}

.bracket-cmd.cmd-red-special:hover,
.bracket-cmd.cmd-red-special:focus-visible {
  background: var(--red);
  box-shadow: 0 0 20px var(--red-glow);
}

.bracket-cmd.cmd-red-special:hover .br-slash,
.bracket-cmd.cmd-red-special:hover .br-open,
.bracket-cmd.cmd-red-special:hover .br-close,
.bracket-cmd.cmd-red-special:hover .br-text {
  color: var(--bg);
}

.mini-cmd {
  font-size: 0.82rem;
  padding: 0.24rem 0.55rem;
}

/* ============================================================================
 * ZONE PRINCIPALE & SECTIONS DU TERMINAL
 * ============================================================================ */

.terminal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  outline: none;
  animation: fadeInTerm 0.18s ease-out;
}

@keyframes fadeInTerm {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.term-section {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.section-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-left: 3px solid var(--red);
  padding-left: 0.75rem;
}

.section-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
}

.section-subcount {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

/* Bloc d'introduction terminal */
.boot-box {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 1.35rem 1.4rem;
  position: relative;
}

.boot-box::before {
  content: 'SYS.BOOT // PRAXIS_LAB';
  position: absolute;
  top: -0.62rem;
  left: 0.9rem;
  background: var(--bg);
  padding: 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--red);
}

.boot-tagline {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.85rem;
}

.boot-lines {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  color: var(--fg-muted);
  font-size: 0.93rem;
}

.boot-lines p::before {
  content: '> ';
  color: var(--red);
  font-weight: 700;
}

/* Répertoire des commandes cliquables sur l'accueil */
.directory-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.dir-row {
  display: grid;
  grid-template-columns: 165px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--fg);
  background: var(--bg);
  transition: background-color 0.14s ease, border-color 0.14s ease;
  cursor: pointer;
}

.dir-row:last-child {
  border-bottom: none;
}

.dir-row:hover {
  background: rgba(255, 30, 45, 0.07);
}

.dir-row.dir-row-red {
  border-left: 3px solid var(--red);
  background: rgba(255, 30, 45, 0.045);
}

.dir-row.dir-row-red:hover {
  background: rgba(255, 30, 45, 0.13);
}

.dir-cmd-token {
  font-weight: 700;
  font-size: 0.96rem;
  white-space: nowrap;
}

.dir-cmd-token .br-slash,
.dir-cmd-token .br-open,
.dir-cmd-token .br-close {
  color: var(--red);
}

.dir-row-red .dir-cmd-token .br-text {
  color: var(--red-bright);
}

.dir-desc {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.dir-row:hover .dir-desc {
  color: var(--fg);
}

.dir-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--red);
  color: var(--red);
  white-space: nowrap;
}

.dir-arrow {
  color: var(--fg-dim);
  font-weight: 700;
  transition: transform 0.14s ease, color 0.14s ease;
}

.dir-row:hover .dir-arrow {
  color: var(--red);
  transform: translateX(3px);
}

/* ============================================================================
 * CARTES PROJETS & FILTRES
 * ============================================================================ */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.project-card {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  border-color: var(--border-red);
  box-shadow: 0 0 18px rgba(255, 30, 45, 0.09);
}

.project-card.featured {
  border-color: var(--red);
}

.project-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--fg-muted);
  margin-bottom: 0.55rem;
}

.project-status {
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.project-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.project-summary {
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

.project-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-chip {
  font-size: 0.72rem;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  padding: 0.1rem 0.45rem;
}

.project-actions {
  display: flex;
  justify-content: flex-start;
}

.cmd-disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

/* ============================================================================
 * CARNET D'ÉCRITS & LECTEUR D'ARTICLES
 * ============================================================================ */

.writings-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.writing-item {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: border-color 0.15s ease;
}

.writing-item:hover {
  border-color: var(--border-red);
}

.writing-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.writing-tag {
  color: var(--red);
  font-weight: 700;
  text-transform: uppercase;
}

.writing-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #ffffff;
}

.writing-excerpt {
  font-size: 0.9rem;
  color: var(--fg-muted);
}

/* Vue lecture complète d'un écrit */
.article-reader {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.article-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.article-h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.35;
}

.article-body {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  font-size: 0.96rem;
  color: var(--fg);
  line-height: 1.78;
}

.article-body h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--red);
  margin-top: 0.5rem;
  letter-spacing: 0.03em;
}

.article-body blockquote {
  border-left: 3px solid var(--red);
  padding: 0.5rem 1rem;
  background: rgba(255, 30, 45, 0.05);
  color: #ffffff;
  font-style: italic;
}

.article-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.article-body ul li::before {
  content: '— ';
  color: var(--red);
  font-weight: 700;
}

.article-body code {
  color: var(--red-bright);
  background: rgba(255, 30, 45, 0.1);
  padding: 0.1rem 0.35rem;
  font-size: 0.9em;
}

/* ============================================================================
 * MANIFESTE
 * ============================================================================ */

.manifesto-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.manifesto-block {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 1.25rem 1.35rem;
}

.manifesto-heading {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.06em;
  margin-bottom: 0.55rem;
}

.manifesto-text {
  font-size: 0.93rem;
  color: var(--fg);
}

/* ============================================================================
 * PIED DE PAGE & INVITE DE COMMANDE LIVE
 * ============================================================================ */

.sys-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cli-output {
  border: 1px solid var(--border);
  background: #040404;
  padding: 0.75rem 0.95rem;
  font-size: 0.84rem;
  max-height: 170px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cli-output.hidden {
  display: none;
}

.cli-line-cmd {
  color: var(--fg-muted);
}

.cli-line-resp {
  color: var(--fg);
}

.cli-line-red {
  color: var(--red-bright);
}

.cli-prompt-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 0.55rem 0.75rem;
}

.cli-prompt-bar:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 12px rgba(255, 30, 45, 0.14);
}

.cli-prompt-label {
  font-size: 0.86rem;
  white-space: nowrap;
  user-select: none;
}

.prompt-user {
  color: var(--red);
  font-weight: 700;
}

.prompt-colon,
.prompt-hash {
  color: var(--fg-muted);
}

.prompt-path {
  color: #ffffff;
  font-weight: 600;
}

.cli-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.cli-input::placeholder {
  color: var(--fg-dim);
}

.footer-meta-line {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: var(--fg-dim);
  letter-spacing: 0.06em;
}

.red-text {
  color: var(--red);
}

/* ============================================================================
 * RESPONSIVE MOBILE
 * ============================================================================ */

@media (max-width: 640px) {
  .terminal-shell {
    padding: 1.25rem 1rem 1.75rem;
    gap: 1.65rem;
  }

  .brand-title {
    font-size: 1.38rem;
  }

  .dir-row {
    grid-template-columns: 1fr auto;
    gap: 0.45rem;
  }

  .dir-desc {
    grid-column: 1 / -1;
    order: 3;
    font-size: 0.85rem;
  }

  .cli-prompt-label {
    font-size: 0.78rem;
  }

  .prompt-user {
    display: none;
  }

  .prompt-colon {
    display: none;
  }
}
