/* romdhane_dart - Complete CSS theme */
:root {
  --bg: #0a0a0f;
  --bg-secondary: #12121a;
  --surface: #181825;
  --surface-elevated: #1e1e30;
  --border: #2a2a3d;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #f0ca89;
  --accent-hover: #f5d6a0;
  --accent-muted: rgba(240, 202, 137, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent-muted); color: var(--accent); }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  word-break: break-word;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

pre code { background: none; padding: 0; font-size: 0.82em; word-break: normal; white-space: pre; }

@media (max-width: 480px) { pre { padding: 0.75rem; } pre code { font-size: 0.72em; } }

.container { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section-title {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.15em; color: var(--accent); margin-bottom: 1rem;
}
.section-heading { font-size: 2rem; font-weight: 600; margin-bottom: 1.5rem; letter-spacing: -0.02em; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(240, 202, 137, 0.06); }
  50% { box-shadow: 0 0 30px rgba(240, 202, 137, 0.1); }
}
.fade-in { animation: fadeIn 0.6s ease-out forwards; }

/* Navigation */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 3.5rem; max-width: 1100px; margin: 0 auto; padding: 0 1.5rem;
}
.nav-logo { font-size: 1.1rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; align-items: center; list-style: none; }
.nav-links a {
  font-size: 0.875rem; font-weight: 500; color: var(--text-secondary);
  transition: color 0.2s; position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px; background: var(--accent); transition: width 0.3s;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.lang-toggle {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-secondary); padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.lang-toggle:hover { color: var(--accent); border-color: var(--accent); }

.nav-link-icon {
  color: var(--text-muted); display: flex; align-items: center;
  padding: 0.35rem; border-radius: var(--radius-sm); transition: all 0.2s;
}
.nav-link-icon:hover { color: var(--accent); background: var(--accent-muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.5rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: all 0.2s; border: none;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #0a0a0f; }
.btn-primary:hover, .btn-primary:focus { background: var(--accent-hover); color: #0a0a0f; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* Tags */
.tag {
  display: inline-block; padding: 0.2rem 0.6rem; font-size: 0.75rem;
  font-weight: 500; border-radius: 4px; background: var(--surface);
  color: var(--text-secondary); border: 1px solid var(--border);
}
.tags { display: flex; gap: 0.4rem; margin-top: 1rem; flex-wrap: wrap; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; transition: all 0.3s;
}
.card:hover {
  border-color: rgba(240, 202, 137, 0.2); transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: glow 3s ease-in-out infinite;
}
.card-glow {
  background: var(--surface-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.5rem;
  animation: glow 4s ease-in-out infinite;
}

/* Hero */
.hero { min-height: 100vh; display: flex; align-items: center; padding-top: 3.5rem; position: relative; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-bg::before {
  content: ''; position: absolute; top: -30%; right: -20%;
  width: 60%; height: 80%;
  background: radial-gradient(ellipse, rgba(240, 202, 137, 0.04) 0%, transparent 70%);
  pointer-events: none;
}
.hero-bg::after {
  content: ''; position: absolute; bottom: -20%; left: -15%;
  width: 50%; height: 60%;
  background: radial-gradient(ellipse, rgba(48, 96, 128, 0.04) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-layout { display: flex; align-items: center; gap: 3rem; }
.hero-avatar-wrapper { flex-shrink: 0; }
.hero-avatar {
  width: 200px; height: 200px; border-radius: 50%; border: 3px solid var(--accent);
  overflow: hidden; box-shadow: 0 0 30px rgba(240, 202, 137, 0.15);
  transition: box-shadow 0.3s;
}
.hero-avatar:hover { box-shadow: 0 0 40px rgba(240, 202, 137, 0.3); }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-greeting { font-size: 1rem; color: var(--accent); margin-bottom: 1rem; font-weight: 500; }
.hero-name { font-size: 3.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 0.5rem; }
.hero-name span {
  background: linear-gradient(135deg, var(--accent) 0%, #e8b86d 50%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-title { font-size: 1.25rem; font-weight: 400; color: var(--text-secondary); margin-bottom: 2rem; line-height: 1.5; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Skills grid */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.75rem; }
.skill-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.5rem 0.75rem;
  text-align: center; font-size: 0.8rem; font-weight: 500;
  color: var(--text-secondary); transition: all 0.2s;
}
.skill-item:hover { border-color: rgba(240, 202, 137, 0.3); color: var(--accent); }

/* Timeline */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 2.5rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -2rem; top: 0.4rem; width: 10px; height: 10px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--bg);
  transform: translateX(-50%);
}
.timeline-date { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin-bottom: 0.3rem; }
.timeline-role { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.15rem; }
.timeline-company { font-size: 0.9rem; color: var(--accent); margin-bottom: 0.5rem; }
.timeline-desc { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }
.timeline-desc p { margin-bottom: 0.3rem; }

.about-paragraph { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.7; margin-bottom: 1rem; }

/* Blog grid */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.blog-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; transition: all 0.3s;
  text-decoration: none; color: inherit; display: block;
}
.blog-card:hover { border-color: rgba(240, 202, 137, 0.2); transform: translateY(-2px); color: inherit; }
.blog-card-date { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.blog-card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; line-height: 1.3; }
.blog-card-excerpt { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.blog-subtitle { color: var(--text-secondary); margin-bottom: 3rem; font-size: 1.05rem; }
.blog-post-date { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 2rem; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem; }
.empty-state h2 { margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); }

/* Blog content */
.blog-content { font-size: 1rem; line-height: 1.8; color: var(--text-secondary); }
.blog-content h1, .blog-content h2, .blog-content h3, .blog-content h4 {
  color: var(--text); margin-top: 2rem; margin-bottom: 0.75rem; font-weight: 600; line-height: 1.3;
}
.blog-content h1 { font-size: 1.8rem; }
.blog-content h2 { font-size: 1.4rem; }
.blog-content h3 { font-size: 1.15rem; }
.blog-content p { margin-bottom: 1rem; }
.blog-content ul, .blog-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.blog-content li { margin-bottom: 0.3rem; }
.blog-content blockquote {
  border-left: 2px solid var(--accent); padding-left: 1rem;
  margin: 1.5rem 0; color: var(--text-secondary); font-style: italic;
}
.blog-content img { border-radius: var(--radius-sm); margin: 1.5rem 0; max-width: 100%; height: auto; }
.blog-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.blog-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; display: block; overflow-x: auto; }
.blog-content th, .blog-content td {
  border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left;
}
.blog-content th { background: var(--surface); color: var(--text); font-weight: 600; white-space: nowrap; }
.blog-content tr:nth-child(even) { background: var(--surface); }

.blog-content pre {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1rem; overflow-x: auto; margin: 1.5rem 0;
}
.blog-content code {
  background: var(--surface); padding: 0.15rem 0.4rem; border-radius: 3px;
  font-size: 0.875em; font-family: 'SF Mono', 'Fira Code', monospace;
}
.blog-content pre code { background: none; padding: 0; border-radius: 0; white-space: pre; }
.blog-content .hljs { background: transparent; padding: 0; }
.blog-content blockquote {
  border-left: 3px solid var(--accent); margin: 1.5rem 0; padding: 0.5rem 1rem;
  color: var(--text-secondary); background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.blog-content hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.blog-content ul, .blog-content ol { margin: 1rem 0; padding-left: 1.5rem; line-height: 1.7; }
.blog-content li { margin-bottom: 0.35rem; }
.blog-content img { border-radius: var(--radius-sm); margin: 1.5rem 0; max-width: 100%; height: auto; background: var(--surface); padding: 0.5rem; border: 1px solid var(--border); }
.blog-content p img { display: block; }

/* Education items */
.edu-item { display: flex; justify-content: space-between; align-items: baseline; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.edu-item.last { border-bottom: none; }
.edu-degree { font-weight: 600; }
.edu-school { color: var(--text-muted); font-size: 0.85rem; }
.edu-year { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }

/* About page extras */
.back-link { color: var(--text-muted); font-size: 0.85rem; }
.approach-block { margin-top: 3rem; }
.approach-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 0.75rem;
}
.approach-num { color: var(--accent); font-weight: 600; min-width: 1.5rem; }
.approach-item p { color: var(--text-secondary); font-size: 0.95rem; }

.contact-card {
  margin-top: 3rem; text-align: center; padding: 2rem;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.contact-card p { color: var(--text-secondary); margin-bottom: 1rem; }

.contact-block { text-align: center; }
.contact-links { justify-content: center; margin-top: 1.5rem; }

.languages-block { display: flex; gap: 2rem; margin-top: 1.5rem; flex-wrap: wrap; }
.languages-block .section-title { margin-bottom: 0.5rem; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 2rem 0; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
footer a { color: var(--text-secondary); }
footer a:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 768px) {
  .hero-layout { flex-direction: column; text-align: center; gap: 2rem; }
  .hero-avatar-wrapper { order: -1; }
  .hero-avatar { width: 150px; height: 150px; }
  .hero-actions { justify-content: center; }
  .nav-inner { padding: 0 0.75rem; }
  .nav-links { gap: 0.6rem; }
  .nav-links a { font-size: 0.75rem; }
  .lang-toggle { padding: 0.2rem 0.4rem; font-size: 0.7rem; }
  .hero-name { font-size: 2.25rem; }
  .hero-title { font-size: 1.05rem; }
  .section { padding: 3rem 0; }
  .section-heading { font-size: 1.6rem; }
  .blog-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
@media (max-width: 480px) {
  .nav-inner { padding: 0 0.5rem; }
  .nav-links { gap: 0.4rem; }
  .nav-links a { font-size: 0.7rem; }
  .hero-avatar { width: 120px; height: 120px; }
  .hero-name { font-size: 1.8rem; }
  .container, .container-wide { padding: 0 1rem; }
  .card-glow { padding: 1.5rem; }
}

/* Language toggle */
html:not(.lang-fr) .lang-fr,
html.lang-fr .lang-en { display: none; }

/* View Transitions */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 300ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
::view-transition-old(header),
::view-transition-new(header),
::view-transition-old(footer),
::view-transition-new(footer) {
  animation: none;
  mix-blend-mode: normal;
}
