/* ==========================================================================
   VŨ VĂN TOÀN — MODERN EXECUTIVE CV (CLEAN, POLISHED & PRINT-READY A4)
   ========================================================================== */

@font-face {
  font-family: 'Manrope';
  src: url('assets/fonts/Manrope.ttf') format('truetype');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --ink-primary: #0f172a;
  --ink-secondary: #334155;
  --ink-muted: #64748b;
  --surface-paper: #ffffff;
  --surface-soft: #f8fafc;
  --border-light: #e2e8f0;

  --accent-blue: #0284c7;
  --accent-blue-bg: #f0f9ff;
  --accent-indigo: #4f46e5;
  --accent-emerald: #059669;
  --accent-emerald-bg: #ecfdf5;
  --accent-amber: #d97706;
  --accent-amber-bg: #fffbeb;
  --accent-rose: #e11d48;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(14, 165, 233, 0.16), transparent 36%),
    radial-gradient(circle at 88% 18%, rgba(99, 102, 241, 0.16), transparent 38%),
    linear-gradient(180deg, #090e1c 0%, #0f172a 100%);
  color: var(--ink-primary);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding: 22px 16px 56px;
}

h1, h2, h3, p, ul {
  margin: 0;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

/* ==========================================================================
   FLOATING GLASS TOOLBAR (SCREEN ONLY)
   ========================================================================== */
.cv-toolbar {
  width: min(920px, 100%);
  margin: 0 auto 20px;
  padding: 10px 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #f8fafc;
}

.toolbar-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #cbd5e1;
  transition: background 0.2s ease, color 0.2s ease;
}
.toolbar-back:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-download,
.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

.btn-download {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}
.btn-download:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.btn-print {
  border: 0;
  background: linear-gradient(135deg, #22d3ee, #3b82f6);
  color: #041018;
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.28);
}
.btn-print:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* ==========================================================================
   EXECUTIVE A4 SHEET
   ========================================================================== */
.cv-sheet {
  position: relative;
  width: min(920px, 100%);
  margin: 0 auto;
  background: var(--surface-paper);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  padding: 40px 46px 30px;
}

.sheet-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #0ea5e9 0%, #6366f1 50%, #10b981 100%);
}

/* Header */
.cv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1.5px solid var(--border-light);
}

.header-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-monogram {
  width: 56px;
  height: 56px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.24);
  flex-shrink: 0;
}

.cv-header h1 {
  font-size: 2.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink-primary);
}

.job-title {
  margin-top: 4px;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--accent-blue);
}

.header-contact {
  font-style: normal;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 7px 18px;
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.header-contact a,
.contact-loc {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.header-contact svg {
  color: var(--accent-blue);
  flex-shrink: 0;
}
.header-contact a:hover {
  color: var(--accent-blue);
}

/* Summary */
.cv-summary {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--surface-soft);
  border-left: 3.5px solid var(--accent-blue);
}
.cv-summary p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--ink-secondary);
}
.cv-summary strong {
  color: var(--ink-primary);
}

/* 2-Column Body */
.cv-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

/* Section Headings */
.cv-section + .cv-section {
  margin-top: 24px;
}

.cv-section h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.96rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-primary);
  padding-bottom: 8px;
  margin-bottom: 14px;
  border-bottom: 1.5px solid var(--border-light);
}

.section-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex-shrink: 0;
}
.dot-blue { background: var(--accent-blue); }
.dot-indigo { background: var(--accent-indigo); }
.dot-amber { background: var(--accent-amber); }
.dot-emerald { background: var(--accent-emerald); }
.dot-rose { background: var(--accent-rose); }

/* Experience Entries */
.entry + .entry {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-light);
}

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

.entry h3 {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--ink-primary);
  line-height: 1.3;
}

.role {
  margin-top: 2px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent-blue);
}

.date-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
}
.date-muted {
  background: #f1f5f9;
  color: var(--ink-muted);
}

.entry ul {
  margin-top: 9px;
  padding-left: 17px;
  display: grid;
  gap: 5px;
  font-size: 0.86rem;
  color: var(--ink-secondary);
}
.entry li::marker {
  color: var(--accent-blue);
}

/* Featured Projects */
.projects-note {
  font-size: 0.83rem;
  color: var(--ink-muted);
  margin-bottom: 12px;
}
.projects-note strong {
  color: var(--ink-primary);
}

.projects-list {
  display: grid;
  gap: 10px;
}

.project-item {
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border-light);
}

.project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.project-head h3 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink-primary);
}

.project-head a {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-indigo);
  white-space: nowrap;
}
.project-head a:hover {
  text-decoration: underline;
}

.project-item p {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.projects-tech {
  margin-top: 11px;
  font-size: 0.82rem;
  color: var(--ink-secondary);
}
.projects-tech strong {
  color: var(--ink-primary);
}

/* Sidebar */
.cv-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.side-block {
  margin-top: 0 !important;
}

.edu-card {
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border-light);
}
.edu-card + .edu-card {
  margin-top: 10px;
}

.edu-date {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 3px;
}

.edu-card h3 {
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink-primary);
}

.edu-card p {
  margin-top: 3px;
  font-size: 0.81rem;
  color: var(--ink-secondary);
}

.gpa-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
}

/* Skill Chips */
.skill-group + .skill-group {
  margin-top: 12px;
}

.skill-group h3 {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

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

.chips span {
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--ink-primary);
  background: var(--surface-soft);
  border: 1px solid var(--border-light);
}

/* Side Project */
.side-project {
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border-light);
}

.side-project-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.side-project-top h3 {
  font-size: 0.86rem;
  font-weight: 800;
}
.side-project-top span {
  font-size: 0.72rem;
  color: var(--ink-muted);
  white-space: nowrap;
}
.side-project p {
  font-size: 0.8rem;
  line-height: 1.52;
  color: var(--ink-secondary);
}
.side-project a {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-rose);
}
.side-project a:hover {
  text-decoration: underline;
}

/* Footer */
.cv-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.76rem;
  color: var(--ink-muted);
}

/* ==========================================================================
   RESPONSIVE MOBILE
   ========================================================================== */
@media (max-width: 780px) {
  body {
    padding: 12px 10px 36px;
  }
  .cv-toolbar {
    flex-wrap: wrap;
    padding: 10px 12px;
  }
  .cv-sheet {
    padding: 28px 20px 24px;
    border-radius: 14px;
  }
  .cv-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .header-contact {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .cv-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .entry-top,
  .project-head {
    flex-direction: column;
    gap: 4px;
  }
  .cv-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ==========================================================================
   PRINT A4 STYLES
   ========================================================================== */
@page {
  size: A4;
  margin: 10mm 12mm;
}

@media print {
  body {
    background: #ffffff !important;
    padding: 0;
    font-size: 9.2pt;
    line-height: 1.45;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .cv-toolbar {
    display: none !important;
  }
  .cv-sheet {
    width: auto;
    margin: 0;
    padding: 14px 4px 0;
    border-radius: 0;
    box-shadow: none;
  }
  .cv-header {
    padding-bottom: 12px;
  }
  .avatar-monogram {
    width: 44px;
    height: 44px;
    font-size: 1rem;
    box-shadow: none;
  }
  .cv-header h1 {
    font-size: 20pt;
  }
  .job-title {
    font-size: 10pt;
  }
  .header-contact {
    font-size: 8.4pt;
    gap: 4px 14px;
  }
  .cv-summary {
    margin-top: 12px;
    padding: 9px 12px;
  }
  .cv-summary p {
    font-size: 8.8pt;
    line-height: 1.48;
  }
  .cv-grid {
    margin-top: 14px;
    gap: 20px;
  }
  .cv-section + .cv-section {
    margin-top: 14px;
  }
  .cv-section h2 {
    font-size: 9.5pt;
    padding-bottom: 5px;
    margin-bottom: 9px;
    break-after: avoid;
  }
  .entry,
  .project-item,
  .edu-card,
  .side-project {
    break-inside: avoid;
  }
  .entry + .entry {
    margin-top: 10px;
    padding-top: 10px;
  }
  .entry ul {
    margin-top: 5px;
    font-size: 8.6pt;
    gap: 3px;
  }
  .project-item {
    padding: 7px 10px;
  }
  .project-item p {
    font-size: 8.2pt;
  }
  .chips span {
    font-size: 7.8pt;
    padding: 2px 7px;
  }
  .cv-footer {
    margin-top: 14px;
    padding-top: 8px;
    font-size: 7.6pt;
  }
}
