/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
  /* Palette - warm orange + stone neutrals */
  --accent: #f97316; /* orange-500 */
  --accent-strong: #ea580c; /* orange-600 */
  --accent-bright: #fb923c; /* orange-400 */
  --accent-soft: #fff7ed; /* orange-50 */
  --accent-tint: rgba(249, 115, 22, 0.12);
  --accent-border: #fed7aa; /* orange-200 */

  --text: #1c1917; /* stone-900 */
  --text-muted: #57534e; /* stone-600 */
  --text-subtle: #78716c; /* stone-500 */
  --border: #e7e5e4; /* stone-200 */
  --divider: #f5f5f4; /* stone-100 */

  --bg: #fafaf9; /* warm white */
  --surface: #ffffff;

  /* 8px spacing system */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  /* Radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-full: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-md: 0 4px 12px rgba(28, 25, 23, 0.08);
}

/* ==========================================================================
   Layout
   ========================================================================== */

@media (min-width: 1201px) {
  .container {
    padding-left: 22vw;
    padding-right: 22vw;
  }
}

@media (min-width: 721px) and (max-width: 1200px) {
  .container {
    padding-left: 12vw;
    padding-right: 12vw;
  }
}

@media (max-width: 720px) {
  .container {
    padding-left: var(--s-5);
    padding-right: var(--s-5);
  }
}

.container {
  animation: drop-container 2s;
}

@keyframes drop-container {
  0% {
    margin-top: 100vh;
  }
  100% {
    margin-top: 0vh;
  }
}

.container > div {
  margin-top: var(--s-7);
}

.content-margin {
  margin-left: var(--s-5);
  margin-right: var(--s-5);
}

/* ==========================================================================
   Dividers
   ========================================================================== */

.full-line {
  margin-top: var(--s-7);
  height: 3px;
  width: 100%;
  background-image: linear-gradient(
    to right,
    var(--accent),
    var(--accent-bright)
  );
  border-radius: var(--r-sm);
}

.half-line {
  margin: var(--s-5) 20%;
  height: 1px;
  width: 60%;
  background-color: var(--border);
  display: inline-block;
}

.separator-line {
  margin: var(--s-6) 10%;
  height: 1px;
  width: 80%;
  background-color: var(--border);
  display: inline-block;
}

/* ==========================================================================
   Header
   ========================================================================== */

.first-letter {
  font-size: 115%;
  font-weight: 800;
  color: var(--accent);
}

.name {
  font-weight: 800;
  width: 100%;
  direction: rtl;
  animation: slide-in-right 2s;
  margin-bottom: var(--s-3);
}

.personal-info {
  animation: slide-in-right 2s;
}

@keyframes slide-in-right {
  0% {
    opacity: 0;
    margin-left: -100vw;
  }
  25% {
    opacity: 0;
    margin-left: -100vw;
  }
  100% {
    opacity: 1;
    margin-left: 0vw;
  }
}

.contact {
  font-size: 14px;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-1) var(--s-5);
  margin-top: var(--s-2);
  color: var(--text-muted);
}

.contact-item {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  transition: color 0.2s ease;
}

.contact-item:hover {
  color: var(--accent);
}

.contact-item > i {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  -webkit-text-stroke-width: 0;
  font-size: 0.95em;
}

.print-btn {
  padding: var(--s-2) var(--s-5);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  float: left;
  border: 0;
  border-radius: var(--r-md);
  background-color: var(--accent);
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

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

/* ==========================================================================
   Section headers (shared h2)
   ========================================================================== */

.container > div > h2,
.objective-title {
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-2);
  border-bottom: 2px solid var(--accent-border);
  color: var(--text);
}

.container > div > h2 > .first-letter,
.objective-title > .first-letter {
  color: var(--accent);
}

.container > div > h2 > i,
.objective-title > i {
  margin-left: var(--s-2);
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  -webkit-text-stroke-width: 0;
  font-size: 0.9em;
}

/* ==========================================================================
   Summary
   ========================================================================== */

.objective-description {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ==========================================================================
   Skills (pills)
   ========================================================================== */

.skills-group {
  margin-bottom: var(--s-4);
}

.skills-group:last-child {
  margin-bottom: 0;
}

.skills-subtitle {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 var(--s-2) 0;
}

.skills-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.pill {
  display: inline-block;
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-full);
  border: 1px solid var(--accent-border);
  background-color: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.pill:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Legacy skills-table kept only in case it's reintroduced */
.skills-table {
  font-weight: 700;
  text-align: center;
  border-collapse: collapse;
}

/* ==========================================================================
   Experience
   ========================================================================== */

.job {
  margin-bottom: var(--s-5);
}

.job-header:after,
.job-group-header:after,
.role-header:after {
  content: '';
  display: table;
  clear: both;
}

.job-header > .title {
  text-align: left;
  width: 45%;
  float: left;
  font-weight: 600;
  color: var(--text);
}

.job-header > .company {
  text-align: center;
  width: 22%;
  float: left;
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.job-header > .company:hover {
  color: var(--accent-strong);
}

/* Unified date-period treatment across Experience, Education, Certifications */
.date-period {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-bright);
  font-variant-numeric: tabular-nums;
}

.job-header > .date-period {
  padding-left: var(--s-3);
  text-align: right;
  width: 28%;
  float: left;
}

@media (max-width: 640px) {
  .job-header > .title {
    width: 100%;
    float: none;
  }
  .job-header > .company {
    width: 100%;
    float: none;
    text-align: left;
    margin-top: var(--s-1);
  }
  .job-header > .date-period {
    width: 100%;
    float: none;
    text-align: left;
    padding-left: 0;
    margin-top: var(--s-1);
  }
}

.job > .address,
.job-group > .address {
  clear: both;
  padding-top: var(--s-1);
  padding-left: var(--s-5);
  margin: 0 0 var(--s-2) 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-subtle);
}

.job > .address:before,
.job-group > .address:before {
  font-family: 'Font Awesome 5 Free';
  content: '\f3c5';
  display: inline-block;
  padding-right: var(--s-1);
  vertical-align: middle;
  font-weight: 900;
  color: var(--accent);
}

.duties {
  list-style: none;
  margin-top: var(--s-2);
  padding-left: var(--s-5);
}

.duty {
  margin-bottom: var(--s-2);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  position: relative;
  padding-left: var(--s-4);
}

.duty:before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--accent);
}

/* ==========================================================================
   Experience - grouped (promotion track)
   ========================================================================== */

.job-group {
  margin-bottom: var(--s-6);
}

.job-group-header {
  margin-bottom: var(--s-1);
}

.job-group-header > .company {
  text-align: left;
  width: 65%;
  float: left;
  cursor: pointer;
  font-size: 19px;
  font-weight: 700;
  color: var(--accent);
}

.job-group-header > .company:hover {
  color: var(--accent-strong);
}

.job-group-header > .date-period {
  text-align: right;
  width: 35%;
  float: left;
}

@media (max-width: 640px) {
  .job-group-header > .company,
  .job-group-header > .date-period {
    width: 100%;
    float: none;
    text-align: left;
  }
}

.company-description {
  font-style: italic;
  margin: var(--s-2) 0 var(--s-4) 0;
  color: var(--text-muted);
  font-size: 14px;
  padding-left: var(--s-5);
  max-width: 70ch;
}

.roles {
  list-style: none;
  padding-left: var(--s-5);
  border-left: 2px solid var(--accent-border);
  margin-left: var(--s-3);
  margin-top: var(--s-3);
}

.role {
  position: relative;
  padding-left: var(--s-2);
  margin-top: var(--s-4);
  margin-bottom: var(--s-4);
}

.role:first-child {
  margin-top: 0;
}

.role:before {
  content: '';
  position: absolute;
  left: calc(var(--s-5) * -1 - 5px);
  top: 0.5em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent);
  border: 2px solid var(--bg);
}

.role--current:before {
  box-shadow: 0 0 0 4px var(--accent-tint);
}

.role-header > .title {
  text-align: left;
  width: 65%;
  float: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.role-header > .date-period {
  text-align: right;
  width: 35%;
  float: left;
  margin: 0;
}

@media (max-width: 640px) {
  .role-header > .title,
  .role-header > .date-period {
    width: 100%;
    float: none;
    text-align: left;
  }
}

.present-badge {
  display: inline-block;
  margin-left: var(--s-2);
  padding: 2px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: white;
  background-color: var(--accent);
  border-radius: var(--r-full);
  vertical-align: middle;
}

/* ==========================================================================
   Education
   ========================================================================== */

.education {
  clear: both;
}

.education .row {
  margin-bottom: var(--s-1);
}

.education .row:after {
  content: '';
  display: table;
  clear: both;
}

.education .left {
  width: 60%;
  float: left;
  color: var(--accent);
  font-weight: 700;
}

.education .right {
  width: 40%;
  float: right;
  text-align: right;
  color: var(--text-muted);
  font-weight: 500;
}

.education > ul > li > .date-period {
  margin-bottom: var(--s-2);
}

.education ul[style*='list-style: circle'],
.education ul[style*='list-style:circle'] {
  padding-left: var(--s-5);
}

.education ul li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: var(--s-1);
}

@media (max-width: 640px) {
  .education .left,
  .education .right {
    width: 100%;
    float: none;
    text-align: left;
  }
}

/* ==========================================================================
   Certifications
   ========================================================================== */

.certifications .row {
  margin-bottom: var(--s-1);
}

.certifications .row .left {
  width: 70%;
  float: left;
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
}

.certifications .row .right {
  width: 30%;
  float: right;
  text-align: right;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
}

.certifications .date-period {
  clear: both;
  padding-top: var(--s-1);
}

@media (max-width: 640px) {
  .certifications .row .left,
  .certifications .row .right {
    width: 100%;
    float: none;
    text-align: left;
  }
}

/* ==========================================================================
   Languages
   ========================================================================== */

.languages dl {
  margin: 0;
}

.languages dt {
  margin-top: var(--s-2);
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.languages dd {
  margin-left: 0;
  margin-bottom: var(--s-2);
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  margin-top: var(--s-5);
}

.social-media {
  margin-top: var(--s-5);
  margin-bottom: var(--s-3);
  text-align: center;
  display: flex;
  justify-content: center;
  gap: var(--s-5);
}

.social-media > a {
  color: var(--accent);
  font-size: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background-color: var(--accent-soft);
  transition: all 0.2s ease;
}

.social-media > a > i {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  -webkit-text-stroke-width: 0;
}

.social-media > a:hover {
  background-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  animation: none;
}

.social-media > a:hover > i {
  color: white;
  -webkit-text-fill-color: white;
}

.credits-parent {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: var(--s-3);
}

.credits {
  margin-bottom: var(--s-3);
  font-size: 12px;
  color: var(--text-subtle);
  letter-spacing: 0;
  transition: letter-spacing 0.8s ease;
  cursor: default;
  display: inline-block;
}

.credits:hover {
  letter-spacing: 3px;
}

/* ==========================================================================
   Icons (global overrides)
   ========================================================================== */

i.fas,
i.fab,
i.far {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  -webkit-text-stroke-width: 0;
}

.fas:hover,
.fab:hover {
  animation: bigger 0.7s infinite;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes bounce-up {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(0, -4px);
  }
}

@keyframes bigger {
  0%,
  100% {
    font-size: 100%;
  }
  50% {
    font-size: 110%;
  }
}

/* ==========================================================================
   Print stylesheet
   ========================================================================== */

@media print {
  @page {
    size: A4;
    margin: 14mm 16mm;
  }

  :root {
    --s-5: 12px;
    --s-6: 16px;
    --s-7: 20px;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 10.5pt;
    line-height: 1.4;
  }

  .no-print,
  .print-btn {
    display: none !important;
  }

  .container {
    animation: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .container > div {
    margin-top: 10px;
  }

  .container *,
  .container *:before,
  .container *:after {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
  }

  h1 {
    font-size: 22pt;
    margin-bottom: 4px;
  }

  h2 {
    font-size: 13pt;
    margin-bottom: 6px;
    padding-bottom: 3px;
    border-bottom: 1.5pt solid var(--accent);
    page-break-after: avoid;
  }

  h3 {
    font-size: 11pt;
  }

  h4 {
    font-size: 10pt;
  }

  h5 {
    font-size: 9pt;
  }

  p,
  li,
  dd {
    font-size: 9.5pt;
    line-height: 1.35;
  }

  /* Dividers - quieter */
  .full-line {
    background: var(--accent);
    height: 1.5pt;
    margin-top: 10px;
  }

  .separator-line,
  .half-line {
    background: #d6d3d1;
    margin: 8px auto;
  }

  /* Keep blocks together */
  .job,
  .job-group,
  .role,
  .education > ul > li,
  .certifications > ul > li {
    page-break-inside: avoid;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }

  /* Pills - quieter */
  .pill {
    background: #fff;
    border: 1px solid var(--accent);
    color: var(--accent-strong);
    padding: 2px 8px;
    font-size: 8.5pt;
  }

  /* Timeline in print */
  .roles {
    border-left: 1pt solid #d6d3d1;
  }

  .role:before {
    background: var(--accent);
    border-color: #fff;
    width: 7px;
    height: 7px;
  }

  .present-badge {
    background: transparent;
    color: var(--accent);
    border: 1pt solid var(--accent);
    padding: 1px 6px;
    font-size: 7.5pt;
  }

  /* Duties */
  .duty {
    margin-bottom: 3px;
  }

  /* Contact row */
  .contact {
    font-size: 9pt;
    gap: 2px 14px;
    margin-top: 4px;
  }

  .contact-item {
    color: #000;
  }

  /* Social media - show as text for print */
  .social-media {
    gap: 14px;
    margin-top: 8px;
  }

  .social-media > a {
    background: transparent;
    width: auto;
    height: auto;
    font-size: 10pt;
  }

  .credits {
    font-size: 8pt;
    color: #78716c;
  }

  /* Ensure backgrounds print (Chrome) */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
}
