/* ═══════════════════════════════════════════════════════
   RAYEN CHEMLALI PORTFOLIO — REDESIGNED CSS
   Palette: Warm Sand + Amber Gold + Sage
   Fonts: Playfair Display (headings) + DM Sans (body)
═══════════════════════════════════════════════════════ */

:root {
  --bg:            #F2EDE4;
  --bg-alt:        #EDE8DE;
  --sidebar-bg:    #E8E2D8;
  --card-bg:       #FDFAF5;
  --card-hover:    #FFFDF8;
  --border:        #D6CFBF;
  --border-hover:  #C17B2A;
  --accent:        #C17B2A;
  --accent-dim:    rgba(193, 123, 42, 0.10);
  --accent-light:  rgba(193, 123, 42, 0.06);
  --sage:          #4A7C6F;
  --sage-dim:      rgba(74, 124, 111, 0.10);
  --text:          #1C1917;
  --text-muted:    #78716C;
  --text-dim:      #57534E;
  --sidebar-w:     230px;
  --topbar-h:      46px;
  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'DM Sans', system-ui, sans-serif;
  --font-mono:     'IBM Plex Mono', monospace;
  --radius:        10px;
  --radius-lg:     16px;
  --shadow-sm:     0 1px 3px rgba(28,25,23,0.06), 0 1px 2px rgba(28,25,23,0.04);
  --shadow-md:     0 4px 12px rgba(28,25,23,0.08), 0 2px 4px rgba(28,25,23,0.04);
  --shadow-lg:     0 12px 32px rgba(28,25,23,0.12), 0 4px 8px rgba(28,25,23,0.06);
  --project-color: var(--accent);
  --a-color:       var(--accent);
  --a-color-dim:   var(--accent-dim);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── PARTICLES ── */
#particles-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}

/* ── TOP BAR ── */
#topbar {
  height: var(--topbar-h);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 100;
  position: relative;
}

.topbar-dots { display: flex; gap: 7px; align-items: center; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #FF5F57; }
.dot-y { background: #FEBC2E; }
.dot-g { background: #28C840; }

#lang-toggle {
  display: flex;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.lang-btn {
  padding: 4px 12px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ── LAYOUT ── */
#layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 24px 0 24px;
}

#sidebar::-webkit-scrollbar { width: 3px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.sidebar-logo {
  padding: 0 20px 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.sidebar-logo-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.sidebar-logo-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  margin-top: 4px;
  letter-spacing: 0.3px;
}

.sidebar-section-label {
  font-family: var(--font-body);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0 20px 8px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.18s;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.1px;
  font-family: var(--font-body);
}

.nav-item:hover {
  color: var(--text);
  background: rgba(28,25,23,0.04);
}

.nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
  font-weight: 600;
}

.nav-icon {
  font-size: 11px;
  width: 16px;
  text-align: center;
  opacity: 0.7;
}

/* ── MAIN PANEL ── */
#main-panel {
  flex: 1;
  overflow-y: auto;
  padding: 48px 56px 72px;
  scroll-behavior: smooth;
}

#main-panel::-webkit-scrollbar { width: 5px; }
#main-panel::-webkit-scrollbar-track { background: transparent; }
#main-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── SECTION ── */
.section { display: none; animation: fadeUp 0.35s ease; }
.section.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 36px;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

/* ── HERO ── */
#hero-section {
  min-height: calc(100vh - var(--topbar-h) - 120px);
  display: flex;
  align-items: center;
  gap: 56px;
}

.hero-left { flex: 1; }

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: 1.5px;
  opacity: 0.9;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.5vw, 64px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.05;
  margin-bottom: 14px;
  letter-spacing: -1.5px;
}

.hero-name span {
  color: var(--accent);
}

.hero-role {
  font-size: 17px;
  color: var(--text-dim);
  margin-bottom: 22px;
  min-height: 26px;
  font-family: var(--font-body);
  font-weight: 400;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.hero-bio {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 32px;
  max-width: 480px;
  font-family: var(--font-body);
}

.hero-btns {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  letter-spacing: 0.1px;
  box-shadow: 0 2px 8px rgba(193,123,42,0.3);
}

.btn-primary:hover {
  background: #A8671E;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(193,123,42,0.4);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  letter-spacing: 0.1px;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.hero-socials {
  display: flex;
  gap: 12px;
}

.social-link {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
  background: var(--card-bg);
}

.social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ── CODE BLOCK (HERO RIGHT) ── */
.hero-right {
  flex-shrink: 0;
  width: 300px;
  height: 380px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--card-bg);
  outline: 1px solid var(--border);
  position: relative;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: calc(var(--radius-lg) - 3px);
}

/* accent line at bottom of photo */
.hero-right::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--sage));
}

/* keep old selectors inert so JS renderHero() doesn't error */
.code-file-tab { display: none; }
#code-block { display: none; }
.json-key, .json-str, .json-bool, .json-punc { display: none; }

/* ── ABOUT ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 40px;
  align-items: start;
}

/* about-left: photo + text side by side */
.about-left {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about-top {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.photo-wrapper { flex-shrink: 0; }

.photo-ring {
  width: 130px;
  height: 130px;
  border-radius: var(--radius-lg);
  padding: 3px;
  background: linear-gradient(135deg, var(--accent), var(--sage));
}

.photo-img {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius-lg) - 3px);
  object-fit: cover;
  object-position: center top;
  border: 3px solid var(--card-bg);
  display: block;
}

.about-text p {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-dim);
  margin-bottom: 14px;
  font-family: var(--font-body);
}

.about-text p:last-child { margin-bottom: 0; }

/* ── ABOUT STATS ── */
.about-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-card-num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-card-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  font-family: var(--font-body);
}

/* ── LANG BARS ── */
.lang-bars {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.lang-bar-item { display: flex; flex-direction: column; gap: 6px; }

.lang-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lang-bar-track {
  height: 5px;
  background: var(--bg-alt);
  border-radius: 99px;
  overflow: hidden;
}

.lang-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #E8A44A);
  border-radius: 99px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── SKILLS ── */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skill-row {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.skill-row:hover { box-shadow: var(--shadow-md); }

.skill-row-bar {
  width: 3px;
  flex-shrink: 0;
}

.skill-row-body { padding: 16px 20px; flex: 1; }

.skill-row-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.skill-row-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-body);
}

.skill-row-count {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid;
  font-weight: 600;
}

.skill-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.skill-pill {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 6px;
  border: 1px solid;
  cursor: default;
  transition: all 0.18s;
  color: var(--text-dim);
}

/* ── EXPERIENCE ── */
.exp-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.exp-col-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.exp-col-label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}

.exp-col-count {
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  font-family: var(--font-body);
  border: 1px solid rgba(193,123,42,0.25);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

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

.timeline-item {
  display: flex;
  gap: 18px;
  padding-bottom: 20px;
  position: relative;
}

.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
  position: relative;
  z-index: 1;
  transition: background 0.2s;
}

.timeline-item:hover .timeline-dot { background: var(--accent); }

.timeline-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  flex: 1;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.timeline-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}

.timeline-role {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-company {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  font-family: var(--font-body);
}

.timeline-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--sage-dim);
  color: var(--sage);
  border: 1px solid rgba(74,124,111,0.2);
  margin-bottom: 10px;
  font-family: var(--font-body);
}

.timeline-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.7;
  font-family: var(--font-body);
}

.timeline-project-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(193,123,42,0.25);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font-body);
}

.timeline-project-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ── PROJECTS ── */
.proj-category { margin-bottom: 40px; }

.proj-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.proj-category-icon { font-size: 18px; }

.proj-category-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.1px;
}

.proj-category-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(193,123,42,0.2);
  padding: 2px 8px;
  border-radius: 99px;
  font-family: var(--font-body);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  cursor: pointer;
  transition: all 0.22s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--project-color);
  opacity: 0.7;
  transition: opacity 0.2s;
}

.project-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--project-color);
  transform: translateY(-2px);
}

.project-card:hover::before { opacity: 1; }

.project-card-top { margin-bottom: 12px; }

.project-emoji {
  font-size: 26px;
  line-height: 1;
  display: block;
}

.project-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.project-tagline {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
  font-family: var(--font-body);
}

.project-tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}

.tech-chip {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-dim);
  letter-spacing: 0.1px;
}

.project-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.project-view-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-body);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s;
}

.project-card:hover .project-view-btn {
  opacity: 1;
  transform: translateX(0);
}

/* ── EDUCATION ── */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.edu-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
  border-top: 3px solid var(--accent);
}

.edu-card:hover { box-shadow: var(--shadow-md); }

.edu-inst {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.edu-full {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-family: var(--font-body);
}

.edu-degree {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  font-family: var(--font-body);
}

.edu-period {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.edu-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edu-highlights li {
  font-size: 12.5px;
  color: var(--text-dim);
  padding-left: 16px;
  position: relative;
  font-family: var(--font-body);
  line-height: 1.5;
}

.edu-highlights li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 11px;
}

/* ── ACHIEVEMENTS ── */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.achievement-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.achievement-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--a-color);
}

.achievement-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--a-color);
}

.achievement-medal { font-size: 28px; line-height: 1; }

.achievement-place {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 7px;
  border: 1.5px solid;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  width: fit-content;
  letter-spacing: 0.5px;
}

.achievement-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.achievement-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  font-family: var(--font-body);
}

.achievement-link {
  margin-top: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font-body);
  width: fit-content;
}

.achievement-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ── CERTIFICATIONS ── */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.cert-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.cert-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.cert-icon { font-size: 26px; line-height: 1; }

.cert-name {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.cert-issuer {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-body);
}

.cert-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-top: 4px;
  transition: opacity 0.18s;
  font-family: var(--font-body);
}

.cert-link:hover { opacity: 0.75; }

.cert-project-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--sage);
  background: var(--sage-dim);
  border: 1px solid rgba(74,124,111,0.2);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font-body);
}

.cert-project-btn:hover {
  background: var(--sage);
  color: #fff;
}

/* ── CONTACT ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 32px;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.18s;
  box-shadow: var(--shadow-sm);
}

.contact-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateX(3px);
}

.contact-card-icon {
  font-size: 16px;
  color: var(--accent);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid rgba(193,123,42,0.2);
}

.contact-card-label {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.contact-card-val {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  font-family: var(--font-body);
}

/* ── FORM ── */
.contact-form {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-family: var(--font-body);
}

.form-input, .form-textarea {
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  width: 100%;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(193,123,42,0.12);
  background: var(--card-bg);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-textarea {
  min-height: 110px;
  resize: vertical;
}

/* ── MODAL ── */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(28,25,23,0.55);
  backdrop-filter: blur(6px);
  overflow-y: auto;
  padding: 32px 16px;
  align-items: flex-start;
  justify-content: center;
}

#modal-overlay.open {
  display: flex;
}

#modal-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: min(680px, 96vw);
  margin: auto;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.5);
  animation: modalIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
  background: var(--bg-alt);
  overflow: hidden;
}

.modal-watermark {
  position: absolute;
  right: -8px;
  top: -10px;
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 800;
  opacity: 0.06;
  pointer-events: none;
  line-height: 1;
  letter-spacing: -3px;
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  transition: all 0.18s;
  z-index: 10;
}

.modal-close:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.modal-emoji {
  font-size: 32px;
  margin-bottom: 10px;
  line-height: 1;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 10px;
  line-height: 1.2;
}

.modal-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.modal-badge {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
}

.modal-tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-body { padding: 20px 28px; }

.modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.modal-tab {
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.18s;
  font-family: var(--font-body);
  margin-bottom: -1px;
}

.modal-tab:hover { color: var(--text); }
.modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; animation: fadeUp 0.2s ease; }

.modal-overview {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dim);
  font-family: var(--font-body);
}

.modal-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dim);
  font-family: var(--font-body);
}

.modal-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-features-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.6;
  font-family: var(--font-body);
}

.modal-features-list li::before {
  content: '▸';
  color: var(--accent);
  flex-shrink: 0;
  font-size: 11px;
  margin-top: 3px;
}

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 28px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.modal-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.18s;
  cursor: pointer;
  font-family: var(--font-body);
}

.modal-link-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ── FOOTER ── */
footer {
  height: 42px;
  background: var(--sidebar-bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-body);
  flex-shrink: 0;
  z-index: 10;
  position: relative;
}

/* ── MOBILE NAV ── */
#mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  box-shadow: 0 -4px 16px rgba(28,25,23,0.08);
}

.mobile-nav-inner {
  display: flex;
  overflow-x: auto;
  gap: 0;
  scrollbar-width: none;
}

.mobile-nav-inner::-webkit-scrollbar { display: none; }

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.18s;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: fit-content;
}

.mobile-nav-item.active { color: var(--accent); }
.mobile-nav-item .nav-icon { font-size: 14px; }

/* ── PHOTO UPLOAD ── */
input[type="file"]#photo-upload-input { display: none; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  #sidebar { display: none; }
  #mobile-nav { display: block; }
  #main-panel { padding: 32px 24px 100px; }
  #hero-section { flex-direction: column; gap: 32px; align-items: flex-start; }
  .hero-right { width: 100%; max-width: 340px; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .exp-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  #main-panel { padding: 24px 16px 100px; }
  .section-title { font-size: 26px; }
  .hero-name { font-size: 36px; }
  .projects-grid { grid-template-columns: 1fr; }
  .achievements-grid { grid-template-columns: 1fr; }
  .certs-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
}

/* ── ACHIEVEMENT RANK BADGE (replaces emoji medal) ── */
.achievement-rank-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  border: 2px solid;
  margin-bottom: 4px;
}

.achievement-rank-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}

.achievement-rank-label {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.75;
  margin-top: 2px;
}

/* ── PROJECT EMOJI — now short text code ── */
.project-emoji {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--project-color);
  background: color-mix(in srgb, var(--project-color) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--project-color) 25%, transparent);
  border-radius: 5px;
  padding: 3px 8px;
  display: inline-block;
}

/* ── CERT ICON BADGE ── */
.cert-icon-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(193,123,42,0.25);
  border-radius: 6px;
  padding: 4px 10px;
  display: inline-block;
  width: fit-content;
  margin-bottom: 4px;
}

/* ── ABOUT INTRO (photo beside first paragraph) ── */
.about-top {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.about-intro p {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text-dim);
  font-family: var(--font-body);
}

/* ── PROJ CATEGORY ICON SVG ── */
.proj-category-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent-dim);
  border: 1px solid rgba(193,123,42,0.2);
  color: var(--accent);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .about-top { flex-direction: column; }
}