@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

/* Timeline theme tokens */
:root {
  --bg: #e6e4de;          /* warm grey page background */
  --paper: #ffffff;       /* the CV sheet */
  --text: #23231f;        /* headings / strong text */
  --ink: #2c2c2c;         /* body text */
  --muted: #666666;
  --accent: #7a2438;      /* burgundy */
  --accent-soft: #e6d3d8; /* timeline rail */
  --bullet: #c99aa6;      /* round list marker */
  --border: #e2e2dd;
  --soft: #f5f5f3;
  --font-sans: "IBM Plex Sans", system-ui, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

.load-error {
  margin: 0 0 20px;
  padding: 12px 16px;
  border: 1px solid #d9b0a8;
  border-radius: 10px;
  background: #fbeae6;
  color: #8a2c1c;
  font-size: 0.9rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 800px;
  margin: 40px auto;
  background: var(--paper);
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.13);
  padding: 52px 60px;
}

/* ===== Header ===== */
.header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

/* Name and the lang/download controls share the top line; the headline, motto and
   contact row sit below and use the full available width (no max-width clamp). */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.header h1 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 31px;
  font-weight: 600;
  line-height: 1.05;
  color: var(--text);
}

.header-headline {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.header-motto {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.header-contact {
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  font-size: 11.5px;
}

.header-contact a {
  color: var(--muted);
  text-decoration: none;
}

.header-contact a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.header-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex: none;
}

/* EN/FI toggle + Download CV as burgundy pills */
#langToggle,
#downloadCv {
  border: 1.5px solid var(--accent);
  background: var(--paper);
  color: var(--accent);
  border-radius: 20px;
  padding: 5px 14px;
  font: 600 11px var(--font-sans);
  letter-spacing: 0.08em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

#langToggle:hover,
#downloadCv:hover {
  background: var(--accent);
  color: #fff;
}

/* ===== Sections ===== */
.content {
  margin-top: 20px;
}

.section {
  margin-top: 20px;
}

.section h2 {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Inline note next to a heading (e.g. "selected for this role") */
.section-note {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  font-size: 10.5px;
  color: var(--muted);
}

/* ===== Summary ===== */
.prose-list {
  max-width: 100%;
  color: #3a3a3a;
}

.prose-list p {
  margin: 0 0 10px;
}

.prose-list p:last-child {
  margin-bottom: 0;
}

/* ===== Experience timeline ===== */
.list-experience {
  position: relative;
  padding-left: 26px;
}

.list-experience::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  background: var(--accent-soft);
}

.experience-item {
  position: relative;
  margin-bottom: 15px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.experience-item:last-child {
  margin-bottom: 0;
}

.experience-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--paper);
  border: 2.5px solid var(--accent);
  box-sizing: border-box;
}

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.experience-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.experience-company {
  margin: 1px 0 3px;
  color: var(--muted);
  font-size: 12px;
}

.experience-dates {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

.experience-description {
  margin: 1px 0 7px;
  color: #555;
  font-size: 12px;
  font-style: italic;
  line-height: 1.45;
}

.experience-highlights {
  list-style: none;
  margin: 0;
  padding: 0;
}

.experience-highlights li {
  position: relative;
  padding-left: 14px;
  margin: 3px 0;
  color: #3a3a3a;
}

.experience-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--bullet);
}

/* ===== Compact lists (shared base) ===== */
.list-compact {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-item-title {
  color: var(--text);
  font-weight: 700;
}

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

/* Skills: short bold category label (key) + value. The labels are kept deliberately
   short in the base data so bold text reads as a clean key column, not a wall. */
.section-skills .list-compact li {
  display: flex;
  gap: 12px;
  margin: 4px 0;
  align-items: baseline;
}

.section-skills .list-item-title {
  flex: 0 0 130px;
  font-weight: 700;
  color: var(--text);
}

.section-skills .list-item-meta {
  color: #444;
}

/* Languages: inline wrap */
.section-languages .list-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.section-languages .list-item-title {
  font-weight: 600;
  margin-right: 5px;
}

/* Projects (apply CVs only): one block per project, title over description */
.section-projects .list-compact li {
  margin: 5px 0;
}

.section-projects .list-item-title {
  display: block;
}

/* Education: two-column */
#educationList {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 30px;
}

#educationList li {
  break-inside: avoid;
}

#educationList .list-item-title {
  display: block;
}

#educationList .list-item-meta {
  display: block;
  font-size: 11.5px;
}

#educationList .list-item-date {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

/* ===== Certifications: flat list, no group headings ===== */
.cert-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Opt-in multi-column (used on the site, where certs are many short items;
   the apply pipeline keeps a single column for its longer curated lines). */
.cert-list.cols2 {
  columns: 2;
  column-gap: 30px;
}

.cert-list li {
  position: relative;
  padding-left: 14px;
  margin: 3px 0;
  font-size: 12px;
  line-height: 1.3;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}

.cert-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--bullet);
}

.cert-list .list-item-title {
  font-weight: 400;
  color: var(--ink);
}

/* ===== Cover letter (shares the resume design; body a touch larger for reading) ===== */
.cover-letter-body p {
  margin: 0 0 11px;
}

/* ===== Footer ===== */
.page-footer {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.page-footer p {
  margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .page {
    margin: 0;
    border-radius: 0;
    padding: 26px 18px;
  }

  .header-controls {
    justify-content: flex-start;
  }

  .section-skills .list-item-title {
    flex-basis: 120px;
  }

  #educationList {
    grid-template-columns: 1fr;
  }

  .cert-list.cols2 {
    columns: 1;
  }
}
