/* ============================================================
   THIBAUT DUFOUR — MODERN PORTFOLIO
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Variables ─────────────────────────────────────────── */
:root {
  --bg:            #ffffff;
  --bg-sidebar:    #fafafa;
  --bg-card:       #f5f5f5;
  --bg-card-hover: #efefef;
  --accent:        #0a66c2;
  --accent-light:  #0052a3;
  --accent-glow:   rgba(10, 102, 194, 0.08);
  --gold:          #6b7280;
  --gold-dim:      rgba(107, 114, 128, 0.08);
  --text:          #1a1a1a;
  --text-muted:    #4b5563;
  --text-dim:      #9ca3af;
  --border:        #e5e7eb;
  --border-strong: #d1d5db;
  --sidebar-w:     260px;
  --ease:          cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ─── Sidebar ───────────────────────────────────────────── */
#sidebar {
  position: fixed;
  inset-block: 0;
  left: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s var(--ease);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Remove textured background */
#sidebar::before {
  display: none;
}

/* Subtle edge accent */
#sidebar::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 1px;
  background: var(--border);
  opacity: 1;
  pointer-events: none;
}

.sidebar-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2.25rem 1.5rem;
}

/* ─── Profile ───────────────────────────────────────────── */
.profile {
  text-align: center;
  margin-bottom: 2.5rem;
}

.profile-img-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 1.25rem;
}

.profile-img {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: none;
}

.profile-ring {
  display: none;
}

.profile-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-transform: none;
  color: var(--text);
}
.profile-name span { color: var(--accent); }

.profile-role {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-weight: 500;
}

.profile-company {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
  letter-spacing: 0;
}

/* ─── Nav ───────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-dim);
  margin-bottom: 0.05rem;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
  position: relative;
}

.sidebar-nav a::before {
  content: '';
  position: absolute;
  left: 0; top: 22%; bottom: 22%;
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.sidebar-nav a:hover {
  color: var(--text);
  background: #f0f0f0;
}

.sidebar-nav a.active {
  color: var(--accent);
  background: #f0f0f0;
}

.sidebar-nav a.active::before,
.sidebar-nav a:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.nav-pip {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.sidebar-nav a.active .nav-pip,
.sidebar-nav a:hover .nav-pip {
  opacity: 1;
}

/* ─── Sidebar footer ────────────────────────────────────── */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.social-links {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}

.social-links a:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  color: var(--accent);
  transform: translateY(-2px);
}

.sidebar-email {
  display: block;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: var(--text-dim);
  word-break: break-all;
  transition: color 0.2s;
}

.sidebar-email:hover { color: var(--accent); }

/* ─── Mobile toggle ─────────────────────────────────────── */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 200;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
}

.mobile-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all 0.25s var(--ease);
}

.mobile-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mobile-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sidebar-overlay.visible { display: block; }

/* ─── Main Layout ───────────────────────────────────────── */
#main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

/* ─── Sections ──────────────────────────────────────────── */
section {
  padding: 6rem 5rem 5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  background: var(--bg);
}

section:nth-child(even) {
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}

section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
  border-radius: 2px;
}

section:last-child { border-bottom: none; }

.section-tag {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.section-title {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  display: none;
}

/* ─── About (Hero) ──────────────────────────────────────── */
#about {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 4rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}

/* Animated gradient background */
#about::before {
  content: '';
  position: absolute;
  top: 0;
  right: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 102, 194, 0.06) 0%, transparent 70%);
  animation: float-subtle 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes float-subtle {
  0%, 100% { transform: translateY(0px) translateX(0px); }
  50% { transform: translateY(20px) translateX(-10px); }
}

.about-content { max-width: 800px; position: relative; z-index: 1; }

.about-metrics {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 1.75rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
  animation: float-card 3.5s ease-in-out infinite;
  min-width: 220px;
  z-index: 2;
}

@keyframes float-card {
  0%, 100% { transform: translateY(calc(-50% + 0px)); }
  50% { transform: translateY(calc(-50% - 15px)); }
}

.metric {
  text-align: center;
  margin-bottom: 1.75rem;
}

.metric:last-child {
  margin-bottom: 0;
}

.metric-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-weight: 600;
}

.about-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.about-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--text-dim);
  opacity: 1;
}

.about-name {
  font-size: clamp(3.2rem, 6vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.5rem;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
  color: var(--text);
}

.about-name-last {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
  color: var(--accent);
}

.about-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
}

.about-divider-line {
  flex: 1;
  max-width: 100px;
  height: 1px;
  background: var(--border);
}

.about-email {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
  letter-spacing: 0;
}

.about-email:hover { color: var(--accent); }

.about-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 700px;
  margin-bottom: 2.5rem;
}

/* Social in about */
.about-social { display: flex; gap: 0.75rem; }

.about-social a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
  font-weight: 500;
}

.about-social a:hover {
  background: var(--bg-card);
  border-color: var(--border-strong);
  color: var(--accent);
  transform: translateY(-2px);
}

.about-social a i { font-size: 0.9rem; }

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  opacity: 0.35;
  animation: scroll-bounce 2s ease-in-out infinite;
}

.scroll-indicator span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.scroll-indicator-arrow {
  width: 16px;
  height: 16px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ─── Timeline ──────────────────────────────────────────── */
.timeline { position: relative; padding-left: 1.5rem; }

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 20px;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item:nth-child(2) { transition-delay: 0.1s; }
.timeline-item:nth-child(3) { transition-delay: 0.2s; }
.timeline-item:nth-child(4) { transition-delay: 0.3s; }

.timeline-dot {
  position: absolute;
  left: -1.815rem;
  top: 0.8rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: none;
  z-index: 1;
}

.timeline-card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.timeline-card:hover {
  background: var(--bg-card);
  border-color: var(--border-strong);
  transform: translateX(4px);
}

.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.timeline-date {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-org {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.timeline-org a {
  opacity: 0.6;
  font-size: 0.75rem;
  transition: opacity 0.2s;
}

.timeline-org a:hover { opacity: 1; }

.timeline-body {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.timeline-body ul {
  padding-left: 1.1rem;
  margin: 0.5rem 0;
  list-style: disc;
}

.timeline-body li { margin-bottom: 0.25rem; }

.timeline-body a {
  color: var(--accent-light);
  border-bottom: 1px solid rgba(96,165,250,0.25);
  transition: border-color 0.15s;
}

.timeline-body a:hover { border-color: var(--accent-light); }

.timeline-body b { color: var(--text); font-weight: 600; }

/* Stack section inside card */
.stack-group { margin-top: 1rem; }

.stack-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

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

.tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
}

.tag-blue   { background: #f0f4ff;  color: #0a66c2; border: 1px solid #d6e4ff; }
.tag-green  { background: #f0fdf4;   color: #166534; border: 1px solid #dcfce7; }
.tag-purple { background: #faf5ff;  color: #6b21a8; border: 1px solid #f3e8ff; }
.tag-amber  { background: #fffbeb;  color: #b45309; border: 1px solid #fef3c7; }
.tag-rose   { background: #ffe4e6;   color: #be123c; border: 1px solid #fbcfe8; }
.tag-teal   { background: #f0fdfa;  color: #0d5d5d; border: 1px solid #ccfbf1; }

/* ─── Skills Section ────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.2s, background 0.2s;
}

.skill-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.skill-card:nth-child(2) { transition-delay: 0.08s; }
.skill-card:nth-child(3) { transition-delay: 0.16s; }
.skill-card:nth-child(4) { transition-delay: 0.24s; }

.skill-card:hover {
  background: var(--bg-card);
  border-color: var(--border-strong);
}

.skill-card-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.skill-card-title::before {
  content: '';
  width: 16px;
  height: 1px;
  background: var(--text-dim);
  opacity: 1;
}

.skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}

.skill-chip:hover {
  background: #f0f0f0;
  border-color: var(--border-strong);
  color: var(--text);
}

.skill-chip i {
  font-size: 1rem;
  opacity: 1;
}

/* Language bars */
.lang-item { margin-bottom: 1.3rem; }
.lang-item:last-child { margin-bottom: 0; }

.lang-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.lang-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.lang-level {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.lang-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.lang-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

/* lang-fill target set via JS: bar.style.transform = 'scaleX(n)' */

/* ─── Miscellaneous ─────────────────────────────────────── */
.misc-list {
  display: grid;
  gap: 1rem;
  max-width: 800px;
}

.misc-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  transition: border-color 0.2s, background 0.2s;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.2s, background 0.2s;
}

.misc-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.misc-item:nth-child(2) { transition-delay: 0.08s; }
.misc-item:nth-child(3) { transition-delay: 0.16s; }
.misc-item:nth-child(4) { transition-delay: 0.24s; }

.misc-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-card);
}

.misc-icon {
  font-size: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.misc-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.misc-text a {
  color: var(--accent);
  border-bottom: 1px solid rgba(10, 102, 194, 0.25);
  transition: border-color 0.15s;
}

.misc-text a:hover { border-color: var(--accent); }
.misc-text b { color: var(--text); font-weight: 600; }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 1100px) {
  section { padding: 5rem 3.5rem 4rem; }
  .about-metrics {
    position: static;
    transform: none;
    margin-top: 2.5rem;
    animation: none;
  }
}

@media (max-width: 800px) {
  #sidebar {
    transform: translateX(-100%);
  }

  #sidebar.open {
    transform: translateX(0);
  }

  #main {
    margin-left: 0;
  }

  .mobile-toggle { display: flex; }

  section {
    padding: 4rem 1.75rem 3rem;
    min-height: auto;
  }

  section::before {
    left: 1.75rem;
  }

  #about { min-height: 100vh; }

  .section-title { font-size: 2.2rem; }
  .about-name { font-size: 2.8rem; }
  .timeline { padding-left: 1.25rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .about-social { flex-wrap: wrap; }
  .timeline-header { flex-direction: column; }
  .scroll-indicator { display: none; }
  .about-metrics { display: none; }
}

@media (max-width: 480px) {
  section { padding: 3rem 1.5rem 2.5rem; }
  .about-name { font-size: 2.2rem; }
  .section-title { font-size: 1.8rem; }
}
