/* =========================
   Theme variables (WCAG AA)
   ========================= */

/* Light (default) */
:root {
  --bg: #ffffff;
  --fg: #111827;
  --muted: #4b5563;
  --accent: #1d4ed8;
  --border: #d1d5db;
}

/* System dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --fg: #f1f5f9;
    --muted: #94a3b8;
    --accent: #93c5fd;
    --border: #1e293b;
  }
}

/* Manual overrides */
html[data-theme="light"] {
  --bg: #ffffff;
  --fg: #111827;
  --muted: #4b5563;
  --accent: #1d4ed8;
  --border: #d1d5db;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --fg: #f1f5f9;
  --muted: #94a3b8;
  --accent: #93c5fd;
  --border: #1e293b;
}

/* =========================
   Base styles
   ========================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

/* =========================
   Layout
   ========================= */

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
}

footer {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

/* =========================
   Typography
   ========================= */

h1 {
  font-size: 2.2rem;
  margin: 0;
}

h2 {
  font-size: 1.4rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 1.25rem;
}

ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0 0;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.summary {
  font-size: 1.05rem;
}

/* =========================
   Content blocks
   ========================= */

.contact {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.contact span {
  margin-right: 1.25rem;
  white-space: nowrap;
}

section {
  margin-bottom: 2.5rem;
}

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.skills ul {
  margin: 0;
  padding-left: 1.2rem;
}

.experience-item {
  margin-bottom: 1.75rem;
}

.experience-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.role {
  font-weight: 600;
}

.company,
.dates {
  color: var(--muted);
  font-size: 0.9rem;
}

.projects ul li {
  margin-bottom: 0.4rem;
}

/* =========================
   Print styles
   ========================= */

@media print {

  /* Use full page width */
  .container {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  /* Page margins (A4 friendly) */
  @page {
    size: A4;
    margin: 15mm;
  }

  body {
    background: white;
    color: black;
    font-size: 10pt;
    line-height: 1.4;
  }

  /* Remove visual chrome */
  header,
  footer {
    border: none;
  }

  /* Ensure links are readable */
  a {
    color: black;
    text-decoration: none;
  }

  /* Improve list readability */
  ul {
    padding-left: 1.1rem;
  }

  /* Avoid awkward page breaks */
  h2,
  .experience-item {
    page-break-inside: avoid;
  }
}
