/* ============================================================
   AI Engineer Resume — resume.css
   Design: Minimal two-column layout (sidebar 30% + main 70%)
   ATS-safe: CSS Grid only, semantic HTML, no skill bars
   Print: @media print + @page A4 ready
   ============================================================ */

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* Colors */
  --color-accent:        #f0cfc3;
  --color-accent-dark:   #d4a898;
  --color-accent-muted:  rgba(240, 207, 195, 0.30);
  --color-sidebar-bg:    #f7f7f7;
  --color-sidebar-text:  #2c2c2c;
  --color-sidebar-muted: #666666;
  --color-sidebar-border:rgba(0, 0, 0, 0.12);
  --color-main-bg:       #ffffff;
  --color-body-bg:       #ece8e6;
  --color-text:          #2c2c2c;
  --color-text-light:    #666666;
  --color-timeline-line: #e4e4e4;
  --color-dot-exp:       #f0cfc3;
  --color-dot-proj:      #c9a0c8;
  --color-border:        #f0f0f0;

  /* Typography */
  --font-primary:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-base: 13px;
  --line-height:    1.6;

  /* Layout — A4 Size: 210mm × 297mm (794px × 1123px at 96dpi) */
  --a4-width:       794px;
  --a4-height:      1123px;
  --sidebar-width:  30%;
  --main-width:     70%;
  --sidebar-pad:    32px 28px;
  --main-pad:       44px 44px 40px 48px;
  --section-gap:    30px;
}

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

html {
  font-size: var(--font-size-base);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-body-bg);
}

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

ul { list-style: none; }

/* ── Wrapper & Container ──────────────────────────────────── */
.resume-wrapper {
  min-height: 100vh;
  padding: 24px 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: var(--color-body-bg);
}

.resume-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) var(--main-width);
  width: var(--a4-width);
  min-height: var(--a4-height);
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.14);
  border-radius: 2px;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  background: var(--color-sidebar-bg);
  color: var(--color-sidebar-text);
  padding: var(--sidebar-pad);
  display: flex;
  flex-direction: column;
  gap: 26px;
  border-right: 3px solid var(--color-accent);
}

/* Photo placeholder */
.photo-placeholder {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px auto 12px;
  flex-shrink: 0;
  overflow: hidden;
}

.photo-initials {
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -1px;
  line-height: 1;
}

/* Sidebar section heading */
.sidebar-heading {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-sidebar-border);
  padding-bottom: 7px;
  margin-bottom: 12px;
}

/* Contact list */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 10.5px;
  color: var(--color-sidebar-text);
  line-height: 1.4;
  word-break: break-word;
}

.contact-icon {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  color: var(--color-accent);
  font-size: 13px;
  margin-top: 1px;
}

.contact-item a {
  color: var(--color-sidebar-text);
  word-break: break-word;
  overflow-wrap: break-word;
}
.contact-item a:hover { color: var(--color-accent); }

/* Skills */
.skill-group {
  margin-bottom: 8px;
}
.skill-group:last-child { margin-bottom: 0; }

.skill-category {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--color-sidebar-muted);
  margin-bottom: 3px;
}

.skill-text {
  font-size: 11px;
  color: var(--color-sidebar-text);
  padding: 2px 0;
  margin: 0;
  line-height: 1.4;
}

/* Education */
.edu-item {
  margin-bottom: 14px;
}
.edu-item:last-child { margin-bottom: 0; }

.edu-degree {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-sidebar-text);
  margin-bottom: 2px;
}

.edu-school {
  font-size: 11.5px;
  color: var(--color-sidebar-muted);
  margin-bottom: 2px;
}

.edu-meta {
  font-size: 10.5px;
  color: var(--color-sidebar-muted);
}

.edu-focus {
  font-size: 10.5px;
  color: var(--color-accent-dark);
  margin-top: 2px;
}

/* Languages */
.lang-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}
.lang-item:last-child { margin-bottom: 0; }

.lang-name {
  font-size: 11.5px;
  color: var(--color-sidebar-text);
  font-weight: 400;
}

.dots {
  display: flex;
  gap: 4px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5e7eb;
  transition: all 0.2s ease;
}

.dot.filled {
  background: #f0cfc3;
}


/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  background: var(--color-main-bg);
  padding: var(--main-pad);
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

/* Resume header */
.resume-header {
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 10px;
}

.resume-name {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--color-text);
  line-height: 1.1;
  margin-bottom: 4px;
}

.resume-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 2px;
  /* text-transform: uppercase; */
  color: var(--color-accent-dark);
  margin-bottom: 10px;
}

.resume-tagline {
  font-size: 11px;
  color: var(--color-text-light);
  letter-spacing: 0.3px;
}

/* Main section */
.main-section {}

.main-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.main-heading::before {
  content: '';
  display: block;
  width: 22px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Profile text */
.profile-text {
  font-size: 12.5px;
  color: var(--color-text-light);
  line-height: 1.7;
}

/* ── Timeline ─────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 28px;
}

/* Vertical connecting line */
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--color-timeline-line);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  margin-bottom: 26px;
}
.timeline-item:last-child { margin-bottom: 0; }

/* Timeline dot */
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-dot-exp);
  border: 3px solid var(--color-main-bg);
  box-shadow: 0 0 0 2px var(--color-dot-exp);
  z-index: 1;
}

.timeline-dot--project {
  background: var(--color-dot-proj);
  box-shadow: 0 0 0 2px var(--color-dot-proj);
}

/* Timeline header row */
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}

.job-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.job-date {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--color-accent-dark);
  background: rgba(198, 216, 79, 0.12);
  padding: 1px 7px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.job-company {
  font-size: 11.5px;
  color: var(--color-text-light);
  margin-bottom: 8px;
}

/* Achievement bullets */
.achievement-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.achievement-list li {
  position: relative;
  padding-left: 14px;
  font-size: 12px;
  color: var(--color-text-light);
  line-height: 1.55;
}

.achievement-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-accent-dark);
  font-size: 10px;
  line-height: 1.55;
}

.achievement-list strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Stack tag line */
.stack-tag {
  display: inline-block;
  font-size: 10px;
  color: var(--color-text-light);
  background: var(--color-border);
  border-radius: 3px;
  padding: 1px 6px;
  margin: 1px 2px 0 0;
}

/* ── Certifications ───────────────────────────────────────── */
.cert-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cert-list li {
  font-size: 12px;
  color: var(--color-text-light);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.cert-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--color-accent-dark);
  font-size: 10px;
}

.cert-list strong {
  color: var(--color-text);
}

/* ── Floating Print Button ────────────────────────────────── */
.print-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--color-accent);
  color: var(--color-sidebar-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.print-btn:hover {
  background: var(--color-accent-dark);
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}

.print-btn:active {
  transform: scale(0.96);
}

/* ── Responsive: single column for narrow screens ─────────── */
@media screen and (max-width: 900px) {
  .resume-wrapper { padding: 16px; }

  .resume-container {
    grid-template-columns: 1fr;
    width: 100%;
    height: auto;
    min-height: auto;
    box-shadow: none;
  }

  .sidebar { padding: 28px 24px; }

  .main-content { padding: 28px 24px; }

  .resume-name { font-size: 26px; }
}

/* ── Print / PDF export ───────────────────────────────────── */
@media print {
  /* Force exact colors — required for sidebar background */
  *, *::before, *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body {
    background: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .resume-wrapper {
    padding: 0 !important;
    margin: 0 !important;
    display: block;
    min-height: unset;
  }

  .resume-container {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    box-shadow: none;
    border-radius: 0;
    display: grid;
    grid-template-columns: var(--sidebar-width) var(--main-width);
  }

  /* ── Prevent awkward page breaks ── */
  .timeline-item  { break-inside: avoid; }
  .main-section   { break-inside: avoid; }
  .edu-item       { break-inside: avoid; }

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

  a {
    color: inherit;
    text-decoration: none;
  }

  .resume-name { font-size: 28px; }
}

@page {
  size: A4;
  margin: 0;
  padding: 0;
}
