/* Base */
:root {
  --fg: #111;
  --muted: #60646c;
  --accent: #0f62fe;
  --accent-ink: #0b4ad9;
  --bg: #ffffff;
  --rule: #e6e8ec;
  --sidebar-bg: #f6f9ff;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 940px;
  margin: 0 auto;
  padding: 16px;
}

/* Header actions (hidden on print) */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #eee;
}
.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.btn {
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #111;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn:hover {
  filter: brightness(0.95);
}

/* CV */
.cv-header {
  margin-top: 8px;
  margin-bottom: 16px;
}
h1 {
  font-size: 36px;
  margin: 0 0 4px 0;
  letter-spacing: 0.2px;
}
.lead {
  margin: 0 0 8px 0;
  color: var(--muted);
}
.meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
}
.meta a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed #c7c7c7;
}
h2 {
  font-size: 18px;
  margin: 24px 0 10px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}
h3 {
  font-size: 16px;
  margin: 0;
}
.entry {
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}
.entry-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.period {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 720px) {
  .columns {
    grid-template-columns: 1fr 1fr;
  }
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.tags li {
  background: #f2f4f7;
  border: 1px solid #e4e7ec;
  color: #1f2937;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.inline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.muted {
  color: var(--muted);
}

/* Two-column layout */
.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  position: sticky;
  top: 64px;
  align-self: start;
  background: var(--sidebar-bg);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 16px;
}
.sidebar .photo {
  width: 180px;
  margin: 0 auto 12px;
  border-radius: 9999px;
  overflow: hidden;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(15, 98, 254, 0.15);
}
.sidebar .photo img {
  width: 100%;
  height: auto;
  display: block;
}
.sidebar h2 {
  border-left-color: var(--accent);
}
.sidebar .tags {
  gap: 8px;
}
.sidebar .tags li {
  background: #eef4ff;
  border-color: #dae6ff;
  color: var(--accent-ink);
  padding: 3px 8px;
  font-size: 11.5px;
}
.sidebar .meta {
  gap: 6px;
  line-height: 1.35;
  flex-direction: column;
  align-items: flex-start;
}
.sidebar .meta li {
  display: block;
  width: 100%;
}
.sidebar .meta a {
  word-break: break-word;
}

.content {
  min-width: 0;
}
/* Company/roles layout */
.company {
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}
.company > .company-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding-left: 8px;
}
.company h3 {
  font-size: 16px;
  margin: 0;
}
.roles {
  list-style: none;
  padding: 0 0 0 10px;
  margin: 6px 0 0 6px;
  border-left: 1px solid var(--rule);
}
.role {
  margin: 10px 0 0 0;
  padding-left: 0;
}
.role-title {
  font-weight: 600;
}
.role .period {
  margin-left: 8px;
}
.role ul {
  margin-top: 6px;
}

/* Typography refinements */
p,
li {
  hyphens: manual;
}
ul {
  margin: 8px 0 0 8px;
  padding-inline-start: 25px;
}
li {
  margin: 3px 0;
}

/* Print styles: A4 page, margins, hide UI */
@page {
  size: A4;
  margin: 18mm 16mm;
}

@media print {
  .no-print {
    display: none !important;
  }
  .container {
    max-width: none;
    padding: 0;
  }
  .layout {
    display: grid;
    grid-template-columns: 32% 1fr;
    gap: 14px;
  }
  .sidebar {
    position: static;
    padding: 10px;
  }
  body {
    color: #000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-size: 11.25pt;
    line-height: 1.35;
  }
  a {
    color: var(--accent-ink);
    text-decoration: none;
  }
  .entry {
    break-inside: avoid;
  }
  .company {
    break-inside: avoid;
  }
  /* Compact print typography */
  h1 {
    font-size: 22pt;
  }
  h2 {
    font-size: 11.5pt;
    margin-top: 10px;
    border-left-color: var(--accent);
  }
  h3 {
    font-size: 10.5pt;
  }
  p,
  li {
    font-size: 10.25pt;
  }
  .tags {
    gap: 6px;
  }
  .tags li {
    background: #f2f2f2;
    border-color: #e0e0e0;
    padding: 2px 6px;
    font-size: 9.5pt;
  }
  .sidebar .tags {
    gap: 6px;
  }
  .sidebar .tags li {
    padding: 2px 6px;
    font-size: 9.25pt;
  }
  .sidebar .meta {
    gap: 4px;
  }
  .sidebar .meta a {
    border-bottom: none;
  }
  /* Ensure consistent margins usage by avoiding extra inner padding */
  main.container.cv {
    padding: 0;
  }
  html,
  body {
    height: auto;
  }
}

/* Screen: add a little color detailing */
.entry + .entry {
  border-top-color: #dde3ee;
}
.actions .btn.primary {
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05), 0 4px 10px rgba(15, 98, 254, 0.25);
}
