/* =========================================
   Stefan Dascalescu — Personal Website
   Design System & Styles
   ========================================= */

/* Variables */
:root {
  --orange:        #F97316;
  --orange-dark:   #EA6C00;
  --orange-light:  #FED7AA;
  --orange-bg:     #FFF7ED;
  --cream:         #F6F1E9;
  --white:         #FFFFFF;
  --text-dark:     #111827;
  --text-mid:      #374151;
  --text-muted:    #6B7280;
  --text-faint:    #9CA3AF;
  --border:        #E5E7EB;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.06);
  --shadow:        0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.12);
  --radius:        12px;
  --radius-sm:     8px;
  --sidebar-width: 288px;
  --transition:    0.2s ease;
}

/* ── Reset ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
ul { list-style: none; }
a { color: var(--orange); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--orange-dark); }
strong { font-weight: 700; }

/* ── Sidebar ────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--white);
  box-shadow: 4px 0 24px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-top-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--orange) 0%, var(--orange-dark) 100%);
  flex-shrink: 0;
}

/* Profile block */
.sidebar-profile {
  padding: 28px 24px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.profile-photo-wrap {
  display: inline-flex;
  padding: 3px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  border-radius: 50%;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(249,115,22,0.3);
}
.profile-photo {
  width: 100px; height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--white);
}
.profile-name {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.profile-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.social-icons {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.social-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  transition: all var(--transition);
}
.social-icon:hover {
  background: var(--orange);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249,115,22,0.35);
}

/* Contact block */
.sidebar-contact {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  font-size: 13px;
  color: var(--text-mid);
}
.contact-item i {
  width: 18px; text-align: center;
  font-size: 13px;
  color: var(--orange);
  flex-shrink: 0;
}
.contact-item a {
  color: var(--text-mid);
  font-size: 13px;
}
.contact-item a:hover { color: var(--orange); }

/* Navigation */
.sidebar-nav {
  padding: 14px 12px;
  flex: 1;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  padding: 8px 8px 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-mid);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}
.nav-link i {
  width: 18px; text-align: center;
  font-size: 14px;
  color: var(--text-faint);
  transition: color var(--transition);
}
.nav-link:hover, .nav-link.active {
  background: var(--orange-bg);
  color: var(--orange);
}
.nav-link:hover i, .nav-link.active i { color: var(--orange); }
.nav-link.active { font-weight: 700; }

/* Language toggle & footer */
.lang-toggle {
  display: inline-flex;
  gap: 6px;
}
.lang-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
  font-family: inherit;
  letter-spacing: 0.03em;
}
.lang-btn:hover { border-color: var(--orange); color: var(--orange); }
.lang-btn.active {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
  box-shadow: 0 2px 8px rgba(249,115,22,0.25);
}

/* ── Mobile Header ──────────────────────── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 58px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 200;
  border-bottom: 2px solid var(--orange);
}
.mobile-logo {
  font-weight: 800;
  font-size: 15px;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}
.hamburger {
  width: 34px; height: 34px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px; cursor: pointer; padding: 4px;
  border: none; background: none;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: all var(--transition);
}
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.overlay.open { display: block; }

/* ── Main Content ───────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 44px 48px;
}

/* Page Header */
.page-header { margin-bottom: 32px; }
.page-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.03em;
  display: inline-block;
}
.page-title::after {
  content: '';
  display: block;
  height: 4px; width: 44px;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
  border-radius: 2px;
  margin-top: 8px;
}
.page-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 10px;
  max-width: 640px;
  line-height: 1.6;
}

/* ── Generic Cards ──────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.card + .card { margin-top: 20px; }
.card-title {
  font-size: 17px; font-weight: 700;
  color: var(--text-dark); margin-bottom: 12px;
}

/* ── Stats Strip ────────────────────────── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.stat-number {
  font-size: 30px; font-weight: 800;
  color: var(--orange);
  letter-spacing: -0.03em;
}
.stat-label {
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px; line-height: 1.4;
}

/* ── Medal Section (Results) ────────────── */
.results-section { margin-bottom: 36px; }
.section-heading {
  font-size: 17px; font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
}
.section-heading::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.medal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.medal-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 14px 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.medal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.medal-emoji { font-size: 38px; margin-bottom: 10px; display: block; }
.medal-count { font-size: 26px; font-weight: 800; color: var(--text-dark); letter-spacing: -0.02em; }
.medal-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; font-weight: 500; }
.medal-note { font-size: 11px; color: var(--text-faint); margin-top: 6px; font-style: italic; line-height: 1.4; }

/* ── Services / Tutoring ────────────────── */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.service-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-top: 3px solid var(--orange);
  transition: box-shadow var(--transition);
}
.service-card:hover { box-shadow: var(--shadow); }
.service-icon {
  font-size: 26px; margin-bottom: 12px;
}
.service-title {
  font-size: 15px; font-weight: 700;
  color: var(--text-dark); margin-bottom: 8px;
}
.service-desc {
  font-size: 13.5px; color: var(--text-muted); line-height: 1.6;
}
.badge-new {
  display: inline-block;
  background: #EF4444; color: var(--white);
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  margin-left: 6px; vertical-align: middle;
  letter-spacing: 0.04em;
}

.technique-list { margin-top: 12px; }
.technique-list li {
  padding: 9px 12px;
  margin-bottom: 7px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text-mid);
  display: flex; align-items: flex-start; gap: 10px;
  line-height: 1.5;
}
.technique-list li::before {
  content: '✓'; color: var(--orange);
  font-weight: 700; flex-shrink: 0; margin-top: 1px;
}

/* ── Projects ───────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}
.project-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
  display: flex; flex-direction: column;
}
.project-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.project-card-header {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px;
}
.project-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--orange-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.project-name {
  font-size: 15px; font-weight: 700; color: var(--text-dark);
  margin-bottom: 3px;
}
.project-role {
  font-size: 11px; color: var(--orange); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.project-desc {
  font-size: 13.5px; color: var(--text-muted); line-height: 1.65;
  flex: 1; margin-bottom: 16px;
}
.project-links { display: flex; gap: 10px; flex-wrap: wrap; }
.project-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--orange);
  padding: 5px 12px; border: 1.5px solid var(--orange-light);
  border-radius: 20px; transition: all var(--transition);
}
.project-link:hover {
  background: var(--orange); color: var(--white);
  border-color: var(--orange);
}

/* ── Blog ───────────────────────────────── */
.blog-grid { display: grid; gap: 16px; }
.blog-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
  display: flex; flex-direction: column; gap: 8px;
  color: inherit;
}
.blog-card:hover {
  box-shadow: var(--shadow); transform: translateY(-2px); color: inherit;
}
.blog-card-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--text-faint);
}
.blog-tag {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 20px;
  background: var(--orange-bg); color: var(--orange);
  font-size: 11px; font-weight: 600;
}
.blog-card-title {
  font-size: 18px; font-weight: 700; color: var(--text-dark);
  letter-spacing: -0.01em; line-height: 1.3;
}
.blog-card-excerpt {
  font-size: 13.5px; color: var(--text-muted); line-height: 1.65;
}
.blog-read-more {
  font-size: 13px; font-weight: 600; color: var(--orange);
  display: inline-flex; align-items: center; gap: 5px; margin-top: 4px;
}

/* Blog post page */
.blog-post-header { margin-bottom: 32px; }
.blog-post-title {
  font-size: 28px; font-weight: 800;
  color: var(--text-dark); letter-spacing: -0.03em;
  line-height: 1.2; margin-bottom: 14px;
}
.blog-post-meta {
  font-size: 13px; color: var(--text-muted);
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
}
.blog-post-content {
  font-size: 15.5px; line-height: 1.8; color: var(--text-mid);
}
.blog-post-content h2 {
  font-size: 21px; font-weight: 700; color: var(--text-dark);
  margin: 32px 0 14px; letter-spacing: -0.02em;
}
.blog-post-content h3 {
  font-size: 17px; font-weight: 700; color: var(--text-dark);
  margin: 24px 0 10px;
}
.blog-post-content p { margin-bottom: 18px; }
.blog-post-content ul, .blog-post-content ol {
  margin: 0 0 18px 20px; padding: 0;
}
.blog-post-content li { margin-bottom: 8px; }
.blog-post-content code {
  background: var(--cream); padding: 2px 6px; border-radius: 4px;
  font-family: 'Fira Code', monospace; font-size: 0.9em;
  color: var(--orange-dark);
}
.blog-post-content pre {
  background: var(--text-dark); color: #e5e7eb;
  padding: 20px; border-radius: var(--radius);
  overflow-x: auto; margin-bottom: 18px;
  font-size: 13.5px; line-height: 1.6;
}
.blog-post-content pre code {
  background: none; color: inherit; padding: 0;
}
.blog-post-content blockquote {
  border-left: 3px solid var(--orange);
  padding: 12px 20px;
  background: var(--orange-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 20px 0; font-style: italic;
}
.blog-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  margin-bottom: 24px; transition: color var(--transition);
}
.blog-back:hover { color: var(--orange); }

/* ── About Page ─────────────────────────── */
.about-text {
  font-size: 15px; line-height: 1.8; color: var(--text-mid);
}
.about-text p { margin-bottom: 16px; }
.about-text p:last-child { margin-bottom: 0; }
.highlight { color: var(--orange); font-weight: 700; }

.project-inline-list { margin-top: 10px; }
.project-inline-list li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px; color: var(--text-mid);
}
.project-inline-list li:last-child { border-bottom: none; }
.project-inline-list li::before {
  content: '•'; color: var(--orange); font-weight: 700;
  flex-shrink: 0; font-size: 14px; line-height: 1.5; margin-top: 1px;
}

/* ── Resume Page ────────────────────────── */
.resume-tabs {
  display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;
}
.resume-tab {
  padding: 9px 20px; border-radius: 8px;
  border: 1.5px solid var(--border);
  background: none; font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; color: var(--text-muted);
  transition: all var(--transition);
}
.resume-tab.active, .resume-tab:hover {
  background: var(--orange); color: var(--white); border-color: var(--orange);
}
.pdf-embed {
  width: 100%; height: 82vh;
  border: none; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pdf-panel { display: none; }
.pdf-panel.active { display: block; }

/* ── Year Slider ────────────────────────── */
.year-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-bottom: 20px;
}
.year-arrow {
  width: 36px; height: 36px;
  border: 1.5px solid var(--border); border-radius: 50%;
  background: none; cursor: pointer; font-size: 13px;
  color: var(--text-mid); transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.year-arrow:hover:not(:disabled) { border-color: var(--orange); color: var(--orange); }
.year-arrow:disabled { opacity: 0.3; cursor: default; }
.year-label {
  font-size: 20px; font-weight: 800; color: var(--text-dark);
  min-width: 100px; text-align: center; letter-spacing: -0.02em;
}
.year-content { min-height: 80px; }
.year-note {
  font-size: 13px; color: var(--text-muted); font-style: italic;
  margin-top: 12px;
}
.pdf-reveal {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}

/* ── Utility ────────────────────────────── */
.flex-center { display: flex; align-items: center; justify-content: center; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all var(--transition); border: none;
}
.btn-primary {
  background: var(--orange); color: var(--white);
  box-shadow: 0 2px 8px rgba(249,115,22,0.3);
}
.btn-primary:hover {
  background: var(--orange-dark); color: var(--white);
  box-shadow: 0 4px 16px rgba(249,115,22,0.4);
  transform: translateY(-1px);
}
.btn-outline {
  background: none; color: var(--orange);
  border: 1.5px solid var(--orange-light);
}
.btn-outline:hover { background: var(--orange-bg); }

/* ── Responsive ─────────────────────────── */
@media (max-width: 1100px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .main-content { padding: 44px 32px; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 150;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { display: flex; }
  .main-content { margin-left: 0; padding: 78px 18px 40px; }
  .page-title { font-size: 24px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .medal-grid { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: 1fr; }
  .blog-post-title { font-size: 22px; }
  .pdf-embed { height: 60vh; }
}

@media (max-width: 480px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .medal-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Blog Images ────────────────────────── */
.blog-img-wrap {
  text-align: center;
  margin: 24px 0;
}
.blog-img-wrap img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: inline-block;
}
.blog-img-caption {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}
.blog-post-content img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ── Hidden elements by language ─────────── */
[data-lang="ro"] { display: none; }
body.lang-ro [data-lang="en"] { display: none; }
body.lang-ro [data-lang="ro"] { display: block; }
body.lang-ro [data-lang="ro"].inline { display: inline; }
