/* Damien Pellier CV — lightweight, no dependencies */

:root {
  --color-text: #1c1c1c;
  --color-heading: #111;
  --color-primary: #2f8fd4;
  --color-primary-dark: #1f6fa8;
  --color-muted: #8a8a8a;
  --color-meta: #9a9a9a;
  --color-border: #c8c8c8;
  --color-dot-empty: #d8d8d8;
  --color-wave: #b8d9ef;
  --color-page-bg: #e4eff7;
  --color-page-bg-end: #f2f7fb;
  --color-surface: #fff;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 52rem;
  --sidebar-width: 34%;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  --line-tight: 1.25;
  --line-base: 1.45;
  --focus-ring: 0 0 0 3px rgba(47, 143, 212, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  line-height: var(--line-base);
  color: var(--color-text);
  background-color: var(--color-page-bg);
  background-image: linear-gradient(
    165deg,
    var(--color-page-bg) 0%,
    var(--color-page-bg-end) 42%,
    #e8f3fa 100%
  );
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-lg);
  z-index: 100;
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Page shell — A4 proportions on large screens */
.cv-page {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.75rem 1.5rem 2.5rem;
  overflow: hidden;
  background-color: var(--color-surface);
  border-radius: 6px;
  box-shadow:
    0 1px 2px rgba(31, 111, 168, 0.06),
    0 8px 28px rgba(47, 143, 212, 0.08);
}

@media (min-width: 28rem) {
  .cv-page {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
  }
}

/* Decorative waves */
.cv-waves {
  position: absolute;
  top: 0;
  right: 0;
  width: min(55%, 22rem);
  height: auto;
  color: var(--color-wave);
  pointer-events: none;
  z-index: 0;
}

/* Header */
.cv-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  padding-bottom: 0;
}

.cv-header__intro {
  flex: 1 1 14rem;
  min-width: 0;
}

.cv-role {
  margin: 0 0 var(--space-xs);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: var(--line-tight);
  color: var(--color-heading);
  text-transform: uppercase;
}

.cv-name {
  margin: 0 0 var(--space-md);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: var(--line-tight);
  color: var(--color-primary);
}

.cv-contact {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cv-contact a,
.cv-contact__static {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.75rem;
}

.cv-contact a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.cv-contact a:focus-visible {
  outline: none;
  border-radius: 2px;
  box-shadow: var(--focus-ring);
}

.cv-icon {
  flex-shrink: 0;
  color: var(--color-primary);
}

/* Profile photo */
.cv-photo {
  flex: 0 0 auto;
  margin: 0;
}

.cv-photo img {
  display: block;
  width: 7.5rem;
  height: 7.5rem;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--color-primary);
}

/* Main two-column layout */
.cv-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 40rem) {
  .cv-main {
    grid-template-columns: 1.85fr 1fr;
    gap: 1.25rem 1.75rem;
    align-items: start;
  }
}

/* Section titles */
.cv-section-title {
  margin: 0 0 var(--space-md);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-meta);
}

.cv-sidebar .cv-section-title {
  margin-top: var(--space-lg);
}

.cv-sidebar section:first-child .cv-section-title {
  margin-top: 0;
}

/* Experience */
.cv-experience .cv-job {
  margin-bottom: var(--space-lg);
}

.cv-experience .cv-job:last-child {
  margin-bottom: 0;
}

.cv-job__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-heading);
}

.cv-job__meta {
  margin: 0.15rem 0 var(--space-sm);
  font-size: 0.75rem;
  color: var(--color-muted);
}

.cv-job__company {
  font-weight: 700;
  margin-right: 0.35rem;
}

.cv-job__meta time::before {
  content: "·";
  margin: 0 0.35rem;
  color: var(--color-border);
}

.cv-job__meta time:first-child::before {
  content: none;
  margin: 0;
}

.cv-job__location::before {
  content: "·";
  margin: 0 0.35rem;
  color: var(--color-border);
}

.cv-job ul {
  margin: 0;
  padding-left: 1.1rem;
}

.cv-job li {
  margin-bottom: 0.2rem;
}

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

/* Technical skill tags */
.cv-skill-group {
  margin-bottom: var(--space-md);
}

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

.cv-skill-group__label {
  margin: 0 0 var(--space-xs);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-muted);
}

.cv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cv-tags li {
  padding-bottom: 1px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--color-text);
}

/* Plus list (skills) */
.cv-plus-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cv-plus-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  line-height: 1.35;
}

.cv-plus-list li:last-child {
  margin-bottom: 0;
}

.cv-icon--plus {
  margin-top: 0.1rem;
}

/* Strengths */
.cv-strengths {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cv-strengths li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
}

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

/* Languages */
.cv-languages {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cv-languages > li {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.1rem 0.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.75rem;
}

.cv-languages > li:last-child {
  margin-bottom: 0;
}

.cv-lang__name {
  font-weight: 600;
  grid-column: 1;
  grid-row: 1;
}

.cv-lang__level {
  color: var(--color-muted);
  grid-column: 2;
  grid-row: 1;
  text-align: right;
}

.cv-lang__dots {
  display: flex;
  gap: 0.25rem;
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 0.15rem;
}

.cv-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--color-dot-empty);
}

.cv-dot--filled {
  background: var(--color-primary);
}

/* Education */
.cv-edu {
  margin-bottom: var(--space-md);
}

.cv-edu:last-child {
  margin-bottom: 0;
}

.cv-edu__degree {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-heading);
}

.cv-edu__school {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
}

.cv-edu__dates {
  margin: 0.1rem 0 0;
  font-size: 0.7rem;
  color: var(--color-muted);
}

/* Certifications */
.cv-certs {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cv-certs li {
  margin-bottom: var(--space-md);
  font-size: 0.75rem;
}

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

.cv-cert__name {
  display: block;
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.3;
}

.cv-cert__issuer {
  display: block;
  margin-top: 0.1rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* Responsive — small phones */
@media (max-width: 24rem) {
  .cv-page {
    padding: 1.25rem 1rem 2rem;
  }

  .cv-role {
    font-size: 1.35rem;
  }

  .cv-photo img {
    width: 6rem;
    height: 6rem;
  }

  .cv-contact {
    flex-direction: column;
    gap: var(--space-xs);
  }
}

/* Medium — stack photo above on narrow */
@media (max-width: 39.99rem) {
  .cv-header {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
  }

  .cv-contact {
    justify-content: center;
  }

  .cv-waves {
    width: 70%;
    opacity: 0.7;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* High contrast */
@media (prefers-contrast: more) {
  :root {
    --color-muted: #555;
    --color-meta: #444;
    --color-border: #666;
    --color-page-bg: #d0e0ec;
    --color-page-bg-end: #e8eef2;
  }

  body {
    background-image: none;
  }

  .cv-page {
    border: 2px solid var(--color-heading);
    box-shadow: none;
  }

  .cv-contact a:focus-visible,
  .skip-link:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
  }
}

/* Print */
@media print {
  body {
    background: #fff;
  }

  .skip-link {
    display: none;
  }

  .cv-page {
    max-width: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
  }

  .cv-waves {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .cv-main {
    grid-template-columns: 1.85fr 1fr;
  }

  .cv-contact a {
    color: var(--color-muted);
  }

  a[href^="http"]::after,
  a[href^="mailto"]::after,
  a[href^="tel"]::after {
    content: " (" attr(href) ")";
    font-size: 0.65rem;
    word-break: break-all;
  }
}
