/* ==========================================================================
   Mateo Van Thienen — Site Styles
   Font: prosaic-std (Adobe Typekit, kit jmw4utn) — brand typeface, unchanged
   ========================================================================== */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f7f8f7;
  --color-text: #1c211d;
  --color-text-muted: #5b645d;
  --color-border: #e4e7e3;
  --color-primary: #245127;
  --color-primary-dark: #17350f8f;
  --color-primary-light: #3f7a3f;
  --color-primary-tint: #eaf1e8;
  --color-accent: #b98b3e;
  --shadow-sm: 0 1px 3px rgba(20, 30, 20, 0.06), 0 1px 2px rgba(20, 30, 20, 0.08);
  --shadow-md: 0 8px 24px rgba(20, 30, 20, 0.08);
  --shadow-lg: 0 20px 48px rgba(20, 30, 20, 0.14);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --max-width: 1120px;
  --font-brand: "prosaic-std", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-brand);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  margin: 0 0 0.5em;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--color-text); }

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.75em;
}

.text-muted { color: var(--color-text-muted); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: #1a3b1c; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary-tint); }

/* ---------------- Navigation ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover { background: var(--color-primary-tint); color: var(--color-primary); }
.nav-links a.active { background: var(--color-primary); color: #fff; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-primary);
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    padding: 12px 24px 20px;
    display: none;
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; }
}

/* ---------------- Hero ---------------- */
.hero {
  padding: 72px 0 56px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.hero-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ---------------- Sections ---------------- */
.section { padding: 64px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------------- Cards (general) ---------------- */
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* ---------------- Skill chips / tag pills ---------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.chip.static {
  cursor: default;
  background: var(--color-primary-tint);
  border-color: transparent;
  color: var(--color-primary-dark);
  font-size: 0.72rem;
  padding: 4px 10px;
}

/* ---------------- Filter bar (portfolio & blog) ---------------- */
.filter-bar {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 36px;
}
.filter-group { margin-bottom: 16px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  display: block;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.select-input {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%235b645d'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 32px;
}
.select-input:hover { border-color: var(--color-primary); }
.select-input:focus { outline: 2px solid var(--color-primary-tint); border-color: var(--color-primary); }
.filter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.link-reset {
  font-weight: 700;
  color: var(--color-primary);
  cursor: pointer;
  background: none;
  border: none;
  font-size: 0.85rem;
  font-family: inherit;
}
.link-reset:hover { text-decoration: underline; }

/* ---------------- Portfolio grid ---------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.project-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.project-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg-alt);
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.project-card:hover .project-thumb img { transform: scale(1.05); }
.gallery-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(20, 25, 20, 0.62);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(2px);
}
.project-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.project-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.project-title { font-size: 1.05rem; margin-bottom: 6px; }
.project-desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--color-text-muted);
}

/* ---------------- Modal (project detail) ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 25, 20, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  z-index: 200;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
/* ---- Gallery (inside the modal) ---- */
.modal-gallery { background: var(--color-bg-alt); }
.modal-gallery-viewport {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg-alt);
  touch-action: pan-y;
}
.modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 25, 20, 0.45);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}
.gallery-nav:hover { background: rgba(20, 25, 20, 0.7); }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-counter {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(20, 25, 20, 0.55);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.gallery-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 12px 0;
  background: var(--color-bg-alt);
}
.gallery-dot {
  width: 34px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background 0.15s ease, transform 0.15s ease;
}
.gallery-dot.active::before {
  background: var(--color-primary);
  transform: scale(1.25);
}

@media (max-width: 520px) {
  .gallery-nav { width: 36px; height: 36px; font-size: 1.3rem; }
}

.modal-body { padding: 28px 32px 32px; }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.9);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.modal-inner { position: relative; }
.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin: 20px 0;
  padding: 16px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.modal-meta-grid div span {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

/* ---------------- Resume tabs ---------------- */
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 36px;
  overflow-x: auto;
}
.tab-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-muted);
  padding: 12px 6px;
  margin-right: 28px;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.tab-btn::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  background: transparent;
  border-radius: 3px;
}
.tab-btn.active { color: var(--color-primary); }
.tab-btn.active::after { background: var(--color-primary); }
.tab-panel { display: none; animation: fadeIn 0.25s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.timeline-item {
  padding: 22px 0;
  border-bottom: 1px solid var(--color-border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.timeline-role { font-size: 1.05rem; font-weight: 700; margin: 0; }
.timeline-org { color: var(--color-primary); font-weight: 600; font-size: 0.92rem; }
.timeline-date { font-size: 0.82rem; color: var(--color-text-muted); white-space: nowrap; }
.timeline-desc { margin-top: 8px; font-size: 0.92rem; color: var(--color-text-muted); }

/* ---- Grouped entries: multiple roles under one employer ---- */
.timeline-company {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 14px;
}
.timeline-subitem {
  position: relative;
  padding: 14px 0 14px 20px;
  border-left: 2px solid var(--color-border);
  margin-bottom: 4px;
}
.timeline-subitem::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
}
.timeline-subitem:last-of-type { margin-bottom: 0; }
.timeline-company-blurb {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--color-border);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--color-text-muted);
}

/* ---------------- Blog ---------------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.blog-card { padding: 24px; display: flex; flex-direction: column; height: 100%; }
.blog-source {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.blog-title { font-size: 1.1rem; margin-bottom: 10px; }
.blog-desc { font-size: 0.9rem; color: var(--color-text-muted); flex: 1; margin-bottom: 16px; }
.blog-read {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.blog-card:hover .blog-read { text-decoration: underline; }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 40px 0 32px;
  text-align: center;
  color: var(--color-text-muted);
}
.site-footer .footer-name {
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 4px;
}
.footer-fine { font-size: 0.78rem; margin-top: 12px; color: #9aa39b; }

/* ---------------- Utilities ---------------- */
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.stack-sm > * + * { margin-top: 8px; }
