/* ============================================================
   ETICAS AI AUDIT PORTFOLIO — v2
   Palette: warm grey #ece9e0 base, yellow #fce407 accent.
   Typefaces: DM Mono (headings/data) + DM Sans (body).
   ============================================================ */

:root {
  /* Core palette */
  --bg:           #ece9e0;        /* Eticas warm grey — page background */
  --surface:      #f5f3ed;        /* Cards and elevated surfaces */
  --surface-2:    #faf9f6;        /* Hovered card */
  --border:       #d8d4c8;        /* Subtle borders */
  --border-mid:   #c4bfb0;        /* More visible dividers */

  /* Accent */
  --yellow:       #fce407;        /* Eticas.ai yellow */
  --yellow-dim:   rgba(252,228,7,0.18);
  --yellow-mid:   rgba(252,228,7,0.35);

  /* Text */
  --text:         #1a1916;        /* Near-black on light bg */
  --text-mid:     #4a4740;        /* Secondary text */
  --text-dim:     #8a857a;        /* Tertiary / labels */
  --text-inv:     #1a1916;        /* Text on yellow */

  /* Entity colours */
  --entity-ai:    #1a1916;
  --entity-fdn:   #5a4a8a;
  --entity-core:  #3a5a3a;

  --mono:         'DM Mono', 'Courier New', monospace;
  --sans:         'DM Sans', system-ui, sans-serif;

  --radius:       3px;
  --radius-lg:    6px;
  --transition:   0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(236,233,224,0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  height: 36px;
}
.logo-img {
  height: 32px;
  width: auto;
  display: block;
}
.logo-text {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.04em;
}
.nav-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── HERO ───────────────────────────────────────────────── */
/* Full-bleed wrapper handles the dark background edge-to-edge */
.hero-wrapper {
  background: #1a1916;
}
.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 5rem 2rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: end;
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgba(236,233,224,0.75);   /* brighter off-white for eyebrow */
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.hero-headline {
  font-family: var(--mono);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 500;
  line-height: 1.12;
  color: #ece9e0;                  /* off-white */
  margin-bottom: 1.25rem;
}
.hero-sub {
  font-size: 1rem;
  color: rgba(236,233,224,0.85);   /* readable off-white for body */
  max-width: 42ch;
  line-height: 1.65;
}
.hero-stats {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 0.5rem;
}
.stat-item {
  border-left: 3px solid var(--yellow);
  padding-left: 1.25rem;
}
.stat-num {
  display: block;
  font-family: var(--mono);
  font-size: 2.5rem;
  font-weight: 500;
  color: #ece9e0;                  /* off-white */
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-label {
  font-size: 0.72rem;
  color: rgba(236,233,224,0.65);   /* legible off-white for stat labels */
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── FILTER BAR ─────────────────────────────────────────── */
.filter-bar {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 56px;
  z-index: 90;
}
.filter-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: flex-start;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.filter-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.pill {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-mid);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.pill:hover { border-color: var(--text); color: var(--text); }
.pill.active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--text-inv);
  font-weight: 500;
}
.filter-clear {
  align-self: flex-end;
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.04em;
}
.filter-clear:hover { color: var(--text); border-color: var(--text-mid); }

/* ── RESULTS BAR ────────────────────────────────────────── */
.results-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 2rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

/* ── PROJECT GRID ───────────────────────────────────────── */
.portfolio-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2rem 5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1px;
  background: var(--border);
}

/* ── PROJECT CARD ───────────────────────────────────────── */
.project-card {
  background: var(--surface);
  padding: 1.75rem;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
}
.project-card:hover { background: var(--surface-2); }
.project-card:hover .card-cta { color: var(--text); }
.project-card:hover .card-headline { border-left-color: var(--text); }

/* Top meta row */
.card-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.card-year {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.card-badges {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.badge {
  font-family: var(--mono);
  font-size: 0.6rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* Entity badges */
.badge-eticas-ai   { background: var(--yellow); color: var(--text-inv); }
.badge-eticas-fdn  { background: #e8e0f5; color: #5a4a8a; }
.badge-eticas      { background: #ddeedd; color: #3a5a3a; }
/* Status badges */
.badge-ongoing { background: #ddeef8; color: #2a6a9a; }

/* Title + client — fixed stacking, no overlap */
.card-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.card-name {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}
.card-client {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Headline finding — the signature element */
.card-headline {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-mid);
  padding: 0.75rem 0.9rem;
  background: var(--bg);
  border-left: 2px solid var(--yellow);
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: border-color var(--transition);
}

.card-outcome {
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.55;
  flex-grow: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.tag {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--text-dim);
  border: 1px solid var(--border-mid);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius);
  letter-spacing: 0.04em;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.card-location {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}
.card-cta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  transition: color var(--transition);
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--surface);
}

/* ── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,25,22,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 800px;
  position: relative;
  margin: auto;
}
.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  font-family: var(--mono);
  transition: color var(--transition);
  z-index: 10;
}
.modal-close:hover { color: var(--text); }

.modal-content { padding: 2.5rem; }

.modal-eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.modal-entity-badge {
  font-family: var(--mono);
  font-size: 0.62rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#modal-title {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.35rem;
  line-height: 1.15;
}
.modal-client {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 1.75rem;
}

.modal-headline {
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-mid);
  padding: 1rem 1.25rem;
  background: var(--bg);
  border-left: 3px solid var(--yellow);
  margin-bottom: 2rem;
}

/* Infographic button */
.infographic-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 0.55rem 1rem;
  background: var(--yellow);
  color: var(--text-inv);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 1.75rem;
  transition: opacity var(--transition);
  font-weight: 500;
}
.infographic-btn:hover { opacity: 0.85; }
.infographic-btn::before { content: '↗'; font-size: 0.85rem; }

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 2.5rem;
}
@media (max-width: 640px) {
  .modal-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
}

.modal-section { margin-bottom: 1.75rem; }
.modal-section-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.modal-section p, .modal-section .body-text {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.7;
}
.modal-findings {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.modal-findings li {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.65;
  padding-left: 1.1rem;
  position: relative;
}
.modal-findings li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* Sidebar */
.modal-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.meta-block { display: flex; flex-direction: column; gap: 0.3rem; }
.meta-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.meta-value { font-size: 0.82rem; color: var(--text-mid); }
.meta-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.meta-tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  border: 1px solid var(--border-mid);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius);
}

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  background: var(--surface);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { padding: 3rem 1.25rem 2rem; gap: 2rem; }
  .hero-wrapper { width: 100%; }
  .filter-inner { padding: 1rem 1.25rem; }
  .results-bar { padding: 1rem 1.25rem 0.25rem; }
  .portfolio-grid { padding: 0 0 4rem; }
  .modal-content { padding: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
