/* =============================================
   Portfolio Stylesheet — Matcha Pastel Green
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  background-color: #f2f7f2;
  color: #1a261a;
  line-height: 1.6;
  min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.25;
  color: #1a261a;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

p {
  color: #3a4f3a;
  font-size: 0.95rem;
}

a {
  color: #4a7c59;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #2e5c3e;
  text-decoration: underline;
}

code {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.85em;
  background-color: #deeede;
  color: #2e5c3e;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* --- Layout --- */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Header --- */
header {
  padding: 3rem 0 2rem;
  border-bottom: 2px solid #c6ddc6;
  background-color: #e4f0e4;
}

header .container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

header h1 {
  font-size: 2.25rem;
  color: #1a261a;
}

header p.subtitle {
  color: #4a7c59;
  font-size: 1rem;
  font-weight: 600;
}

/* --- Main Content --- */
main {
  padding: 3rem 0;
}

/* --- Section --- */
.section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7aaa8a;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #c6ddc6;
}

/* --- Project List --- */
.project-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* --- Project Item --- */
.project-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid #d4e8d4;
  scroll-margin-top: 2rem;
}

.project-item:first-child {
  padding-top: 0.25rem;
}

.project-item:last-child {
  border-bottom: none;
}

/* --- Project Anchor Link (the # glyph) --- */
.project-anchor {
  font-size: 1rem;
  font-weight: 700;
  color: #a8cca8;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
  margin-right: 0.35rem;
  user-select: none;
  flex-shrink: 0;
}

.project-item:hover .project-anchor,
.project-item:target .project-anchor {
  opacity: 1;
}

.project-anchor:hover {
  color: #4a7c59;
  text-decoration: none;
}

/* Highlight the item when navigated to via anchor */
.project-item:target {
  background-color: #edf6ed;
  border-radius: 8px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

/* --- Project Main Content --- */
.project-main {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}

.project-heading {
  display: flex;
  align-items: baseline;
  gap: 0;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1a261a;
}

.project-description {
  font-size: 0.9rem;
  color: #3d553d;
  line-height: 1.65;
}

/* --- Tag Chips --- */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.tag {
  display: inline-block;
  background-color: #deeede;
  color: #3a6b4a;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

/* --- Project Meta (right column) --- */
.project-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.project-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: #4a7c59;
  white-space: nowrap;
  text-decoration: none;
  border: 1.5px solid #a8cca8;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.project-link:hover {
  background-color: #e4f0e4;
  border-color: #4a7c59;
  color: #2e5c3e;
  text-decoration: none;
}

.project-link--static {
  color: #7aaa8a;
  border-color: #c6ddc6;
  cursor: default;
  font-style: italic;
  font-weight: 600;
}

.project-link--static:hover {
  background-color: transparent;
  border-color: #c6ddc6;
  color: #7aaa8a;
}

/* --- AI Callout Paragraphs --- */
.project-description--callout {
  background-color: #e8f4e8;
  border-left: 3px solid #7aaa8a;
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
  color: #2e4a2e;
}

/* --- Project Screenshot --- */
.project-screenshot {
  margin-top: 1.25rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid #c6ddc6;
  background-color: #e4f0e4;
  width: 100%;
}

.project-screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

/* --- Grafana Embed --- */
.grafana-embed {
  margin-top: 1.25rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid #c6ddc6;
  background-color: #e4f0e4;
  width: 100%;
}

.grafana-embed iframe {
  display: block;
  width: 100%;
  height: 480px;
  border: none;
}

/* --- Footer --- */
footer {
  padding: 1.5rem 0;
  border-top: 2px solid #c6ddc6;
  background-color: #e4f0e4;
  text-align: center;
}

footer p {
  font-size: 0.85rem;
  color: #7aaa8a;
  font-weight: 600;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  h1 { font-size: 1.75rem; }

  .project-item {
    flex-direction: column;
    gap: 1rem;
  }

  .project-meta {
    align-items: flex-start;
  }

  .grafana-embed iframe {
    height: 360px;
  }
}
