/* CSS Variables for Light and Dark Themes */
:root {
  --bg-color-overlay: rgba(255, 255, 255, 0.93);
  --text-color: #333333;
  --heading-color: #111111;
  --subtext-color: #555555;
  --card-bg: #f9f9f9;
  --card-border: #eeeeee;
  --accent-color: #0077b5;
  --accent-hover: #005582;
  --border-bottom-color: #0077b5;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
  --bg-color-overlay: rgba(18, 18, 18, 0.94);
  --text-color: #e0e0e0;
  --heading-color: #ffffff;
  --subtext-color: #b0b0b0;
  --card-bg: #2a2a2a;
  --card-border: #3d3d3d;
  --accent-color: #38bdf8;
  --accent-hover: #0ea5e9;
  --border-bottom-color: #38bdf8;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Base Body & External SVG Background Integration (~5MB background.svg) */
body {
  background-image: url('background.svg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed; /* Keeps your external SVG locked in place during scroll */
  
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Theme Toggle Button */
#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--card-border);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, background 0.3s ease;
}

#theme-toggle:hover {
  transform: scale(1.1);
}

/* Profile Container Layout */
.profile-container {
  max-width: 850px;
  margin: 50px auto;
  padding: 45px;
  background: var(--bg-color-overlay);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

section {
  margin-bottom: 2.5rem;
}

/* Hero Section */
.hero {
  text-align: center;
}

.headshot-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.headshot {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent-color);
  box-shadow: var(--shadow);
}

h1 {
  margin: 0 0 0.4rem 0;
  font-size: 2.8rem;
  color: var(--heading-color);
}

h2 {
  font-size: 1.2rem;
  color: var(--subtext-color);
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

/* Large Social Brand Icons */
.social-icons {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 1.8rem;
}

.social-icons a {
  color: var(--text-color);
  font-size: 2.2rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-icons a:hover {
  color: var(--accent-color);
  transform: translateY(-3px);
}

.tagline {
  text-align: left;
  margin-bottom: 1rem;
}

/* Section Headings */
h3 {
  border-bottom: 2px solid var(--border-bottom-color);
  padding-bottom: 0.4rem;
  color: var(--heading-color);
  font-size: 1.5rem;
  margin-bottom: 1.2rem;
}

/* Expertise Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.card {
  background: var(--card-bg);
  padding: 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  transition: background 0.3s ease, border 0.3s ease;
}

.card h4 {
  margin-top: 0;
  color: var(--heading-color);
}

/* Blog Feed Grid */
.blog-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-card {
  background: var(--card-bg);
  padding: 1rem 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  transition: transform 0.2s ease;
}

.blog-card:hover {
  transform: translateX(4px);
}

.blog-card h4 {
  margin: 0 0 0.5rem 0;
}

.blog-card h4 a {
  color: var(--accent-color);
  text-decoration: none;
}

.blog-card h4 a:hover {
  text-decoration: underline;
}

.blog-excerpt {
  font-size: 0.95rem;
  color: var(--subtext-color);
  margin: 0 0 0.5rem 0;
}

.blog-date {
  font-size: 0.8rem;
  color: var(--subtext-color);
  opacity: 0.8;
}

.loading-blog {
  color: var(--subtext-color);
  font-style: italic;
}

/* Work Experience & Education */
.job, .edu-item {
  margin-bottom: 1.2rem;
}

.job h4, .edu-item h4 {
  margin: 0 0 0.2rem 0;
  color: var(--heading-color);
}

.date {
  font-size: 0.9rem;
  color: var(--subtext-color);
  margin: 0;
}

.contact p {
  margin: 0.4rem 0;
}

.contact a {
  color: var(--accent-color);
  text-decoration: none;
}

.contact a:hover {
  text-decoration: underline;
}

/* Responsive Scaling for Mobile to 8K Ultra-Wide */
@media (max-width: 768px) {
  .profile-container {
    margin: 15px;
    padding: 20px;
  }

  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.05rem;
  }
}