:root {
  --primary-color: #0066cc;
  --primary-dark: #004499;
  --secondary-color: #f8f9fa;
  --accent-color: #28a745;
  --text-primary: #2c3e50;
  --text-secondary: #6c757d;
  --border-color: #e9ecef;
  --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.14);
  --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* ------------------------------------------------
   Typography
   ------------------------------------------------ */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  line-height: 1.7;
  color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; color: var(--primary-color); }
h3 { font-size: 1.5rem; }

.section-heading {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

/* ------------------------------------------------
   Navigation
   ------------------------------------------------ */
nav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-light);
}

nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
}

nav a:hover {
  color: var(--primary-color);
  background-color: var(--secondary-color);
}

nav a[role="button"] {
  background: var(--primary-color);
  color: white;
}

nav a[role="button"]:hover {
  background: var(--primary-dark);
  color: white;
}

/* ------------------------------------------------
   Hero section (index.html)
   ------------------------------------------------ */
.hero-section {
  text-align: center;
  padding: 3rem 0 1rem;
}

.hero-section hgroup {
  margin-bottom: 1.5rem;
}

.hero-section hgroup h2 {
  background: var(--gradient-bg);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-section hgroup h3 {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 1.25rem;
}

.hero-text {
  max-width: 720px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* ------------------------------------------------
   Project cards (index.html)
   ------------------------------------------------ */
article {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

article:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}

article header {
  background: var(--secondary-color);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

article header strong {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.project-year {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
}

article p {
  padding: 0 1.5rem;
  margin: 1rem 0;
}

article footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--secondary-color);
}

article footer a[role="button"] {
  background: var(--primary-color);
  color: white;
  padding: 0.6rem 1.4rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  display: inline-block;
}

article footer a[role="button"]:hover {
  background: var(--primary-dark);
  transform: translateX(4px);
}

/* ------------------------------------------------
   Case-study article (sub-pages)
   ------------------------------------------------ */
.case-study {
  box-shadow: none;
  border: none;
}

.case-study:hover {
  transform: none;
  box-shadow: none;
}

.case-study header {
  background: transparent;
  border-bottom: none;
  display: block;
  padding: 2rem 0 0;
}

.case-study header hgroup h1 {
  font-size: 2.2rem;
  margin-bottom: 0.25rem;
}

.case-study header hgroup h2 {
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.case-study section {
  margin-bottom: 2rem;
}

.case-study footer {
  background: var(--secondary-color);
  border-radius: var(--border-radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
}

/* ------------------------------------------------
   Tech Stack badges
   ------------------------------------------------ */
.tech-stack-section {
  background: var(--secondary-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin: 3rem 0;
  border-left: 4px solid var(--primary-color);
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.badge:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.badge-cert {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  font-weight: 600;
}

.badge-cert:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
}

/* ------------------------------------------------
   Contact section
   ------------------------------------------------ */
#contact {
  background: var(--gradient-bg);
  color: white;
  margin-top: 4rem;
  padding: 3rem 0;
}

#contact article {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#contact article:hover {
  transform: none;
}

#contact h2,
#contact h3 {
  color: white;
}

#contact input,
#contact textarea {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius);
  padding: 0.85rem 1rem;
  font-size: 1rem;
  transition: var(--transition);
  color: var(--text-primary);
}

#contact input:focus,
#contact textarea:focus {
  background: white;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

#contact textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

#contact button {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.85rem 2rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

#contact button:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

#contact button:active {
  transform: translateY(0);
}

/* Contact messages */
.contact-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

.contact-message.success {
  background: rgba(40, 167, 69, 0.2);
  border: 1px solid rgba(40, 167, 69, 0.3);
  color: white;
}

.contact-message.error {
  background: rgba(220, 53, 69, 0.2);
  border: 1px solid rgba(220, 53, 69, 0.3);
  color: white;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------------------------
   Profile photo
   ------------------------------------------------ */
.profile-photo {
  width: 160px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  flex-shrink: 0;
  border: 3px solid var(--primary);
}

.hero-profile {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.profile-photo-about {
  display: block;
  margin: 0 auto 1.5rem;
  width: 180px;
  height: 220px;
}

@media (max-width: 768px) {
  .hero-profile {
    flex-direction: column;
    text-align: center;
  }
}

/* ------------------------------------------------
   Honeypot — invisible to users, catches bots
   ------------------------------------------------ */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ------------------------------------------------
   Site footer
   ------------------------------------------------ */
.site-footer {
  background: transparent;
  text-align: center;
  padding: 2rem 0;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.site-footer a {
  color: var(--primary-color);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------
   Responsive
   ------------------------------------------------ */
@media (max-width: 768px) {
  .hero-section hgroup h2 {
    font-size: 2rem;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  nav a {
    text-align: center;
  }

  .case-study header hgroup h1 {
    font-size: 1.6rem;
  }
}

/* ------------------------------------------------
   Utilities
   ------------------------------------------------ */
html {
  scroll-behavior: smooth;
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@media print {
  nav, #contact, .site-footer {
    display: none;
  }

  article {
    box-shadow: none;
    border: 1px solid #000;
  }
}
