/* ==========================================================
   Moses Njehu — portfolio
   Dark developer-terminal style: charcoal canvas, one lime
   accent, editor syntax colours, 1px hairlines, no shadows.
   ========================================================== */

:root {
  /* surfaces */
  --canvas: #1c1e21;
  --ink: #121317;
  --steel: #272a2e;
  --graphite: #3b3e45;

  /* text */
  --bone: #e5e7eb;
  --cloud: #d7d9dd;
  --ash: #b5b8c0;
  --fog: #878c99;

  /* accent */
  --lime: #a8ff53;
  --lime-dim: rgba(168, 255, 83, 0.12);

  /* syntax */
  --violet: #9c9af2;
  --pink: #fa3abf;
  --event: #7655fd;
  --green: #afec73;
  --keylime: #d9f07c;
  --magenta: #e888f8;
  --red: #f43f5e;

  --font-display: "Satoshi", "General Sans", "Inter", system-ui, sans-serif;
  --font-body: "Geist", "Inter", system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  --radius: 4px;
  --max: 1200px;
  --gutter: 24px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--fog);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.56;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--lime); color: var(--ink); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--bone);
  margin: 0;
}

.mono { font-family: var(--font-mono); font-size: 14px; line-height: 1.43; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(28, 30, 33, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--steel);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; color: var(--bone); }
.brand-mark { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 14px solid var(--lime); }
.brand span { color: var(--fog); font-weight: 400; }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-size: 14px; color: var(--cloud); transition: color .15s; }
.nav-links a:hover, .nav-links a.active { color: var(--lime); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.menu-btn { display: none; background: none; border: 1px solid var(--steel); color: var(--cloud); border-radius: var(--radius); width: 38px; height: 38px; cursor: pointer; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 500; font-size: 15px;
  padding: 10px 18px; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s; white-space: nowrap;
}
.btn-primary { background: var(--lime); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.btn-primary:hover { background: #bbff7a; }
.btn-ghost { background: transparent; color: var(--cloud); border-color: var(--graphite); }
.btn-ghost:hover { color: var(--bone); border-color: var(--fog); }
.btn-sm { padding: 7px 14px; font-size: 14px; }

/* ---------- pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 9999px; border: 1px solid var(--steel);
  color: var(--bone); font-size: 14px; background: rgba(255,255,255,0.02);
}
.pill i { font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(168,255,83,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(168,255,83,.5); } 70% { box-shadow: 0 0 0 8px rgba(168,255,83,0); } 100% { box-shadow: 0 0 0 0 rgba(168,255,83,0); } }

/* ---------- section scaffolding ---------- */
section { padding: 112px 0; border-top: 1px solid var(--steel); }
.eyebrow { font-family: var(--font-mono); font-size: 14px; color: var(--lime); margin-bottom: 16px; display: block; }
.section-title { font-size: 36px; line-height: 1.2; letter-spacing: 0.05em; max-width: 760px; }
.section-lead { font-size: 18px; line-height: 1.5; max-width: 640px; margin: 16px 0 0; }
.section-head { margin-bottom: 64px; }

/* ---------- hero ---------- */
.hero { padding: 96px 0 112px; border-top: none; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--steel) 1px, transparent 1px), linear-gradient(90deg, var(--steel) 1px, transparent 1px);
  background-size: 48px 48px; opacity: .35;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 80%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.25fr 1fr; gap: 64px; align-items: center; }
.hero h1 { font-size: 60px; line-height: 1.05; letter-spacing: 0.02em; font-weight: 600; margin: 24px 0; }
.hero h1 em { font-style: normal; color: var(--lime); }
.hero-sub { font-size: 18px; line-height: 1.6; color: var(--ash); max-width: 560px; margin: 0 0 32px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 40px; font-size: 14px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta i { color: var(--fog); }

.typed { color: var(--bone); }
.caret { display: inline-block; width: 9px; height: 1.05em; background: var(--lime); vertical-align: -2px; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* window chrome (shared by panes) */
.window { background: var(--ink); border: 1px solid var(--steel); border-radius: var(--radius); overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--steel); font-family: var(--font-mono); font-size: 12px; color: var(--fog); }
.window-bar .lights { display: flex; gap: 6px; margin-right: 6px; }
.window-bar .lights i { width: 10px; height: 10px; border-radius: 50%; background: var(--graphite); display: block; }
.window-bar .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window-bar .tag { color: var(--lime); }

.portrait .photo { position: relative; aspect-ratio: 4 / 4.6; overflow: hidden; }
.portrait .photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.portrait .photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(18,19,23,.75), transparent 40%); }
.portrait .whoami { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1; color: var(--cloud); }
.portrait .whoami b { color: var(--lime); font-weight: 400; }

/* ---------- pipeline ---------- */
.stage-track {
  position: sticky; top: 64px; z-index: 40;
  background: rgba(28, 30, 33, 0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--steel); margin-bottom: 48px;
}
.stage-track ol { list-style: none; margin: 0; padding: 14px 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.stage-track ol::-webkit-scrollbar { display: none; }
.stage-track li { flex: 1; min-width: 120px; }
.stage-track a { display: block; font-family: var(--font-mono); font-size: 13px; color: var(--fog); padding-top: 10px; border-top: 2px solid var(--steel); transition: color .2s, border-color .2s; }
.stage-track a b { color: var(--graphite); font-weight: 400; margin-right: 6px; transition: color .2s; }
.stage-track a.done { border-color: var(--graphite); color: var(--ash); }
.stage-track a.current { border-color: var(--lime); color: var(--bone); }
.stage-track a.current b { color: var(--lime); }

.stages { position: relative; }
.stage { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; align-items: center; padding: 56px 0; }
.stage:nth-child(even) .stage-copy { order: 2; }
.stage-num { font-family: var(--font-mono); font-size: 14px; color: var(--fog); display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.stage-num::after { content: ""; flex: 0 0 48px; height: 1px; background: var(--graphite); }
.stage-num b { color: var(--lime); font-weight: 400; }
.stage h3 { font-size: 30px; line-height: 1.33; letter-spacing: 0.025em; margin-bottom: 16px; }
.stage p { margin: 0 0 20px; }
.stage ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stage li { display: flex; gap: 12px; font-size: 15px; color: var(--ash); }
.stage li::before { content: "→"; color: var(--lime); font-family: var(--font-mono); }

/* code */
.code { margin: 0; padding: 20px; font-family: var(--font-mono); font-size: 14px; line-height: 1.6; color: var(--cloud); overflow-x: auto; white-space: pre; tab-size: 2; }
.code .ln { color: var(--graphite); user-select: none; display: inline-block; width: 2.2em; }
.k { color: var(--violet); }
.s { color: var(--pink); }
.t { color: var(--green); }
.v { color: var(--keylime); }
.p { color: var(--magenta); }
.c { color: var(--fog); }
.f { color: var(--bone); }
.ok { color: var(--lime); }
.err { color: var(--red); }
.dim { color: var(--fog); }

/* ideation board */
.board { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.note { border: 1px solid var(--steel); border-radius: var(--radius); padding: 14px; background: var(--canvas); font-size: 14px; color: var(--ash); }
.note b { display: block; font-family: var(--font-mono); font-size: 12px; font-weight: 400; margin-bottom: 8px; }
.note.wide { grid-column: span 2; }
.note.pain b { color: var(--red); }
.note.need b { color: var(--violet); }
.note.idea { border-color: rgba(168,255,83,.35); }
.note.idea b { color: var(--lime); }

/* architecture diagram */
.arch { padding: 16px; }
.arch svg { width: 100%; height: auto; display: block; }
.arch .node rect { fill: var(--canvas); stroke: var(--graphite); }
.arch .node text { fill: var(--bone); font-family: var(--font-mono); font-size: 13px; }
.arch .node text.sub { fill: var(--fog); font-size: 11px; }
.arch .node.hot rect { stroke: var(--lime); }
.arch .edge { stroke: var(--graphite); stroke-width: 1.5; fill: none; }
.arch .flow { stroke: var(--lime); stroke-width: 1.5; fill: none; stroke-dasharray: 4 10; animation: flow 1.4s linear infinite; }
.arch .flow.v { stroke: var(--violet); }
.arch .flow.m { stroke: var(--magenta); }
.arch .label { fill: var(--fog); font-family: var(--font-mono); font-size: 10px; }
@keyframes flow { to { stroke-dashoffset: -28; } }

/* terminal lines appear one by one */
.term { padding: 20px; font-family: var(--font-mono); font-size: 14px; line-height: 1.7; color: var(--cloud); min-height: 300px; }
.term .line { opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s; white-space: pre-wrap; }
.term.play .line { opacity: 1; transform: none; }
.bar-progress { display: inline-block; width: 140px; height: 8px; background: var(--steel); vertical-align: middle; border-radius: 2px; overflow: hidden; }
.bar-progress i { display: block; height: 100%; width: 0; background: var(--lime); transition: width 1.6s ease; }
.term.play .bar-progress i { width: 100%; }

/* product browser */
.browser .url { flex: 1; background: var(--canvas); border: 1px solid var(--steel); border-radius: 9999px; padding: 4px 12px; color: var(--ash); display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; }
.browser .url i { color: var(--lime); font-size: 11px; }
.browser .shot { aspect-ratio: 16 / 10; overflow: hidden; position: relative; }
.browser .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 6s ease; }
.browser:hover .shot img { transform: translateY(-8%); }
.browser .live { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 8px; background: var(--ink); border: 1px solid var(--steel); border-radius: 9999px; padding: 4px 12px; font-family: var(--font-mono); font-size: 12px; color: var(--bone); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--steel); border-radius: var(--radius); }
.stat { padding: 32px 28px; border-right: 1px solid var(--steel); }
.stat:last-child { border-right: none; }
.stat strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 48px; line-height: 1.1; letter-spacing: 0.03em; color: var(--bone); }
.stat strong sup { color: var(--lime); font-size: 28px; vertical-align: top; margin-left: 2px; }
.stat span { font-size: 14px; }

/* ---------- experience ---------- */
.jobs { display: grid; gap: 0; border-top: 1px solid var(--steel); }
.job { display: grid; grid-template-columns: 260px 1fr; gap: 48px; padding: 40px 0; border-bottom: 1px solid var(--steel); }
.job-when { font-family: var(--font-mono); font-size: 13px; line-height: 1.6; }
.job-when .now { display: inline-flex; align-items: center; gap: 8px; color: var(--lime); margin-bottom: 6px; }
.job h3 { font-size: 24px; line-height: 1.38; }
.job h3 span { color: var(--fog); font-weight: 500; }
.job .ctx { font-size: 14px; margin: 4px 0 16px; }
.job ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.job li { position: relative; padding-left: 20px; color: var(--ash); font-size: 15px; }
.job li::before { content: ""; position: absolute; left: 0; top: 10px; width: 8px; height: 1px; background: var(--lime); }
.job .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tag-chip { font-family: var(--font-mono); font-size: 12px; color: var(--ash); border: 1px solid var(--steel); border-radius: var(--radius); padding: 2px 8px; }

/* ---------- work ---------- */
.case { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; padding: 48px 0; border-bottom: 1px solid var(--steel); }
.case:first-of-type { padding-top: 0; }
.case h3 { font-size: 30px; line-height: 1.33; letter-spacing: 0.025em; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.case .lede { color: var(--ash); margin: 12px 0 20px; }
.case .facts { display: flex; gap: 24px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 13px; margin-bottom: 20px; }
.case .facts b { color: var(--bone); font-weight: 400; }
.case ul { margin: 0 0 24px; padding: 0; list-style: none; display: grid; gap: 12px; }
.case li { padding-left: 20px; position: relative; font-size: 15px; color: var(--ash); }
.case li::before { content: "▸"; position: absolute; left: 0; color: var(--lime); font-size: 12px; top: 2px; }
.case li b { color: var(--bone); font-weight: 500; }
.live-pill { font-family: var(--font-mono); font-size: 12px; color: var(--lime); border: 1px solid rgba(168,255,83,.35); border-radius: 9999px; padding: 2px 10px; letter-spacing: 0; display: inline-flex; align-items: center; gap: 6px; }

.grid-title { font-size: 20px; letter-spacing: .02em; margin: 72px 0 24px; }
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project { display: flex; flex-direction: column; background: var(--canvas); border: 1px solid var(--steel); border-radius: var(--radius); overflow: hidden; transition: border-color .15s; }
.project:hover { border-color: var(--graphite); }
.project .thumb { aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--steel); background: var(--ink); }
.project .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; filter: saturate(.85); transition: transform .4s, filter .4s; }
.project:hover .thumb img { transform: scale(1.03); filter: none; }
.project .body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project h4 { font-size: 20px; line-height: 1.4; letter-spacing: .02em; }
.project p { margin: 0; font-size: 15px; flex: 1; }
.project .stack { font-family: var(--font-mono); font-size: 12px; color: var(--violet); }
.project .link { font-size: 14px; color: var(--cloud); display: inline-flex; gap: 8px; align-items: center; margin-top: 6px; cursor: pointer; }
.project .link:hover { color: var(--lime); }
.project details { font-family: var(--font-mono); font-size: 12px; }
.project summary { cursor: pointer; color: var(--fog); }
.project details p { font-size: 12px; margin-top: 6px; color: var(--ash); }

/* ---------- stack ---------- */
.stack-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; }
.stack-groups { display: grid; gap: 28px; }
.stack-group h4 { font-family: var(--font-mono); font-size: 13px; font-weight: 400; color: var(--fog); margin-bottom: 12px; letter-spacing: .04em; text-transform: uppercase; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- writing ---------- */
.post { display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: center; border: 1px solid var(--steel); border-radius: var(--radius); padding: 24px; transition: border-color .15s; }
.post:hover { border-color: var(--graphite); }
.post img { border-radius: var(--radius); aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.post h4 { font-size: 24px; margin: 8px 0; }
.post p { margin: 0 0 12px; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: start; }
.contact h2 { font-size: 48px; line-height: 1.11; letter-spacing: .04em; font-weight: 600; }
.contact h2 em { font-style: normal; color: var(--lime); }
.contact-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--steel); }
.contact-list li { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--steel); font-size: 15px; }
.contact-list .key { font-family: var(--font-mono); font-size: 13px; color: var(--fog); }
.contact-list .val { color: var(--bone); text-align: right; }
.contact-list a.val:hover { color: var(--lime); }
.socials { display: flex; gap: 10px; margin-top: 24px; }
.socials a { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--steel); border-radius: var(--radius); color: var(--cloud); transition: color .15s, border-color .15s; }
.socials a:hover { color: var(--lime); border-color: var(--graphite); }

footer { border-top: 1px solid var(--steel); padding: 28px 0; font-size: 14px; }
footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .term .line { opacity: 1 !important; transform: none !important; transition: none !important; }
  .arch .flow, .dot, .caret { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid, .stage, .case, .stack-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .stage:nth-child(even) .stage-copy { order: 0; }
  .portrait { max-width: 440px; }
  .projects { grid-template-columns: repeat(2, 1fr); }
  .job { grid-template-columns: 1fr; gap: 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--steel); }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  section { padding: 80px 0; }
  .hero { padding: 56px 0 80px; }
  .hero h1 { font-size: 40px; }
  .section-title { font-size: 28px; letter-spacing: .03em; }
  .contact h2 { font-size: 36px; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--canvas); border-bottom: 1px solid var(--steel); padding: 8px 16px; }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px 0; font-size: 16px; }
  .menu-btn { display: inline-grid; place-items: center; }
  .nav-actions .btn { display: none; }
  .projects { grid-template-columns: 1fr; }
  .post { grid-template-columns: 1fr; }
  .stat { padding: 24px 20px; }
  .stat strong { font-size: 36px; }
  .board { grid-template-columns: 1fr; }
  .note.wide { grid-column: auto; }
  .code, .term { font-size: 12.5px; }
  .contact-list li { flex-direction: column; gap: 4px; }
  .contact-list .val { text-align: left; }
}

/* keep wide code panes from stretching grid columns */
.hero-grid > *, .stage > *, .case > *, .stack-grid > *, .contact-grid > *, .job > * { min-width: 0; }
.stage:nth-child(even) { grid-template-columns: 1.2fr 1fr; }
.browser .shot img.contain { object-fit: contain; background: var(--ink); }
.case .browser { position: sticky; top: 96px; }
@media (max-width: 1000px) {
  .stage:nth-child(even) { grid-template-columns: 1fr; }
  .case .browser { position: static; }
}
