/* --- VARIABLES --- */
:root {
  /* Fonts */
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Colors - Light Theme */
  --bg-color: #f8f9fa;
  /* Added: A subtle top-left light blue glow */
  --bg-gradient: radial-gradient(
    circle at 0% 0%,
    rgba(37, 99, 235, 0.12) 0%,
    rgba(248, 249, 250, 0) 50%
  ), #f8f9fa;
  
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --text-primary: #111111;
  --text-secondary: #555555;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border-color: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  /* Colors - Dark Theme */
  --bg-color: #0a0a0a;
  /* Added: A subtle top-right dark blue glow */
  --bg-gradient: radial-gradient(
    circle at 100% 0%,
    rgba(59, 130, 246, 0.15) 0%,
    rgba(10, 10, 10, 0) 50%
  ), #0a0a0a;

  --bg-card: #171717;
  --bg-card-hover: #1f1f1f;
  --text-primary: #ffffff;
  --text-secondary: #a3a3a3;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --border-color: #262626;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  /* Changed: Use the gradient variable */
  background: var(--bg-gradient); 
  /* Fallback color */
  background-color: var(--bg-color);
  background-attachment: fixed; /* Ensures gradient stays while scrolling */
  
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-heading); color: var(--text-primary); font-weight: 700; }
a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

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

.icon {
  width: 1.2em;
  height: 1.2em;
  fill: currentColor;
  vertical-align: middle;
}

/* --- HEADER / TOGGLE --- */
.site-header {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
}

#theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}
#theme-toggle:hover { transform: rotate(15deg); border-color: var(--accent); }

/* --- HERO SECTION --- */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 100px 0 50px;
}

.hero-content { flex: 1; }
.intro-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero h1 { 
  font-size: 4rem; 
  line-height: 1.1; 
  margin-bottom: 0.5rem; 
  letter-spacing: -0.02em; 
  
  /* --- ADDED: Text Gradient Styling --- */
  background: linear-gradient(
    120deg, 
    var(--text-primary) 0%, 
    var(--accent) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* Optional: Ensures the gradient box doesn't stretch full width unnecessarily */
  display: inline-block; 
}

.tagline { font-size: 1.5rem; color: var(--text-secondary); margin-bottom: 1.5rem; font-weight: 300; 
font-style: italic; }
.description { font-size: 1.1rem; color: var(--text-secondary); max-width: 600px; margin-bottom: 2rem; }

.headshot-container { position: relative; width: 350px; height: 350px; flex-shrink: 0; }
.headshot {
  width: 100%; height: 100%;
  border-radius: 20px;
  background-size: cover;
  background-position: center;
  position: relative;
  z-index: 2;
  border: 1px solid var(--border-color);
}

.headshot-backdrop {
  position: absolute;
  top: 20px; right: -20px;
  width: 100%; height: 100%;
  background: var(--accent);
  border-radius: 20px;
  opacity: 0.3;
  z-index: 1;
  transition: transform 0.3s ease;
}
.headshot-container:hover .headshot-backdrop { transform: translate(10px, -10px); }

/* --- BUTTONS & SOCIAL --- */
.social-links { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 8px; font-weight: 600;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { border-color: var(--accent); transform: translateY(-2px); }

/* --- CHIPS (SKILLS) --- */
.skills-group {
  margin-bottom: 10px;
}

.skills-group h4 {
  font-size: 1rem;
  font-weight: 400;
  margin-top: 5px;
}

.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 12px;
  color: var(--text-primary);
  background: rgba(125, 125, 125, 0.08);
  border: 1px solid rgba(125, 125, 125, 0.15);
  transition: 0.2s ease background, 0.2s ease border;
}

.chip:hover {
  background: rgba(125, 125, 125, 0.15);
  border-color: var(--accent);
  cursor: default;
}

.chip-container.small .chip { font-size: 0.75rem; padding: 4px 10px; }

/* --- SECTIONS --- */
section { padding: 80px 0; border-top: 1px solid var(--border-color); }
section#about { border-top: none; }
.section-title { font-size: 2.5rem; margin-bottom: 40px; }

/* --- TIMELINE (Education/Experience) --- */
.timeline { position: relative; padding-left: 0; }
.timeline-item {
  display: flex; gap: 20px; margin-bottom: 40px;
  opacity: 0; transform: translateY(20px); transition: all 0.6s ease;
}
.timeline-item.visible { opacity: 1; transform: translateY(0); }

.timeline-logo-wrapper {
  flex-shrink: 0; width: 60px; height: 60px;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 0px;
  border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
}
.timeline-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.timeline-content { flex: 1; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.timeline-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; margin-bottom: 5px; }
.meta { font-size: 0.9rem; color: var(--text-secondary); font-family: monospace; }
.institution { color: var(--accent); font-weight: 600; margin-bottom: 10px; }
.bullet-list { padding-left: 20px; list-style-type: disc; color: var(--text-secondary); }
.bullet-list li { margin-bottom: 5px; }

/* --- PROJECT GRID (Bento) --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: var(--accent); }

.project-image-wrapper { height: 200px; overflow: hidden; border-bottom: 1px solid var(--border-color); }
.project-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.project-card:hover .project-img { transform: scale(1.05); }

.project-content { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.project-content h3 { font-size: 1.4rem; margin-bottom: 10px; }
.project-content p { color: var(--text-secondary); margin-bottom: 15px; flex: 1; font-size: 0.95rem; }
.project-links { margin-top: 20px; display: flex; gap: 15px; }
.link-btn { font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.link-btn:hover { color: var(--accent); }

/* --- CONTACT --- */
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.contact-header p { color: var(--text-secondary); font-size: 1.1rem; margin-top: 10px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.9rem; }
input, textarea {
  width: 100%; padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-primary);
  font-family: inherit;
  transition: border 0.2s;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
.full-width { width: 100%; justify-content: center; }

/* --- FOOTER --- */
footer { border-top: 1px solid var(--border-color); padding: 40px 0; margin-top: 40px; text-align: center; color: var(--text-secondary); }
.footer-content { display: flex; justify-content: space-between; align-items: center; }
.footer-icons { display: flex; gap: 20px; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .hero { flex-direction: column-reverse; text-align: center; padding-top: 120px; }
  .headshot-container { width: 250px; height: 250px; margin: 0 auto; }
  .social-links { justify-content: center; }
  .chip-container { justify-content: center; }
  .hero h1 { font-size: 2.5rem; }
  .contact-card { grid-template-columns: 1fr; }
  .site-header { position: absolute; }
}

/* --- ANIMATION CLASSES --- */
.fade-in { animation: fadeIn 0.8s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

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