/* style.css */

/* ─── Imports ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ─── Variables ───────────────────────────────────────────── */
:root {
  --bg:             #0d1117;
  --bg-secondary:   #161b22;
  --border:         #21262d;
  --border-hover:   #30363d;
  --text-primary:   #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted:     #484f58;

  --blue:        #58a6ff;
  --green:       #3fb950;
  --purple:      #d2a8ff;
  --orange:      #ffa657;

  --border-blue:   #1f6feb;
  --border-green:  #238636;
  --border-purple: #553098;
  --border-orange: #9e6a03;

  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'DM Sans', system-ui, sans-serif;

  --nav-height: 56px;
  --max-width: 900px;
  --padding-x: 40px;

  --bg-rgb: 13, 17, 23;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100svh;
}

a { color: inherit; text-decoration: none; }

a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ─── Navigation ──────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(var(--bg-rgb), 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  padding: 0 var(--padding-x);
  gap: 32px;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  margin-right: auto;
  text-decoration: none;
}

.nav-logo span { color: var(--green); }

.nav-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--text-primary); }

.nav-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
  border-radius: 2px;
  color: var(--text-primary);
}

.nav-link.active { color: var(--blue); }

/* ─── Page wrapper ────────────────────────────────────────── */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 72px var(--padding-x);
}

/* ─── Section label ───────────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::before {
  content: '//';
  color: var(--text-muted);
}

/* ─── Page title ──────────────────────────────────────────── */
.page-title {
  font-size: clamp(32px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin-bottom: 0;
}

/* ─── Divider ─────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
}

/* ─── Tags / Badges ───────────────────────────────────────── */
.tag {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 4px;
  white-space: nowrap;
}

.tag--blue   { border-color: var(--border-blue);   color: var(--blue);   background: var(--bg); }
.tag--green  { border-color: var(--border-green);  color: var(--green);  background: var(--bg); }
.tag--purple { border-color: var(--border-purple); color: var(--purple); background: var(--bg); }
.tag--orange { border-color: var(--border-orange); color: var(--orange); background: var(--bg); }

/* ─── Fade-in animation (utilisé par main.js) ─────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Cursor clignotant ───────────────────────────────────── */
.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--blue);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 1.2s step-end infinite;
}

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

/* ─── Responsive ──────────────────────────────────────────── */
/* ─── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .cursor {
    animation: none;
    opacity: 1;
  }
}

@media (max-width: 640px) {
  :root {
    --padding-x: 20px;
  }

  .nav { gap: 20px; }
  .nav-logo { font-size: 12px; }
  .nav-link { font-size: 12px; }
}

/* ─── Easter egg terminal ─────────────────────────────── */
.ee-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.ee-overlay.ee-visible {
  opacity: 1;
  pointer-events: all;
}

.ee-window {
  width: min(640px, calc(100vw - 40px));
  max-height: min(480px, calc(100vh - 80px));
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
}

.ee-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ee-titlebar-title {
  color: var(--text-secondary);
  font-size: 12px;
}

.ee-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}

.ee-close:hover { color: var(--text-primary); }

.ee-output {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  color: var(--green);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.ee-output-line { display: block; }
.ee-output-line--dim { color: var(--text-muted); }
.ee-output-line--info { color: var(--blue); }
.ee-output-line--warn { color: var(--orange); }
.ee-output-line--error { color: #f85149; }
.ee-output-line--plain { color: var(--text-secondary); }

.ee-input-wrap {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  gap: 8px;
  flex-shrink: 0;
}

.ee-prompt {
  color: var(--blue);
  user-select: none;
  flex-shrink: 0;
}

.ee-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  caret-color: var(--blue);
}
