/* Simple, professional styling for the whole site. */

:root {
  --text: #1f2530;
  --muted: #5b6472;
  --accent: #1d6fb8;
  --accent-dark: #15537d;
  --border: #e3e6ea;
  --bg-alt: #f6f8fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

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

h1 { font-size: 2.2rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.1rem; margin: 0 0 0.25rem; }

.section-number { color: var(--accent); margin-right: 0.5rem; font-weight: 600; }

/* Header / nav */
.site-header {
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.nav-name { font-weight: 700; font-size: 1.15rem; color: var(--text); }

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

.nav-links a { color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

/* Hero */
.hero {
  display: flex;
  gap: 2rem;
  align-items: center;
  padding: 3rem 0 1rem;
}

.headshot {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.tagline { color: var(--accent); font-weight: 600; margin: 0 0 0.75rem; }
.bio { max-width: 42rem; }

.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
}
.button:hover { background: var(--accent-dark); text-decoration: none; }

.button-secondary { background: var(--bg-alt); color: var(--text); border: 1px solid var(--border); }
.button-secondary:hover { background: var(--border); }

/* Cards (featured projects) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--bg-alt);
  color: inherit;
}

a.card:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

a.card h3 { color: var(--accent); }

.card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 0; }

.card-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  background: #fff;
}

/* Experience timeline */
.timeline { list-style: none; margin: 0; padding: 0; }

.timeline-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }

.timeline-dates {
  flex: 0 0 12rem;
  color: var(--muted);
  font-size: 0.9rem;
  padding-top: 0.2rem;
}

.timeline-org { color: var(--accent); font-weight: 500; margin: 0 0 0.25rem; }

.timeline li { list-style: none; }

a.timeline-link { color: inherit; }
a.timeline-link:hover { text-decoration: none; background: var(--bg-alt); }
a.timeline-link:hover h3 { color: var(--accent); }

/* Landing offset when arriving via an anchor link */
.timeline-item, .portfolio-item { scroll-margin-top: 1.5rem; }

/* Portfolio */
.portfolio-list { display: flex; flex-direction: column; gap: 2rem; margin-top: 1.5rem; }

.portfolio-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
}

.portfolio-item h2 { margin: 0 0 0.75rem; font-size: 1.35rem; }
.portfolio-text p { color: var(--muted); margin: 0 0 1rem; }

/* Uniform-height rows: each item keeps its natural aspect ratio, so
   wide charts and tall photos pack tightly side by side instead of
   being forced into equal-width cells. */
.media-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Heights are set per item as inline styles, arranged in the layout
   editor (/layout-editor/ in dev). object-fit keeps images undistorted
   if a narrow viewport caps their width. */
.media-grid img,
.media-grid video {
  width: auto;
  max-width: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
}

.media-grid iframe {
  aspect-ratio: 16 / 9;
  width: auto;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

@media (max-width: 640px) {
  .media-grid img,
  .media-grid video { height: auto !important; width: 100%; }
  .media-grid iframe { height: auto !important; width: 100%; }
}

/* Contact */
.contact-lead { font-size: 1.1rem; }

.social-links { list-style: none; padding: 0; display: flex; gap: 1.5rem; margin-top: 2rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Mobile */
@media (max-width: 640px) {
  .hero { flex-direction: column; text-align: center; padding-top: 2rem; }
  .hero-actions { justify-content: center; }
  .timeline-item { flex-direction: column; gap: 0.25rem; }
  .timeline-dates { flex: none; }
  .portfolio-item { flex-direction: column; }
  .portfolio-item img { width: 100%; height: auto; }
  .nav { flex-direction: column; gap: 0.75rem; }
}
