/*
  ==========================================
  Portfolio — Mohamed Jalal Baim
  ==========================================
*/

/* 1. Variables
   ========================================== */
:root {
  color-scheme: light;

  --bg:          #f8f9fb;
  --bg-alt:      #f0f2f7;
  --surface:     #ffffff;
  --surface-alt: #f4f5fb;
  --border:      #dde0ec;
  --border-sub:  #e8eaf3;

  --text:        #111827;
  --text-2:      #4b5563;
  --text-3:      #9ca3af;

  --accent:      #6c63e8;
  --accent-2:    #5046c8;
  --accent-bg:   rgba(108, 99, 232, 0.08);
  --accent-brd:  rgba(108, 99, 232, 0.22);

  --green:       #0ea87a;
  --green-bg:    rgba(14, 168, 122, 0.08);
  --green-brd:   rgba(14, 168, 122, 0.20);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius:    9px;
  --radius-lg: 13px;

  --nav-h: 56px;
  --max-w: 980px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
}

/* 2. Reset & Base
   ========================================== */
*, *::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);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* 3. Layout
   ========================================== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }

section { padding: 72px 0; }
section + section { border-top: 1px solid var(--border-sub); }

.section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin-bottom: 36px;
}

/* 4. Navigation
   ========================================== */
.nav {
  position: sticky;
  top: 0;
  height: var(--nav-h);
  background: rgba(248, 249, 251, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-sub);
  z-index: 100;
}

.nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.nav-brand:hover { color: var(--text); }
.nav-brand span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  padding: 5px 13px;
  border-radius: var(--radius-sm);
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--text); background: var(--surface-alt); }

/* 5. Page Header (inner pages)
   ========================================== */
.page-header {
  padding: 64px 0 52px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}

.page-header .subtitle {
  font-size: 15px;
  color: var(--text-2);
  max-width: 520px;
}

/* 6. Hero
   ========================================== */
#hero {
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 5% 0%, rgba(108,99,232,0.06) 0%, transparent 65%),
    radial-gradient(ellipse 30% 30% at 95% 90%, rgba(14,168,122,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
}

.hero-name {
  font-size: clamp(36px, 6vw, 58px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 18px;
  color: var(--text);
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-2);
  font-weight: 400;
  margin-bottom: 22px;
}

.hero-bio {
  font-size: 15px;
  color: var(--text-2);
  max-width: 560px;
  line-height: 1.8;
  margin-bottom: 38px;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 7. Buttons
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  color: var(--text);
  border-color: var(--accent-brd);
  background: var(--surface-alt);
}

.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.btn-accent {
  background: var(--accent-bg);
  border-color: var(--accent-brd);
  color: var(--accent-2);
}
.btn-accent:hover {
  background: rgba(124,114,245,0.16);
  border-color: var(--accent);
  color: var(--accent-2);
}

.btn-sm { font-size: 12px; padding: 6px 13px; }

/* 8. Badges
   ========================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 99px;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-default { background: var(--surface-alt); color: var(--text-2); border: 1px solid var(--border); }
.badge-accent   { background: var(--accent-bg);   color: var(--accent-2); border: 1px solid var(--accent-brd); }
.badge-green    { background: var(--green-bg);    color: var(--green);    border: 1px solid var(--green-brd); }
.badge-mono     { background: var(--bg-alt);      color: var(--text-3);   border: 1px solid var(--border); font-family: var(--mono); font-size: 10.5px; }

/* 9. Chips (skill tags, tech stack)
   ========================================== */
.chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: var(--radius-xs);
}

.chip-accent {
  color: var(--accent-2);
  background: var(--accent-bg);
  border-color: var(--accent-brd);
}

/* 10. Education
   ========================================== */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.edu-logo-wrap {
  width: 72px;
  height: 72px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  padding: 6px;
}

.edu-logo-wrap img { width: 56px; height: 56px; object-fit: contain; }

.edu-logo-placeholder {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-align: center;
  line-height: 1.3;
}

.edu-card .school-name {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.3;
}

.edu-card .degree {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
  line-height: 1.5;
}

.edu-card .edu-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

/* 11. Skills
   ========================================== */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.skill-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.skill-key {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  min-width: 100px;
  padding-top: 5px;
  flex-shrink: 0;
}

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

/* 12. Experience
   ========================================== */
.exp-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.exp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

.exp-card:hover { border-color: var(--accent-brd); }

.exp-logo-wrap {
  width: 80px;
  height: 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  padding: 8px;
}

.exp-logo-wrap img { width: 64px; height: 64px; object-fit: contain; }

.exp-logo-placeholder {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-align: center;
  line-height: 1.3;
}

.exp-content { flex: 1; min-width: 0; }

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

.exp-role { font-weight: 700; font-size: 16px; color: var(--text); }

.exp-badges { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }

.exp-company {
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 12px;
}

.exp-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
}

/* 13. Projects
   ========================================== */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.project-card:hover { border-color: var(--accent-brd); }

.proj-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border-sub);
}

.proj-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 7px;
}

.proj-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.proj-tagline {
  font-size: 13px;
  color: var(--text-2);
  font-style: italic;
  line-height: 1.5;
}

.proj-body {
  padding: 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.proj-desc {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.75;
}

.proj-block-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-3);
  margin-bottom: 9px;
}

.proj-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.proj-features {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.proj-features li {
  display: flex;
  gap: 8px;
}

.proj-features li::before {
  content: '–';
  color: var(--text-3);
  flex-shrink: 0;
  margin-top: 1px;
}

.proj-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-sub);
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

/* 14. Footer
   ========================================== */
footer {
  padding: 32px 0;
  border-top: 1px solid var(--border-sub);
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

/* 15. Responsive
   ========================================== */
@media (max-width: 900px) {
  .projects-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .edu-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .edu-grid { grid-template-columns: 1fr; }
  .exp-card { flex-direction: column; gap: 16px; }
  .exp-header { flex-direction: column; align-items: flex-start; }
  .skill-row { flex-direction: column; gap: 8px; }
  .skill-key { min-width: auto; }
  .container { padding: 0 20px; }
}

@media (max-width: 480px) {
  .hero-name { font-size: 32px; }
  .nav-links a { padding: 5px 9px; font-size: 13px; }
  section { padding: 52px 0; }
}
