/* MY STYLESHEET
   Refactored for Glassmorphism, Scientific Aesthetic, and Dynamic Components.
*/

/* --- FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;700&family=Montserrat:wght@300;400;600;800&family=Merriweather:ital,wght@0,300;0,700;1,300&display=swap');

/* --- VARIABLES --- */
:root {
  /* Dark Theme (Starfield) */
  --bg-color: #050505; 
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --accent: #38bdf8; /* Sky Blue */
  --accent-glow: rgba(56, 189, 248, 0.3);
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --line-color: #2e4058;
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Merriweather', serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Light Theme overrides (Solar Surface) */
/* The JS will handle the canvas, CSS handles the overlays */
body.light-mode {
  --bg-color: #fdefcc; /* Warm white */
  --text-primary: #4a0404; /* Dark Red/Brown */
  --text-secondary: #7c2d12; /* Rust */
  --accent: #d97706; /* Amber */
  --accent-glow: rgba(217, 119, 6, 0.2);
  --glass-bg: rgba(183, 131, 102, 0.6);
  --glass-border: rgba(255, 165, 0, 0.2);
  --card-shadow: 0 8px 32px 0 rgba(255, 140, 0, 0.15);
  --line-color: #334155;
}

p {
      margin-bottom: 1em; /* or use px, rem, etc. */
}
/* --- RESET & BASICS --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: color 0.3s ease;
}

/* --- BACKGROUND CANVAS --- */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* Pixelated for retro feel */
  image-rendering: pixelated; 
}

/* --- LAYOUT --- */
.site {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-pad-small { padding: 40px 0; }
.section-pad-big { padding: 80px 0; }

/* --- HEADER --- */
header {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  padding: 20px 40px;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.2); /* Slight tint */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
}

.logo a {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--text-primary);
  text-transform: capitalize;
  letter-spacing: 1px;
}
.logo span { color: var(--accent); }

nav ul { display: flex; list-style: none; gap: 30px; }
nav a {
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  transition: color 0.3s;
}
nav a:hover { color: var(--accent); }

/* Theme Toggle */
.theme-toggle-checkbox { display: none; }
.theme-toggle-label { cursor: pointer; font-size: 1.2rem; }
.theme-toggle-label .fa-sun { display: none; }
#theme-toggle:checked ~ .site .theme-toggle-label .fa-moon { display: none; }
#theme-toggle:checked ~ .site .theme-toggle-label .fa-sun { display: inline-block; color: rgb(255, 98, 0); }

/* --- HERO --- */
.hero {
  height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 4rem;
  margin-bottom: 20px;
  text-shadow: 0 0 20px var(--accent-glow);
}

.hero h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
}

.hero p {
  font-size: 1.5rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.hero-img { flex: 1; display: flex; justify-content: left; }
.hero-img img {
  width: 400px; height: 400px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  box-shadow: var(--shadow);
}
/* Small Hero for internal pages */
.small-hero { min-height: 40vh; text-align: center; justify-content: center; }

.var-text { color: var(--accent); font-weight: 700; }
/* --- GRAPHIC 1: Architecture Flow Diagram --- */
.architecture-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.03); /* Subtle glass effect */
    border: 1px solid var(--outline);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.arch-step {
    text-align: center;
    max-width: 150px;
}

.arch-icon {
    font-size: 2.2rem;
    color: var(--accent-2); /* Uses your Teal variable */
    margin-bottom: 12px;
    transition: transform 0.3s ease, color 0.3s ease;
}

/* Hover Effect: Icon pops up and turns orange */
.arch-step:hover .arch-icon {
    transform: translateY(-5px) scale(1.1);
    color: var(--accent-3); 
}

.arch-step h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
}

.arch-step p {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.4;
}

.arch-arrow {
    color: var(--muted);
    opacity: 0.3;
    font-size: 1.2rem;
}

/* Mobile Responsive for Diagram */
@media (max-width: 768px) {
    .architecture-diagram {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    .arch-arrow {
        transform: rotate(90deg); /* Point arrows down on mobile */
    }
}

/* --- GRAPHIC 2: Model Chart Zoom Effect --- */
.model-chart-wrapper {
    color: var(--muted);
    background-color: var(--accent-glow);
    margin-top: 50px;
    text-align: center;
    position: relative; /* Context for z-index */
}

.chart-caption {
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-style: italic;
    font-family: 'Merriweather', serif;
}

.img-container {
    width: 100%;
    max-width: 700px; /* Limits width so it doesn't span the whole screen */
    margin: 0 auto;
    /* Ensure the container doesn't clip the image when it grows */
    overflow: visible; 
    perspective: 1000px;
}

.zoom-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--outline);
    box-shadow: var(--shadow);
    /* The magic transition: smooth grow effect */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
    cursor: zoom-in;
    background: var(--surface); /* Prevents transparency issues behind the image */
    position: relative;
    z-index: 10;
}

/* THE HOVER TRIGGER */
.zoom-img:hover {
    transform: scale(1.1); /* Grow 1.5x size */
    z-index: 100; /* Sit on top of absolutely everything */
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    border-color: var(--accent-2);
}

/* Mobile Tweak: Don't zoom as much on phones or it goes off-screen */
@media (max-width: 768px) {
    .zoom-img:hover {
        transform: scale(1.1);
    }
}
/* --- GLASS CARDS (General) --- */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--card-shadow);
  margin-bottom: 40px;
}

h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
}
h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--accent);
}

/* --- TIMELINE SECTION --- */
.timeline-wrapper {
  width: 100%;
  overflow-x: auto;
  padding: 40px 0;
  /* Hide scrollbar */
  scrollbar-width: none; 
  -ms-overflow-style: none;
  cursor: grab;
  background: var(--accent-glow);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}
.timeline-wrapper::-webkit-scrollbar { display: none; }
.timeline-wrapper:active { cursor: grabbing; }

.timeline-track {
  display: flex;
  align-items: center;
  position: relative;
  min-width: fit-content;
  padding: 0 50px;
}
/* The central line */
.timeline-track::before {
  content: '';
  position: absolute;
  left: 20px; right: 0px; top: 50%;
  height: 2px;
  background: var(--text-secondary);
  opacity: 0.7;
  z-index: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
/* The Arrow Head at the end */
.timeline-track::after {
    content: '';
    position: absolute;
    left: +20px; /* Adjust based on arrow size */
    top: 50%;
    transform: scale(3) translateY(-8%);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 20px solid var(--line-color);
}
.timeline-item {
  width: 350px;
  margin: 0 30px;
  position: relative;
  flex-shrink: 0;
  z-index: 1;
}

.t-dot {
  width: 16px; height: 16px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px var(--bg-color); /* fake gap */
  transition: transform 0.3s;
}

.timeline-item:hover .t-dot { transform: translate(-50%, -50%) scale(1.5); }

.t-content {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  padding: 25px;
  border-radius: 12px;
  border-left: 3px solid var(--accent);
  transition: transform 0.3s, box-shadow 0.3s;
}
.timeline-item:hover .t-content {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow);
}

/* Alternating */
.timeline-item:nth-child(odd) { margin-bottom: 400px; }
.timeline-item:nth-child(even) { margin-top: 400px; }

/* Connector lines */
.timeline-item:nth-child(odd) .t-content::after { 
  content: ''; position: absolute; bottom: -7%; left: 40%;
  width: 2px; height: 5%; background: var(--accent); opacity: 1; 
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px;
  border-top: 5px;
}
.timeline-item:nth-child(even) .t-content::before {
  content: ''; position: absolute; top: -7%; left: 40%;
  width: 2px; height: 5%; background: var(--accent); opacity: 1; 
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px;
  border-top: 5px;
}

.t-date { font-family: var(--font-mono); color: var(--accent); font-size: 0.85rem; font-weight: bold; display: block; margin-bottom: 5px; }
.t-role { font-family: var(--font-heading); font-size: 1.1rem; color: var(--text-primary); margin: 0; }
.t-company { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 10px; font-weight: 600;}
.t-desc { font-size: 0.85rem; color: var(--text-primary); opacity: 0.8; }
.t-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.t-tag { font-size: 0.7rem; background: rgba(255,255,255,0.1); padding: 2px 8px; border-radius: 4px; color: var(--text-secondary); }

/* --- PROJECTS --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
}

.project-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.project-card:hover { transform: translateY(-10px); border-color: var(--accent); }

.p-img-box {
  height: 200px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-family: var(--font-mono);
  border-bottom: 1px solid var(--glass-border);
}
/* Use this if you have real images */
.p-img-box img { width: 100%; height: 100%; object-fit: cover; }

.p-info { padding: 25px; flex-grow: 1; display: flex; flex-direction: column;}
.p-info h3 { font-family: var(--font-heading); margin-bottom: 10px; color: var(--accent); }
.p-info p { font-size: 0.9rem; margin-bottom: 15px; opacity: 0.9; }
.p-info a { font-size: 0.9rem; margin-bottom: 15px; opacity: 0.9; }
.p-stack { margin-top: auto; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary); }

/* --- TECH STACK (D3 Container) --- */

#graph-container {
  width: 100%;
  height: 600px;
  background: rgba(0,0,0,0.8);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

/* Tooltip for D3 */
.d3-tooltip {
  position: absolute;
  background: var(--bg-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
  backdrop-filter: blur(4px);
  transform: translate(-50%, -100%); /* Centers above cursor */
  margin-top: -15px;
}

/* --- CONTACT --- */
.contact-box {
  text-align: center;
  padding: 60px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), transparent);
}
.email-link {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  display: block;
  margin: 20px 0;
}
.social-links { display: flex; justify-content: center; gap: 20px; font-size: 1.5rem; }
.social-links a { color: var(--text-secondary); transition: 0.3s; }
.social-links a:hover { color: var(--accent); transform: scale(1.1); }

/* --- HOBBIES STACK (Personal.html) --- */
.carousel-container {
  position: relative;
  width: 100%;
  height: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
  margin-top: 40px;
  margin-bottom: 80px;
}
.stack-card {
  position: absolute;
  width: 80%;
  height: 600px;
  border-radius: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255,255,255,0.3);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px;
  text-align: center;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform, opacity;
  margin-bottom: auto;
}
.stack-icon { font-size: 60px; margin-bottom: 20px; color: var(--accent); }
.stack-card h3 { font-family: var(--font-heading); font-size: 1.8rem; margin-bottom: 15px; }
.stack-card p { font-size: 0.95rem; opacity: 0.8; line-height: 1.6; }
.stack-meta { margin-top: auto; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); border: 1px solid var(--accent); padding: 5px 15px; border-radius: 20px;margin-bottom: auto; }
.stack-img-box {
  height: 60%;
  background:  var(--glass-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-family: var(--font-mono);
  border-bottom: 1px solid var(--glass-border);
  transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 1s ease, border-color 0.5s ease;
  margin-bottom: 10px;
}
 
/* Use this if you have real images */
.stack-img-box img { width: 100%; height: 100%; object-fit: fill; cursor: zoom-in;}
.stack-img-box:hover {
    transform: scale(2); /* Grow 1.5x size */
    z-index: 100; /* Sit on top of absolutely everything */
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    border-color: var(--accent-2);
}
.stack-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  width: 50px; height: 50px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  z-index: 100;
  display: flex; justify-content: center; align-items: center;
  font-size: 20px;
  transition: 0.3s;
}
.stack-nav:hover { background: var(--accent); color: #fff; }
.prev-btn { left: 20px; }
.next-btn { right: 20px; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .timeline-item { width: 280px; }
  .stack-card { width: 280px; height: 450px; }
  header { padding: 15px 20px; }
}