@media (prefers-color-scheme: light) {
  :root {
    --bg-outer: #edf0f4;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 20px rgba(0, 0, 0, 0.06);
    --skill-track: #e5e7eb;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-outer: #070a0f;
    --shadow: 0 0 0 1px #30363d;
    --skill-track: #21262d;
  }
}

body {
  background-color: var(--bg-outer);
  color: var(--text);
  padding: 2rem 1rem;
}

.page {
  background: var(--bg);
  max-width: 880px;
  margin: 0 auto;
  padding: 2.5rem 3rem;
  box-shadow: var(--shadow);
  border-radius: 8px;
}

/* ── Header ──────────────────────────────────────────────── */

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.header-photo {
  width: 96px;
  height: 96px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.header-name h1 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.header-name h1 a {
  color: inherit;
  text-decoration: none;
}

.header-name h1 a:hover {
  opacity: 0.75;
}

.header-name .job-title {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 0.45rem;
}

.header-contact {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex-shrink: 0;
  align-self: flex-start;
}

.contact-item {
  display: grid;
  grid-template-columns: 16px auto;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

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

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

.contact-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* ── Two-column layout ───────────────────────────────────── */

.columns {
  display: grid;
  grid-template-columns: 1fr 210px;
  gap: 2.5rem;
}

/* ── Section headings ────────────────────────────────────── */

h2 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

section {
  margin-bottom: 1.75rem;
}

section:last-child {
  margin-bottom: 0;
}

/* ── Entries (education & experience) ────────────────────── */

.entry {
  margin-bottom: 1.1rem;
}

.entry:last-child {
  margin-bottom: 0;
}

.entry-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.entry-title .sep {
  font-weight: 400;
  color: var(--muted);
  margin: 0 0.2rem;
}

.entry-title .org {
  color: var(--accent);
  font-weight: 500;
}

.entry-title .org a {
  color: inherit;
  text-decoration: none;
}

.entry-title .org a:hover {
  text-decoration: underline;
}

.entry-title .location {
  color: var(--muted);
  font-weight: 400;
}

.entry-date {
  font-size: 0.775rem;
  color: var(--muted);
  margin: 0.2rem 0 0.3rem;
}

.entry-body {
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--text);
  opacity: 0.85;
}

.entry-body p + p {
  margin-top: 0.2rem;
}

.entry-tags {
  font-size: 0.775rem;
  color: var(--muted);
  margin-top: 0.25rem;
  font-style: italic;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.sidebar-block {
  margin-bottom: 1.5rem;
}

.sidebar-block:last-child {
  margin-bottom: 0;
}

/* Skills */

.skill {
  margin-bottom: 0.75rem;
}

.skill:last-child {
  margin-bottom: 0;
}

.skill-name {
  font-size: 0.8125rem;
  margin-bottom: 0.35rem;
}

.skill-bar {
  height: 3px;
  background: var(--skill-track);
  border-radius: 2px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

/* Interests */

.interest {
  font-size: 0.8125rem;
  margin-bottom: 0.4rem;
}

.interest:last-child {
  margin-bottom: 0;
}

.interest .note {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Social links */

.social {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

.social a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

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

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 640px) {
  body {
    padding: 0;
  }

  .page {
    border-radius: 0;
    padding: 1.5rem;
  }

  header {
    flex-direction: column;
    gap: 1rem;
  }

  .header-photo {
    width: 56px;
    height: 56px;
  }

  .header-contact {
    text-align: left;
  }

  .contact-item {
    justify-content: flex-start;
  }

  .columns {
    grid-template-columns: 1fr;
  }
}

/* ── Toolbar ─────────────────────────────────────────────── */

.toolbar {
  max-width: 880px;
  margin: 0 auto 0.75rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0 0.25rem;
}


/* ── Print ───────────────────────────────────────────────── */

@page {
  size: A4 portrait;
  margin: 1cm 0 0;
}

@page :first {
  margin-top: 0;
}

@media print {
  .toolbar {
    display: none;
  }

  body {
    background: white;
    padding: 0;
  }

  .page {
    box-shadow: none;
    border-radius: 0;
    padding: 1cm 1.6cm;
    max-width: 100%;
    width: 100%;
  }

  header {
    break-after: avoid;
    padding-bottom: 0.9rem;
    margin-bottom: 1rem;
  }

  .header-name h1 {
    font-size: 1.7rem;
  }

  .header-photo {
    width: 76px;
    height: 76px;
  }

  .columns {
    gap: 1.75rem;
  }

  section {
    margin-bottom: 1.2rem;
  }

  h2 {
    font-size: 0.68rem;
    margin-bottom: 0.55rem;
    padding-bottom: 0.28rem;
  }

  .entry {
    break-inside: avoid;
    margin-bottom: 0.7rem;
  }

  .entry-title {
    font-size: 0.85rem;
  }

  .entry-date {
    font-size: 0.72rem;
    margin: 0.12rem 0 0.22rem;
  }

  .entry-body {
    font-size: 0.78rem;
    line-height: 1.52;
  }

  .entry-tags {
    font-size: 0.71rem;
  }

  .sidebar-block {
    margin-bottom: 0.95rem;
  }

  .skill {
    margin-bottom: 0.52rem;
  }

  .skill-name {
    font-size: 0.78rem;
    margin-bottom: 0.28rem;
  }

  .interest {
    font-size: 0.78rem;
    margin-bottom: 0.28rem;
  }

  .social a {
    font-size: 0.78rem;
  }

  .social {
    padding-top: 0.65rem;
    margin-top: 0.65rem;
  }

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

  .skill-fill {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
