:root {
  --bg: #faf6ef;
  --ink: #2b2620;
  --muted: #6f6759;
  --accent: #4a4438;
  --rule: #e4dccc;
  --measure: 640px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a17;
    --ink: #ece6da;
    --muted: #a89e8c;
    --accent: #d6cdb9;
    --rule: #3a352c;
  }
}

* {
  box-sizing: border-box;
}

/* --- decorative background --- */

.bg-decor {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-glyph {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: clamp(1.5rem, 4vw, 3rem);
  color: var(--muted);
  opacity: 0.12;
  animation: bg-float 14s ease-in-out infinite;
  animation-delay: var(--d);
}

@keyframes bg-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(-4deg); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-glyph {
    animation: none;
  }
}

main,
footer {
  position: relative;
  z-index: 1;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  line-height: 1.6;
  font-size: 18px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    -45deg,
    var(--rule) 0,
    var(--rule) 1px,
    transparent 1px,
    transparent 80px
  );
  opacity: 0.35;
}

.print-only {
  display: none;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.eyebrow {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-size: 2.6rem;
  margin: 0 0 1.25rem;
  line-height: 1.1;
}

.lede {
  max-width: 54ch;
  color: var(--ink);
  font-size: 1.15rem;
}

section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--rule);
}

section:last-of-type {
  border-bottom: none;
}

h2 {
  font-size: 0.85rem;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 2rem;
}

.entry {
  margin-bottom: 2.25rem;
}

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

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 0.25rem 1rem;
}

.entry-head h3 {
  margin: 0;
  font-size: 1.25rem;
  min-width: 0;
  flex: 1 1 auto;
}

.dates {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.role {
  margin: 0.15rem 0 0.75rem;
  font-style: italic;
  color: var(--muted);
}

.entry ul {
  margin: 0;
  padding-left: 1.15rem;
}

.entry li {
  margin-bottom: 0.5rem;
}

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

.certs {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 2rem;
}

.certs strong {
  color: var(--ink);
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.skills-grid h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.skills-grid p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 560px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

.contact-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}

footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

/* --- download button --- */

.download-cv {
  margin: 0;
}

.download-cv button {
  font: inherit;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 3px;
  cursor: pointer;
}

.download-cv button:hover {
  opacity: 0.9;
}

/* --- print (used by the Download CV button) --- */

@media print {
  .no-print {
    display: none !important;
  }

  .site-header {
    display: none;
  }

  body::before {
    display: none;
  }

  .print-only {
    display: block;
  }

  #contact > p.lede {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 10.5pt;
    line-height: 1.35;
  }

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

  main {
    max-width: none;
    padding: 0;
  }

  .hero,
  section {
    padding: 0.55rem 0;
    border-bottom: 1px solid #ccc;
  }

  .hero {
    padding-top: 0;
  }

  .hero h1 {
    font-size: 19pt;
    margin: 0 0 0.25rem;
  }

  .eyebrow {
    font-size: 8.5pt;
    margin: 0 0 0.25rem;
  }

  .lede {
    font-size: 10pt;
    max-width: none;
  }

  h2 {
    font-size: 8.5pt;
    margin: 0 0 0.5rem;
  }

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

  .entry-head h3 {
    font-size: 10.5pt;
  }

  .role {
    margin: 0.1rem 0 0.25rem;
  }

  .entry ul {
    padding-left: 1rem;
  }

  .entry li {
    margin-bottom: 0.15rem;
  }

  .certs {
    margin-top: 0.5rem;
    font-size: 9pt;
  }

  .skills-grid {
    gap: 1rem;
  }

  .skills-grid h3 {
    font-size: 9.5pt;
    margin: 0 0 0.2rem;
  }

  .contact-list {
    margin-top: 0.5rem;
    gap: 1rem;
  }

  section:last-of-type {
    border-bottom: none;
  }

  @page {
    margin: 1.2cm;
    size: letter;
  }
}
