/*
 * "Workshop" palette from EV Charger: asphalt/charcoal neutrals with safety yellow as the accent.
 * Dark on screen; print switches to a light, ink-friendly version.
 */
:root {
  --bg: #0f1113;
  --surface: #181b1f;
  --surface-2: #22262b;
  --border: #3a4048;
  --text: #eef0f2;
  --text-2: #a3aab3;
  --accent: #f5b301;
  --accent-ink: #14110a;
  --accent-soft: #2c2510;
  --accent-soft-ink: #f7d36b;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
main {
  max-width: 860px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 16px 40px;
}
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 20px; margin: 24px 0 14px; }
h3 { font-size: 16px; line-height: 1.35; }
.muted { color: var(--text-2); }

/* Hero */
.hero { display: flex; gap: 20px; align-items: flex-start; }
.avatar {
  flex: none; width: 76px; height: 76px; border-radius: 22px;
  object-fit: cover; display: block;
  background: var(--surface-2); border: 2px solid var(--accent);
}
h1 { font-size: clamp(30px, 7vw, 44px); line-height: 1.05; letter-spacing: -0.5px; }
.role { color: var(--accent); font-weight: 700; margin-top: 6px; }
.lede { color: var(--text-2); margin-top: 12px; max-width: 60ch; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
}
.chip:hover { border-color: var(--accent); }
.chip svg { width: 16px; height: 16px; fill: currentColor; }

/* Cards & grids */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.card p { margin-top: 6px; }
.card p.muted { margin-top: 2px; font-size: 14px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Quick facts */
.facts { margin-top: 20px; }
.facts dl { margin: 0; }
.facts dl > div { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.facts dt { color: var(--text-2); font-size: 14px; }
.facts dd { margin: 0; }

/* Tags */
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  background: var(--accent-soft); color: var(--accent-soft-ink);
  padding: 3px 10px; border-radius: 999px; font-size: 14px; font-weight: 600;
}
.tags.small li { font-size: 12px; padding: 2px 9px; }

/* Experience timeline */
.timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 24px; }
/* The line starts at the centre of the first dot, so nothing pokes out above it. */
.timeline::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 0; width: 2px; background: var(--border); }
.job { position: relative; padding: 0 0 26px; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ''; position: absolute; left: -30px; top: 5px;
  box-sizing: border-box; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border);
}
.job:first-child::before { background: var(--accent); border-color: var(--accent); }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; }
.at { color: var(--accent); }
.at::before { content: '· '; color: var(--text-2); }
.when { color: var(--text-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.job .tags { margin-top: 10px; }
.via { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.points { margin: 10px 0 0; padding-left: 18px; color: var(--text); }
.points li { margin: 4px 0; }
.points li::marker { color: var(--text-2); }

/* Projects */
.project { display: block; color: inherit; text-decoration: none; transition: border-color .15s; }
.project:hover { border-color: var(--accent); }
.project h3 { color: var(--accent); }
.project h3::after { content: ' ↗'; color: var(--text-2); font-weight: 400; }
.project p { color: var(--text-2); margin-bottom: 12px; }
.more { margin-top: 12px; font-weight: 600; }

/* Workshops list */
.list { list-style: none; margin: 0; padding: 4px 18px; }
.list li { padding: 12px 0; border-top: 1px solid var(--border); display: grid; gap: 2px; }
.list li:first-child { border-top: 0; }
.list span { color: var(--text-2); }

footer {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--text-2);
}
.print {
  margin-left: auto; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 999px; padding: 10px 18px;
}

/* Draft markers: remove before publishing */
.todo {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 6px;
  border: 1px dashed var(--accent); color: var(--accent);
  font-size: 12px; font-weight: 700; vertical-align: middle;
}

@media (max-width: 520px) {
  /* Name, title and place sit beside the avatar; the intro and links run full width below. */
  .hero {
    display: grid; grid-template-columns: auto 1fr; gap: 0 14px;
    grid-template-areas: "avatar name" "avatar role" "lede lede" "links links";
    align-items: center;
  }
  .hero-text { display: contents; }
  .avatar { grid-area: avatar; width: 64px; height: 64px; border-radius: 18px; font-size: 22px; }
  .hero h1 { grid-area: name; align-self: end; font-size: 28px; }
  .role { grid-area: role; align-self: start; margin-top: 4px; font-size: 15px; }
  .place { display: block; font-size: 14px; }
  .place .sep { display: none; }
  .lede { grid-area: lede; margin-top: 16px; }
  .links { grid-area: links; }
  .print { margin-left: 0; }
}

@media print {
  /* Paper gets its own layout: a classic two-page resume, no boxes, no colour fills. */
  /* Zero page margin leaves the browser no room for its date/URL header and footer;
     the spacing comes from main instead, cloned onto every page. */
  @page { size: A4; margin: 0; }
  :root {
    --bg: #fff; --surface: #fff; --border: #c9ccd1;
    --text: #15171a; --text-2: #5a6068; --accent: #7a5800;
    color-scheme: light;
  }
  body { font-size: 9.6pt; line-height: 1.42; }
  main { max-width: none; padding: 14mm 16mm; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  a { color: inherit; text-decoration: none; }
  .print, .todo, footer, .more, .links { display: none; }
  .hero { position: relative; padding-right: 30mm; }
  .avatar { position: absolute; top: 0; right: 0; width: 24mm; height: 24mm; border-radius: 6mm; border: 0; }
  .print-only { display: block !important; }

  /* Header */
  .hero { display: block; }
  h1 { font-size: 22pt; letter-spacing: -0.3px; }
  .role { margin-top: 2px; font-size: 11pt; }
  .lede { margin-top: 6px; max-width: none; font-size: 9.6pt; }
  .contact { margin-top: 6px; color: var(--text-2); font-size: 9pt; }
  .contact span + span::before { content: '  ·  '; }

  /* Stack line */
  .facts { margin-top: 8px; border: 0; padding: 0; border-radius: 0; }
  .facts dl > div { display: block; }
  .facts dt { display: inline; font-size: inherit; color: var(--text); font-weight: 700; }
  .facts dt::after { content: ': '; }
  .facts dl, .facts dl > div { display: block; }
  .facts dd, .facts dd > ul { display: inline !important; }

  /* Tags become plain comma lists */
  .tags, .tags.small { display: inline; }
  .tags li, .tags.small li {
    display: inline; background: none; padding: 0; border-radius: 0;
    color: var(--text-2); font-size: inherit; font-weight: 400;
  }
  .tags li + li::before { content: ', '; }
  .job .tags { display: block; margin-top: 1px; font-size: 8.8pt; }
  .card .tags { display: block; margin-top: 2px; font-size: 8.8pt; }

  /* Section headings with a rule */
  h2 {
    margin: 14px 0 6px; padding-bottom: 3px; border-bottom: 1px solid var(--border);
    font-size: 10pt; text-transform: uppercase; letter-spacing: 1.2px; color: var(--accent);
    break-after: avoid;
  }
  h3 { font-size: 10pt; }

  /* Experience: no line or dots */
  .timeline { padding: 0; border: 0; }
  .timeline::before { display: none; }
  .job { padding: 0 0 9px; break-inside: avoid; }
  .job::before { display: none; }
  .job-head { flex-wrap: nowrap; }
  .when { font-size: 9pt; white-space: nowrap; }
  .via { font-size: 8.8pt; }
  .points { margin-top: 3px; padding-left: 14px; }
  .points li { margin: 1px 0; }

  /* Cards become compact blocks in two columns */
  .grid { grid-template-columns: 1fr 1fr; gap: 6px 22px; }
  .card { border: 0; border-radius: 0; padding: 0; break-inside: avoid; }
  .card p { margin-top: 1px; }
  .card p.muted { font-size: 8.8pt; }
  .project h3 { color: var(--text); }
  .project h3::after { content: none; }
  .project .url { display: inline !important; margin-left: 8px; color: var(--text-2); font-weight: 400; font-size: 8.8pt; }
  .projects { break-inside: avoid; }
  section:has(.projects) { break-inside: avoid; }
  .project p { margin-bottom: 0; }
  .projects { grid-template-columns: 1fr; gap: 4px; }
  .projects .tags { display: none; }

  .list { padding: 0; border: 0; }
  .list li { padding: 2px 0; border: 0; display: block; }
  .list span::before { content: ' · '; }
}
.place { color: var(--text-2); font-weight: 500; }
.nowrap { white-space: nowrap; }
/* Comfortable tap targets for text links on touch screens */
.more a, footer a { display: inline-block; padding: 10px 0; }
.card .tags { margin-top: 12px; }
.print-only { display: none; }
/* Role summary line under each job title, and full-width card */
.job-sum { color: var(--text-2); margin-top: 8px; }
.card.wide { grid-column: 1 / -1; }
.chip.print { margin-left: 0; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
@media print {
  .job-sum { margin-top: 2px; }
}

/* Earlier experience: collapsed continuation of the timeline */
.earlier { margin-top: 0; }
.earlier > summary {
  list-style: none; cursor: pointer; display: block;
  padding: 14px 0 4px 22px; border-left: 2px dashed var(--border);
}
.earlier > summary::-webkit-details-marker { display: none; }
.earlier .more-label { color: var(--accent); font-weight: 700; }
.earlier .more-label::after { content: ' ▾'; }
.earlier[open] .more-label { }
.earlier[open] .more-label::before { content: 'Hide earlier experience'; }
.earlier[open] .more-label { font-size: 0; }
.earlier[open] .more-label::before, .earlier[open] .more-label::after { font-size: 16px; }
.earlier[open] .more-label::after { content: ' ▴'; }
.earlier .preview { display: block; color: var(--text-2); font-size: 14px; margin-top: 2px; }
.earlier[open] .preview { display: none; }
.earlier > summary:hover .more-label, .earlier > summary:focus-visible .more-label { text-decoration: underline; }
.earlier > .timeline { padding-top: 18px; }
.earlier > .timeline::before { top: 0; }
.earlier > .timeline .job:first-child::before { background: var(--bg); border-color: var(--border); }
@media print {
  .earlier > summary { display: none; }
  .earlier > .timeline { padding-top: 9px; }
}
