/* ==========================================================
   luckymunugoti.com — redesign
   Warm black + amber (carried over from the original site),
   Instrument Serif for headlines, Geist for text, DM Mono for labels. Three "pages"
   toggled in place; cards for projects.
   ========================================================== */

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

:root {
  --bg: #0c0a09;
  --bg-2: #120f0d;
  --surface: #17140f;
  --surface-2: #1d1914;
  --line: #2a2520;
  --line-2: #3a332c;
  --fg: #e7e5e4;
  --muted: #a8a29e;
  --faint: #6b645d;
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.12);
  --accent-line: rgba(245, 158, 11, 0.35);
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --nav-h: 68px;
  --radius: 12px;
}

html, body {
  height: 100%;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* ---------- navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
  z-index: 100;
  background: linear-gradient(to bottom, rgba(12, 10, 9, 0.95), rgba(12, 10, 9, 0.75));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-logo {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--fg);
}

.nav-links { display: flex; gap: 28px; }

.nav-link {
  position: relative;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.2s;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-link:hover { color: var(--fg); }
.nav-link.active { color: var(--fg); }
.nav-link.active::after { transform: scaleX(1); }

/* ---------- page switching ---------- */
.content { height: 100vh; height: 100dvh; padding-top: var(--nav-h); overflow: hidden; }

.page {
  display: none;
  height: calc(100vh - var(--nav-h));
  height: calc(100dvh - var(--nav-h));
  overflow-y: auto;
  animation: pageIn 0.45s ease;
}
.page.active { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- shared bits ---------- */
.container { max-width: 1040px; margin: 0 auto; padding: 72px clamp(20px, 4vw, 48px) 96px; }
.container-narrow { max-width: 880px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.eyebrow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--accent-soft); } 50% { box-shadow: 0 0 0 7px rgba(245, 158, 11, 0.06); } }

.section-head { margin-bottom: 44px; }
.section-title {
  font-family: var(--display);
  font-size: clamp(2.4rem, 4.6vw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.05;
  text-wrap: balance;
}
.section-title em, .hero-name em { font-style: italic; color: var(--accent); }
.section-sub { color: var(--muted); margin-top: 12px; font-size: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  padding: 12px 20px;
  transition: background 0.2s, color 0.2s, transform 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--accent); color: #1a1205; }
.btn-primary:hover { background: #fbbf24; transform: translateY(-1px); }
.btn-text { color: var(--fg); padding-left: 6px; padding-right: 6px; }
.btn-text .arrow { transition: transform 0.2s; color: var(--accent); }
.btn-text:hover .arrow { transform: translateX(4px); }
.arrow { display: inline-block; }

/* ========================== HOME ========================== */
#home {
  background:
    radial-gradient(900px 500px at 85% 20%, rgba(245, 158, 11, 0.07), transparent 60%),
    var(--bg);
}

.home-container {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
  min-height: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px clamp(20px, 4vw, 48px) 64px;
}

.hero-name {
  font-family: var(--display);
  font-size: clamp(3.4rem, 8.5vw, 7rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.95;
  margin: 8px 0 24px;
}

.hero-sub {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 32px;
}
.hero-sub a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-line);
  transition: border-color 0.2s, color 0.2s;
}
.hero-sub a:hover { color: var(--accent); border-color: var(--accent); }

.home-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* portrait: hard-edged photo with an offset amber outline */
.home-right { display: flex; flex-direction: column; align-items: center; gap: 22px; }

.portrait {
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.portrait::before {
  /* offset outline */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  border: 1px solid var(--accent);
  transform: translate(10px, 10px);
  pointer-events: none;
  z-index: 2;
  opacity: 0.8;
  transition: transform 0.35s ease;
}
.home-right:hover .portrait::before { transform: translate(6px, 6px); }
.portrait img, .portrait-placeholder { border-radius: 6px; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; filter: brightness(0.92) saturate(0.95); }
.portrait::after {
  /* warm the studio-white background so it sits on the dark page */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.06), rgba(12, 10, 9, 0.22));
  mix-blend-mode: multiply;
  pointer-events: none;
}

.portrait-placeholder {
  display: none;
  width: 100%; height: 100%;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 3.5rem;
  letter-spacing: -0.04em;
  color: var(--accent);
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.10), transparent 55%),
    repeating-linear-gradient(-45deg, transparent 0 14px, rgba(255, 255, 255, 0.025) 14px 15px),
    var(--surface);
}

.socials { display: flex; gap: 18px; }
.social {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.social svg { width: 16px; height: 16px; }
.social:hover { color: var(--accent); }

/* ======================== PROJECTS ======================== */
.projects { display: flex; flex-direction: column; gap: 24px; }

.card {
  display: grid;
  grid-template-columns: 5fr 6fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.card:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -24px rgba(0, 0, 0, 0.8);
}

/* a child project, indented under its parent with an amber rule */
.card-nested {
  margin-left: clamp(20px, 5vw, 56px);
  position: relative;
  background: var(--bg-2);
}
.card-nested::before {
  content: "";
  position: absolute;
  left: -1px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.card-media {
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  min-height: 280px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card-body { padding: 32px 36px; display: flex; flex-direction: column; justify-content: center; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
  margin-bottom: 14px;
}
.idx { color: var(--accent); }
.year { margin-left: auto; }
.chip {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 0.68rem;
}
.chip-live { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }

.card-title { font-family: var(--display); font-size: 1.8rem; font-weight: 400; letter-spacing: -0.01em; margin-bottom: 10px; }
.card-text { color: var(--muted); line-height: 1.7; font-size: 0.95rem; }

.card-body .facts { margin-top: 18px; }
.card-body .facts dd { color: var(--fg); }

.card-links { margin-top: 20px; }
.card-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-line);
  transition: color 0.2s, border-color 0.2s;
}
.card-links a:hover { color: var(--accent); border-color: var(--accent); }
.card-links .arrow { color: var(--accent); }

/* ---------- CSS "screenshot" mocks (swap for real images any time) ---------- */
.mock {
  width: 100%;
  padding: 20px 22px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  display: flex; flex-direction: column; gap: 8px;
  background:
    radial-gradient(500px 220px at 0% 0%, rgba(245, 158, 11, 0.06), transparent 70%),
    var(--surface-2);
}
.mock-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mock-pill { padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.64rem; }
.mock-dim { color: var(--faint); font-size: 0.64rem; }

.mock-row {
  display: grid; grid-template-columns: 84px 1fr auto;
  align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
}
.mock-row b { color: var(--fg); font-weight: 500; }
.mock-row i { font-style: normal; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-row u { text-decoration: none; font-size: 0.62rem; color: var(--muted); }
.mock .ok { color: var(--accent); }
.mock-foot { margin-top: auto; color: var(--faint); font-size: 0.64rem; text-align: right; padding-top: 6px; }

.mock-term pre { font: inherit; line-height: 1.8; white-space: pre-wrap; color: var(--muted); }
.mock-term pre b { font-weight: 400; color: var(--accent); }
.cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.mock-sheet table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.mock-sheet th, .mock-sheet td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 400; }
.mock-sheet tr:last-child td { border-bottom: 0; }
.mock-sheet th { color: var(--faint); font-size: 0.62rem; background: rgba(255, 255, 255, 0.02); }
.mock-sheet td { color: var(--muted); }

/* ========================== ABOUT ========================== */
.about-layout { display: grid; grid-template-columns: 280px 1fr; gap: 56px; align-items: start; }

.portrait-sm { width: 100%; aspect-ratio: 1 / 1; margin-bottom: 24px; }
.portrait-sm .portrait-placeholder { font-size: 2.6rem; }

.facts { font-size: 0.84rem; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.facts dt { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); padding-top: 3px; }
.facts dd { color: var(--muted); overflow-wrap: anywhere; }
.facts a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--accent-line); }
.facts a:hover { color: var(--accent); border-color: var(--accent); }

.about-bio p { font-size: 1.05rem; line-height: 1.75; color: var(--muted); margin-bottom: 22px; }
.about-bio a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--accent-line); }
.about-bio a:hover { color: var(--accent); border-color: var(--accent); }

/* ========================== MOBILE ========================== */
@media (max-width: 820px) {
  .nav-links { gap: 18px; }
  .nav-link { font-size: 0.85rem; }

  .home-container {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 32px 20px 56px;
    align-content: start;
  }
  .home-right { order: -1; align-items: flex-start; }
  .portrait { width: 160px; }
  .portrait::before { transform: translate(8px, 8px); }
  .hero-name { font-size: clamp(3rem, 15vw, 4.5rem); }
  .hero-sub { font-size: 1rem; }

  .container { padding: 48px 20px 72px; }
  .card { grid-template-columns: 1fr; }
  .card-media { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; }
  .card-body { padding: 24px; }
  .card-nested { margin-left: 16px; }

  .about-layout { grid-template-columns: 1fr; gap: 36px; }
  .portrait-sm { width: 160px; }
}

/* ---------- scrollbar / a11y ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  .page, .eyebrow-dot, .cursor { animation: none; }
  .card, .btn, .portrait::before, .nav-link::after { transition: none; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
