/* --- Naledi.co.uk style --- */
:root {
  --bg: #ffffff;
  --text: #5f6368;
  --text-body: #5f6368;
  --blue: #4285f4;
  --blue-hover: #3367d6;
  --red: #ea4335;
  --font-sans: "Open Sans", system-ui, sans-serif;
  --max-width: 960px;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 5rem;
  --touch-min: 44px;
  /* Surfaces & borders for theming */
  --surface: #ffffff;
  --surface-alt: #f1f3f4;
  --heading: #202124;
  --border: #e8eaed;
  --border-light: #eee;
  --input-bg: #ffffff;
  --btn-text: #ffffff;
}

*,
*::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: 1rem;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg);
  font-weight: 400;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  color: var(--blue-hover);
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Layout --- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-3xl);
  width: 100%;
}

/* --- Header / Nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-lg);
  min-height: var(--touch-min);
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
  min-height: var(--touch-min);
  padding: 0.75rem 0 0.65rem 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -3px 0 0 transparent;
}

.nav-link:hover {
  color: var(--blue);
}

.nav-link.active {
  color: var(--red);
  box-shadow: inset 0 -3px 0 0 var(--red);
}

.nav-link.active:hover {
  color: var(--red);
  text-decoration: none;
}

.theme-toggle {
  background: none;
  border: none;
  padding: 0.75rem 0.5rem 0.65rem 0.5rem;
  margin: 0;
  cursor: pointer;
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  font-family: var(--font-sans);
  box-sizing: border-box;
  pointer-events: auto;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.theme-toggle-icon,
.theme-toggle-label {
  pointer-events: none;
}

.theme-toggle-label {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
}


.theme-toggle:hover {
  color: var(--blue);
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.theme-toggle-icon {
  display: block;
}

.theme-toggle-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-toggle-sun {
    display: none;
  }
  html:not([data-theme="light"]) .theme-toggle-moon {
    display: block;
  }
}

html[data-theme="light"] .theme-toggle-sun {
  display: block;
}

html[data-theme="light"] .theme-toggle-moon {
  display: none;
}

/* --- Hero --- */
.hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
  text-align: center;
}

.hero-name {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-sans);
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--blue);
}

.hero-title {
  margin: 0 0 var(--space-md);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text);
}

.hero-tagline {
  margin: 0 auto var(--space-xl);
  font-size: 1rem;
  color: var(--text);
  max-width: 52ch;
  line-height: 1.65;
}

.hero-cta {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--btn-text);
  background: var(--blue);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}

.hero-cta:hover {
  background: var(--blue-hover);
  color: var(--btn-text);
  text-decoration: none;
}

/* --- Services (3 columns) --- */
.services {
  padding: var(--space-2xl) 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

@media (min-width: 768px) {
  .services {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
  }
}

.service {
  text-align: center;
}

.service-icon {
  width: 80px;
  height: 64px;
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.service-title {
  margin: 0 0 var(--space-sm);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue);
}

.service-text {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text);
  text-align: left;
  line-height: 1.6;
}

.service-text strong {
  color: var(--blue);
  font-weight: 600;
}

/* --- About (full-width 50/50: image left, blue panel right) --- */
.about-full {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 85vh;
  grid-auto-rows: 1fr;
}

/* Left column: image fills entire column, edge-to-edge, full height */
@keyframes aboutImageIn {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes aboutPanelIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.about-full .about-image-wrap {
  opacity: 0;
  transform: translateX(-24px);
  transition: none;
}

.about-full .about-panel {
  opacity: 0;
  transform: translateX(24px);
  transition: none;
}

.about-full.about-visible .about-image-wrap {
  animation: aboutImageIn 0.65s ease-out forwards;
}

.about-full.about-visible .about-panel {
  animation: aboutPanelIn 0.65s ease-out 0.15s forwards;
}

.about-image-wrap {
  position: relative;
  overflow: hidden;
  min-height: 85vh;
}

.about-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.85) brightness(0.95);
}

.about-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(42, 115, 232, 0.08) 0%, rgba(60, 80, 140, 0.12) 100%);
  pointer-events: none;
}

/* Right column: solid blue, content top-aligned, generous padding, scrollable */
.about-panel {
  background: #2a73e8;
  padding: 5rem 4rem 5rem 4.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
  max-height: 85vh;
  -webkit-overflow-scrolling: touch;
}

.about-panel-inner {
  width: 100%;
  max-width: 36em;
}

.about-panel-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 1.5rem;
  line-height: 1.2;
  font-family: var(--font-sans);
}

.about-panel-text {
  font-size: 1rem;
  font-weight: 400;
  color: #ffffff;
  line-height: 1.75;
  margin: 0 0 1rem;
}

.about-panel-text:last-of-type {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .about-full {
    grid-template-columns: 1fr;
    min-height: auto;
    grid-auto-rows: auto;
  }

  .about-image-wrap {
    min-height: 50vh;
    position: relative;
  }

  .about-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 50vh;
    object-fit: cover;
  }

  .about-panel {
    max-height: none;
    padding: 3rem 2rem 3rem 2.25rem;
  }

  .about-panel-inner {
    max-width: none;
  }
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 var(--space-md);
  color: var(--heading);
}

/* --- Portfolio (dense, full-width dashboard collage) --- */
@keyframes portfolioReveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes portfolioCardIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portfolio .portfolio-heading,
.portfolio .portfolio-subtitle,
.portfolio .portfolio-filters {
  opacity: 0;
  transform: translateY(16px);
}

.portfolio .portfolio-gallery .project-card-link {
  opacity: 0;
  transform: translateY(20px);
}

.portfolio.portfolio-visible .portfolio-heading {
  animation: portfolioReveal 0.55s ease-out forwards;
}

.portfolio.portfolio-visible .portfolio-subtitle {
  animation: portfolioReveal 0.55s ease-out 0.06s forwards;
}

.portfolio.portfolio-visible .portfolio-filters {
  animation: portfolioReveal 0.55s ease-out 0.12s forwards;
}

.portfolio.portfolio-visible .portfolio-gallery .project-card-link {
  animation: portfolioCardIn 0.5s ease-out forwards;
}

.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(1) { animation-delay: 0.18s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(2) { animation-delay: 0.24s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(3) { animation-delay: 0.30s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(4) { animation-delay: 0.36s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(5) { animation-delay: 0.42s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(6) { animation-delay: 0.48s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(7) { animation-delay: 0.54s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(8) { animation-delay: 0.60s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(9) { animation-delay: 0.66s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(10) { animation-delay: 0.72s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(11) { animation-delay: 0.78s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(12) { animation-delay: 0.84s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(13) { animation-delay: 0.90s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(14) { animation-delay: 0.96s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(15) { animation-delay: 1.02s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(16) { animation-delay: 1.08s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(17) { animation-delay: 1.14s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(18) { animation-delay: 1.20s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(19) { animation-delay: 1.26s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(20) { animation-delay: 1.32s; }
.portfolio.portfolio-visible .portfolio-gallery .project-card-link:nth-child(n+21) { animation-delay: 1.38s; }

.portfolio {
  width: 100vw;
  max-width: 100vw;
  position: relative;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding: var(--space-lg) 1rem;
  border-top: 1px solid var(--border);
  box-sizing: border-box;
}

.portfolio-heading {
  font-size: 2rem;
  font-weight: 700;
  color: #d93025;
  margin: 0 0 0.25rem;
  text-align: center;
}

.portfolio-subtitle {
  font-size: 1rem;
  color: var(--heading);
  margin: 0 0 var(--space-md);
  text-align: center;
}

.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: var(--space-lg);
}

.portfolio-filter-btn {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.portfolio-filter-btn:hover {
  background: var(--surface-alt);
  color: var(--heading);
  border-color: var(--blue);
}

.portfolio-filter-btn.is-active {
  background: var(--blue);
  color: var(--btn-text);
  border-color: var(--blue);
}

.portfolio-filter-btn.is-active:hover {
  background: var(--blue-hover);
  color: var(--btn-text);
  border-color: var(--blue-hover);
}

.portfolio-gallery .project-card-link.is-hidden {
  display: none;
}

.portfolio-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: start;
}

@media (min-width: 600px) {
  .portfolio-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .project-card-link--wide {
    grid-column: span 2;
  }
}

@media (min-width: 768px) {
  .portfolio-gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .project-card-link--wide {
    grid-column: span 2;
  }
}


.project-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.project-card-link:hover,
.project-card-link:focus {
  color: inherit;
}

.project-card-link:focus .project-hover-overlay {
  opacity: 1;
}

/* Wide cards: larger visual, dashboard-style */
.project-card--wide .project-visual {
  min-height: 300px;
}

@media (min-width: 900px) {
  .project-card--wide .project-visual {
    min-height: 320px;
  }
}

.project-card {
  background: var(--surface);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.project-card-link:hover .project-card {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #dadce0;
}

.project-visual {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background: var(--surface-alt);
}

.project-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Hover overlay: dark blue/purple, title + desc + tech in white */
.project-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 35, 80, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: 0;
  pointer-events: none;
}

.project-card-link:hover .project-hover-overlay {
  opacity: 1;
}

.project-overlay-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.project-overlay-desc {
  display: block;
  font-size: 0.875rem;
  color: #fff;
  margin: 0 0 0.35rem;
  line-height: 1.4;
  opacity: 0.95;
}

.project-overlay-tech {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.project-card-body {
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--border-light);
}

.project-title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  color: var(--heading);
}

.project-desc {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text);
  line-height: 1.4;
}

/* Survey / Sustrans */
.project-visual--survey {
  background: #f8f9fa;
}

.viz-row { margin: 0; }
.viz-meta { color: var(--text); font-size: 0.7rem; }
.viz-year { font-weight: 600; margin-bottom: 0.25rem; }
.viz-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.viz-pill { padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.65rem; font-weight: 600; color: var(--btn-text); }
.viz-pill--blue { background: var(--blue); }
.viz-pill--orange { background: #f9a825; }
.viz-pill--yellow { background: #ffcc80; color: var(--heading); }
.viz-pill--red { background: #e53935; }
.viz-dot-matrix { display: flex; gap: 0.75rem; align-items: flex-end; margin-top: 0.5rem; min-height: 56px; }
.dot-block { display: flex; flex-wrap: wrap; gap: 3px; }
.dot-block--small { width: 52px; }
.dot-block--large { flex: 1; max-width: 180px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.blue { background: #4285f4; }
.dot.orange { background: #f9a825; }
.viz-label { font-size: 0.65rem; color: var(--text); margin-top: 0.35rem; }

/* Map cards */
.project-visual--map { background: #e8eaf6; }
.viz-title { font-weight: 700; font-size: 0.8rem; margin: 0 0 0.25rem; }
.viz-copy { margin: 0; font-size: 0.7rem; line-height: 1.4; color: var(--heading); }
.viz-map { border-radius: 6px; margin: 0.5rem 0; min-height: 100px; }
.viz-map--africa { background: linear-gradient(180deg, #c5cae9 0%, #9fa8da 50%, #7986cb 100%); }
.viz-map--sea { background: linear-gradient(180deg, #1a237e 0%, #283593 50%, #3949ab 100%); min-height: 120px; position: relative; }
.viz-map--sea::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,0.6) 1px, transparent 1px); background-size: 12px 12px; border-radius: 6px; }
.viz-map--drc { background: linear-gradient(135deg, #e1bee7 0%, #ce93d8 100%); min-height: 80px; }
.viz-credit { font-size: 0.6rem; color: var(--text); margin-top: 0.25rem; }

/* Mediterranean */
.project-visual--mediterranean { background: #e3f2fd; }

/* WMO Power BI */
.project-visual--wmo { background: #0d47a1; color: #fff; }
.viz-wmo-header { font-size: 0.7rem; font-weight: 600; margin-bottom: 0.5rem; }
.viz-wmo-section { display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0; flex-wrap: wrap; }
.viz-wmo-label { font-size: 0.7rem; opacity: 0.95; }
.viz-wmo-dropdown { font-size: 0.65rem; padding: 0.2rem 0.5rem; background: rgba(255,255,255,0.2); border-radius: 4px; }
.viz-wmo-bars { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.5rem 0; }
.wmo-bar { height: 6px; background: rgba(255,255,255,0.2); border-radius: 3px; overflow: hidden; }
.wmo-fill { display: block; height: 100%; background: #ffb74d; border-radius: 3px; }
.viz-wmo-btn { font-size: 0.6rem; padding: 0.2rem 0.4rem; border-radius: 4px; margin-right: 0.25rem; }
.viz-wmo-btn--on { background: rgba(255,255,255,0.3); }
.viz-wmo-icons { font-size: 0.6rem; opacity: 0.9; margin-top: 0.35rem; }

/* Fistula engagement */
.project-visual--fistula { background: #f5f5f5; }
.viz-fistula-layout { display: grid; gap: 0.5rem; margin-top: 0.5rem; }
.viz-scatter-label, .viz-bars-label, .viz-map-label { font-size: 0.65rem; color: var(--text); }
.viz-scatter { height: 50px; background: linear-gradient(180deg, #e3f2fd 0%, #bbdefb 100%); border-radius: 4px; }
.viz-bars { display: flex; align-items: flex-end; gap: 0.35rem; height: 36px; }
.viz-bars span { width: 100%; min-width: 8px; background: #90a4ae; border-radius: 2px 2px 0 0; }

/* Equal Measures */
.project-visual--equal { background: #f3e5f5; }
.viz-lollipops-row { display: flex; gap: 0.5rem; margin: 0.5rem 0; }
.viz-lollipop { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; min-height: 32px; }
.lollipop-bar { width: 4px; height: 20px; background: #ce93d8; border-radius: 2px; }
.lollipop-dot { width: 10px; height: 10px; border-radius: 50%; background: #7e57c2; margin-top: -2px; }
.viz-labels-row { font-size: 0.6rem; color: var(--text); }
.viz-world-text { font-weight: 700; font-size: 0.85rem; color: #7e57c2; margin: 0.5rem 0 0.25rem; }
.viz-world-map { min-height: 70px; background: linear-gradient(180deg, #e1bee7 0%, #ba68c8 100%); border-radius: 6px; }
.viz-desc { margin: 0.35rem 0 0; font-size: 0.65rem; color: var(--text); }

/* Capgemini */
.project-visual--capgemini { background: #1565c0; color: #fff; }
.viz-gauges { display: flex; gap: 1rem; margin: 0.75rem 0; flex-wrap: wrap; }
.viz-gauge { text-align: center; }
.gauge-num { display: block; font-size: 1.5rem; font-weight: 700; }
.gauge-caption { font-size: 0.6rem; opacity: 0.9; }
.viz-caption { margin: 0 0 0.5rem; font-size: 0.6rem; opacity: 0.95; }
.viz-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.35rem; font-size: 0.7rem; }

/* Books */
.project-visual--books { background: #fafafa; }
.viz-books-stats { display: flex; gap: 1rem; margin: 0.5rem 0; flex-wrap: wrap; }
.books-small { display: block; font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--text); }
.books-big { display: block; font-size: 1.1rem; font-weight: 700; color: var(--heading); }
.viz-donut { width: 72px; height: 72px; border-radius: 50%; background: conic-gradient(#7e57c2 0 46%, #ff8a65 46% 100%); margin: 0.5rem 0; position: relative; }
.viz-donut::after { content: ""; position: absolute; inset: 8px; background: #fafafa; border-radius: 50%; }
.viz-donut-caption { font-size: 0.6rem; color: var(--text); margin: 0.25rem 0 0.5rem; }
.viz-book-bars { display: flex; flex-direction: column; gap: 0.25rem; }
.book-bar { font-size: 0.65rem; padding-left: 0.5rem; border-left: 3px solid #7e57c2; }

/* Code */
.project-visual--code { background: #263238; color: #b0bec5; font-family: "Consolas", "Monaco", monospace; }
.code-tabs { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.code-tabs span { font-size: 0.65rem; color: #81d4fa; padding: 0.2rem 0.5rem; border-bottom: 1px solid #546e7a; }
.code-heading { font-size: 0.7rem; color: #fff; margin-bottom: 0.35rem; }
.code-line, .code-block { margin: 0 0 0.25rem; font-size: 0.6rem; white-space: pre-wrap; word-break: break-all; color: #aed581; }

/* Flourish / UNDP */
.project-visual--flourish { background: #e8f5e9; }
.viz-chart-placeholder { min-height: 80px; background: linear-gradient(180deg, #c8e6c9 0%, #a5d6a7 100%); border-radius: 6px; margin: 0.5rem 0; }

/* --- Testimonial (white bg, italic quote, cyan name) --- */
.testimonial {
  padding: var(--space-3xl) 0 var(--space-2xl) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-2xl);
  background: var(--surface);
}

.testimonial-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.testimonial-quote {
  font-size: 1.25rem;
  font-style: italic;
  margin: 0 0 var(--space-lg);
  color: var(--text);
  line-height: 1.7;
  font-weight: 400;
}

.testimonial-attribution {
  margin: 0;
}

.testimonial-name {
  font-style: normal;
  display: block;
  margin-bottom: 0.25rem;
}

.testimonial-name a {
  color: #00acc1;
  font-weight: 700;
  text-decoration: none;
}

.testimonial-name a:hover {
  text-decoration: underline;
  color: #0097a7;
}

.testimonial-role {
  font-size: 0.9375rem;
  color: var(--text);
  margin: 0;
  font-weight: 400;
}

/* --- Blog / Coming soon (red heading, ALL BLOG POSTS button, 60/40 two-column) --- */
.blog-cta {
  padding: var(--space-2xl) 0 0;
  background: var(--surface);
}

.blog-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.blog-heading {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0;
}

.blog-all-posts {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--btn-text);
  background: var(--blue);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}

.blog-all-posts:hover {
  background: var(--blue-hover);
  color: var(--btn-text);
  text-decoration: none;
}

/* Blog posts list (vertical) */
.blog-posts {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.blog-post {
  margin: 0;
}

.blog-post-link {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.blog-post-link:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-color: var(--blue);
  color: inherit;
}

.blog-post-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-alt);
}

.blog-post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-post-body {
  padding: var(--space-md) var(--space-lg);
}

.blog-post-date {
  display: block;
  font-size: 0.8125rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.blog-post-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.blog-post-link:hover .blog-post-title {
  color: var(--blue);
}

.blog-post-excerpt {
  font-size: 0.9375rem;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}

.blog-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: start;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding-top: var(--space-md);
}

@media (min-width: 768px) {
  .blog-content {
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-2xl);
  }
}

.blog-left {
  min-width: 0;
  padding: 0;
  margin: 0;
}

.blog-left .blog-coming,
.blog-left .blog-text,
.blog-left .blog-privacy,
.blog-left .newsletter-form {
  margin-left: 0;
  padding-left: 0;
}

.blog-left .newsletter-form {
  width: 100%;
  max-width: 100%;
}

.blog-coming {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 var(--space-md);
}

.blog-text {
  margin: 0 0 var(--space-sm);
  font-size: 1rem;
  color: var(--heading);
  line-height: 1.6;
}

.blog-privacy {
  font-size: 0.9375rem;
  color: #667788;
  font-style: italic;
  margin: 0 0 var(--space-md);
  line-height: 1.5;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.blog-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--heading);
  margin: 0 0 0.25rem 0;
  padding-left: 0;
}

.blog-input {
  width: 100%;
  max-width: 320px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
}

.blog-input:focus {
  outline: none;
  border-color: var(--blue);
}

.btn-blog {
  padding: 0.6rem 1.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--btn-text);
  background: var(--blue);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.25rem;
}

.btn-blog:hover {
  background: var(--blue-hover);
}

.blog-image-wrap {
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-alt);
}

.blog-image-wrap {
  position: relative;
}

.blog-image {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  filter: grayscale(1) brightness(0.92);
}

.blog-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(102, 153, 255, 0.08) 0%, rgba(80, 100, 140, 0.1) 100%);
  pointer-events: none;
}

.blog-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-2xl) 0 var(--space-2xl) 0;
}

/* --- Contact (centered heading, form in white box with shadow, pill SEND) --- */
.contact {
  padding: var(--space-2xl) 0;
  padding-top: var(--space-3xl);
  background: var(--surface);
  text-align: center;
}

.contact-heading {
  font-size: 2rem;
  font-weight: 700;
  color: #e44d26;
  margin: 0 0 var(--space-md);
}

.contact-intro {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  margin: 0 0 var(--space-xl);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.contact-form-wrap {
  max-width: 480px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  padding: var(--space-xl);
  text-align: left;
  box-sizing: border-box;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
  text-align: left;
}

.contact-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--heading);
  margin: 0 0 0.25rem;
}

.contact-label .required {
  color: #e44d26;
}

.contact-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.contact-form-message {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  min-height: 1.4em;
}

.contact-form-message--success {
  color: var(--blue);
}

.contact-form-message--error {
  color: var(--red);
}

.contact-input,
.contact-textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: #202124;
}

.contact-input:focus,
.contact-textarea:focus {
  outline: none;
  border-color: #5b8cff;
}

.contact-textarea {
  resize: vertical;
  min-height: 100px;
}

.btn-send {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0.5rem auto 0;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--btn-text);
  background: var(--blue);
  border: none;
  border-radius: 28px;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
}

.btn-send:hover {
  background: var(--blue-hover);
}

.btn-send:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* --- Buttons (legacy) --- */
.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--blue);
  color: var(--btn-text);
}

.btn-primary:hover {
  background: var(--blue-hover);
  color: var(--btn-text);
  text-decoration: none;
}

/* --- Footer (thin line, two social icons centered) --- */
.site-footer {
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  background: var(--surface);
}

.footer-line {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 var(--space-lg);
}

.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
}

.footer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s;
}

.footer-icon:hover {
  opacity: 0.8;
  color: #1a73e8;
}

.footer-icon--linkedin {
  color: var(--text);
}

.footer-icon--linkedin:hover {
  color: #0a66c2;
}

.footer-icon--github {
  color: var(--text);
}

.footer-icon--github:hover {
  color: #58a6ff;
}

/* ========== RESPONSIVE: Mobile & Tablet ========== */

/* --- Mobile (up to 599px) --- */
@media (max-width: 599px) {
  main {
    padding: 0 1rem var(--space-2xl);
  }

  .nav {
    padding: 0.75rem 1rem;
    gap: 1.25rem;
  }

  .hero {
    padding: var(--space-xl) 0 var(--space-lg);
  }

  .hero-name {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }

  .hero-title {
    font-size: 1.0625rem;
  }

  .hero-tagline {
    font-size: 0.9375rem;
    margin-bottom: var(--space-lg);
  }

  .hero-cta {
    padding: 0.875rem 1.5rem;
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .services {
    padding: var(--space-xl) 0;
    gap: var(--space-xl);
  }

  .service-icon {
    width: 64px;
    height: 52px;
    margin-bottom: var(--space-sm);
  }

  .service-title {
    font-size: 1.125rem;
  }

  .service-text {
    font-size: 0.875rem;
  }

  .about-panel {
    padding: 2rem 1.25rem;
    max-height: none;
  }

  .about-panel-title {
    font-size: 1.75em;
  }

  .about-panel-text {
    font-size: 0.9375rem;
  }

  .about-image {
    min-height: 40vh;
  }

  .portfolio {
    padding: var(--space-lg) 1rem;
  }

  .portfolio-heading {
    font-size: 1.5rem;
  }

  .portfolio-subtitle {
    font-size: 0.9375rem;
    margin-bottom: var(--space-lg);
  }

  .portfolio-gallery {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .project-card-link--wide {
    grid-column: span 1;
  }

  .project-visual {
    min-height: 180px;
    padding: 0.75rem;
  }

  .project-card-body {
    padding: 1rem;
  }

  .testimonial {
    padding: var(--space-lg) 0;
  }

  .testimonial-quote {
    font-size: 1rem;
    padding: 0 0.5rem;
  }

  .testimonial-inner {
    padding: 0 0.5rem;
  }

  .blog-cta {
    padding: var(--space-lg) 0 0;
  }

  .blog-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
  }

  .blog-heading {
    font-size: 1.5rem;
  }

  .blog-all-posts {
    padding: 0.625rem 1rem;
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
  }

  .blog-coming {
    font-size: 1.375rem;
  }

  .blog-text {
    font-size: 0.9375rem;
  }

  .blog-privacy {
    font-size: 0.875rem;
  }

  .blog-input {
    max-width: none;
  }

  .btn-blog {
    min-height: var(--touch-min);
    padding: 0.75rem 1.25rem;
  }

  .blog-image {
    min-height: 240px;
  }

  .contact {
    padding: var(--space-lg) 0;
  }

  .contact-heading {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
  }

  .contact-intro {
    font-size: 0.9375rem;
    margin-bottom: var(--space-lg);
    padding: 0 0.5rem;
  }

  .contact-form-wrap {
    margin-left: 1rem;
    margin-right: 1rem;
    padding: var(--space-lg) var(--space-md);
    border-radius: 8px;
  }

  .contact-form {
    gap: var(--space-sm);
  }

  .contact-input,
  .contact-textarea {
    padding: 0.75rem;
    min-height: 48px;
  }

  .contact-textarea {
    min-height: 120px;
  }

  .btn-send {
    max-width: none;
    min-height: var(--touch-min);
    padding: 0.875rem 1.5rem;
    margin-top: 0.5rem;
  }

  .site-footer {
    padding: var(--space-lg) 1rem;
  }

  .footer-social {
    gap: var(--space-md);
  }

  .footer-icon {
    width: 44px;
    height: 44px;
  }
}

/* --- Tablet (600px – 899px) --- */
@media (min-width: 600px) and (max-width: 899px) {
  main {
    padding: 0 1.25rem var(--space-3xl);
  }

  .nav {
    padding: var(--space-sm) 1.25rem;
  }

  .services {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  .service:nth-child(3) {
    grid-column: span 2;
  }

  .portfolio-gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  .project-card--wide {
    grid-column: span 2;
  }

  .blog-content {
    grid-template-columns: 1fr;
  }

  .blog-image-wrap {
    max-height: 360px;
  }

  .blog-image {
    min-height: 280px;
    max-height: 360px;
  }

  .contact-form-wrap {
    margin-left: 1.25rem;
    margin-right: 1.25rem;
  }
}

/* --- About section: stack earlier on tablet --- */
@media (max-width: 768px) {
  .about-full {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .about-image {
    min-height: 45vh;
  }

  .about-panel {
    max-height: none;
    padding: 2.5rem 1.5rem;
  }
}

/* --- Large mobile / small tablet: ensure no horizontal scroll --- */
@media (max-width: 767px) {
  .portfolio-gallery {
    grid-template-columns: 1fr;
  }

  .project-card-link--wide {
    grid-column: 1;
  }
}

/* --- Very small phones (optional) --- */
@media (max-width: 380px) {
  main {
    padding: 0 0.75rem var(--space-xl);
  }

  .hero-name {
    font-size: 1.5rem;
  }

  .blog-heading,
  .contact-heading {
    font-size: 1.25rem;
  }

  .contact-form-wrap {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
    padding: var(--space-md);
  }
}

/* ========== DARK MODE ========== */
[data-theme="dark"] {
  --bg: #121212;
  --text: #b0b0b0;
  --text-body: #e0e0e0;
  --blue: #6ea8fe;
  --blue-hover: #8bb9ff;
  --red: #f28b82;
  --surface: #1e1e1e;
  --surface-alt: #2d2d2d;
  --heading: #ffffff;
  --border: #3a3a3a;
  --border-light: #333;
  --input-bg: #2d2d2d;
  --btn-text: #ffffff;
}

[data-theme="dark"] .project-card-link:hover .project-card {
  border-color: #4a4a4a;
}

[data-theme="dark"] .contact-form-wrap {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .blog-input:focus {
  border-color: var(--blue);
}

[data-theme="dark"] .contact-input,
[data-theme="dark"] .contact-textarea {
  background: #ffffff;
  color: #202124;
  border-color: #dadce0;
}

[data-theme="dark"] .contact-input:focus,
[data-theme="dark"] .contact-textarea:focus {
  border-color: var(--blue);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #121212;
    --text: #b0b0b0;
    --text-body: #e0e0e0;
    --blue: #6ea8fe;
    --blue-hover: #8bb9ff;
    --red: #f28b82;
    --surface: #1e1e1e;
    --surface-alt: #2d2d2d;
    --heading: #ffffff;
    --border: #3a3a3a;
    --border-light: #333;
    --input-bg: #2d2d2d;
    --btn-text: #ffffff;
  }

  html:not([data-theme="light"]) .project-card-link:hover .project-card {
    border-color: #4a4a4a;
  }

  html:not([data-theme="light"]) .contact-form-wrap {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  }

  html:not([data-theme="light"]) .blog-input:focus {
    border-color: var(--blue);
  }

  html:not([data-theme="light"]) .contact-input,
  html:not([data-theme="light"]) .contact-textarea {
    background: #ffffff;
    color: #202124;
    border-color: #dadce0;
  }

  html:not([data-theme="light"]) .contact-input:focus,
  html:not([data-theme="light"]) .contact-textarea:focus {
    border-color: var(--blue);
  }
}
