/* =============================== */
/* Joseph Owino | Portfolio Styles */
/* =============================== */

/* ========== VARIABLES & RESET ========== */
:root {
  --bg-dark: #0f172a; /* slate-900 */
  --bg-medium: #1e293b; /* slate-800 */
  --text-light: #f1f5f9; /* slate-100 */
  --text-medium: #94a3b8; /* slate-400 */
  --accent-primary: #38bdf8; /* sky-400 */
  --accent-secondary: #0ea5e9; /* sky-500 */

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;

  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Offset for fixed header */
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-medium);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3 {
  color: var(--text-light);
  line-height: 1.2;
  margin-bottom: 1rem;
}

h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-secondary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul { list-style: none; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 4rem 0;
}

/* ========== HEADER & NAVIGATION ========== */
header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
  background: rgba(15, 23, 42, 0.98);
  box-shadow: var(--shadow-md);
}

.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-photo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-primary);
}

.brand-name {
  font-size: 1.5rem;
  margin: 0;
}

.navigation {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-weight: 600;
  padding: 0.5rem 0;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.burger-menu {
  display: none; /* Hidden on desktop */
  font-size: 2rem;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
}

/* ========== HERO SECTION ========== */
.hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-greeting {
  font-size: 3rem;
  color: var(--text-light);
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.btn-primary {
  display: inline-block;
  background-color: var(--accent-primary);
  color: var(--bg-dark);
  padding: 0.8rem 2rem;
  border-radius: 0.5rem;
  font-weight: 700;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--accent-secondary);
  color: var(--bg-dark);
  transform: translateY(-2px);
}

/* ========== GRIDS (EXPERTISE & PROJECTS) ========== */
.skills-grid, .projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.skill-card, .project-card {
  background-color: var(--bg-medium);
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-card:hover, .project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.project-img {
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.project-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
}

/* ========== WRITING SECTION ========== */
.article-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--bg-medium);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.article-list a {
  font-size: 1.1rem;
}

/* ========== CONTACT FORM ========== */
.contact-form {
  max-width: 700px;
  margin: 2rem auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 0.8rem;
  background-color: var(--bg-medium);
  border: 1px solid transparent;
  border-radius: 0.5rem;
  color: var(--text-light);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.contact-links {
  text-align: center;
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-size: 1.1rem;
}

/* ========== FOOTER ========== */
footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--bg-medium);
  margin-top: 2rem;
}

/* ========== UTILITIES & ANIMATIONS ========== */
.scroll-up-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent-primary);
  color: var(--bg-dark);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.scroll-up-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.fade-in-element {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-element.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .navigation {
    position: fixed;
    top: 80px; /* Below header */
    left: 0;
    width: 100%;
    background: var(--bg-medium);
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    transform: translateY(-120%);
    transition: transform 0.3s ease-in-out;
  }

  .navigation.show {
    transform: translateY(0);
  }

  .burger-menu {
    display: block;
  }
}
