/* Melesh Kesha — CV */

:root {
  --bg: #fbfaf7;
  --fg: #1d2125;
  --muted: #5b636b;
  --accent: #1f6f6b;
  --accent-soft: #e4efed;
  --rule: #e2e0da;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --fg: #e6e8ea;
    --muted: #9aa3ab;
    --accent: #5fb3ad;
    --accent-soft: #1d2d2c;
    --rule: #2a2f34;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

.site-header, main, .site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* Header */

.site-header { padding-top: 56px; padding-bottom: 8px; }

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

h1 {
  margin: 0;
  font-size: 2.25rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.pronounce {
  margin: 2px 0 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.role-title {
  margin: 4px 0 0;
  font-size: 1.15rem;
  color: var(--accent);
  font-weight: 500;
}

.download {
  flex: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
}
.download:hover { background: var(--accent-soft); }

.contact {
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  color: var(--muted);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.badges {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 12px;
}

.rights {
  margin: 10px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Sections */

h2 {
  margin: 44px 0 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

p { margin: 0 0 12px; }

/* Skills */

.skills {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) 1fr;
  gap: 8px 20px;
  margin: 0;
}

.skills dt { font-weight: 600; }
.skills dd { margin: 0; color: var(--fg); overflow-wrap: anywhere; }

/* Roles */

.role, .degree { margin-bottom: 28px; }

.role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 16px;
}

.role-head h3 {
  flex: 1 1 auto;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.role-head time {
  order: 2;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.role-head .org {
  order: 3;
  flex-basis: 100%;
  margin: 2px 0 0;
  color: var(--muted);
}

.loc { white-space: nowrap; }

.role ul {
  margin: 10px 0 0;
  padding-left: 1.2em;
}

.role li { margin-bottom: 6px; }
.role li::marker { color: var(--muted); }

.achievement {
  margin: 12px 0 0;
  padding: 8px 0 8px 14px;
  border-left: 3px solid var(--accent);
}

.achievement strong { color: var(--accent); }

/* Footer */

.site-footer {
  margin-top: 48px;
  padding-bottom: 48px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Small screens */

@media (max-width: 600px) {
  body { font-size: 15px; }
  .site-header { padding-top: 32px; }
  h1 { font-size: 1.85rem; }
  .skills { grid-template-columns: 1fr; gap: 2px; }
  .skills dd { margin-bottom: 10px; }
  .role-head time { margin-left: 0; order: 4; flex-basis: 100%; }
}

/* Print / PDF */

@page { size: A4; margin: 12mm 14mm; }

@media print {
  :root {
    --bg: #fff;
    --fg: #000;
    --muted: #333;
    --accent: #000;
    --accent-soft: transparent;
    --rule: #999;
    color-scheme: light;
  }

  body { font-size: 9.5pt; line-height: 1.35; background: #fff; color: #000; font-variant-ligatures: none; }
  .pronounce { font-size: 9pt; }

  .site-header, main, .site-footer { max-width: none; padding: 0; }
  .site-header { padding-top: 0; }

  .download { display: none; }

  h1 { font-size: 20pt; }
  .role-title { font-size: 11.5pt; }

  a { color: #000; text-decoration: none; }

  .contact { margin-top: 6px; font-size: 9pt; }

  .badges { margin-top: 6px; gap: 0; }
  .badge { padding: 0; font-weight: 600; background: none; border-radius: 0; font-size: 9pt; }
  .badge + .badge::before { content: "\00a0\00b7\00a0"; }

  .rights { margin-top: 2px; font-size: 9pt; }

  h2 { margin: 14px 0 6px; padding-bottom: 2px; font-size: 9pt; break-after: avoid; }
  h3 { break-after: avoid; }

  .skills { grid-template-columns: max-content 1fr; gap: 1px 14px; }

  /* Long roles may split between bullets; a role's heading stays with its first bullet. */
  .role, .degree { margin-bottom: 10px; }
  .role-head, .degree { break-inside: avoid; break-after: avoid; }
  .role ul { margin-top: 4px; }
  .role li { margin-bottom: 2px; break-inside: avoid; }
  .achievement { margin-top: 4px; padding: 2px 0 2px 8px; border-left-width: 2px; break-inside: avoid; }

  .site-footer { margin-top: 12px; padding-bottom: 0; font-size: 8pt; }
}
