:root {
  --bg: #fdfdfc;
  --fg: #1f2328;
  --muted: #656d76;
  --accent: #0969da;
  --border: #e3e3e0;
  --code-bg: #f4f4f2;
  --code-fg: #24292f;
  --maxw: 46rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181d;
    --fg: #e6e6e3;
    --muted: #9aa4ae;
    --accent: #6cb0ff;
    --border: #2a2e35;
    --code-bg: #1d2027;
    --code-fg: #e6e6e3;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1.06rem/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

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

.site-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding-top: 1.75rem; padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border); margin-bottom: 2.5rem;
}
.site-title { font-weight: 700; font-size: 1.15rem; color: var(--fg); }
.site-header nav a { margin-left: 1rem; color: var(--muted); font-size: 0.95rem; }

.intro h1 { font-size: 2rem; margin: 0 0 0.4rem; }
.tagline { color: var(--muted); margin-top: 0; }

/* Home / landing hero */
.home-hero { padding: 1.5rem 0 0; }
.home-hero h1 { font-size: 2.5rem; line-height: 1.1; margin: 0 0 0.6rem; }
.home-hero .wave { display: inline-block; }
.home-tagline { font-size: 1.3rem; font-weight: 600; line-height: 1.35; margin: 0 0 1.4rem; }
.home-blurb { font-size: 1.08rem; margin: 0 0 1.9rem; }
.home-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 2rem; }
.home-links a {
  display: inline-block; padding: 0.6rem 1.15rem;
  border: 1px solid var(--accent); border-radius: 8px;
  font-weight: 600; font-size: 0.95rem;
}
.home-links a:hover { text-decoration: none; background: var(--accent); color: var(--bg); }
.home-now {
  font-size: 0.98rem; color: var(--muted);
  background: var(--code-bg); border-radius: 8px;
  padding: 0.75rem 0.95rem; margin: 0 0 1.4rem;
}
.home-now strong { color: var(--fg); }
.home-contact { font-size: 1.05rem; }

@media (prefers-reduced-motion: no-preference) {
  .home-hero .wave { animation: wave 1.8s ease-in-out 1; transform-origin: 70% 70%; }
  @keyframes wave {
    0%,60%,100% { transform: rotate(0deg); }
    10%,30% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    40% { transform: rotate(-4deg); }
  }
}

.post-list ul { list-style: none; padding: 0; }
.post-list li { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.post-list li a { font-size: 1.2rem; font-weight: 600; }
.post-list time { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.15rem; }
.post-list p { color: var(--muted); margin: 0.4rem 0 0; font-size: 0.98rem; }

.post-header h1 { font-size: 2.1rem; line-height: 1.2; margin-bottom: 0.4rem; }
.post-meta { color: var(--muted); font-size: 0.9rem; }
.draft-badge { color: #b35900; font-weight: 700; }
.tags { list-style: none; padding: 0; margin: 0.75rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li { font-size: 0.78rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0.1rem 0.6rem; }

.post-content { margin-top: 2rem; }
.post-content h2 { margin-top: 2.2rem; font-size: 1.45rem; }
.post-content h3 { margin-top: 1.6rem; font-size: 1.2rem; }
.post-content img { max-width: 100%; height: auto; }
.post-content blockquote {
  margin: 1.2rem 0; padding: 0.2rem 1rem; color: var(--muted);
  border-left: 3px solid var(--border);
}
.post-content table {
  border-collapse: collapse; width: 100%; margin: 1.75rem 0;
  font-size: 0.97rem;
}
.post-content th, .post-content td {
  padding: 0.7rem 0.95rem; border-bottom: 1px solid var(--border);
  text-align: left; vertical-align: top;
}
.post-content thead th { font-weight: 600; border-bottom: 2px solid var(--border); }
.post-content tbody tr:last-child td { border-bottom: none; }

code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--code-bg); color: var(--code-fg);
  padding: 0.12em 0.35em; border-radius: 4px;
}
pre {
  background: var(--code-bg); color: var(--code-fg);
  padding: 1rem; border-radius: 8px; overflow-x: auto;
  border: 1px solid var(--border); line-height: 1.5;
}
pre code { background: none; padding: 0; font-size: 0.86rem; }
.highlight, .chroma { background: var(--code-bg) !important; border-radius: 8px; }

/* Projects list, grouped by personal / client */
.project-group { margin-bottom: 2.75rem; }
.project-group > h2 {
  font-size: 1.35rem; margin-bottom: 0.25rem;
  padding-bottom: 0.4rem; border-bottom: 1px solid var(--border);
}
.project-list { list-style: none; padding: 0; margin: 0; }
.project-list li { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.project-title-row { display: flex; align-items: center; gap: 0.45rem 0.75rem; flex-wrap: wrap; }
.project-title { font-size: 1.2rem; font-weight: 600; }
.project-list .project-category { display: block; color: var(--muted); font-size: 0.85rem; margin: 0.35rem 0 0; }
.project-list .project-dates { display: block; color: var(--muted); font-size: 0.8rem; margin: 0.1rem 0 0; }
.project-list p { color: var(--muted); margin: 0.5rem 0 0; font-size: 0.98rem; }

/* Shared "Visit live site" button */
.project-live {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.3rem; line-height: 1.2; white-space: nowrap; font-size: 0.85rem;
  border: 1px solid var(--accent); border-radius: 6px;
  padding: 0.48rem 0.75rem 0.32rem; /* extra top / less bottom to optically center text */
}
.project-live:hover { text-decoration: none; background: var(--code-bg); }
.project-list .project-live { margin-left: auto; }

/* Status key (legend) + colored dots */
.status-key {
  list-style: none; display: flex; flex-wrap: wrap; gap: 1.1rem;
  padding: 0; margin: 1.25rem 0 2.5rem; font-size: 0.85rem; color: var(--muted);
}
.status-key li { white-space: nowrap; }
.status-key .dot { margin-right: 0.32rem; }
.dot {
  display: inline-block; width: 0.6rem; height: 0.6rem;
  border-radius: 50%; background: var(--muted); margin-right: 0.4rem;
  /* middle = x-height center; raise ~half the cap/x-height gap to center on capitals */
  vertical-align: middle; position: relative; top: -0.1em;
}
.dot-ongoing    { background: #1a7f37; }
.dot-maintained { background: var(--accent); }
.dot-completed  { background: #b5179e; }
.dot-dormant    { background: #9a6700; }
@media (prefers-color-scheme: dark) {
  .dot-ongoing { background: #4ac26b; }
  .dot-completed { background: #e879f9; }
  .dot-dormant { background: #d4a72c; }
}

/* Status label (project single page) — plain colored text, no box */
.status {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--muted); vertical-align: middle;
}
.status-ongoing    { color: #1a7f37; }
.status-maintained { color: var(--accent); }
.status-completed  { color: #b5179e; }
.status-dormant    { color: #9a6700; }
@media (prefers-color-scheme: dark) {
  .status-ongoing { color: #4ac26b; }
  .status-completed { color: #e879f9; }
  .status-dormant { color: #d4a72c; }
}
.project-dates { color: var(--muted); font-size: 0.8rem; margin-left: 0.55rem; }

/* Project single page */
.project-header h1 { font-size: 2.1rem; line-height: 1.2; margin-bottom: 0.4rem; }
.project-meta { color: var(--muted); font-size: 0.9rem; margin: 0.2rem 0; }
.project-stack { color: var(--muted); font-size: 0.85rem; margin: 0.2rem 0; }
.project-header .project-live { margin: 0.6rem 0 0; padding: 0.52rem 0.8rem 0.38rem; font-size: 0.9rem; }
.project-timing { margin: 0.3rem 0; }
.project-header .project-dates,
.project-header .status { margin-left: 0; margin-right: 0.55rem; }

/* Project timeline / version history */
.project-timeline { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.project-timeline h2 { font-size: 1.35rem; margin-bottom: 1rem; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: flex; gap: 1rem; padding: 0 0 1.1rem 1rem;
  border-left: 2px solid var(--border); position: relative;
}
.timeline li::before {
  content: ""; position: absolute; left: -0.4rem; top: 0.35rem;
  width: 0.6rem; height: 0.6rem; border-radius: 50%;
  background: var(--accent);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline-date { flex: 0 0 6.5rem; color: var(--muted); font-size: 0.85rem; padding-top: 0.1rem; }
.timeline-body strong { display: block; }
.timeline-body p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.95rem; }

.site-footer {
  margin-top: 4rem; padding: 2rem 0; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.85rem;
}
