/* ── Variables: dark theme (default) ───────────── */
:root {
  --bg:          #07090c;
  --surface:     #0c0f14;
  --surface2:    #12161e;
  --border:      #1a1f2a;
  --border2:     #232938;
  --text:        #ccd2e0;
  --muted:       #4e5668;
  --accent:      #5ef5c8;
  --accent-dim:  rgba(94, 245, 200, 0.12);
}

/* ── Variables: light theme ─────────────────────── */
body.light {
  --bg:          #f2f4f7;
  --surface:     #ffffff;
  --surface2:    #eaecf0;
  --border:      #d8dce6;
  --border2:     #c4c9d6;
  --text:        #2c3140;
  --muted:       #8892a4;
  --accent:      #0a9e6e;
  --accent-dim:  rgba(10, 158, 110, 0.1);
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

div.not-divided{
  break-inside: avoid
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ── Page grid ─────────────────────────────────── */
.cv {
  display: grid;
  grid-template-columns: 230px 1fr;
  max-width: 920px;
  min-height: 100vh;
  margin: 0 auto;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* ── Sidebar ───────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 32px 22px 32px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* Photo */
.photo-wrap {
  width: 90px;
  height: 90px;
  margin: 0 auto 2px;
  position: relative;
}

.photo-wrap img,
.photo-fallback {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  border: 1.5px solid var(--border2);
  object-fit: cover;
  display: block;
}

.photo-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}

/* Section label */
.s-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Contact list */
.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}

.contact-list li svg {
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.4;
}

.contact-list li a { color: var(--text); }
.contact-list li a:hover { color: var(--accent); text-decoration: none; }

/* Tags / skills */
.skill-group { margin-bottom: 13px; }
.skill-group:last-child { margin-bottom: 0; }

.skill-group-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  white-space: nowrap;
}

.tag.hi {
  background: var(--accent-dim);
  border-color: rgba(94, 245, 200, 0.25);
  color: var(--accent);
}

body.light .tag.hi {
  border-color: rgba(10, 158, 110, 0.3);
}

/* Availability pills */
.avail-pill {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--muted);
}

/* ── Main ──────────────────────────────────────── */
.main {
  padding: 32px 34px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Hero */
.hero {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
}

h1 {
  font-family: 'Syne', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 5px;
}

body.light h1 { color: #111; }

.hero-role {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  font-size: 12px;
  color: var(--muted);
}

.hero-meta span::before {
  content: '·';
  margin-right: 14px;
  opacity: 0;
}

.hero-meta span:not(:first-child)::before {
  opacity: 0.4;
}

/* Section heading */
.sec-title {
  font-family: 'DM Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.sec-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tl-item {
  position: relative;
  padding-left: 18px;
  border-left: 1px solid var(--border2);
  page-break-inside: avoid;
}

.tl-item::before {
  content: '';
  position: absolute;
  left: -4.5px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
}

.tl-item.active::before {
  background: var(--accent);
  border-color: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.tl-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

h2.tl-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #e0e6f2;
  line-height: 1.3;
}

body.light h2.tl-title { color: #1a1f2e; }

h2.tl-title a { color: inherit; }
/* h2.tl-title a:hover { color: var(--accent); text-decoration: none; } */

.tl-date {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}

.tl-place {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
}

.tl-role {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  color: var(--accent);
  opacity: 0.75;
  margin-bottom: 6px;
}

.tl-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 7px;
}

.tl-skills .tag {
  font-size: 10px;
  padding: 2px 7px;
}

.tl-desc {
  font-size: 12px;
  color: #7a8599;
  line-height: 1.65;
}

.tl-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

.tl-link {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border2);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.12s, border-color 0.12s;
}

.tl-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

body.light .tl-desc { color: #5a6478; }

/* Education */
.edu-item { page-break-inside: avoid; }

.edu-name {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #e0e6f2;
  margin-bottom: 2px;
}

body.light .edu-name { color: #1a1f2e; }

.edu-degree {
  font-size: 12px;
  color: var(--text);
  margin-bottom: 1px;
}

.edu-years {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--muted);
}

/* Interests */
.interests-text {
  font-size: 12px;
  color: #7a8599;
  line-height: 1.7;
}

body.light .interests-text { color: #5a6478; }

/* ── Controls (theme toggle + print) ───────────── */
.controls {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex;
  gap: 8px;
  z-index: 99;
}

.ctrl-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 7px;
  padding: 9px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: opacity 0.12s, transform 0.12s, background 0.2s, color 0.2s;
}

.ctrl-btn:hover  { opacity: 0.82; transform: translateY(-1px); }
.ctrl-btn:active { opacity: 1;    transform: translateY(0);     }

.ctrl-btn.primary {
  background: var(--accent);
  color: #07090c;
  border-color: transparent;
  box-shadow: 0 4px 24px rgba(94, 245, 200, 0.15);
}

body.light .ctrl-btn.primary {
  box-shadow: 0 4px 24px rgba(10, 158, 110, 0.2);
}

@media (max-width: 680px) {
  .cv {
    grid-template-columns: 1fr;
    min-height: unset;
    border: none;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 24px 16px;
  }

  .photo-wrap { margin-bottom: 4px; }

  .main { padding: 24px 16px; gap: 22px; }

  .controls { bottom: 12px; right: 12px; gap: 6px; }
  .ctrl-btn  { padding: 7px 10px; font-size: 10.5px; gap: 5px; }
}

/* ── Print styles ──────────────────────────────── */
@media print {
  @page {
    size: A4;
    margin: 12mm 14mm;
  }

  html, body {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
    background: #fff !important;
    color: #111 !important;
    font-size: 11.5px;
  }

  .cv {
    grid-template-columns: 200px 1fr;
    min-height: unset;
    max-width: 100%;
    border: none;
  }

  .sidebar {
    background: #f4f6f8 !important;
    border-right: 1px solid #dde1e8 !important;
    padding: 22px 16px;
    gap: 18px;
  }

  .main { padding: 22px 22px; gap: 18px; }

  h1,
  body.light h1 { color: #111 !important; font-size: 26px; }

  .hero { border-bottom-color: #dde1e8 !important; padding-bottom: 16px; }

  .hero-role,
  .tl-role,
  .sec-title { color: #197a58 !important; }

  .s-label,
  .skill-group-label,
  .tl-date,
  .tl-place,
  .edu-years,
  .hero-meta { color: #888 !important; }

  h2.tl-title,
  body.light h2.tl-title,
  .edu-name,
  body.light .edu-name { color: #111 !important; }

  .tl-desc,
  .interests-text,
  body.light .tl-desc,
  body.light .interests-text { color: #555 !important; }

  .tag {
    background: #eaecef !important;
    border-color: #d1d5dd !important;
    color: #333 !important;
  }

  .tag.hi,
  body.light .tag.hi {
    background: #ddf5ed !important;
    border-color: #9dd5c0 !important;
    color: #197a58 !important;
  }

  .avail-pill {
    background: #eaecef !important;
    border-color: #d1d5dd !important;
    color: #555 !important;
  }

  .tl-item { border-left-color: #ccc !important; }
  .tl-item::before { background: #ccc !important; border-color: #fff !important; box-shadow: none !important; }
  .tl-item.active::before { background: #197a58 !important; }

  .sec-title::after { background: #dde1e8 !important; }

  .contact-list li { color: #333 !important; }
  .contact-list li a { color: #197a58 !important; }

  .controls { display: none !important; }

  a { text-decoration: none !important; }
}
