* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  width: min(100% - 2rem, 820px);
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

p { margin: 0.5rem 0; }

a {
  color: var(--accent);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.22em;
}

/* Header */

.site-header { margin-bottom: 2.25rem; }

.name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}

.label {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.label-role { color: var(--text); }
.label-sep { color: var(--border); }
.label-skill { color: var(--muted); }

.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.contact-list a { color: var(--muted); }
.contact-list a:hover { color: var(--text); }

/* Sections + glyph divider quirk */

.section {
  padding: 1.6rem 0 0.6rem;
  position: relative;
}

.section + .section::before {
  content: "§";
  display: block;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin: 0.5rem 0 1.25rem;
  opacity: 0.55;
}

.section-title {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* Entries */

.entry {
  margin-bottom: 1.4rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--entry-accent, var(--border));
}
.entry:last-child { margin-bottom: 0; }

.entry-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.entry-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

/* Company logo quirk — full colour wordmarks in a fixed-width slot so names align */
.entry-logo-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 3px;
}

.entry-logo {
  height: 16px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

/* Dark mode: opt-in chip via data-dark-chip="true" — for transparent-bg logos
   with dark/low-contrast marks (e.g. DXC). Logos with their own opaque
   backgrounds (Bosch, DBS, Optimum) and bright brand colours (S&P, SP, Wen)
   stand on the dark background as-is. */
[data-theme="dark"] .entry-logo-slot[data-dark-chip="true"] {
  background: #ebe9e0;
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .entry-logo-slot[data-dark-chip="true"] {
    background: #ebe9e0;
  }
}

.entry-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.entry-role {
  font-weight: 400;
  color: var(--muted);
}

.entry-meta {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.entry-subtitle {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.bullets { margin: 0.55rem 0 0; padding-left: 1.15rem; }
.bullets li { margin: 0.3rem 0; }

/* Skills */

.skills-list {
  margin: 0;
  display: grid;
  gap: 0.4rem 1rem;
}

.skills-row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.5rem 1rem;
}

.skills-category {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.skills-items { margin: 0; }

/* Tags */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: transparent;
}

/* Toggles + PDF download */

.toggle-row {
  display: flex;
  gap: 0.3rem;
  margin-top: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.toggle-row button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  transition: color 150ms ease, border-color 150ms ease;
}

.toggle-row button:hover { color: var(--text); }

.toggle-row button[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--text);
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 1.1rem;
}

.action-row .toggle-row,
.action-row .download-row { margin-top: 0; }

.download-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
  margin-left: auto;
}

.print-button {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: normal;
  cursor: pointer;
  text-decoration: none;
  transition: color 150ms ease, border-color 150ms ease;
}

.download-row .print-button { margin-top: 0; }
.print-button:hover {
  color: var(--text);
  border-color: var(--text);
}
.print-button[data-state="downloaded"] { border-color: var(--accent); }

.download-status {
  min-width: 6.5rem;
  text-align: right;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.no-print { display: block; }
.toggle-row.no-print,
.action-row.no-print,
.download-row.no-print { display: flex; }

@media (max-width: 640px) {
  main { width: min(100% - 1.25rem, 820px); padding: 1.75rem 0 2.5rem; }
  .action-row { align-items: flex-start; flex-wrap: wrap; }
  .download-row { width: 100%; }
  .entry-header { display: block; }
  .entry-meta { white-space: normal; margin-top: 0.2rem; display: block; }
  .skills-row { grid-template-columns: 1fr; gap: 0.1rem; }
}

@media print {
  @page {
    margin: 0.45in 0.55in;
  }

  *,
  *::before,
  *::after {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  :root,
  [data-theme="dark"],
  [data-theme="auto"] {
    --bg: #ffffff;
    --text: #000000;
    --muted: #3a3a3a;
    --border: #bdbdbd;
    --surface: #ffffff;
    color-scheme: light;
  }

  html { font-size: 9.5pt; }
  body { background: #fff; line-height: 1.32; }
  main { width: auto; max-width: none; margin: 0; padding: 0; }
  a[href] {
    color: #064f9e;
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
    font-weight: 500;
  }
  p { margin: 0.18rem 0; }

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

  /* Header: tight stack, no toggles, no print button */
  .site-header { margin-bottom: 0.55rem; }
  .name { font-size: 1.55rem; line-height: 1.05; letter-spacing: -0.035em; }
  .label { margin-top: 0.15rem; font-size: 0.78rem; line-height: 1.35; }
  .contact-list { margin-top: 0.3rem; gap: 0.15rem 0.7rem; font-size: 0.72rem; }

  /* Sections: clear PDF headings without the decorative screen dividers */
  .section { padding: 0.85rem 0 0.12rem; }
  .section + .section { margin-top: 0.28rem; }
  .section + .section::before { display: none; content: ""; }
  .section-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.5rem;
    color: #000;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.13em;
  }
  .section-title::after {
    content: "";
    display: block;
    flex: 1;
    border-top: 1px solid var(--border);
  }

  /* Entries: tight, preserve company accent rules in generated PDFs */
  .entry {
    margin-bottom: 0.45rem;
    padding-left: 0.55rem;
    border-left-color: var(--entry-accent, var(--border));
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .entry-title { font-size: 0.92rem; }
  .entry-meta { font-size: 0.72rem; }
  .entry-subtitle { margin-top: 0.05rem; font-size: 0.78rem; }

  /* Logos: smaller fixed-width slot, no chip in print */
  .entry-logo-slot {
    width: 26px;
    height: 14px;
    background: transparent !important;
    border-radius: 2px;
  }
  .entry-logo {
    height: 11px;
    max-width: 100%;
  }

  /* Bullets: tight */
  .bullets { margin: 0.18rem 0 0; padding-left: 0.95rem; }
  .bullets li { margin: 0.08rem 0; }

  /* Skills: tighter rows */
  .skills-list { gap: 0.2rem 1rem; }
  .skills-row { gap: 0.3rem 0.8rem; }
  .skills-category { font-size: 0.7rem; }

  .tag { border-color: #999; background: transparent; font-size: 0.65rem; padding: 0.05rem 0.4rem; }
}
