/* ==========================================================================
   Christopher Mutua — Portfolio Stylesheet
   Clean, professional, responsive. No external dependencies.
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-surface-alt: #f1f3f7;
  --color-border: #e2e6ed;
  --color-text: #1f2733;
  --color-text-muted: #5a6474;
  --color-text-faint: #8a94a3;
  --color-heading: #0f1b2d;

  --color-primary: #1e3a5f;
  --color-primary-dark: #142a45;
  --color-accent: #0ea5a4;
  --color-accent-dark: #0b807f;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 27, 45, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 27, 45, 0.10);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --max-width: 960px;
  --space-section: 3.5rem;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  vertical-align: middle;
}

a {
  color: var(--color-accent-dark);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover,
a:focus {
  color: var(--color-primary);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

h1, h2, h3, h4 {
  color: var(--color-heading);
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1rem;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Layout Container ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: relative;
  background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #ffffff;
  padding: 2.5rem 0 3rem;
  overflow: hidden;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 85% 15%,
    rgba(14, 165, 164, 0.25),
    transparent 45%
  );
  pointer-events: none;
}

.site-header .container {
  position: relative;
  z-index: 1;
}

/* --- Section Nav --- */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.site-nav a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.25rem 0;
}

.site-nav a:hover,
.site-nav a:focus {
  color: #ffffff;
  text-decoration: none;
  border-bottom: 2px solid var(--color-accent);
}

/* --- Name & Headline --- */
.name {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.headline {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 500;
  color: var(--color-accent);
  margin: 0 0 1.5rem;
  letter-spacing: 0.01em;
}

/* --- Contact List --- */
.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.75rem;
  margin: 0 0 1.75rem;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.9);
}

.contact-item .icon {
  flex-shrink: 0;
  color: var(--color-accent);
}

.contact-item a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.contact-item a:hover,
.contact-item a:focus {
  color: #ffffff;
  text-decoration: underline;
}

/* --- Tagline --- */
.tagline {
  font-size: 0.98rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  max-width: 65ch;
}

/* ==========================================================================
   Main & Sections
   ========================================================================== */
main.container {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}

.section {
  margin-bottom: var(--space-section);
}

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

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.6rem;
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* ==========================================================================
   Summary
   ========================================================================== */
.summary-text {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--color-text);
  max-width: 75ch;
  margin: 0;
}

.summary-text strong {
  color: var(--color-heading);
  font-weight: 600;
}

/* ==========================================================================
   Expertise Grid
   ========================================================================== */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.75rem;
}

.expertise-item {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem 0.75rem 1.15rem;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--color-heading);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.expertise-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--color-primary);
}

/* ==========================================================================
   Experience — Jobs
   ========================================================================== */
.job {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.75rem 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.job:hover {
  box-shadow: var(--shadow-md);
}

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

.job-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-surface-alt);
}

.job-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-heading);
  margin: 0 0 0.15rem;
}

.job-company {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-accent-dark);
  margin: 0 0 0.25rem;
}

.job-dates {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-faint);
  letter-spacing: 0.02em;
  margin: 0;
}

.job-intro {
  font-size: 0.98rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0 0 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid var(--color-surface-alt);
}

/* --- Job Bullets --- */
.job-bullets {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.job-bullets li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--color-text);
}

.job-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.15);
}

.job-bullets li strong {
  color: var(--color-heading);
  font-weight: 600;
}

/* ==========================================================================
   Education
   ========================================================================== */
.education-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-sm);
}

.education-degree {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-heading);
  margin: 0 0 0.2rem;
}

.education-school {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--color-accent-dark);
  margin: 0 0 0.2rem;
}

.education-dates {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-faint);
  margin: 0;
}

/* ==========================================================================
   Certifications
   ========================================================================== */
   .certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
  }
  
  .certification-card {
    display: flex;
    gap: 1.15rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  
  .certification-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
  
  .cert-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-alt);
    border-radius: var(--radius-sm);
  }
  
  .cert-content {
    flex: 1;
    min-width: 0; /* Prevents flex overflow */
  }
  
  .cert-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-heading);
    margin: 0 0 0.15rem;
    line-height: 1.35;
  }
  
  .cert-issuer {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin: 0 0 0.15rem;
  }
  
  .cert-date {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-faint);
    margin: 0 0 0.75rem;
  }
  
  .cert-status {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent-dark);
    background: rgba(14, 165, 164, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-top: 0.25rem;
  }
  
  .cert-actions {
    margin-bottom: 0.75rem;
  }
  
  .cert-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
    transition: all 0.15s ease;
  }
  
  .cert-link:hover,
  .cert-link:focus {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    text-decoration: none;
  }
  
  .cert-skills {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.5;
  }
  
  .cert-skills strong {
    color: var(--color-text);
  }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.75);
  padding: 1.75rem 0;
  font-size: 0.88rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--color-accent);
  font-weight: 500;
}

.site-footer a:hover,
.site-footer a:focus {
  color: #ffffff;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 640px) {
  :root {
    --space-section: 2.5rem;
  }

  .site-header {
    padding: 1.75rem 0 2.25rem;
  }

  .site-nav {
    gap: 0.4rem 0.9rem;
    margin-bottom: 1.5rem;
  }

  .site-nav a {
    font-size: 0.78rem;
  }

  .contact-list {
    flex-direction: column;
    gap: 0.5rem;
  }

  .job {
    padding: 1.35rem 1.25rem;
  }

  .job-intro {
    padding-left: 0.75rem;
  }

  .expertise-grid {
    grid-template-columns: 1fr;
  }

  .certifications-list {
    grid-template-columns: 1fr;
  }

  .site-footer .container {
    flex-direction: column;
    text-align: center;
  }
}

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

  * {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  :root {
    --color-bg: #ffffff;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
  }

  body {
    font-size: 11pt;
    color: #000;
    background: #fff;
  }

  .site-header {
    background: none !important;
    color: #000 !important;
    padding: 0 0 1rem;
    border-bottom: 2px solid #000;
  }

  .site-header::after {
    display: none;
  }

  .name,
  .headline,
  .contact-item,
  .contact-item a,
  .tagline {
    color: #000 !important;
  }

  .site-nav {
    display: none;
  }

  .section-title {
    color: #000;
    border-bottom: 1px solid #000;
    padding-bottom: 0.25rem;
  }

  .section-title::after {
    display: none;
  }

  .job,
  .education-item,
  .expertise-item,
  .certification-item {
    border: 1px solid #ccc;
    box-shadow: none;
    page-break-inside: avoid;
  }

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

  .site-footer {
    background: none;
    color: #000;
    border-top: 1px solid #000;
  }

  .site-footer a {
    color: #000;
  }
}