/* ==========================================================================
   Matthieu VIGUIER (@matDOTviguier) — Modern Cyber-Terminal Stylesheet
   Zero External CDN · Self-contained System Font Stack · Dark/Light Themes
   License: CC BY-NC-SA 4.0 — © Matthieu VIGUIER
   ========================================================================== */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f1623;
  --bg-card: #131c2e;
  --bg-terminal: #070a10;
  --terminal-header-bg: #111827;
  --terminal-header-border: #1e293b;
  --terminal-input-bg: #0b111e;
  --terminal-text: #e2e8f0;
  --terminal-text-muted: #94a3b8;
  --terminal-line-border: rgba(148, 163, 184, 0.15);
  --terminal-input-text: #f8fafc;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #1e293b;
  --border-highlight: #334155;
  --accent-orange: #fc6d26;
  --accent-amber: #fca326;
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-crimson: #d70a53;
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.65);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-terminal: #ffffff;
  --terminal-header-bg: #e2e8f0;
  --terminal-header-border: #cbd5e1;
  --terminal-input-bg: #f8fafc;
  --terminal-text: #0f172a;
  --terminal-text-muted: #475569;
  --terminal-line-border: rgba(100, 116, 139, 0.2);
  --terminal-input-text: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --border-highlight: #94a3b8;
  --accent-orange: #e24329;
  --accent-amber: #d97706;
  --accent-cyan: #0284c7;
  --accent-emerald: #059669;
  --accent-crimson: #be123c;
  --shadow-lg: 0 15px 30px -10px rgba(15, 23, 42, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-orange);
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(9, 13, 22, 0.82);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .site-header {
  background: rgba(248, 250, 252, 0.88);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.25rem;
  gap: 1rem;
}

.brand {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--text-primary);
}

.prompt-user {
  color: var(--accent-emerald);
}

.prompt-path {
  color: var(--accent-cyan);
}

.prompt-dollar {
  color: var(--text-muted);
  margin-right: 0.35rem;
}

.prompt-cmd {
  color: var(--accent-orange);
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  background: var(--accent-emerald);
  margin-left: 4px;
  animation: blink 1.1s step-end infinite;
}

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

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.4rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.btn-chip:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: 0.55rem;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-orange), #e24329);
  color: #ffffff;
  border: 1px solid transparent;
}

.btn-primary:hover {
  color: #ffffff;
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-highlight);
}

.btn-secondary:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-emerald);
  border: 1px dashed var(--accent-emerald);
}

.btn-ghost:hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
}

/* Hero Section */
.hero-section {
  padding: 4.5rem 0 3.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 2.5rem;
  align-items: center;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.status-hero {
  border-color: rgba(252, 109, 38, 0.5);
  color: var(--accent-orange);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-orange);
  box-shadow: 0 0 8px var(--accent-orange);
}

.hero-title {
  font-size: clamp(2.1rem, 4vw, 3.25rem);
  line-height: 1.15;
  font-weight: 800;
  margin-bottom: 1.15rem;
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-amber), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-handle {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--accent-emerald);
  margin-top: 0.35rem;
}

.hero-quote {
  font-size: 1.08rem;
  color: var(--text-primary);
  margin-bottom: 0.9rem;
}

.hero-subquote {
  font-size: 0.86rem;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent-orange);
  padding-left: 0.9rem;
  margin-bottom: 1.65rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.65rem;
  padding: 0.85rem;
}

.metric-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.metric-lbl {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

/* Terminal Window */
.terminal-window {
  background: var(--bg-terminal);
  border: 1px solid var(--border-highlight);
  border-radius: 0.85rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  color: var(--terminal-text);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--terminal-header-bg);
  border-bottom: 1px solid var(--terminal-header-border);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.terminal-dots {
  display: flex;
  gap: 0.45rem;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-amber { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--terminal-text-muted);
}

.terminal-body {
  padding: 1.35rem;
}

.profile-fetch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.avatar-wrapper {
  position: relative;
}

.profile-avatar {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 3px solid var(--accent-orange);
  object-fit: cover;
}

.avatar-badge {
  position: absolute;
  bottom: 0;
  right: -8px;
  background: var(--terminal-header-bg);
  border: 1px solid var(--accent-orange);
  color: var(--terminal-text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.sys-specs {
  width: 100%;
  font-size: 0.8rem;
  display: grid;
  gap: 0.42rem;
}

.sys-specs div {
  display: grid;
  grid-template-columns: 88px 1fr;
  border-bottom: 1px dashed var(--terminal-line-border);
  padding-bottom: 0.25rem;
}

.sys-specs dt {
  color: var(--accent-orange);
  font-weight: 600;
}

.sys-specs dd {
  color: var(--terminal-text);
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  max-width: 760px;
  margin-bottom: 2.75rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent-emerald);
  margin-bottom: 0.4rem;
}

.section-title {
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 0.65rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Timeline */
.timeline {
  position: relative;
  border-left: 2px solid var(--border-highlight);
  margin-left: 0.75rem;
  padding-left: 1.75rem;
  display: grid;
  gap: 1.75rem;
}

.timeline-item {
  position: relative;
}

.timeline-marker {
  position: absolute;
  left: -2.25rem;
  top: 1.35rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--accent-cyan);
}

.marker-active {
  border-color: var(--accent-orange);
  box-shadow: 0 0 10px var(--accent-orange);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  padding: 1.5rem;
  transition: border-color 0.2s ease;
}

.timeline-card:hover {
  border-color: var(--accent-cyan);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-bottom: 0.45rem;
}

.timeline-period {
  color: var(--accent-emerald);
}

.timeline-org {
  color: var(--accent-orange);
  font-weight: 600;
}

.timeline-role {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
}

.timeline-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Cards & Tags */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.35rem;
}

.feature-card,
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover,
.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-cyan);
}

.card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.feature-card h3,
.project-card h3 {
  font-size: 1.12rem;
  margin-bottom: 0.6rem;
}

.feature-card p,
.project-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 1.1rem;
  flex-grow: 1;
}

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

.tag {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  padding: 0.22rem 0.55rem;
  border-radius: 0.35rem;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.22);
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.project-badge {
  font-size: 0.74rem;
  color: var(--accent-amber);
}

.project-link {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.project-footer {
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-color);
  padding-top: 0.65rem;
  word-break: break-all;
}

/* Interactive Terminal */
.quick-cmds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cmd-btn {
  background: var(--bg-card);
  color: var(--accent-emerald);
  border: 1px solid var(--border-highlight);
  border-radius: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
}

.cmd-btn:hover {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
}

.terminal-interactive {
  max-width: 920px;
}

.terminal-log {
  min-height: 240px;
  max-height: 360px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.term-line {
  margin-bottom: 0.55rem;
}

.term-cmd {
  color: var(--accent-amber);
  font-weight: 600;
}

.term-res {
  color: var(--terminal-text);
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  background: var(--terminal-input-bg);
  border-top: 1px solid var(--terminal-header-border);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.prompt-label {
  color: var(--accent-emerald);
  font-size: 0.85rem;
  white-space: nowrap;
}

#term-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--terminal-input-text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
}

/* Social Grid */
.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.social-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
  color: var(--text-primary);
}

.social-card:hover {
  border-color: var(--accent-orange);
  color: var(--text-primary);
}

.social-icon {
  font-size: 1.6rem;
}

.social-card strong {
  display: block;
  font-size: 0.95rem;
}

.social-card span.mono {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* Responsive */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .cards-grid,
  .social-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .metrics-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .main-nav {
    display: none;
  }
  .cards-grid,
  .social-grid,
  .metrics-strip {
    grid-template-columns: 1fr;
  }
}
