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

:root {
  --bg:       #0e0e0e;
  --surface:  #161616;
  --border:   #2a2a2a;
  --text:     #e8e2d9;
  --muted:    #666;
  --accent:   #c8a96e;
  --accent2:  #7b9e87;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono:    'DM Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.4rem 3rem;
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
nav.scrolled { border-color: var(--border); background: rgba(14,14,14,.92); backdrop-filter: blur(12px); }
.nav-logo { font-family: var(--font-display); font-size: 1.2rem; color: var(--accent); text-decoration: none; letter-spacing: .03em; }
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; transition: color .2s; }
.nav-links a:hover { color: var(--text); }

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 8rem 3rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero-text { max-width: 520px; }
.hero-eyebrow {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: .75rem;
}
.hero-eyebrow::before { content: ''; display: block; width: 32px; height: 1px; background: var(--accent); }
h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 5vw, 5rem);
  line-height: 1.05;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -.02em;
}
h1 em { font-style: italic; color: var(--accent); }
.hero-desc { color: var(--muted); font-size: 18px; line-height: 1.8; max-width: 380px; margin-bottom: 2.5rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

/* 1. The container holding the image */
.avatar-frame {
  position: relative;
  border-radius: 24px; 
  z-index: 1;
  
  /* 👇 ADD THESE TO CONTROL THE OVERALL SIZE 👇 */
  width: 500px;  /* Adjust this number down to make it smaller (e.g., 200px) */
  height: 600px; /* Keep this exactly the same as the width for a perfect square/circle */
  
  /* Optional: If making it smaller pushes it off-center, this will center it again */
  margin: 0 auto; 
}

/* 2. The Gradient Shadow / Outline */
.avatar-frame::before {
  content: "";
  position: absolute;
  /* Negative values push the gradient outside the image to create the border */
  top: -4px; 
  left: -4px; 
  right: -4px; 
  bottom: -4px; 
  /* Uses the gold and green hex codes from your particle background */
  background: linear-gradient(135deg, #c8a96e 0%, #7b9e87 100%); 
  border-radius: 26px; /* Should be slightly larger than the frame's radius */
  z-index: -1; /* Pushes it behind your photo */
  
  /* THIS IS THE SHADOW: Higher pixels = bigger glow. 
     Change this to blur(0) if you just want a solid gradient line with no glow. */
  filter: blur(12px); 
  opacity: 0.85;
  transition: all 0.3s ease;
}

/* Optional: Make the shadow glow brighter when you hover over it */
.avatar-frame:hover::before {
  filter: blur(20px);
  opacity: 1;
}

/* 3. The actual photo */
.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px; /* MUST match the .avatar-frame radius */
  display: block;
  position: relative;
  z-index: 2;
  /* Optional: Adds a dark inner border to separate your photo from the colorful glow */
  border: 2px solid var(--bg); 
}

.btn-primary {
  padding: .75rem 2rem; border: 1px solid var(--accent);
  background: transparent; color: var(--accent);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: background .2s, color .2s;
}
.btn-primary:hover { background: var(--accent); color: var(--bg); }
.btn-ghost {
  padding: .75rem 2rem; border: 1px solid var(--border);
  background: transparent; color: var(--muted);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: var(--text); color: var(--text); }

.hero-visual {
  display: flex; justify-content: center; align-items: center;
  position: relative;
}

.deco-line {
  position: absolute; top: 2rem; right: -1.5rem;
  width: 1px; height: 200px; background: linear-gradient(to bottom, transparent, var(--accent), transparent);
}

/* ── SECTION SHARED ── */
section { padding: 6rem 3rem; border-top: 1px solid var(--border); }
.section-label {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 3rem; display: flex; align-items: center; gap: .75rem;
}
.section-label::after { content: ''; flex: 1; max-width: 60px; height: 1px; background: var(--accent); }
h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 700; line-height: 1.1; margin-bottom: 1rem;
}

/* ── ABOUT ── */
#about .about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 6rem; align-items: start; margin-top: 3rem; }
#about p { color: var(--muted); margin-bottom: 1rem; }
.skills-list { display: flex; flex-direction: column; gap: 1.2rem; }
.skill-row { display: flex; flex-direction: column; gap: .4rem; }
.skill-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text); display: flex; justify-content: space-between; }
.skill-bar { height: 2px; background: var(--border); position: relative; }
.skill-fill { position: absolute; top: 0; left: 0; height: 100%; background: var(--accent); }

/* ── WORK ── */
#work .projects-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
  gap: 2.5rem; /* 👈 Increased spacing between cards */
  margin-top: 3rem; 
  /* Removed the old background that was creating the harsh grid lines */
}

.project-card {
  
  background: linear-gradient(145deg, rgba(35,35,35,0.9) 0%, rgba(14,14,14,0.95) 100%);
  padding: 2.5rem;
  border-radius: 12px; /* Softens the edges of the gradient */
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); /* Gives the cards 3D depth */
  border: none; /* Removes any outlines */
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  cursor: pointer;
}

.project-card:hover { 
  /* Slightly brightens the gradient and adds a subtle gold glow on hover */
  background: linear-gradient(145deg, rgba(45,45,45,0.9) 0%, rgba(20,20,20,0.95) 100%);
  box-shadow: 0 15px 40px rgba(200, 169, 110, 0.15); 
  transform: translateY(-5px); /* Gentle floating lift */
}

.project-num { font-size: 11px; color: var(--muted); margin-bottom: 1.5rem; }
.project-title { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: .75rem; }
.project-desc { color: var(--muted); font-size: 13px; margin-bottom: 1.5rem; }
.project-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid rgba(200, 169, 110, 0.3); /* Subtle gold border for tags */
  background: rgba(200, 169, 110, 0.05);
  padding: .3rem .7rem; color: var(--accent);
  border-radius: 4px;
}
.project-arrow { float: right; color: var(--accent); font-size: 1.2rem; margin-top: -.5rem; }

/* ── EXPERIENCE ── */
#experience .timeline, #education .timeline { margin-top: 3rem; display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: grid; grid-template-columns: 180px 1fr;
  gap: 3rem; padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}
.timeline-date { color: var(--muted); font-size: 12px; padding-top: .2rem; }
.timeline-role { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: .25rem; }
.timeline-company { color: var(--accent); font-size: 12px; margin-bottom: .75rem; }
.timeline-desc { color: var(--muted); font-size: 13px; }

/* ── CERTIFICATIONS (3D COVERFLOW) ── */
.carousel-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.carousel-viewport {
  position: relative;
  width: 100%;
  max-width: 800px; /* Constrains how far the side cards spread out */
  height: 380px;
  perspective: 1200px; /* The 3D camera depth */
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-card {
  position: absolute;
  width: 280px;
  /* Premium Dark Gradient */
  background: linear-gradient(145deg, rgba(30,30,30,0.9) 0%, rgba(14,14,14,0.95) 100%);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  padding: 2.5rem 1.5rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s, z-index 0.6s;
  opacity: 0;
  pointer-events: none; /* Disables clicking on hidden background cards */
}

/* ── The Logo Box ── */
.card-logo {
  height: 40px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}
.card-logo img, .card-logo svg {
  max-height: 100%;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* ── 3D JavaScript State Classes ── */
.carousel-card.card-active {
  transform: translateX(0) translateZ(50px) scale(1);
  opacity: 1;
  z-index: 3;
  pointer-events: auto;
  border-color: var(--accent); /* Highlights the middle card gold */
  box-shadow: 0 10px 40px rgba(200, 169, 110, 0.15); /* Gold glow */
}

.carousel-card.card-prev {
  transform: translateX(-65%) translateZ(-100px) rotateY(25deg); /* Tilted left */
  opacity: 0.5;
  z-index: 2;
  pointer-events: auto;
  cursor: pointer; /* Lets user click the side card to bring it forward */
}

.carousel-card.card-next {
  transform: translateX(65%) translateZ(-100px) rotateY(-25deg); /* Tilted right */
  opacity: 0.5;
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
}

.carousel-card.card-hidden {
  transform: translateX(0) translateZ(-300px) scale(0.5);
  opacity: 0;
  z-index: 1;
}

/* Text Tweaks inside the card */
.carousel-card h3 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 0.25rem; line-height: 1.2; }
.cert-issuer { color: var(--muted); font-size: 12px; margin-bottom: 2rem; }
.cert-btn { margin-top: auto; padding: 0.5rem 1.5rem; width: 100%; text-align: center; }

/* ── Carousel Arrows ── */
.carousel-btn {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  width: 45px; height: 45px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; z-index: 5;
}
.carousel-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(200, 169, 110, 0.05); transform: scale(1.05); }

@media (max-width: 768px) {
  .carousel-viewport { height: 320px; }
  .carousel-card { width: 240px; padding: 1.5rem; }
  .carousel-btn { display: none; /* Hide arrows on mobile to save space, let them click the side cards */ }
  .carousel-card.card-prev { transform: translateX(-40%) translateZ(-100px) rotateY(35deg); }
  .carousel-card.card-next { transform: translateX(40%) translateZ(-100px) rotateY(-35deg); }
}

/* ── CONTACT ── */
#contact { text-align: center; }
#contact h2 { margin-bottom: 1rem; }
#contact p { color: var(--muted); margin-bottom: 2.5rem; }
.contact-email {
  display: inline-block;
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  color: var(--text); text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: .25rem;
  transition: color .2s;
}
.contact-email:hover { color: var(--accent); }
.social-row { display: flex; justify-content: center; gap: 2rem; margin-top: 3rem; }
.social-row a { color: var(--muted); text-decoration: none; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; transition: color .2s; }
.social-row a:hover { color: var(--text); }

/* ── FOOTER ── */
footer {
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: 11px;
}

/* ── GSAP initial states (FOUC Prevention) ── */
.hero-eyebrow, 
.hero-desc, 
.hero-cta > *, 
.deco-line, 
.gsap-fade,
.project-card,
.timeline-item,
.connected-timeline-item,
.cert-item, 
.section-label,
#contact h2,
#contact p,
.contact-email,
.social-row a,
footer {
  visibility: hidden;
}

/* Ensure h1 stays visible on load for the ScrambleText target */
h1 {
  visibility: visible;
}

/* ── JS Magnetic Button Fix ── */
.mag-inner {
  display: inline-block;
  pointer-events: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  #hero { grid-template-columns: 1fr; padding: 7rem 1.5rem 3rem; }
  .hero-visual { display: none; }
  section { padding: 4rem 1.5rem; }
  #about .about-grid { grid-template-columns: 1fr; gap: 3rem; }
  .timeline-item { grid-template-columns: 1fr; gap: .5rem; }
  footer { flex-direction: column; gap: .75rem; text-align: center; }
}

/* ── Typewriter Cursor Color ── */
.typed-cursor {
  color: var(--accent);
}

#typed-text {
  color: var(--text);
}

/* ── CONNECTED TIMELINE (EDUCATION) ── */
.connected-timeline {
  position: relative;
  margin-top: 3rem;
  padding-left: 2rem; /* Space for the line */
}

/* The Vertical Line */
.connected-timeline::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 0;
  left: 6px; /* Centers line behind the dots */
  width: 1px;
  background: var(--border);
}

.connected-timeline-item {
  position: relative;
  padding-bottom: 3.5rem;
}

.connected-timeline-item:last-child {
  padding-bottom: 0;
}

/* The Nodes/Dots */
.timeline-dot {
  position: absolute;
  left: -2rem; 
  top: 0.35rem; 
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  z-index: 2;
  transition: all 0.3s ease;
}

/* Hover Effect (Dot glows) */
.connected-timeline-item:hover .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(200, 169, 110, 0.4);
  transform: scale(1.2);
}

/* ── Content & Logo Layout ── */
.connected-timeline-content {
  padding-left: 1.5rem;
}

.timeline-header {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  margin-bottom: 1rem;
}

/* Premium Logo Styling */
.timeline-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05); /* Very subtle background for contrast */
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  flex-shrink: 0; /* Prevents the logo from squishing on mobile */
}


/* ── PROJECT MODAL ── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg); /* Uses your dark background variable */
  padding: 3rem;
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  position: relative;
  transform: translateY(30px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy pop-up */
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--accent); /* Uses your gold/accent variable */
}

.modal-buttons {
  margin-top: 2.5rem;
  display: flex;
  gap: 1rem;
}

/* Typography inside the timeline */
.timeline-meta .timeline-date { color: var(--muted); font-size: 12px; margin-bottom: 0.25rem; font-family: var(--font-mono); }
.timeline-meta .timeline-title { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 0.25rem; color: var(--text); }
.timeline-meta .timeline-issuer { color: var(--accent); font-size: 13px; margin: 0; }
.connected-timeline-content .timeline-desc { color: var(--muted); font-size: 13px; line-height: 1.6; max-width: 600px; }