/* ============================================================
   Gareth Slade — CV site
   Inspired by the print CV: light, airy, thin outlined name,
   grey accents, generous whitespace, subtle divider rules.
   ============================================================ */

:root {
  --ink: #3a3a3a;
  --ink-soft: #6b6b6b;
  --ink-faint: #9a9a9a;
  --line: #d9d9d9;
  --line-soft: #ececec;
  --bg: #fdfdfc;
  --bg-panel: #ffffff;
  --accent: #7a7f87;
  /* muted slate, echoes the CV badges' cool grey */
  --accent-strong: #4a4f57;
  --max: 1080px;
  --gap: 3rem;
  --radius: 4px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-weight: 400;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

/* ---------- Header ---------- */
.header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 2rem 0;
}

.header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.name {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: #b9bcc1;
  /* light grey fill — soft, not bold */
  display: flex;
  flex-direction: column;
}

.name-line {
  display: block;
}

.header-contact {
  text-align: right;
  color: var(--ink-soft);
}

.header-contact .tagline {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.cv-download {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.cv-download:hover,
.cv-download:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  text-decoration: none;
}

.header-rule {
  max-width: var(--max);
  margin: 2rem auto 0;
  height: 1px;
  background: var(--line);
}

/* ---------- Mobile quick nav (hidden on desktop) ---------- */
.mobile-nav {
  display: none;
}

.mobile-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  margin: 0;
}

.mobile-nav li {
  flex: 0 0 auto;
}

.mobile-nav a {
  display: block;
  white-space: nowrap;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: #f0f1f2;
  transition: background 0.2s ease, color 0.2s ease;
}

.mobile-nav a:hover,
.mobile-nav a:focus-visible {
  background: #e4e6e8;
  color: var(--accent-strong);
  text-decoration: none;
}

.mobile-nav a:active {
  background: #dcdee0;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.profile p {
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 1rem;
  max-width: none;
}

.traits {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  margin: 1.75rem auto 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.85rem;
}

.traits li {
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--bg-panel);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.traits li:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--gap);
  margin-top: 3rem;
}

.col-left,
.col-right {
  min-width: 0;
}

/* ---------- Section titles ---------- */
.section-title {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.sub-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.1rem 0 0.5rem;
  text-align: center;
}

.block {
  margin-bottom: 2.75rem;
}

/* ---------- Certifications ---------- */
.cert-list,
.course-list {
  list-style: none;
}

.cert-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.28rem 0;
  color: var(--ink-soft);
  border-bottom: 1px dotted var(--line-soft);
}

.cert-list a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

/* External-link cue after each cert link */
.cert-list a::after {
  content: '↗';
  display: inline-block;
  margin-left: 0.3em;
  font-size: 0.8em;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.cert-list a:hover,
.cert-list a:focus-visible {
  color: #2f333a;
  text-decoration-color: var(--accent-strong);
}

.cert-list a:hover::after,
.cert-list a:focus-visible::after {
  transform: translate(1px, -1px);
}

.cert-list em {
  color: var(--ink-faint);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ---------- Competency tag flows ---------- */
.tag-flow {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
  margin-bottom: 1.5rem;
}

.tag-flow li {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--bg-panel);
  font-size: 0.8rem;
  line-height: 1.3;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.tag-flow li:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* ---------- Courses / education ---------- */
.course-list li {
  margin-bottom: 1rem;
}

.course-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.course-head strong {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
}

.course-head span {
  color: var(--ink-faint);
  font-size: 0.82rem;
  white-space: nowrap;
}

.col-left p {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-top: 0.15rem;
}

/* ---------- Highlights ---------- */
.highlights {
  list-style: none;
}

.highlights li {
  position: relative;
  padding: 0.9rem 0 0.9rem 1.75rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
}

.highlights li::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 0.9rem;
  color: var(--accent);
}

.highlights strong {
  color: var(--accent-strong);
  font-weight: 600;
}

/* ---------- Roles ---------- */
.role {
  padding: 1.5rem 0 0.5rem;
  border-top: 1px solid var(--line);
  margin-bottom: 1.5rem;
  transition: transform 0.25s ease;
}

.role:first-of-type {
  border-top: none;
}

.role-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.15rem;
}

.dates {
  order: 3;
  /* sits below the job title */
}

.company {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent-strong);
}

.company-desc {
  font-style: italic;
  color: var(--ink-faint);
  font-size: 0.88rem;
}

.job-title {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-top: 0.15rem;
}

.dates {
  color: var(--ink-faint);
  font-size: 0.85rem;
  white-space: nowrap;
  margin-top: 0.25rem;
}

.role-intro {
  font-style: italic;
  color: var(--ink-soft);
  margin: 0.9rem 0 0.25rem;
  font-size: 0.9rem;
  text-align: center;
}

.engagement {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.1rem 0 0.5rem;
  text-align: center;
}

.eng-desc {
  display: block;
  font-weight: 400;
  font-style: italic;
  color: var(--ink-faint);
  font-size: 0.85rem;
  margin-top: 0.1rem;
}

.bullets {
  list-style: none;
}

.bullets li {
  position: relative;
  padding: 0.32rem 0 0.32rem 1.25rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- Footer ---------- */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 2rem 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

/* ---------- Cookie consent modal ---------- */
.consent-overlay[hidden] {
  display: none;
}

.consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(40, 42, 46, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.consent-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.consent-modal {
  width: 100%;
  max-width: 460px;
  background: var(--bg-panel);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.consent-overlay.is-visible .consent-modal {
  transform: translateY(0) scale(1);
}

.consent-title {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: 1.4rem;
  letter-spacing: 0.03em;
  color: var(--accent-strong);
}

.consent-text {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.consent-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

/* Prevent background scroll while the consent modal is open */
body.consent-open {
  overflow: hidden;
}

.consent-btn {
  font-family: inherit;
  font-size: 0.82rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.consent-btn:hover,
.consent-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* Accept and Reject are equally weighted for compliance */
.consent-accept {
  background: #f0f1f2;
}

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children within the highlights + roles */
.role,
.highlights li {
  will-change: transform;
}

/* ---------- Responsive ---------- */

/* Tablet: narrower left rail, tighter gap */
@media (max-width: 900px) {
  :root {
    --gap: 2.25rem;
  }

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

/* Phone: single column, reordered, mobile-tuned spacing */
@media (max-width: 640px) {
  .container {
    padding: 1.75rem 1.25rem 3rem;
  }

  /* Show the sticky quick-nav */
  .mobile-nav {
    display: block;
    position: sticky;
    top: 0;
    z-index: 100;
    isolation: isolate;
    background: rgba(253, 253, 252, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line-soft);
  }

  .mobile-nav a {
    position: relative;
    z-index: 1;
  }

  /* Single column: flatten the column wrappers so sections order freely */
  .grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 2rem;
  }

  .col-left,
  .col-right {
    display: contents;
  }

  /* Desired mobile order:
     Highlights -> Certification -> Competencies -> Employment -> Courses -> Education */
  .sec-high {
    order: 1;
  }

  .sec-cert {
    order: 2;
  }

  .sec-comp {
    order: 3;
  }

  .sec-emp {
    order: 4;
  }

  .sec-courses {
    order: 5;
  }

  .sec-edu {
    order: 6;
  }

  /* Offset sticky-nav anchor jumps so headings aren't hidden under the bar */
  .block {
    scroll-margin-top: 4rem;
  }

  /* Header: centred, stacked, smaller */
  .header {
    padding: 2.5rem 1.25rem 0;
  }

  .header-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }

  .name {
    align-items: center;
    font-size: clamp(2.75rem, 16vw, 4rem);
  }

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

  .header-rule {
    margin-top: 1.5rem;
  }

  /* Profile + traits read better left-aligned on a phone */
  .profile p {
    font-size: 0.95rem;
  }

  .traits {
    justify-content: flex-start;
    padding: 1.25rem 0;
  }

  /* Section titles a touch smaller, centered on mobile */
  .section-title {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    text-align: center;
  }

  .block {
    margin-bottom: 2.25rem;
  }

  /* Larger, comfortable touch targets for cert links */
  .cert-list li {
    padding: 0.5rem 0;
  }

  .cert-list a {
    padding: 0.15rem 0;
  }

  /* Engagement date rows (Contino sub-roles) stack too */
  .engagement {
    line-height: 1.4;
  }

  /* Footer stacks */
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 2rem 1.25rem 2.5rem;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}