:root {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --action-primary: #1568D5;
  --action-hover: #1155B0;
  --action-secondary: #0B4AA3;
  --text-heading: #003C86;
  --text-body: #333333;
  --border-light: #E5E7EB;
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 35px rgba(0, 0, 0, 0.08);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 24px;
  
  --font-heading: 'Roboto', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg, #afc7df 0%, #e0e9f1 100%);
  background-attachment: fixed;
  color: var(--text-body);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (max-width: 768px) {
  /* Mobile browsers often render fixed backgrounds poorly */
  body {
    background-attachment: scroll !important;
  }

  .section {
    padding: 3rem 0;
  }

  .container {
    padding: 0 1.125rem;
  }
}

img, video {
  max-width: 100%;
  height: auto;
}

::selection {
  background: rgba(21, 104, 213, 0.18);
}

:focus-visible {
  outline: 3px solid rgba(21, 104, 213, 0.55);
  outline-offset: 3px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transform: translateY(-150%);
  transition: transform 0.2s ease;
  z-index: 999;
}
.skip-link:focus {
  transform: translateY(0);
}

/* Typography */
h1, h2, h3, h4, h5, h6, strong {
  font-family: var(--font-heading);
  color: var(--text-heading);
  font-weight: 700;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; font-size: 1rem; }
a { color: var(--action-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--action-hover); }

/* Layout Wrapper */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 800px;
}

.container-medium {
  max-width: 900px;
}

.container-wide {
  max-width: 980px;
}

/* Main Content Area */
main {
  flex: 1;
}

/* Header & Navbar */
header {
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 0;
  background-color: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-heading);
  font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--action-primary);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-heading);
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-primary);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  }
  .nav-links li {
    width: 100%;
  }
  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.85rem 0.75rem;
    border-radius: 10px;
  }
  .nav-links a:hover, .nav-links a.active {
    background: rgba(21, 104, 213, 0.08);
  }
  .nav-links.active {
    display: flex;
  }
  .mobile-menu-btn {
    display: block;
  }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  transition: all 0.2s ease-in-out;
  touch-action: manipulation;
}

.btn-primary {
  background-color: var(--action-primary);
  color: var(--bg-primary);
}

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

.btn-outline {
  background-color: transparent;
  color: var(--action-primary);
  border: 2px solid var(--action-primary);
}

.btn-outline:hover {
  background-color: var(--action-primary);
  color: var(--bg-primary);
}

.btn-block {
  width: 100%;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-light {
  background-color: transparent;
}

/* Surfaces */
.surface {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.surface-md {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.surface-pad {
  padding: 2.25rem;
}

@media (max-width: 768px) {
  .surface-pad {
    padding: 1.5rem;
  }
}

/* Page title */
.page-title {
  font-size: clamp(2.1rem, 4vw, 3rem);
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}
.page-lede {
  font-size: 1.1rem;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

/* Hero */
.hero {
  min-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@supports (height: 100dvh) {
  .hero {
    min-height: calc(100dvh - 160px);
  }
}
.hero-card {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3.25rem) 1.25rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.10);
}
.hero-title {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.12;
  margin-bottom: 0.75rem;
}
.hero-subtitle {
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  color: var(--action-primary);
  margin-bottom: 1rem;
}
.hero-kicker {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1.75rem;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-light);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-body);
  font-size: 0.875rem;
}

/* Cards (Portfolio) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* Contact page: 2-col on desktop, stacked on mobile */
.contact-grid {
  grid-template-columns: 1fr 1.5fr;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  transition: box-shadow 0.3s, transform 0.3s;
}

.card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  transform: translateY(-5px);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-heading);
}

.card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.card-meta {
  font-size: 0.875rem;
  color: var(--text-body);
  margin-bottom: 1rem;
  font-weight: 500;
}

.card-text {
  font-size: 0.9rem;
  flex: 1;
}

.card-footer {
  margin-top: 1.5rem;
}

/* Badges for Skills */
.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.badge {
  background-color: rgba(21, 104, 213, 0.1);
  color: var(--text-heading);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Utility */
.text-center { text-align: center; }
.text-left { text-align: left; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.mb-5 { margin-bottom: 3rem; }
.flex { display: flex; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }

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