/* =========================================================
   Enock Mecheo — AI Engineer · Portfolio
   Palette: navy rgb(18,23,36) + gold rgb(233,196,103)
   Titles: Cinzel · Body: Montserrat · No gradients
   ========================================================= */

:root {
  --bg: rgb(18, 23, 36);
  --bg-soft: rgb(24, 30, 46);
  --surface: rgb(26, 33, 50);
  --surface-2: rgb(31, 39, 58);
  --border: rgba(233, 196, 103, 0.14);
  --border-soft: rgba(255, 255, 255, 0.08);
  --gold: rgb(233, 196, 103);
  --gold-dim: rgba(233, 196, 103, 0.7);
  --text: #eef1f6;
  --text-dim: #aab1c2;
  --text-faint: #7b8298;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1100px;
  --font-title: 'Cinzel', Georgia, serif;
  --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

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

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* =================== Navbar =================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.nav.scrolled {
  background: rgba(18, 23, 36, 0.9);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-cta {
  background: var(--gold) !important;
  color: var(--bg) !important;
  font-weight: 600 !important;
}
.nav-cta:hover { background: #f0d07f !important; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; }

/* =================== Buttons =================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 13px 26px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.2s, border-color 0.2s, color 0.2s;
  border: 1px solid transparent;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--gold); color: var(--bg); }
.btn-primary:hover { background: #f0d07f; transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }

/* =================== Hero =================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 760px;
  gap: 24px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 22px;
}
.hero h1 {
  font-family: var(--font-title);
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.hero h1 .gold { color: var(--gold); }
.hero-lead {
  font-size: 1.08rem;
  color: var(--text-dim);
  max-width: 540px;
  margin-bottom: 34px;
}
.hero-lead strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 42px; }
.hero-meta { display: flex; gap: 40px; flex-wrap: wrap; }
.hero-meta .stat .num {
  font-family: var(--font-title);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--gold);
}
.hero-meta .stat .lbl { font-size: 0.8rem; color: var(--text-faint); letter-spacing: 0.02em; }

/* Hero visual */
.hero-visual { position: relative; display: flex; justify-content: center; }
.avatar-wrap { position: relative; width: 300px; max-width: 100%; }
.avatar-wrap::before {
  content: '';
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 1px solid var(--gold);
  border-radius: 18px;
  z-index: 0;
}
.avatar {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
}
.code-chip {
  position: absolute;
  bottom: -16px; left: -22px;
  z-index: 2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 16px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
}
.code-chip .k { color: var(--gold); }
.code-chip .v { color: var(--text); }

/* =================== Sections =================== */
section { padding: 96px 0; }
.section-head { margin-bottom: 50px; max-width: 660px; }
.section-tag {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
}
.section-head h2,
.about-text h2 {
  font-family: var(--font-title);
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 14px 0 16px;
  font-weight: 700;
}
.section-head p { color: var(--text-dim); font-size: 1rem; }

/* =================== About =================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text p { color: var(--text-dim); font-size: 1.04rem; margin-bottom: 18px; }
.about-text p strong { color: var(--text); }
.focus-list { display: grid; gap: 14px; }
.focus-item {
  display: flex;
  gap: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, transform 0.2s;
}
.focus-item:hover { border-color: var(--border); transform: translateX(4px); }
.focus-item .ic {
  flex: 0 0 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(233, 196, 103, 0.1);
  color: var(--gold);
}
.focus-item .ic svg { width: 19px; height: 19px; }
.focus-item h4 { font-family: var(--font-body); font-size: 0.98rem; font-weight: 600; margin-bottom: 2px; }
.focus-item p { font-size: 0.85rem; color: var(--text-faint); }

/* =================== Skills =================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.25s, transform 0.25s;
}
.skill-card:hover { border-color: var(--gold); transform: translateY(-4px); }
.skill-card .ic {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--gold);
  color: var(--bg);
  margin-bottom: 18px;
}
.skill-card .ic svg { width: 23px; height: 23px; }
.skill-card h3 { font-family: var(--font-title); font-size: 1.02rem; letter-spacing: 0.03em; margin-bottom: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  padding: 5px 11px;
  border-radius: 7px;
}

/* =================== Projects =================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}
.project {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 30px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}
.project::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.project:hover { border-color: var(--border); transform: translateY(-5px); }
.project:hover::before { transform: scaleX(1); }
.project-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.project-cat {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
}
.project-num { font-family: var(--font-title); font-size: 0.9rem; color: var(--text-faint); }
.project h3 { font-family: var(--font-title); font-size: 1.28rem; letter-spacing: 0.02em; margin-bottom: 12px; }
.project p { color: var(--text-dim); font-size: 0.92rem; flex-grow: 1; margin-bottom: 20px; }
.project .tags { margin-bottom: 22px; }
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--gold);
  width: fit-content;
}
.project-link svg { width: 15px; height: 15px; transition: transform 0.2s; }
.project-link:hover svg { transform: translateX(4px); }
.projects-cta { text-align: center; margin-top: 46px; }

/* =================== Experience =================== */
.timeline { display: grid; gap: 16px; max-width: 780px; }
.exp {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.exp:hover { border-color: var(--border); }
.exp .when { font-size: 0.82rem; font-weight: 600; color: var(--gold); padding-top: 2px; letter-spacing: 0.03em; }
.exp h4 { font-family: var(--font-title); font-size: 1.05rem; letter-spacing: 0.02em; margin-bottom: 5px; }
.exp .org { font-size: 0.86rem; color: var(--text-faint); margin-bottom: 9px; }
.exp p { font-size: 0.92rem; color: var(--text-dim); }

/* =================== Contact =================== */
.contact { text-align: center; padding-bottom: 64px; }
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 70px 32px;
}
.contact-card h2 {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.contact-card p { color: var(--text-dim); max-width: 500px; margin: 0 auto 34px; font-size: 1.02rem; }
.social-row { display: flex; gap: 14px; justify-content: center; margin-top: 38px; }
.social-row a {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.social-row a:hover { color: var(--gold); border-color: var(--gold); transform: translateY(-3px); }
.social-row a svg { width: 20px; height: 20px; }

/* =================== Footer =================== */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 32px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-faint);
  font-size: 0.84rem;
}

/* =================== Case Study (project detail) =================== */
.cs-main { padding: 130px 0 80px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 30px;
  transition: color 0.2s, gap 0.2s;
}
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--gold); gap: 12px; }
.cs-header { margin-bottom: 40px; max-width: 820px; }
.cs-eyebrow {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
}
.cs-title {
  font-family: var(--font-title);
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 14px 0 0;
}
.cs-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 44px;
  align-items: start;
}
.cs-image {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 38px;
}
.cs-block { margin-bottom: 38px; }
.cs-block:last-child { margin-bottom: 0; }
.cs-block h3 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  color: var(--text);
}
.cs-block p { color: var(--text-dim); font-size: 1.02rem; }
.cs-list { list-style: none; display: grid; gap: 13px; }
.cs-list li {
  position: relative;
  padding-left: 28px;
  color: var(--text-dim);
  font-size: 0.98rem;
}
.cs-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
}
.tech-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  padding: 8px 14px;
  border-radius: 9px;
}
.tech-badge i { color: var(--gold); }
.cs-sidebar {
  position: sticky;
  top: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.cs-sidebar h4 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  letter-spacing: 0.03em;
  margin-bottom: 20px;
  text-transform: uppercase;
}
.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.9rem;
}
.meta-row:last-of-type { border-bottom: 0; }
.meta-row .k { color: var(--text-faint); font-weight: 600; }
.meta-row .v { color: var(--text); text-align: right; }
.cs-sidebar .btn { width: 100%; justify-content: center; margin-top: 22px; }

/* =================== Reveal animation =================== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* =================== Responsive =================== */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { order: -1; justify-content: flex-start; }
  .avatar-wrap { width: 220px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .cs-grid { grid-template-columns: 1fr; gap: 32px; }
  .cs-sidebar { position: static; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 66px; right: 16px; left: 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
  }
  .nav-links.open a { width: 100%; }
  .nav-toggle { display: grid; place-items: center; }
  .exp { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 520px) {
  section { padding: 64px 0; }
  .hero { padding: 120px 0 60px; }
  .hero-meta { gap: 26px; }
  .contact-card { padding: 48px 22px; }
  .code-chip { left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
