/* ==========================================================================
   Jimmy Lubega — Portfolio
   ========================================================================== */

:root {
  --bg: #090d15;
  --bg-alt: #0c111c;
  --surface: #111828;
  --surface-2: #161f33;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef1f7;
  --text-dim: #9aa5bd;
  --text-faint: #6b7690;
  --accent: #4fc8ee;
  --accent-2: #34e0b8;
  --accent-soft: rgba(79, 200, 238, 0.12);
  --danger-safe: #f59e0b;
  --radius: 14px;
  --radius-sm: 8px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --container: 1120px;
  --shadow-lg: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4 { line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -0.02em; }

p { margin: 0 0 1em; color: var(--text-dim); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #041018;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* Decorative background grid */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 21, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo-mark {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
.cursor { color: var(--accent); }

.main-nav ul {
  display: flex;
  gap: 32px;
}

.main-nav a {
  font-size: 0.92rem;
  color: var(--text-dim);
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}
.main-nav a:hover { color: var(--text); }
.main-nav a.active { color: var(--accent); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 16px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121a;
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text); }

.btn-sm { padding: 9px 18px; font-size: 0.85rem; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: 120px 0 0;
  text-align: center;
}

.hero-inner { max-width: 760px; margin: 0 auto; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  background: linear-gradient(135deg, #ffffff 30%, #b9c4d8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 14px;
}

.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--text-dim);
  margin-bottom: 26px;
  min-height: 1.6em;
}

.tech-motion {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: -8px 0 26px;
  font-size: 1.35rem;
}
.tech-motion span {
  display: inline-block;
  animation: tech-drift 2.8s ease-in-out infinite;
}
.tech-motion span:nth-child(2) { animation-delay: 0.2s; }
.tech-motion span:nth-child(3) { animation-delay: 0.4s; }
.tech-motion span:nth-child(4) { animation-delay: 0.6s; }
@keyframes tech-drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(4deg); }
}
.type-cursor {
  color: var(--accent);
  animation: blink 1s step-start infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-lede {
  font-size: 1.08rem;
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-social {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 72px;
}
.hero-social a {
  color: var(--text-faint);
  transition: color 0.2s ease, transform 0.2s ease;
}
.hero-social a:hover { color: var(--accent); transform: translateY(-2px); }

.hero-stats {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
  padding: 40px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat { display: flex; flex-direction: column; gap: 6px; }

.stat-num {
  font-family: var(--font-mono);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-faint);
  line-height: 1.4;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding: 108px 0; scroll-margin-top: 68px; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  margin-bottom: 20px;
  max-width: 640px;
}

.section-lede {
  color: var(--text-dim);
  max-width: 620px;
  font-size: 1.02rem;
  margin-bottom: 48px;
}

/* ==========================================================================
   About
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 56px;
  margin-top: 40px;
  align-items: start;
}

.about-copy p { font-size: 1.02rem; }

.about-education {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.edu-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.edu-degree { color: var(--text); font-weight: 600; margin: 0; }
.edu-school { color: var(--text-faint); margin: 0; font-size: 0.92rem; }

.about-highlights {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.about-highlights ul { display: flex; flex-direction: column; gap: 22px; }
.about-highlights li { display: flex; flex-direction: column; gap: 4px; }

.hl-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.hl-value { color: var(--text); font-size: 0.95rem; font-weight: 500; }

/* ==========================================================================
   Timeline
   ========================================================================== */

.timeline {
  position: relative;
  margin-top: 40px;
  padding-left: 32px;
  border-left: 1px solid var(--border-strong);
}

.timeline-item { position: relative; padding-bottom: 52px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -37.5px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.tl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.tl-head h3 { font-size: 1.2rem; color: var(--text); }

.tl-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
}

.tl-org {
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 14px;
}
.tl-org-sub { color: var(--text-faint); font-weight: 400; }

.timeline-content ul { display: flex; flex-direction: column; gap: 9px; }
.timeline-content li {
  color: var(--text-dim);
  font-size: 0.95rem;
  padding-left: 20px;
  position: relative;
}
.timeline-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  opacity: 0.7;
}

/* ==========================================================================
   Skills
   ========================================================================== */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.skill-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }

.skill-card h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text);
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tags span {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 6px;
}

.skills-footnote {
  margin-top: 32px;
  font-size: 0.92rem;
  color: var(--text-faint);
}
.skills-footnote strong { color: var(--text-dim); }

/* ==========================================================================
   Projects
   ========================================================================== */

.project-featured {
  margin-top: 40px;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 44px;
  position: relative;
  overflow: hidden;
}
.project-featured::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  pointer-events: none;
}

.project-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.project-info h3 { font-size: 1.5rem; margin-bottom: 14px; color: var(--text); max-width: 560px; }
.project-info p { max-width: 620px; margin-bottom: 22px; }
.project-info .tags { margin-bottom: 26px; }

.project-more {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 28px 32px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.project-more h3 { font-size: 1.05rem; color: var(--text); margin-bottom: 6px; }
.project-more p { margin: 0; max-width: 480px; font-size: 0.92rem; }

/* ==========================================================================
   Certifications
   ========================================================================== */

.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.cert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.cert-card:hover { border-color: var(--accent); transform: translateY(-3px); }

.cert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 32px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  margin-bottom: 16px;
}

.cert-name { color: var(--text); font-weight: 600; margin-bottom: 4px; font-size: 0.98rem; }
.cert-issuer { color: var(--text-faint); font-size: 0.86rem; margin: 0; }

/* ==========================================================================
   Feature band (PureNest360)
   ========================================================================== */

.section-feature {
  background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(79, 200, 238, 0.08), transparent 70%), var(--bg);
}

.feature-inner { text-align: center; max-width: 700px; }
.feature-text .section-eyebrow,
.feature-text .section-title { margin-left: auto; margin-right: auto; }
.feature-text p { font-size: 1.02rem; margin-bottom: 30px; }

/* ==========================================================================
   Contact
   ========================================================================== */

.section-contact { text-align: center; }
.section-contact .section-title,
.section-contact .section-lede { margin-left: auto; margin-right: auto; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 8px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}
.contact-card:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

.contact-location {
  margin-top: 36px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-inner p { margin: 0; color: var(--text-faint); font-size: 0.85rem; }

.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--text-faint); font-size: 0.85rem; transition: color 0.2s ease; }
.footer-links a:hover { color: var(--accent); }

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
}

@media (max-width: 760px) {
  .main-nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: rgba(9, 13, 21, 0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .main-nav.open { max-height: 400px; }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 20px;
  }
  .main-nav a { display: block; padding: 14px 0; border-bottom: 1px solid var(--border); }
  .nav-toggle { display: flex; }
  .header-actions .btn-ghost { display: none; }

  .hero { padding: 88px 0 0; }
  .hero-lede { font-size: 1rem; }

  .section { padding: 76px 0; }

  .skills-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }

  .timeline { padding-left: 24px; }
  .timeline-marker { left: -29.5px; }

  .project-featured { padding: 30px 24px; }
  .project-more { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
}
