/* ============================================================
   SAMAEL LEGROS — PORTFOLIO
   style.css
   Dark technical aesthetic · Space Mono + DM Sans
   ============================================================ */

/* ---- RESET & BASE ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colors */
  --bg:           #0d0f14;
  --bg-surface:   #13161d;
  --bg-card:      #181c26;
  --bg-card-hover:#1e2332;
  --border:       #252a38;
  --border-light: #2e3447;

  --accent:       #4f8ef7;       /* electric blue */
  --accent-dim:   rgba(79,142,247,.12);
  --accent-mid:   rgba(79,142,247,.3);
  --accent-edu:   #3ecfb2;       /* teal for education */
  --accent-edu-dim: rgba(62,207,178,.12);

  --text-primary:   #e8ecf4;
  --text-secondary: #8d95ab;
  --text-muted:     #545d74;

  /* Typography */
  --font-mono: 'Space Mono', monospace;
  --font-body: 'DM Sans', sans-serif;

  /* Spacing */
  --section-gap: 7rem;
  --container:   1100px;
  --radius:      8px;
  --radius-lg:   14px;

  /* Transitions */
  --transition: 200ms ease;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Selection */
::selection {
  background: var(--accent);
  color: #fff;
}

/* ---- UTILITY ---- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem;
}

.section-padding {
  padding: var(--section-gap) 0;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   HEADER / NAV
   ============================================================ */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(13, 15, 20, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: border-color var(--transition);
}

.nav-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo-dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--border);
}

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  padding: 0.45rem 1rem;
  border: 1px solid var(--accent-mid);
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.nav-cta:hover {
  background: var(--accent-dim);
}

/* Burger button */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: auto;
}

.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Mobile menu */
.mobile-menu {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem 1.5rem;
}

.mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-menu a {
  display: block;
  padding: 0.6rem 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.mobile-menu a:hover { color: var(--accent); }
.mobile-menu li:last-child a { border-bottom: none; }

/* ============================================================
   SECTION HEADER PATTERN
   ============================================================ */
.section-header {
  margin-bottom: 3.5rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.section-desc {
  margin-top: -2.5rem;
  margin-bottom: 2.5rem;
  color: var(--text-secondary);
  max-width: 55ch;
  font-size: 0.95rem;
}

/* ============================================================
   HERO
   ============================================================ */
.section-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 2rem 5rem;
  position: relative;
  overflow: hidden;
}

/* Grid background pattern */
.section-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.25;
  pointer-events: none;
}

/* Radial glow */
.section-hero::after {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(79,142,247,.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-mid);
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  margin-bottom: 2rem;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 10vw, 6.5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.hero-name-accent {
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin: 1.5rem auto;
  line-height: 1.6;
}

.hero-subtitle strong {
  color: var(--text-primary);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

/* Decorative element */
.hero-deco {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.deco-line {
  width: 1px;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--border-light), transparent);
}

.deco-badge {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
}

.deco-badge-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  text-transform: uppercase;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #6ba0fa;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-light);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: var(--bg-surface);
}

/* ============================================================
   ABOUT
   ============================================================ */
.section-about {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 4rem;
  align-items: start;
}

.about-lead {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  line-height: 1.75;
}

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

.about-text strong {
  color: var(--text-primary);
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.info-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-item:first-child {
  padding-top: 0;
}

.info-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.info-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.info-value.available {
  color: var(--accent-edu);
  font-weight: 600;
}

.info-link {
  text-decoration: none;
  color: var(--accent);
  transition: opacity var(--transition);
}

.info-link:hover { opacity: 0.7; }

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.skill-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.skill-block:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.skill-block-icon {
  color: var(--accent);
  margin-bottom: 1rem;
}

.skill-block-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 400;
}

.skill-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tags li {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border-light);
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  transition: border-color var(--transition), color var(--transition);
}

.skill-block:hover .skill-tags li {
  border-color: var(--accent-mid);
  color: var(--text-primary);
}

/* ============================================================
   TECHNOLOGIES
   ============================================================ */
.section-tech {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tech-list span {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-mid);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  letter-spacing: 0.03em;
  transition: background var(--transition);
}

.tech-list span:hover {
  background: rgba(79,142,247,.2);
}

/* ============================================================
   EXPERIENCE — TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 2rem;
}

/* Vertical line */
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent-mid), var(--border), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding-bottom: 0.5rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

/* Dot */
.timeline-marker {
  position: absolute;
  left: -2.4rem;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px var(--accent-mid);
}

.timeline-edu .timeline-marker {
  background: var(--accent-edu);
  box-shadow: 0 0 0 3px var(--accent-edu-dim);
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  transition: border-color var(--transition);
}

.timeline-item:hover .timeline-content {
  border-color: var(--border-light);
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.timeline-type {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.timeline-type--edu {
  color: var(--accent-edu);
  background: var(--accent-edu-dim);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
}

.timeline-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.timeline-org {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.timeline-tasks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-tasks li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding-left: 1rem;
  position: relative;
  line-height: 1.6;
}

.timeline-tasks li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
  top: 0.05em;
}

/* ============================================================
   TRAVAUX PRATIQUES
   ============================================================ */
.section-tp {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

/* Loading */
.tp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.tp-loading-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty */
.tp-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.tp-empty svg { opacity: 0.4; }

.tp-empty-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tp-empty-hint code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* Grid */
.tp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Card */
.tp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.tp-card:hover {
  border-color: var(--accent-mid);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.tp-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--accent-dim);
  border: 1px solid var(--accent-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.tp-card-body {
  flex: 1;
  min-width: 0;
}

.tp-card-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
}

.tp-card-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tp-card-dl {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition);
}

.tp-card:hover .tp-card-dl {
  color: var(--accent);
}

/* Info box */
.tp-info-box {
  margin-top: 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.tp-info-box svg { flex-shrink: 0; margin-top: 2px; }

.tp-info-box strong { color: var(--text-secondary); }

.tp-info-box code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* ============================================================
   FOOTER
   ============================================================ */
#footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.footer-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.footer-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--accent); }

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 100%;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
/* Fade-in-up for sections */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
[data-animate-stagger] > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

[data-animate-stagger].is-visible > *:nth-child(1)  { opacity: 1; transform: none; transition-delay: 0.05s; }
[data-animate-stagger].is-visible > *:nth-child(2)  { opacity: 1; transform: none; transition-delay: 0.12s; }
[data-animate-stagger].is-visible > *:nth-child(3)  { opacity: 1; transform: none; transition-delay: 0.19s; }
[data-animate-stagger].is-visible > *:nth-child(4)  { opacity: 1; transform: none; transition-delay: 0.26s; }
[data-animate-stagger].is-visible > *:nth-child(5)  { opacity: 1; transform: none; transition-delay: 0.33s; }
[data-animate-stagger].is-visible > *:nth-child(6)  { opacity: 1; transform: none; transition-delay: 0.40s; }

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

/* Tablet */
@media (max-width: 900px) {
  :root { --section-gap: 5rem; }

  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }

  .hero-deco { display: none; }

  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }
}

/* Mobile */
@media (max-width: 600px) {
  :root { --section-gap: 4rem; }

  .container { padding: 0 1.25rem; }

  .hero-title { font-size: clamp(2.5rem, 14vw, 4rem); }

  .section-header { flex-direction: column; gap: 0.25rem; }

  .skills-grid { grid-template-columns: 1fr; }

  .timeline { padding-left: 1.5rem; }
  .timeline-marker { left: -1.9rem; }

  .timeline-header { flex-direction: column; gap: 0.25rem; }
  .timeline-date { margin-left: 0; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .footer-links { margin-left: 0; }

  .hero-actions { flex-direction: column; }
  .btn { justify-content: center; width: 100%; }
}
