:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-alt: #f0f5fb;
  --text: #142033;
  --muted: #56657d;
  --line: #dbe5f0;
  --accent: #1167d8;
  --accent-soft: #eaf3ff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Tajawal, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f7faff 0%, #eef3fb 100%);
}
body[dir='rtl'] { font-family: Tajawal, Inter, Arial, sans-serif; }

.cv-shell {
  width: min(980px, calc(100% - 28px));
  margin: 28px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(20, 32, 51, 0.08);
}

.cv-header {
  padding: 36px;
  background:
    radial-gradient(circle at top right, rgba(17, 103, 216, 0.14), transparent 32%),
    linear-gradient(135deg, #0f1d32 0%, #142a48 100%);
  color: #f7fbff;
}

.cv-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.cv-mark {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, #8ddcff, #c7ffec);
  color: #0f1d32;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.cv-headline h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.cv-headline p {
  margin: 0;
  max-width: 760px;
  color: rgba(247, 251, 255, 0.82);
  line-height: 1.75;
}

.cv-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.cv-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: #f7fbff;
  text-decoration: none;
  font-size: 0.95rem;
}

.cv-main {
  display: grid;
  grid-template-columns: 300px 1fr;
}

.cv-sidebar {
  padding: 28px;
  background: var(--surface-alt);
  border-inline-end: 1px solid var(--line);
}

.cv-content {
  padding: 28px;
}

.cv-section + .cv-section { margin-top: 26px; }

.cv-label {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  font-weight: 700;
}

.cv-section h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.cv-section p,
.cv-section li,
.cv-entry-meta,
.cv-note {
  color: var(--muted);
  line-height: 1.7;
}

.cv-list,
.cv-bullets {
  margin: 0;
  padding-left: 18px;
}

body[dir='rtl'] .cv-list,
body[dir='rtl'] .cv-bullets {
  padding-right: 18px;
  padding-left: 0;
}

.cv-grid-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cv-grid-tags span {
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.cv-entry {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.cv-entry:first-of-type { border-top: 0; padding-top: 0; }

.cv-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 6px;
}

.cv-entry h3 {
  margin: 0;
  font-size: 1.05rem;
}

.cv-entry-meta {
  white-space: nowrap;
  font-size: 0.92rem;
}

.cv-note {
  font-size: 0.95rem;
}

.print-actions {
  width: min(980px, calc(100% - 28px));
  margin: 20px auto 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.print-actions a,
.print-actions button {
  border: 0;
  cursor: pointer;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  font: inherit;
  text-decoration: none;
}

.print-actions button {
  background: #142a48;
  color: #fff;
}

.print-actions a {
  background: #fff;
  color: #142a48;
  border: 1px solid var(--line);
}

@media (max-width: 860px) {
  .cv-main { grid-template-columns: 1fr; }
  .cv-sidebar { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .cv-top, .cv-entry-head { flex-direction: column; }
  .cv-entry-meta { white-space: normal; }
}

@media print {
  body { background: #fff; }
  .print-actions { display: none; }
  .cv-shell {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .cv-header { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
