body {
  padding-bottom: 2rem;
}

/* ============================================
   DOC BAR: version switch, PDF and print, along the top of the card (screen only)
   ============================================ */
/* Spans the card edge to edge: cancels the card's padding and copies its top corners */
.doc-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: calc(-1 * var(--pad-y)) calc(-1 * var(--pad-x)) 2rem;
  /* links carry 12px of padding, so their text lines up with the resume text below */
  padding: 0.7rem max(0.6rem, calc(var(--pad-x) - 12px));
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.025);
  border-radius: inherit;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.doc-bar .version,
.doc-actions {
  display: flex;
  gap: 2px;
}

.doc-bar .version a,
.doc-bar .ghost {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 0;
  background: none;
  font: 13px var(--font-family);
  color: #cbd5e1;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.doc-bar .version a:hover,
.doc-bar .ghost:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.doc-bar .version a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.doc-bar .ghost iconify-icon {
  font-size: 16px;
}

/* One-page version: hide the detail only the full resume carries */
.short .full {
  display: none !important;
}

/* ...and the full version hides what only the one-page resume carries */
html:not(.short) .short-only {
  display: none !important;
}

/* ============================================
   RESUME SHEET
   ============================================ */
.resume {
  --ink: #e2e8f0;
  --muted: var(--text-muted);
  --accent: #c4b5fd;
  --rule: rgba(255, 255, 255, 0.12);

  --pad-y: 3rem;
  --pad-x: 3rem;

  /* Side gutters sit on the card, not on body, so the top bar lines up with the home page */
  width: min(860px, 100% - 2rem);
  margin: 0.5rem auto 0;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 28px;
  background: rgba(15, 18, 35, 0.55);
  backdrop-filter: var(--blur-amount);
  -webkit-backdrop-filter: var(--blur-amount);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

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

.resume a:hover {
  color: var(--accent);
}

.resume b {
  color: var(--white);
  font-weight: 600;
}

.head {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.photo {
  width: 104px;
  height: 104px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid rgba(139, 92, 246, 0.6);
}

.name {
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.1;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.role {
  font: 500 1.1rem var(--font-display);
  color: var(--accent);
  margin: 0.25rem 0 0.75rem;
}

.contact {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-size: 13.5px;
  color: var(--muted);
}

.contact li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.summary {
  margin: 1.5rem 0 0.5rem;
}

.resume section {
  margin-top: 1.75rem;
}

.resume h2 {
  break-after: avoid;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 0.4rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

.item {
  margin-bottom: 1.1rem;
}

.item-head,
.item li,
.rows li {
  break-inside: avoid;
}

.item-head {
  break-after: avoid;
}

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

.item h3 {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.01em;
}

.item h3 span {
  font-weight: 400;
  color: var(--muted);
}

.item-head time,
.item-head a,
.rows time {
  flex: none;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.item p {
  color: var(--muted);
}

.item .context {
  margin-top: 0.2rem;
}

.item ul {
  margin: 0.35rem 0 0 1.1rem;
}

.item li {
  margin-bottom: 0.3rem;
}

.item li::marker {
  color: var(--violet);
}

/* ============================================
   EXPERIENCE TIMELINE (full version)
   Company start years in a left margin, company logos on one line, and
   each company's positions on their own indented line, joined to their
   titles by curved connectors.
   ============================================ */
@property --year-w {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

@property --logo {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

@property --gutter {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

@property --indent {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

.timeline {
  --year-w: 2.3em; /* width of the year margin */
  --logo: 1.7em; /* logo size */
  --gutter: 4.9em; /* where company names start */
  --indent: 1.3em; /* how far positions sit in from the company name */
  --axis: calc(var(--year-w) + 0.4em + var(--logo) / 2); /* company line */
  --branch: 0.4em; /* position line, measured from the company name */
  --line: rgba(167, 139, 250, 0.45);
  --tag-bg: rgba(139, 92, 246, 0.22);
  --tag-ink: #ddd6fe;
  --glow: rgba(139, 92, 246, 0.35);
  --logo-ring: rgba(255, 255, 255, 0.18);
}

.co {
  position: relative;
  padding: 0 0 1.1em var(--gutter);
}

/* company line: from this logo down to the next one */
.co:not(:last-child)::before {
  content: "";
  position: absolute;
  left: calc(var(--axis) - 1px);
  top: 1.6em;
  bottom: 0;
  border-left: 2px solid var(--line);
}

.co-logo {
  position: absolute;
  z-index: 1;
  left: calc(var(--axis) - var(--logo) / 2);
  top: -0.2em;
  width: var(--logo);
  height: var(--logo);
  border-radius: 0.5em;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 1px var(--logo-ring);
}

.co-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.co-logo.pad img {
  object-fit: contain;
  padding: 8%;
}

.co.current .co-logo {
  box-shadow:
    0 0 0 1px var(--logo-ring),
    0 0 0 0.3em var(--glow);
}

.co-head,
.pos-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  break-after: avoid;
  break-inside: avoid;
}

.yr {
  position: absolute;
  left: calc(-1 * var(--gutter));
  top: 0;
  bottom: 0;
  width: var(--year-w);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font: 600 0.86em var(--font-display);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.co h3 {
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
}

.co-meta,
.pos-head time {
  flex: none;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tag {
  display: inline-block;
  margin-left: 0.5em;
  padding: 0 0.6em;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-size: 0.9em;
  font-weight: 600;
}

.pos {
  position: relative;
  padding: 0 0 0.45em var(--indent);
}

.co-head + .pos {
  margin-top: 0.3em;
}

.pos h4 {
  font: 600 1.04em var(--font-display);
  color: var(--ink);
}

/* position line: a curved connector into each title... */
.pos::before {
  content: "";
  position: absolute;
  left: var(--branch);
  top: -0.45em;
  width: calc(var(--indent) - var(--branch) - 0.35em);
  height: calc(0.45em + 0.5lh);
  border-left: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  border-bottom-left-radius: 0.7em;
}

/* ...and a straight run down past this position to the next one */
.pos:not(:last-child)::after {
  content: "";
  position: absolute;
  left: var(--branch);
  top: calc(0.5lh - 0.2em);
  bottom: -0.45em;
  border-left: 2px solid var(--line);
}

.pos .context {
  margin-top: 0.2rem;
  color: var(--muted);
}

.pos ul {
  margin: 0.3rem 0 0 0.95rem;
}

.pos li {
  margin-bottom: 0.3rem;
  break-inside: avoid;
}

.pos li::marker {
  color: var(--violet);
}

.skills {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin-bottom: 1.75rem;
}

.skills dt {
  font-weight: 600;
  color: var(--white);
}

.rows {
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.rows li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  /* PDF and print go icon-only so the bar stays on one line */
  .doc-bar .ghost span {
    display: none;
  }

  .resume {
    --pad-y: 1.5rem;
    --pad-x: 1.1rem;
    border-radius: 20px;
  }

  .head {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .name {
    font-size: 1.9rem;
  }

  .item-head,
  .co-head,
  .pos-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  /* phones: no year margin, logos at the left edge */
  .timeline {
    --year-w: 0px;
    --logo: 1.7em;
    --gutter: 2.6em;
    --indent: 1.4em;
    --axis: calc(var(--logo) / 2);
  }

  .timeline .yr {
    display: none;
  }

  .tag {
    margin-left: 0;
  }
}

/* ============================================
   PRINT: light A4 sheet
   ============================================ */
@media print {
  @page {
    size: A4;
    margin: 12mm 15mm;
  }

  html,
  body {
    background: #fff !important;
    padding: 0;
  }

  body::before,
  body::after,
  .topbar,
  .doc-bar {
    display: none !important;
  }

  .resume {
    --ink: #1e293b;
    --muted: #475569;
    --accent: #6d28d9;
    --rule: #e2e8f0;

    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    font-size: 9.2pt;
    line-height: 1.36;
  }

  .resume b,
  .item h3,
  .skills dt {
    color: #0f172a;
  }

  .name {
    background: none;
    color: #0f172a;
    font-size: 24pt;
  }

  .photo {
    width: 80px;
    height: 80px;
    border-color: #c4b5fd;
  }

  .head {
    padding-bottom: 0.9rem;
  }

  .summary {
    margin-top: 0.9rem;
  }

  .resume section {
    margin-top: 1.1rem;
  }

  .resume h2 {
    margin-bottom: 0.6rem;
  }

  .item {
    margin-bottom: 0.75rem;
  }

  .item li {
    margin-bottom: 0.15rem;
  }

  .skills {
    gap: 0.25rem 1rem;
    margin-bottom: 1.1rem;
  }

  .rows {
    gap: 0.3rem;
  }

  .timeline {
    --line: #c4b5fd;
    --tag-bg: #f5f3ff;
    --tag-ink: #5b21b6;
    --glow: #ede9fe;
    --logo-ring: #e2e8f0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .co h3 {
    color: #0f172a;
  }

  .co {
    padding-bottom: 0.8em;
  }

  .pos {
    padding-bottom: 0.3em;
  }

  .pos ul {
    margin-top: 0.15rem;
  }

  .pos li {
    margin-bottom: 0.08rem;
  }

  /* One-page version: a little denser so it fits a single sheet */
  .short .resume {
    font-size: 9pt;
    line-height: 1.38;
  }

  .short .photo {
    width: 68px;
    height: 68px;
  }

  .short .name {
    font-size: 21pt;
  }

  .short .resume section {
    margin-top: 0.85rem;
  }

  .short .item {
    margin-bottom: 0.55rem;
  }

  .short .item li {
    margin-bottom: 0.1rem;
  }

  .short .rows {
    gap: 0.15rem;
  }

  .short .skills {
    gap: 0.15rem 1rem;
    margin-bottom: 0;
  }
}
