/* ==========================================================================
   Ahmed Osama Mohammed — CV
   Technical Artist & Technical Game Designer
   Two-column professional layout · Clean modern aesthetic · ATS-compliant
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=DM+Mono:wght@500;600&display=swap');

:root {
  --ink: #0f172a;        /* Deep slate/black */
  --ink-2: #334155;      /* Secondary text */
  --muted: #64748b;      /* Muted text / meta */
  --rule: #0f172a;       /* Section header underline */
  --rule-soft: #e2e8f0;  /* Subtle dividers */
  --accent: #1257ff;     /* Bright signature blue */
  --accent-hover: #0945d8;
  --accent-soft: #edf3ff;
  --accent-border: #bfdbfe;
  --desk: #f1f5f9;       /* Desktop background */
  --sheet-w: 210mm;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--desk);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 8.2pt;
  line-height: 1.36;
  -webkit-font-smoothing: antialiased;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Top Action Bar (Screen Only)
   -------------------------------------------------------------------------- */
.action-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 5%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13.5px;
}

.action-bar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.action-bar-title i { color: var(--accent); }

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--rule-soft);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: 600 12px 'Inter', sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(18, 87, 255, 0.25);
}

.btn-primary:hover {
  color: #fff;
  background: var(--accent-hover);
  box-shadow: 0 6px 16px rgba(18, 87, 255, 0.35);
}

/* --------------------------------------------------------------------------
   Sheet Container (Clean, breathable A4 pages)
   -------------------------------------------------------------------------- */
.cv-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 28px 16px 70px;
}

.sheet {
  position: relative;
  width: var(--sheet-w);
  min-height: 297mm;
  padding: 11mm 13mm 11mm;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 20px 40px rgba(15, 23, 42, 0.09);
  display: flex;
  flex-direction: column;
}

.sheet-footer {
  margin-top: auto;
  padding-top: 2.5mm;
  display: flex;
  justify-content: flex-end;
  font-size: 6.8pt;
  color: var(--muted);
  letter-spacing: 0.04em;
  border-top: 0.5pt solid var(--rule-soft);
}

/* --------------------------------------------------------------------------
   Header (Page 1)
   -------------------------------------------------------------------------- */
.cv-header {
  padding-bottom: 3.2mm;
  margin-bottom: 3.8mm;
  border-bottom: 1.8pt solid var(--ink);
}

.cv-name {
  margin: 0;
  font-size: 30pt;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--ink);
}

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

.cv-headline {
  margin: 2mm 0 0;
  font-size: 10.8pt;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.005em;
}

.cv-subheadline {
  margin: 0.8mm 0 0;
  font-size: 8.5pt;
  font-weight: 500;
  color: var(--ink-2);
}

.cv-subheadline .learning-inline {
  color: var(--accent);
  font-weight: 700;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2mm 4.5mm;
  margin: 2.2mm 0 0;
  padding: 0;
  list-style: none;
  font-size: 7.5pt;
  color: var(--ink-2);
}

.contact-row li { white-space: nowrap; }

.contact-row .label {
  font-weight: 700;
  color: var(--accent);
  margin-right: 0.9mm;
}

/* --------------------------------------------------------------------------
   Header (Page 2)
   -------------------------------------------------------------------------- */
.page2-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 2mm;
  margin-bottom: 3.6mm;
  border-bottom: 1.4pt solid var(--ink);
}

.page2-header .name {
  font-size: 12.5pt;
  font-weight: 900;
  letter-spacing: -0.02em;
}

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

.page2-header .meta {
  font-size: 7.3pt;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Two-column Grid (64% Main / 36% Sidebar)
   -------------------------------------------------------------------------- */
.cv-columns {
  flex: 1;
  display: grid;
  grid-template-columns: 64fr 36fr;
  gap: 0 5.5mm;
  min-height: 0;
}

.col-main,
.col-side {
  min-width: 0;
}

.col-side {
  padding-left: 5mm;
  border-left: 0.6pt solid var(--rule-soft);
}

/* --------------------------------------------------------------------------
   Sections & Titles
   -------------------------------------------------------------------------- */
.cv-section { margin-bottom: 3.2mm; }
.cv-section:last-child { margin-bottom: 0; }

.cv-section-title {
  position: relative;
  margin: 0 0 1.8mm;
  padding-bottom: 0.8mm;
  font-size: 9.1pt;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 0.6pt solid var(--rule);
}

.cv-section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1.4pt;
  width: 8.5mm;
  height: 2pt;
  background: var(--accent);
}

.cv-section-title .title-note {
  margin-left: 1.2mm;
  font-size: 6.6pt;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-transform: none;
}

.summary p {
  margin: 0 0 1.2mm;
  font-size: 8.1pt;
  line-height: 1.36;
  color: var(--ink-2);
}

.summary p:last-child { margin-bottom: 0; }
.summary strong { color: var(--ink); font-weight: 700; }

/* --------------------------------------------------------------------------
   Badges / Tags (Real text for ATS readability)
   -------------------------------------------------------------------------- */
.tag {
  display: inline-block;
  padding: 0.2mm 1.2mm;
  border-radius: 2pt;
  font-family: 'DM Mono', monospace, sans-serif;
  font-size: 5.8pt;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  vertical-align: 0.4pt;
  white-space: nowrap;
}

.tag--learning {
  background: var(--accent-soft);
  color: var(--accent);
  border: 0.6pt solid var(--accent-border);
}

.tag--applied {
  background: #f1f5f9;
  color: var(--ink);
  border: 0.6pt solid #cbd5e1;
}

.tag--dev {
  background: #fffbeb;
  color: #b45309;
  border: 0.6pt dashed #f59e0b;
}

/* --------------------------------------------------------------------------
   Jobs & Experience (Consistent styling across all jobs)
   -------------------------------------------------------------------------- */
.job {
  margin-bottom: 2.2mm;
}

.job:last-child { margin-bottom: 0; }

.job-head,
.job-org {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2.5mm;
}

.job-org { margin-top: 0.2mm; }

.job-role {
  font-size: 8.8pt;
  font-weight: 800;
  color: var(--ink);
}

.job-date {
  flex-shrink: 0;
  font-size: 7.2pt;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

.job-company {
  font-size: 8.3pt;
  font-weight: 700;
  color: var(--accent);
}

.job-loc {
  flex-shrink: 0;
  font-size: 7pt;
  color: var(--muted);
  white-space: nowrap;
}

.job-context {
  margin-top: 0.3mm;
  font-size: 7.4pt;
  font-style: italic;
  color: var(--muted);
}

.job-bullets {
  margin: 0.8mm 0 0;
  padding-left: 3.5mm;
}

.job-bullets li {
  margin-bottom: 0.5mm;
  font-size: 7.9pt;
  line-height: 1.33;
  color: var(--ink-2);
}

.job-bullets li::marker { color: var(--accent); }
.job-bullets strong { color: var(--ink); font-weight: 700; }

.job-keywords {
  margin-top: 0.6mm;
  font-size: 7pt;
  color: var(--muted);
}

.job-keywords b {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   Projects
   -------------------------------------------------------------------------- */
.project {
  padding: 1.4mm 0 1.6mm;
  border-bottom: 0.5pt solid var(--rule-soft);
}

.project:first-of-type { padding-top: 0; }
.project:last-child { border-bottom: none; padding-bottom: 0; }

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2.5mm;
}

.project-name {
  font-size: 8.7pt;
  font-weight: 800;
  color: var(--ink);
}

.project-cat {
  flex-shrink: 0;
  font-size: 6.4pt;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.project-tech {
  margin-top: 0.2mm;
  font-size: 7.1pt;
  font-weight: 600;
  color: var(--muted);
}

.project-desc {
  margin: 0.6mm 0 0;
  font-size: 7.8pt;
  line-height: 1.33;
  color: var(--ink-2);
}

.project-link {
  margin-top: 0.5mm;
  font-size: 6.8pt;
  color: var(--muted);
  word-break: break-all;
}

.project-link a { color: var(--accent); font-weight: 500; }

/* --------------------------------------------------------------------------
   Side Column: Skills & Focus Blocks
   -------------------------------------------------------------------------- */
.skill-group { margin-bottom: 1.8mm; }
.skill-group:last-child { margin-bottom: 0; }

.skill-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2mm;
  margin-bottom: 0.2mm;
  font-size: 7.8pt;
  font-weight: 800;
  color: var(--ink);
}

.skill-items {
  margin: 0;
  color: var(--ink-2);
  font-size: 7.6pt;
  line-height: 1.33;
}

.focus-block {
  margin-bottom: 1.8mm;
  padding-bottom: 1.5mm;
  border-bottom: 0.5pt solid var(--rule-soft);
}

.focus-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.focus-block.is-learning .skill-label { color: var(--accent); }

/* --------------------------------------------------------------------------
   Side Column: Education, Training & Courses
   -------------------------------------------------------------------------- */
.edu-item { margin-bottom: 1.6mm; }
.edu-item:last-child { margin-bottom: 0; }

.edu-title {
  font-size: 8pt;
  font-weight: 800;
  color: var(--ink);
}

.edu-org {
  font-size: 7.5pt;
  font-weight: 600;
  color: var(--accent);
}

.edu-meta {
  font-size: 6.9pt;
  color: var(--muted);
}

.edu-desc {
  margin-top: 0.3mm;
  font-size: 7.3pt;
  line-height: 1.3;
  color: var(--ink-2);
}

/* Course track headers */
.course-track-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.4mm 0 0.8mm;
  font-size: 7.2pt;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 0.5pt solid var(--rule-soft);
  padding-bottom: 0.3mm;
}

.course-track-header.track-learning {
  color: var(--accent);
}

.list-compact {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-compact li {
  position: relative;
  padding: 0.45mm 0 0.45mm 2.8mm;
  font-size: 7.5pt;
  line-height: 1.3;
  color: var(--ink-2);
  border-bottom: 0.4pt dotted #e2e8f0;
}

.list-compact li:last-child { border-bottom: none; }

.list-compact li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.8mm;
  width: 1.1mm;
  height: 1.1mm;
  background: var(--ink);
}

.list-compact.is-learning li::before {
  background: #fff;
  border: 0.6pt solid var(--accent);
}

.list-compact b { color: var(--ink); font-weight: 700; }
.list-compact .src { color: var(--muted); font-size: 7.1pt; }
.list-compact .note { display: block; font-size: 6.8pt; color: var(--muted); }

.side-note {
  margin-top: 1mm;
  font-size: 6.5pt;
  font-style: italic;
  color: var(--muted);
  line-height: 1.3;
}

/* Target roles */
.roles-label {
  margin: 0 0 0.3mm;
  font-size: 7.1pt;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.roles-label.is-junior { color: var(--accent); margin-top: 1.2mm; }

.roles-text {
  margin: 0 0 1.2mm;
  font-size: 7.5pt;
  line-height: 1.3;
  color: var(--ink-2);
}

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

/* --------------------------------------------------------------------------
   Responsive (Screen only, mobile/tablets)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 860px) {
  .action-bar { flex-direction: column; align-items: flex-start; }
  .cv-wrapper { padding: 16px 8px 48px; gap: 20px; }
  .sheet {
    width: 100%;
    min-height: auto;
    padding: 24px 18px 36px;
  }
  body { font-size: 10pt; }
  .cv-name { font-size: 28pt; }
  .cv-columns { grid-template-columns: 1fr; }
  .col-side {
    padding-left: 0;
    border-left: none;
    margin-top: 6mm;
  }
}

/* --------------------------------------------------------------------------
   Print — Exact A4 2-page Export
   -------------------------------------------------------------------------- */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm 7mm 10mm;
  }

  html, body {
    background: #ffffff !important;
    font-size: 7.75pt !important;
    line-height: 1.28 !important;
    color: #0f172a !important;
  }

  .action-bar { display: none !important; }

  .cv-wrapper {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
  }

  .sheet {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 282mm !important;
    max-height: 282mm !important;
    min-height: 282mm !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .sheet:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .cv-header,
  .page2-header,
  .cv-section,
  .job,
  .project,
  .skill-group,
  .focus-block,
  .edu-item {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .cv-header {
    padding-bottom: 2mm !important;
    margin-bottom: 2.2mm !important;
    border-bottom-width: 1.5pt !important;
  }

  .cv-name {
    font-size: 23pt !important;
    line-height: 0.95 !important;
  }

  .cv-headline {
    font-size: 9.6pt !important;
    margin-top: 1.2mm !important;
  }

  .cv-subheadline {
    font-size: 7.6pt !important;
    margin-top: 0.4mm !important;
  }

  .contact-row {
    margin-top: 1.4mm !important;
    gap: 0.8mm 3.2mm !important;
    font-size: 7pt !important;
  }

  .page2-header {
    padding-bottom: 1.4mm !important;
    margin-bottom: 2.2mm !important;
    border-bottom-width: 1.2pt !important;
  }

  .page2-header .name {
    font-size: 11pt !important;
  }

  .page2-header .meta {
    font-size: 7pt !important;
  }

  .cv-section {
    margin-bottom: 2mm !important;
  }

  .cv-section-title {
    font-size: 8.4pt !important;
    margin: 0 0 1.2mm !important;
    padding-bottom: 0.5mm !important;
  }

  .summary p {
    font-size: 7.6pt !important;
    line-height: 1.28 !important;
  }

  .job {
    margin-bottom: 1.6mm !important;
  }

  .job-role {
    font-size: 8.2pt !important;
  }

  .job-company {
    font-size: 7.8pt !important;
  }

  .job-date,
  .job-loc {
    font-size: 6.8pt !important;
  }

  .job-context {
    font-size: 7pt !important;
    margin-top: 0.2mm !important;
  }

  .job-bullets {
    margin: 0.4mm 0 0 !important;
    padding-left: 3.2mm !important;
  }

  .job-bullets li {
    font-size: 7.4pt !important;
    line-height: 1.25 !important;
    margin-bottom: 0.3mm !important;
  }

  .job-keywords {
    font-size: 6.8pt !important;
    margin-top: 0.3mm !important;
  }

  .skill-group {
    margin-bottom: 1.3mm !important;
  }

  .skill-label {
    font-size: 7.5pt !important;
    margin-bottom: 0.1mm !important;
  }

  .skill-items {
    font-size: 7.2pt !important;
    line-height: 1.25 !important;
  }

  .edu-item {
    margin-bottom: 1.2mm !important;
  }

  .edu-title {
    font-size: 7.7pt !important;
  }

  .edu-meta {
    font-size: 6.8pt !important;
  }

  .edu-desc {
    font-size: 7pt !important;
    line-height: 1.24 !important;
    margin-top: 0.2mm !important;
  }

  .list-compact li {
    padding: 0.25mm 0 0.25mm 2.5mm !important;
    font-size: 7.1pt !important;
    line-height: 1.24 !important;
  }

  .list-compact .note {
    font-size: 6.5pt !important;
  }

  .side-note {
    font-size: 6.2pt !important;
    margin-top: 0.6mm !important;
  }

  .project {
    padding: 0.9mm 0 1.1mm !important;
  }

  .project-name {
    font-size: 8.2pt !important;
  }

  .project-cat {
    font-size: 6.2pt !important;
  }

  .project-tech {
    font-size: 6.8pt !important;
    margin-top: 0.1mm !important;
  }

  .project-desc {
    font-size: 7.35pt !important;
    line-height: 1.25 !important;
    margin-top: 0.3mm !important;
  }

  .project-link {
    font-size: 6.5pt !important;
    margin-top: 0.3mm !important;
  }

  .focus-block {
    margin-bottom: 1.3mm !important;
    padding-bottom: 1mm !important;
  }

  .course-track-header {
    margin: 1.1mm 0 0.5mm !important;
    font-size: 6.9pt !important;
  }

  .roles-label {
    font-size: 6.8pt !important;
    margin-bottom: 0.2mm !important;
  }

  .roles-label.is-junior {
    margin-top: 0.8mm !important;
  }

  .roles-text {
    font-size: 7.15pt !important;
    line-height: 1.24 !important;
    margin-bottom: 0.6mm !important;
  }

  .sheet-footer {
    padding-top: 1.2mm !important;
    font-size: 6.4pt !important;
  }

  a:hover { color: inherit; }
}
