/* ─── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --color-bg:          #F9F7F4;   /* warm off-white */
  --color-surface:     #FFFFFF;
  --color-text:        #222222;   /* near-charcoal */
  --color-muted:       #555555;
  --color-accent:      #0A9396;   /* teal */
  --color-accent-light:#E0F5F5;
  --color-border:      #E2DDD8;

  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;

  --space-xs:  0.375rem;
  --space-sm:  0.75rem;
  --space-md:  1.25rem;
  --space-lg:  2rem;
  --space-xl:  3rem;

  --radius-sm: 6px;
  --radius-md: 10px;
}

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

/* ─── Base (mobile-first) ────────────────────────────────────────────────── */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100dvh;
}

/* ─── Page wrapper ───────────────────────────────────────────────────────── */
.page {
  width: 100%;
  padding: var(--space-md) var(--space-md) var(--space-xl);
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.header {
  padding: var(--space-lg) var(--space-md);
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.header__inner {
  display: flex;
  flex-direction: column-reverse;   /* photo on top, text below on mobile */
  align-items: center;
  gap: var(--space-md);
}

.header__text {
  width: 100%;
  text-align: center;
}

.header__photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid rgba(255,255,255,0.6);
  flex-shrink: 0;
}

.header__name {
  font-size: clamp(1.75rem, 6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--space-sm);
}

.header__contact {
  list-style: none;
  display: flex;
  flex-direction: column;       /* stacked on mobile */
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.9rem;
}

.contact__icon {
  display: inline-block;
  width: 1.25em;
  font-style: normal;
}

.contact__link {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.35);
  padding-bottom: 1px;
  transition: border-color 0.15s;
}

.contact__link:hover,
.contact__link:focus-visible {
  border-color: #fff;
  outline: none;
}

/* ─── Sections ───────────────────────────────────────────────────────────── */
.section {
  margin-bottom: var(--space-lg);
}

.section__title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-md);
}

/* ─── Summary ────────────────────────────────────────────────────────────── */
.summary__text {
  font-size: 1rem;
  color: var(--color-muted);
  max-width: 65ch;
}

/* ─── Role cards ─────────────────────────────────────────────────────────── */
.role {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

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

.role__header {
  display: flex;
  flex-direction: column;       /* stacked on mobile */
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}

.role__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
}

.role__employer {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.role__dates {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  white-space: nowrap;
  background: var(--color-accent-light);
  padding: 2px var(--space-xs);
  border-radius: var(--radius-sm);
  align-self: flex-start;
}

.role__bullets {
  margin-top: var(--space-sm);
  padding-left: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.role__bullets li {
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* ─── Skills ─────────────────────────────────────────────────────────────── */
.skills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
}

.skill {
  background: var(--color-accent-light);
  color: var(--color-accent);
  border: 1px solid #b0e0e0;
  border-radius: 999px;
  padding: 4px var(--space-md);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ─── Desktop enhancement (min-width: 720px) ─────────────────────────────── */
@media (min-width: 720px) {

  .page {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg) var(--space-xl);
  }

  .header {
    padding: var(--space-xl) var(--space-xl);
  }

  .header__inner {
    flex-direction: row;          /* text left, photo right on desktop */
    align-items: center;
    justify-content: space-between;
  }

  .header__text {
    text-align: left;
  }

  .header__photo {
    width: 150px;
    height: 150px;
  }

  /* Contact details in one row on desktop */
  .header__contact {
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-lg);
    font-size: 0.95rem;
  }

  /* Role title and dates on same line */
  .role__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .role__dates {
    align-self: center;
    flex-shrink: 0;
    margin-left: var(--space-md);
  }

  .role__bullets li {
    font-size: 0.925rem;
  }

  .summary__text {
    font-size: 1.05rem;
  }
}

/* ─── Print ──────────────────────────────────────────────────────────────── */
@media print {
  body { background: #fff; }
  .page { padding: 0; max-width: 100%; }
  .header { background: var(--color-accent) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .role { break-inside: avoid; }
}
