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

:root {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --bg-card: #161b22;
  --border: #262c36;
  --text: #e6edf3;
  --text-dim: #9aa5b1;
  --accent: #4a9eff;
  --accent-soft: rgba(74, 158, 255, 0.12);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  --maxw: 900px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --bg-soft: #f6f8fa;
    --bg-card: #ffffff;
    --border: #d8dee4;
    --text: #1f2328;
    --text-dim: #59636e;
    --accent: #0969da;
    --accent-soft: rgba(9, 105, 218, 0.08);
  }
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout helpers ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0 1rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: var(--maxw); margin: 0 auto; padding: 0.9rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  font-family: var(--mono); font-weight: 700; font-size: 1.1rem;
  color: var(--text); text-decoration: none;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.25rem 0.55rem;
}
.nav-links a {
  color: var(--text-dim); text-decoration: none; margin-left: 1.4rem;
  font-size: 0.94rem; transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }

/* ---------- Hero ---------- */
.hero { max-width: var(--maxw); margin: 0 auto; padding: 5.5rem 1.5rem 3rem; }
.eyebrow {
  font-family: var(--mono); color: var(--accent);
  font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.12;
  letter-spacing: -0.02em; margin-bottom: 1.5rem; max-width: 20ch;
}
.lede { font-size: 1.12rem; color: var(--text-dim); max-width: 60ch; margin-bottom: 2rem; }
.lede strong { color: var(--text); font-weight: 600; }

.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.btn {
  display: inline-block; padding: 0.7rem 1.3rem; border-radius: 10px;
  font-size: 0.95rem; font-weight: 500; text-decoration: none;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.stack-strip {
  list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem;
  padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.stack-strip li {
  font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim);
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 0.25rem 0.6rem; border-radius: 6px;
}

/* ---------- Section headings ---------- */
.section-title { font-size: 1.6rem; letter-spacing: -0.01em; margin-bottom: 0.5rem; }
.section-sub { color: var(--text-dim); margin-bottom: 2rem; max-width: 55ch; }

/* ---------- Cards ---------- */
.cards { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .cards { grid-template-columns: 1fr 1fr; } }

.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.6rem;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.card:not(.card-soon):hover {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
}
.card-tag {
  font-family: var(--mono); font-size: 0.75rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.7rem;
}
.card h3 { font-size: 1.25rem; margin-bottom: 0.6rem; letter-spacing: -0.01em; }
.card p { color: var(--text-dim); font-size: 0.96rem; margin-bottom: 1rem; }
.card-link { color: var(--accent); font-weight: 500; font-size: 0.92rem; }
.card-link.muted { color: var(--text-dim); }
.card-soon { opacity: 0.72; }
.soon-badge {
  font-family: var(--mono); font-size: 0.65rem; vertical-align: middle;
  background: var(--accent-soft); color: var(--accent);
  padding: 0.15rem 0.45rem; border-radius: 5px; margin-left: 0.4rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* First card spans full width on 2-col */
@media (min-width: 700px) { .cards .card:first-child { grid-column: 1 / -1; } }

/* ---------- About ---------- */
.section-about { border-top: 1px solid var(--border); margin-top: 3rem; }
.about-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 750px) { .about-grid { grid-template-columns: 1.6fr 1fr; } }
.about-body p { margin-bottom: 1.1rem; color: var(--text-dim); }
.about-body strong { color: var(--text); }
.about-side {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem;
}
.about-side h4 {
  font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--accent); margin-bottom: 0.9rem;
}
.about-side ul { list-style: none; }
.about-side li {
  font-size: 0.9rem; color: var(--text-dim); padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.about-side li:last-child { border-bottom: none; }

/* ---------- Contact ---------- */
.section-contact { border-top: 1px solid var(--border); margin-top: 3rem; padding-bottom: 4rem; }
.contact-links { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.5rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); text-align: center;
  padding: 2rem 1.5rem; color: var(--text-dim); font-size: 0.85rem;
}
.footer-note { font-family: var(--mono); font-size: 0.75rem; margin-top: 0.3rem; opacity: 0.7; }

/* ---------- Article / case study ---------- */
.article { max-width: 720px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }
.article .back {
  font-family: var(--mono); font-size: 0.85rem; color: var(--accent);
  text-decoration: none; display: inline-block; margin: 0 0 2rem;
}
.article .back:hover { text-decoration: underline; }
.article-meta {
  font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.8rem;
}
.article h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 1rem; }
.article .subtitle { font-size: 1.1rem; color: var(--text-dim); font-style: italic; margin-bottom: 2.5rem; }
.article h2 {
  font-size: 1.35rem; margin: 2.5rem 0 0.9rem; letter-spacing: -0.01em;
  padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.article h3 { font-size: 1.1rem; margin: 1.6rem 0 0.6rem; }
.article p { margin-bottom: 1.1rem; color: var(--text); }
.article ul, .article ol { margin: 0 0 1.2rem 1.3rem; }
.article li { margin-bottom: 0.5rem; color: var(--text); }
.article blockquote {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 1rem 1.3rem; border-radius: 0 8px 8px 0; margin: 1.5rem 0;
  color: var(--text-dim); font-style: italic;
}
.article blockquote p:last-child { margin-bottom: 0; }
.article strong { color: var(--text); font-weight: 600; }
.article a { color: var(--accent); }

/* Markdown extras: code, tables, images, rules */
.article pre {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.1rem; overflow-x: auto; margin: 1.2rem 0;
}
.article pre code { font-family: var(--mono); font-size: 0.86rem; background: none; padding: 0; border: 0; }
.article :not(pre) > code {
  font-family: var(--mono); font-size: 0.85em;
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 0.1rem 0.4rem; border-radius: 5px;
}
.article table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; font-size: 0.92rem; display: block; overflow-x: auto; }
.article th, .article td { border: 1px solid var(--border); padding: 0.55rem 0.8rem; text-align: left; }
.article th { background: var(--bg-soft); font-weight: 600; }
.article img { max-width: 100%; height: auto; border-radius: 8px; }
.article hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* Mermaid diagrams */
.mermaid { margin: 1.5rem 0; text-align: center; }
.mermaid svg { max-width: 100%; height: auto; }

/* Convenience classes usable inside markdown (unsafe HTML enabled) */
.nda-note {
  font-size: 0.9rem; color: var(--text-dim); font-style: italic;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.9rem 1.1rem; margin: 1.5rem 0;
}
.skills-line {
  font-family: var(--mono); font-size: 0.85rem; color: var(--text-dim);
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 8px; padding: 1rem 1.2rem; margin-top: 2rem;
}
