*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f9f9f9;
  color: #1a1a1a;
  line-height: 1.7;
}

/* ── Header ── */
header {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 1rem;
}

.site-title {
  font-weight: 600;
  font-size: 1rem;
  color: #1a1a1a;
  white-space: nowrap;
  text-decoration: none;
}

.site-title:hover { color: #333; }

nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  text-decoration: none;
  color: #555;
  font-size: 0.875rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

nav a:hover, nav a.active {
  color: #1a1a1a;
  border-bottom-color: #1a1a1a;
}

/* ── Main layout ── */
main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

/* ── Intro paragraph ── */
p.intro {
  font-size: 1rem;
  color: #333;
  margin-bottom: 2rem;
  max-width: 860px;
  hyphens: none;
  word-break: normal;
  overflow-wrap: break-word;
}

/* ── Projects grid ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

/* ── Project card ── */
.project-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
}

.project-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f0f0f0;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.card-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
  color: #1a1a1a;
}

.project-card p {
  font-size: 0.875rem;
  color: #555;
  flex-grow: 1;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0066cc;
  margin-top: auto;
}

/* ── Live dashboard embed ── */
.dashboard-embed {
  position: relative;
  width: 100%;
  padding-top: 62%; /* 16:10 ratio typical for Looker Studio */
  margin-bottom: 2.5rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  background: #f9f9f9;
}

.dashboard-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── General content styles (dashboard pages) ── */
.content h1 { font-size: 2rem; margin-bottom: 1rem; }
.content h2 { font-size: 1.4rem; margin: 2rem 0 0.75rem; }
.content h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.content p { margin-bottom: 1rem; color: #333; }
.content a { color: #0066cc; text-decoration: underline; }
.content ul, .content ol { margin: 0.75rem 0 1rem 1.5rem; }
.content li { margin-bottom: 0.25rem; }
.content img { max-width: 100%; border-radius: 8px; margin: 1rem 0; }
.content code { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; font-size: 0.9em; }
.content pre { background: #f0f0f0; padding: 1rem; border-radius: 6px; overflow-x: auto; margin: 1rem 0; }
.content blockquote { border-left: 3px solid #ddd; padding-left: 1rem; color: #555; margin: 1rem 0; }
.content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.content th, .content td { padding: 0.5rem 0.75rem; border: 1px solid #ddd; text-align: left; }
.content th { background: #f5f5f5; font-weight: 600; }

/* ── Footer ── */
footer {
  height: 2rem;
}

/* ── Responsive: tablet (2 columns) ── */
@media (max-width: 900px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  nav { gap: 1rem; }
  nav a { font-size: 0.8rem; }
}

/* ── Responsive: mobile (1 column) ── */
@media (max-width: 540px) {
  .projects-grid { grid-template-columns: 1fr; }

  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 0.75rem 0;
    gap: 0.5rem;
  }

  nav { justify-content: center; }
  main { padding: 1.5rem 1rem 3rem; }
}
