/* ════════════════════════════════════════════
   CV — Omar Kouraiche  |  Modern Dark Design
   ════════════════════════════════════════════ */

:root {
  --bg:        #0a0e1a;
  --bg-card:   rgba(15,23,42,0.6);
  --bg-hero:   #0c1222;
  --border:    rgba(56,189,248,0.08);
  --border-h:  rgba(56,189,248,0.18);
  --text:      #e2e8f0;
  --muted:     #8b9fc5;
  --radius:    16px;
  --t:         0.25s ease;
  --glass:     rgba(255,255,255,0.05);
  --glass-h:   rgba(255,255,255,0.1);
  --avatar-bg: #1e1e2e;
  --shadow:    rgba(0,0,0,0.4);
  --shadow-sm: rgba(0,0,0,0.35);
  --scrollbar: rgba(255,255,255,0.1);
}

/* ════ LIGHT THEME ════ */
html[data-theme="light"] {
  --bg:        #f0f4f8;
  --bg-card:   rgba(255,255,255,0.75);
  --bg-hero:   #e2e8f0;
  --border:    rgba(14,165,233,0.15);
  --border-h:  rgba(14,165,233,0.3);
  --text:      #1e293b;
  --muted:     #475569;
  --glass:     rgba(0,0,0,0.04);
  --glass-h:   rgba(0,0,0,0.08);
  --avatar-bg: #cbd5e1;
  --shadow:    rgba(0,0,0,0.1);
  --shadow-sm: rgba(0,0,0,0.08);
  --scrollbar: rgba(0,0,0,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ══ GRADIENT TEXT ══ */
.grad {
  background: linear-gradient(135deg, #0ea5e9, #38bdf8, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ════ HERO ════ */
.hero {
  position: relative;
  background: var(--bg-hero);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  padding: 56px 48px;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 36px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Avatar */
.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(#0ea5e9, #38bdf8, #06b6d4, #0284c7, #0ea5e9);
  animation: spin 4s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.avatar {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--avatar-bg);
  border: 3px solid var(--bg-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: #38bdf8;
  z-index: 1;
}

.status-dot {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 14px;
  height: 14px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--bg-hero);
  z-index: 2;
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

.hero-text h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 20px;
}

/* Hero chips */
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  padding: 6px 13px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--muted);
  transition: background var(--t), border-color var(--t), color var(--t);
  backdrop-filter: blur(10px);
}
.chip:hover {
  background: var(--glass-h);
  border-color: var(--border-h);
  color: var(--text);
}
.chip i { font-size: 0.8rem; }

.chip-linkedin { color: #0a66c2; border-color: rgba(10,102,194,0.3); background: rgba(10,102,194,0.1); }
.chip-linkedin:hover { background: rgba(10,102,194,0.2); color: #3b9ee8; }

.chip-web { color: #22d3ee; border-color: rgba(34,211,238,0.3); background: rgba(34,211,238,0.08); }
.chip-web:hover { background: rgba(34,211,238,0.18); color: #67e8f9; }

/* ════ LAYOUT ════ */
.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 28px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ════ CARD ════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px;
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.card:hover {
  border-color: var(--border-h);
  box-shadow: 0 8px 32px var(--shadow);
}
.col-left .card:last-child,
.col-right .card:last-child { margin-bottom: 0; }

.card-title {
  display: flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.card-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: #fff;
  flex-shrink: 0;
}

/* ════ ABOUT ════ */
.about-text {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.85;
}

/* ════ SKILLS ════ */
.skills { display: flex; flex-direction: column; gap: 12px; }

.skill-item {}
.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  margin-bottom: 6px;
}
.skill-header span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
}
.skill-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
}

.skill-bar {
  height: 6px;
  background: var(--glass);
  border-radius: 99px;
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--clr), var(--clr2));
  border-radius: 99px;
  transition: width 1.4s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.skill-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clr2);
  box-shadow: 0 0 8px var(--clr2);
}

/* ════ CERT ════ */
.cert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  transition: background var(--t), border-color var(--t);
}
.cert-item:hover {
  background: var(--glass-h);
  border-color: var(--border-h);
}

.cert-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 3px 10px var(--shadow-sm);
}

.cert-info { flex: 1; min-width: 0; }
.cert-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cert-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.cert-issuer {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}
.cert-info { flex: 1; }
.cert-name { font-size: 0.87rem; font-weight: 600; }
.cert-sub { font-size: 0.74rem; color: var(--muted); }
.cert-check { font-size: 1.3rem; color: #22c55e; filter: drop-shadow(0 0 6px #22c55e88); }

/* ════ LANGUES ════ */
.lang-grid { display: flex; flex-direction: column; gap: 10px; }
.lang-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 13px;
  transition: background var(--t);
}
.lang-item:hover { background: var(--glass-h); }
.flag-big { font-size: 1.5rem; }
.lang-name { display: block; font-size: 0.84rem; font-weight: 600; }
.lang-lvl { display: block; font-size: 0.72rem; color: var(--muted); }

/* ════ QUALITÉS ════ */
.quality-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.qtag {
  font-size: 0.74rem;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 99px;
  background: rgba(var(--c1), 0.1);
  border: 1px solid color-mix(in srgb, var(--c1) 35%, transparent);
  color: var(--c1);
  transition: background var(--t), transform var(--t);
  cursor: default;
}
.qtag:hover { background: rgba(var(--c1), 0.2); transform: scale(1.05); }

/* Fallback pour les navigateurs sans color-mix */
.qtag { border-color: var(--border); color: var(--text); }
.qtag:nth-child(1) { background:rgba(14,165,233,0.12); border-color:rgba(14,165,233,0.35); color:#0284c7; }
.qtag:nth-child(2) { background:rgba(245,158,11,0.12); border-color:rgba(245,158,11,0.35); color:#d97706; }
.qtag:nth-child(3) { background:rgba(6,182,212,0.12); border-color:rgba(6,182,212,0.35); color:#0891b2; }

/* ════ INTÉRÊTS ════ */
.interests-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.interest-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--border);
  transition: background var(--t), border-color var(--t), transform var(--t);
  cursor: default;
}
.interest-pill:hover { transform: translateY(-2px); }
.interest-pill:nth-child(1) { background:rgba(14,165,233,0.1);  border-color:rgba(14,165,233,0.3);  color:#0284c7; }
.interest-pill:nth-child(2) { background:rgba(239,68,68,0.1);   border-color:rgba(239,68,68,0.3);   color:#dc2626; }
.interest-pill:nth-child(3) { background:rgba(16,185,129,0.1);  border-color:rgba(16,185,129,0.3);  color:#059669; }
.interest-pill:nth-child(4) { background:rgba(14,165,233,0.1);  border-color:rgba(14,165,233,0.3);  color:#0284c7; }
.interest-pill:nth-child(5) { background:rgba(245,158,11,0.1);  border-color:rgba(245,158,11,0.3);  color:#d97706; }
.interest-pill i { font-size: 0.82rem; }

/* ════ TIMELINE ════ */
.timeline { display: flex; flex-direction: column; gap: 0; }

.tl-item {
  display: flex;
  gap: 16px;
  position: relative;
  padding-bottom: 26px;
}
.tl-item:last-child { padding-bottom: 0; }

.tl-item::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--scrollbar), transparent);
}
.tl-item:last-child::before { display: none; }
.tl-item:not(:has(.tl-icon))::before { display: none; }

.tl-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.93rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px var(--shadow-sm);
}

.tl-body { flex: 1; }
.tl-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.tl-top h3 { font-size: 0.92rem; font-weight: 600; }

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: #22c55e;
  border-radius: 99px;
}
.badge-live i { font-size: 0.5rem; animation: blink 1.5s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.tl-date {
  font-size: 0.74rem;
  font-family: 'JetBrains Mono', monospace;
  color: #38bdf8;
  font-weight: 600;
}

.tl-role {
  font-size: 0.8rem;
  color: #38bdf8;
  font-weight: 500;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tl-role i { font-size: 0.72rem; }

.tl-desc {
  font-size: 0.81rem;
  color: var(--muted);
  line-height: 1.7;
}

.tl-list {
  list-style: none;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tl-list li {
  font-size: 0.81rem;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
  line-height: 1.6;
}
.tl-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #0ea5e9;
  font-size: 0.7rem;
  top: 3px;
}

/* ════ PROJECTS ════ */
.projects { display: flex; flex-direction: column; gap: 12px; }

.project-card {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
  background: var(--glass);
}
.project-card:hover {
  border-color: var(--border-h);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--shadow-sm);
}

.project-body { flex: 1; padding: 14px 18px; }
.project-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.project-top h3 { font-size: 0.9rem; font-weight: 600; }
.project-link-btn {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--glass);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--muted);
  transition: background var(--t), color var(--t);
}
.project-link-btn:hover { background: rgba(14,165,233,0.2); color: #38bdf8; }

.project-body p { font-size: 0.8rem; color: var(--muted); line-height: 1.65; margin-bottom: 9px; }

.project-techs {
  display: flex;
  gap: 9px;
  font-size: 1.1rem;
}
.project-techs span {
  transition: transform var(--t), filter var(--t);
  cursor: default;
}
.project-techs span:hover { transform: scale(1.25); filter: brightness(1.3); }

/* ════ TECHNOLOGIES ════ */
.tech-section { display: flex; flex-direction: column; gap: 18px; }
.tech-group {}
.tech-group-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tech-pills { display: flex; flex-wrap: wrap; gap: 8px; }

.tech-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--pill-bg, var(--glass));
  border: 1px solid var(--pill-border, var(--border));
  transition: background var(--t), border-color var(--t), transform var(--t);
  cursor: default;
}
.tech-pill:hover {
  transform: translateY(-2px);
}
.tech-pill i { font-size: 0.82rem; }

/* ════ FOOTER ════ */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  margin: 8px 32px 24px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 12px;
  font-size: 1rem;
}
.footer-links a {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--glass);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background var(--t), color var(--t), border-color var(--t);
}
.footer-links a:hover { background: rgba(14,165,233,0.15); color: #38bdf8; border-color: rgba(14,165,233,0.35); }

/* ════ REVEAL ANIMATION ════ */
.reveal {
  opacity: 1;
  transform: none;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ════ FLAG IMAGES ════ */
.flag-big {
  width: 32px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ════ BACK BUTTON ════ */
.back-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--muted);
  text-decoration: none;
  transition: background var(--t), color var(--t), border-color var(--t), transform var(--t);
  box-shadow: 0 4px 16px var(--shadow-sm);
}
.back-btn:hover {
  color: var(--text);
  border-color: var(--border-h);
  transform: scale(1.1);
}

/* ════ THEME TOGGLE ════ */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--muted);
  transition: background var(--t), color var(--t), border-color var(--t), transform var(--t);
  box-shadow: 0 4px 16px var(--shadow-sm);
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-h);
  transform: scale(1.1);
}
.theme-toggle .fa-sun  { display: none; }
.theme-toggle .fa-moon { display: inline-block; }
html[data-theme="light"] .theme-toggle .fa-sun  { display: inline-block; }
html[data-theme="light"] .theme-toggle .fa-moon { display: none; }

/* Light theme: darker gradient for readability */
html[data-theme="light"] .grad {
  background: linear-gradient(135deg, #0284c7, #0369a1, #0e7490);
  -webkit-background-clip: text;
  background-clip: text;
}
html[data-theme="light"] .tl-date { color: #0284c7; }
html[data-theme="light"] .tl-role { color: #0284c7; }
html[data-theme="light"] .avatar { color: #0284c7; }
html[data-theme="light"] .tl-list li::before { color: #0284c7; }
html[data-theme="light"] .footer-links a:hover { background: rgba(14,165,233,0.12); color: #0369a1; border-color: rgba(14,165,233,0.3); }
html[data-theme="light"] .flag-big { box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
html[data-theme="light"] .status-dot { border-color: var(--bg-hero); }
.gh-actions i { color: var(--text); }

/* ════ SCROLLBAR ════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(14,165,233,0.4); }

/* ════ RESPONSIVE ════ */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 20px 16px;
  }
  .col-left {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
  }
  .hero { padding: 36px 24px; }
  .hero-inner { gap: 22px; }
  .footer { margin: 8px 16px 20px; padding: 16px 20px; }
}

@media (max-width: 600px) {
  .hero { padding: 28px 16px; }
  .hero-inner { flex-direction: column; text-align: center; gap: 16px; }
  .hero-chips { justify-content: center; }
  .hero-text h1 { font-size: 1.6rem; }
  .hero-sub { font-size: 0.85rem; }
  .col-left { grid-template-columns: 1fr; }
  .layout { padding: 12px; gap: 16px; }
  .card { padding: 16px; margin-bottom: 14px; }
  .card-title { font-size: 0.92rem; margin-bottom: 16px; padding-bottom: 12px; }
  .back-btn { top: 12px; left: 12px; width: 36px; height: 36px; font-size: 0.95rem; }
  .theme-toggle { top: 12px; right: 12px; width: 36px; height: 36px; font-size: 0.95rem; }

  /* Timeline */
  .tl-item { gap: 12px; padding-bottom: 20px; }
  .tl-icon { width: 32px; height: 32px; font-size: 0.8rem; }
  .tl-item::before { left: 15px; top: 36px; }
  .tl-top { flex-direction: column; align-items: flex-start; gap: 4px; }
  .tl-top h3 { font-size: 0.84rem; }
  .tl-date { font-size: 0.7rem; }
  .tl-desc { font-size: 0.78rem; }
  .tl-list li { font-size: 0.78rem; }

  /* Projects */
  .project-card { flex-direction: column; }
  .project-body { padding: 12px 14px; }
  .project-top h3 { font-size: 0.84rem; }
  .project-body p { font-size: 0.78rem; }

  /* Topology buttons */
  .project-body div[style*="display:flex"] { flex-direction: column; }
  .project-body div[style*="display:flex"] a { width: 100%; justify-content: center; }

  /* Certifications */
  .cert-item { padding: 9px 10px; gap: 10px; }
  .cert-icon-wrap { width: 30px; height: 30px; font-size: 0.85rem; }
  .cert-name { font-size: 0.78rem; }

  /* Languages */
  .lang-item { padding: 8px 10px; gap: 10px; }
  .flag-big { width: 26px; height: 18px; }
  .lang-name { font-size: 0.8rem; }

  /* Footer */
  .footer { flex-direction: column; gap: 12px; margin: 8px 12px 16px; padding: 14px 16px; font-size: 0.75rem; }
  .footer-links a { width: 28px; height: 28px; }

  /* Avatar */
  .avatar { width: 80px; height: 80px; font-size: 2rem; }

  /* Skills */
  .skill-header { font-size: 0.78rem; }

  /* Tech pills */
  .tech-pill { font-size: 0.72rem; padding: 6px 10px; }
  .interest-pill { font-size: 0.72rem; padding: 6px 10px; }
  .chip { font-size: 0.72rem; padding: 5px 10px; }
}

@media (max-width: 380px) {
  .hero { padding: 22px 12px; }
  .hero-text h1 { font-size: 1.4rem; }
  .layout { padding: 8px; }
  .card { padding: 14px; }
  .tl-top h3 { font-size: 0.8rem; }
  .project-top h3 { font-size: 0.8rem; }
}
