/* Mark Njeru — personal site. Hermes-inspired: cobalt field, serif display,
   mono meta labels, square edges, hairlines, grain + ghost type. Plain CSS. */

:root {
  --blue: #0000f2;
  --paper: #ffffff;
  --ink: #0a0a2e;
  --offwhite: #f5f5f5;
  --accent: #edff45;
  --navy: #00008f;
  --layer: rgba(255, 255, 255, 0.09);
  --grey: #eceaf5;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Archivo", system-ui, -apple-system, sans-serif;
  --font-cond: "Archivo Narrow", "Arial Narrow", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "Courier New", monospace;
  --frame: 10px;
  --gutter: clamp(20px, 6vw, 90px);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

a, .btn { -webkit-tap-highlight-color: transparent; }

body {
  background: var(--blue);
  color: var(--offwhite);
  font-family: var(--font-body);
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Viewport frame */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  border: var(--frame) solid var(--blue);
  pointer-events: none;
  z-index: 100;
}

::selection { background: var(--accent); color: var(--blue); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(245, 245, 245, 0.65); }

a { color: inherit; }
img { max-width: 100%; }

/* ---------- Type utilities ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  opacity: 0.85;
  margin-bottom: 20px;
}
.eyebrow-blue { color: var(--blue); }

.mono-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  opacity: 0.7;
  margin-bottom: 8px;
}

.ghost {
  position: absolute;
  top: 24px;
  right: 0;
  font-family: var(--font-display);
  font-size: clamp(120px, 22vw, 340px);
  line-height: 0.8;
  letter-spacing: 0.03em;
  color: var(--accent);
  opacity: 0.2;
  mix-blend-mode: exclusion;
  pointer-events: none;
  user-select: none;
  text-transform: uppercase;
}
.ghost-blue { color: var(--blue); opacity: 0.08; mix-blend-mode: normal; }

/* ---------- Grain ---------- */
.hero::after, .blue::after, .footer::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--noise);
  background-size: 12.8rem 12.8rem;
  mix-blend-mode: color-burn;
  opacity: 0.2;
  pointer-events: none;
}

/* ---------- Nav ---------- */
.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 28px var(--gutter) 0;
  font-family: var(--font-cond);
  letter-spacing: 0.06em;
  position: relative;
  z-index: 5;
}
.brand {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-transform: uppercase;
}
.nav-links { display: flex; gap: 28px; font-size: 14px; }
.nav-links a { text-decoration: none; opacity: 0.85; }
.nav-links a:hover { opacity: 1; text-decoration: underline; }
.nav .btn { justify-self: end; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  min-height: 36px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-light { background: var(--offwhite); color: var(--blue); }
.btn-light:hover { background: var(--accent); color: var(--blue); }
.btn-ghost { border-color: var(--offwhite); color: var(--offwhite); }
.btn-ghost:hover { background: var(--layer); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 80px var(--gutter) 90px;
  overflow: clip;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  min-height: 520px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-title { margin: 0 0 24px; }
.hero-title > span {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(72px, 11vw, 180px);
  line-height: 0.85;
  letter-spacing: 0.03em;
}
.hero-roles {
  font-family: var(--font-cond);
  font-size: clamp(16px, 1.6vw, 22px);
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.hero-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  opacity: 0.8;
  margin-bottom: 30px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Terminal */
.terminal { max-width: 450px; margin-bottom: 34px; }
.terminal-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}
.terminal-panel {
  background: var(--navy);
  border-radius: 6px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  text-transform: none;
  letter-spacing: 0;
}
.terminal-panel code { display: block; white-space: nowrap; overflow-x: auto; }
.prompt { color: var(--accent); }
.dim { opacity: 0.75; }
.dim a { color: inherit; }

.hero-stats { display: grid; gap: 0; max-width: 450px; border-top: 1px solid var(--offwhite); }
.hero-stats > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--offwhite);
}
.hero-stats dt { font-family: var(--font-display); font-size: 40px; line-height: 1; }
.hero-stats dd { font-family: var(--font-cond); font-size: 14px; letter-spacing: 0.06em; opacity: 0.9; }

/* ---------- Marquee ---------- */
.marquee {
  border-top: 1px solid var(--offwhite);
  border-bottom: 1px solid var(--offwhite);
  overflow: hidden;
  padding: 12px 0;
  position: relative;
  z-index: 1;
}
.marquee-track { display: flex; width: max-content; animation: slide 28s linear infinite; }
.marquee-track span {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { position: relative; padding: 140px var(--gutter) 100px; overflow: clip; }
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 5.5vw, 88px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  max-width: 16ch;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
}
.lede {
  font-size: 17px;
  line-height: 1.5;
  max-width: 620px;
  text-transform: none;
  letter-spacing: 0;
  position: relative;
  z-index: 1;
}
.paper { background: var(--paper); color: var(--ink); }
.paper .section-title { color: var(--blue); }
.blue { background: var(--blue); color: var(--offwhite); }

/* ---------- Cards ---------- */
.cards-3, .cards-2 {
  display: grid;
  gap: 40px;
  position: relative;
  z-index: 1;
  margin-top: 50px;
}
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  border-top: 1px solid currentColor;
  padding-top: 22px;
  position: relative;
}
.card-index {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  opacity: 0.8;
}
.card h3 {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.card p, .card li {
  font-size: 14px;
  line-height: 1.55;
  text-transform: none;
  letter-spacing: 0;
}
.card ul { list-style: none; display: grid; gap: 12px; }
.card li { border-top: 1px dotted currentColor; padding-top: 12px; }
.card li:first-child { border-top: 0; padding-top: 0; }
.card-blue h3 { color: var(--blue); }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  background: var(--blue);
  padding: 120px var(--gutter) 40px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: clip;
}
.footer > *:not(.ghost) { position: relative; z-index: 1; }
.footer-title { margin: 10px 0 24px; }
.footer-title > span {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(64px, 14vw, 220px);
  line-height: 0.85;
  letter-spacing: 0.03em;
}
.footer-line {
  font-family: var(--font-cond);
  font-size: 17px;
  letter-spacing: 0.05em;
  max-width: 640px;
  margin-bottom: 50px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  border-top: 1px solid var(--offwhite);
  padding-top: 26px;
  margin-bottom: 60px;
}
.footer-link { font-family: var(--font-cond); font-size: 16px; letter-spacing: 0.05em; text-decoration: none; }
a.footer-link:hover { color: var(--accent); }
.footer-nav { font-family: var(--font-cond); font-size: 15px; letter-spacing: 0.05em; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.legal {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  opacity: 0.7;
  border-top: 1px dotted var(--offwhite);
  padding-top: 18px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cards-3 { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .terminal, .hero-stats { max-width: 560px; }
}
@media (max-width: 767px) {
  :root { --frame: 6px; }
  .section { padding: 80px var(--gutter) 56px; }
  .hero { padding: 48px var(--gutter) 56px; }
  .nav { grid-template-columns: 1fr auto; }
  .brand { font-size: 20px; }
  .nav-links { display: none; }
  .btn { min-height: 44px; padding: 12px 18px; }
  .hero-title > span { font-size: clamp(60px, 17vw, 96px); }
  .ghost { font-size: clamp(88px, 26vw, 170px); top: 12px; }
  .section-title { font-size: clamp(36px, 9vw, 60px); }
  .terminal-panel code { white-space: normal; overflow-wrap: anywhere; }
  .hero-stats dt { font-size: 32px; }
  .marquee-track span { font-size: 22px; }
  .cards-3, .cards-2, .footer-grid { grid-template-columns: 1fr; }
  .footer-grid { gap: 22px; }
  .footer-title > span { font-size: clamp(56px, 16vw, 120px); }
  .hero-stats > div { grid-template-columns: 64px 1fr; }
}
@media (max-width: 440px) {
  .terminal-panel { font-size: 12px; }
  .hero-actions .btn { flex: 1; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
}
