/* =====================================================================
   styles.css — Premium Personal Portfolio (Slate Blue Theme)
   ===================================================================== */

/* ---- Fonts & Variables ---------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  /* Dynamic Color Palette - Slate & Sky Blue */
  --bg-body: #0f172a;
  /* Deep Slate */
  --bg-card: #1e293b;
  /* Lighter Slate */
  --bg-card-hover: #334155;
  /* Hover Slate */

  --text-main: #f1f5f9;
  /* Soft White */
  --text-muted: #94a3b8;
  /* Muted Blue-Grey */
  --text-accent: #38bdf8;
  /* Sky Blue */

  --primary: #38bdf8;
  /* Sky Blue */
  --primary-dark: #0284c7;
  /* Darker Blue */

  --border-light: rgba(255, 255, 255, 0.1);
  --glass-border: 1px solid rgba(148, 163, 184, 0.1);

  --gradient-text: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
  --gradient-main: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);

  /* Spacing & Layout */
  --nav-h: 80px;
  --container-width: 1100px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;

  /* Fonts */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* ---- Reset & Base --------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.3s ease;
}

ul,
ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Typography ----------------------------------------------------- */
h1,
h2,
h3,
h4,
.brand {
  font-family: var(--font-heading);
  margin: 0;
}

h1 {
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: clamp(2rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 32px;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--gradient-main);
  margin-top: 8px;
  border-radius: 2px;
}

.text-gradient {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- Components ----------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--primary);
  color: #0f172a;
  font-weight: 700;
  border-radius: 50px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px 0 rgba(0, 118, 255, 0.39);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 118, 255, 0.23);
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  box-shadow: none;
}

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
}

.section {
  padding: 100px 0;
  /* Scroll Reveal Animation Init */
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Navigation ----------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: var(--glass-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.brand span {
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
}

.nav a:hover,
.nav a.active {
  color: var(--text-main);
}

.nav-toggle {
  display: none;
}

/* ---- Hero Section --------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}

/* Background blob for style */
.hero::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15), transparent 70%);
  filter: blur(80px);
  z-index: -1;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 64px;
}

.tagline {
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 24px;
  display: inline-block;
  padding: 6px 16px;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 100px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.hero-photo-container {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-photo {
  width: 380px;
  height: 380px;
  border-radius: 30px;
  /* Squircle */
  overflow: hidden;
  position: relative;
  z-index: 2;
  box-shadow: 20px 20px 60px rgba(0, 0, 0, 0.3);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-bg-decoration {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid var(--primary);
  border-radius: 30px;
  top: 24px;
  right: -24px;
  z-index: 1;
  opacity: 0.2;
}

/* ---- About & Skills ------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
}

.about-text p {
  margin-bottom: 24px;
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Resume Summary Box */
.resume-summary {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.resume-section-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.skill-tag {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-main);
  transition: 0.3s;
}

.skill-tag:hover {
  background: rgba(56, 189, 248, 0.1);
  color: var(--primary);
  border-color: var(--primary);
}

.cert-list li {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cert-list li::before {
  content: '✓';
  color: var(--primary);
}

/* ---- Experience Timeline -------------------------------------------- */
.timeline {
  border-left: 2px solid var(--bg-card-hover);
  margin-left: 10px;
  padding-left: 40px;
}

.timeline-item {
  position: relative;
  margin-bottom: 64px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -47px;
  top: 4px;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 6px var(--bg-body);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: block;
}

.timeline-item h3 {
  font-size: 1.5rem;
  margin-bottom: 4px;
  color: var(--text-main);
}

.timeline-role {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 16px;
  display: block;
}

/* ---- Projects Grid -------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 40px 32px;
  transition: 0.4s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-8px);
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.3);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover::before {
  opacity: 1;
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.card p {
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.7;
}

.card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ---- Contact -------------------------------------------------------- */
.contact-wrapper {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 40px;
}

.social-link {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-card);
  border: var(--glass-border);
  transition: 0.3s;
  color: var(--text-muted);
}

.social-link:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(56, 189, 248, 0.3);
}

/* ---- Footer --------------------------------------------------------- */
.site-footer {
  padding: 48px 0;
  text-align: center;
  border-top: var(--glass-border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---- Responsive ----------------------------------------------------- */
@media (max-width: 900px) {
  :root {
    --nav-h: 70px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 48px;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-photo-container {
    order: -1;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .resume-summary {
    order: 2;
  }

  .nav-toggle {
    display: block;
    font-size: 1.5rem;
    color: var(--text-main);
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    width: 100%;
    background: var(--bg-body);
    flex-direction: column;
    padding: 32px;
    gap: 24px;
    border-bottom: var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  .nav.open {
    display: flex;
  }
}

/* ---- Project Modals ------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  z-index: 10;
}

.modal-close:hover {
  background: var(--primary);
  color: #000;
}

.modal-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
}

@media (max-width: 768px) {
  .modal-body {
    grid-template-columns: 1fr;
  }
}

.modal-visuals {
  background: #0f172a;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.modal-img-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.modal-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 500;
  background: #0f172a;
}

.modal-img-container img[src=""]+.modal-placeholder {
  display: flex;
}

.modal-img-container img:not([src=""])+.modal-placeholder {
  display: none;
}

.modal-img-container img[src="#"]+.modal-placeholder {
  display: flex;
}

.modal-info {
  padding: 40px;
}

.modal-tag {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  display: block;
}

.modal-info h3 {
  font-size: 2rem;
  margin-bottom: 16px;
  line-height: 1.2;
}

.modal-tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.modal-tech-item {
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.modal-actions {
  margin-top: 32px;
  display: flex;
  gap: 16px;
}

/* ---- Project Accordion ---------------------------------------------- */
.project-card {
  transition: all 0.3s ease;
}

.project-card.expanded {
  transform: scale(1.01);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-card .card-preview {
  margin-bottom: 16px;
  color: var(--text-muted);
}

.project-details {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-details .detailed-desc {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tech-tag {
  font-size: 0.75rem;
  padding: 6px 12px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  color: var(--primary);
  font-weight: 500;
}

.project-toggle {
  margin-top: 16px;
  width: 100%;
}

/* Carousel Controls */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 5;
  transition: 0.2s;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.carousel-btn.prev {
  left: 0;
}

.carousel-btn.next {
  right: 0;
}

.carousel-counter {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* ---- Contact Form --------------------------------------------------- */
.contact-form {
  max-width: 600px;
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 16px 20px;
  background: #1e293b;
  /* Explicit dark slate */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #f1f5f9;
  /* Light text */
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #0f172a;
  /* Darker on focus */
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

.form-group textarea {
  resize: vertical;
}

/* ---- Full-Page Project Modal ---------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-body);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  padding: 60px 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  width: 100%;
  max-width: 800px;
  margin: auto;
  position: relative;
  transform: translateY(40px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6);
  padding: 48px;
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
  z-index: 10000;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-close:hover {
  background: var(--primary);
  color: #000;
  transform: rotate(90deg);
}

.modal-body {
  display: block;
}

.modal-visuals {
  display: none;
}

#modalImg {
  width: 100%;
  border-radius: 16px;
  margin-bottom: 32px;
}

#modalTag {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  display: block;
}

#modalTitle {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  line-height: 1.2;
}

#modalDesc {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 1.1rem;
  margin-bottom: 32px;
}

#modalTech {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.modal-tech-item {
  font-size: 0.85rem;
  padding: 8px 16px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  color: var(--primary);
  font-weight: 500;
}

.modal-actions {
  margin-top: 32px;
}

.modal-actions .btn {
  font-size: 1rem;
}


@media (max-width: 768px) {
  .modal-content {
    padding: 32px 24px;
  }

  #modalTitle {
    font-size: 1.8rem;
  }

  .modal-close {
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
  }
}

/* ---- Extra Mobile Optimizations ------------------------------------- */

@media (max-width: 480px) {
  :root {
    --container-width: 100%;
    --nav-h: 60px;
  }

  .container {
    padding: 0 16px;
  }

  /* Typography Adjustments */
  h1 {
    font-size: 2rem;
    /* Fallback */
    font-size: clamp(2rem, 8vw, 3rem);
    line-height: 1.1;
  }

  h2 {
    font-size: 1.5rem;
  }

  .section {
    padding: 48px 0;
  }

  /* Hero Section */
  .hero {
    padding-top: calc(var(--nav-h) + 10px);
    min-height: auto;
    padding-bottom: 48px;
  }

  .hero-inner {
    gap: 24px;
  }

  .hero-photo {
    width: 240px;
    height: 240px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn,
  .hero-actions .btn-outline {
    width: 100%;
    justify-content: center;
  }

  /* Resume/Skills */
  .resume-summary {
    padding: 24px;
  }

  /* Projects */
  .cards {
    grid-template-columns: 1fr;
    /* Stack cards on very small screens */
  }

  .card {
    padding: 24px;
  }

  /* Modals */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
    /* Slide up from bottom feeling */
  }

  .modal-content {
    border-radius: 24px 24px 0 0;
    max-height: 85vh;
    margin: 0;
    width: 100%;
    transform: translateY(100%);
  }

  .modal-overlay.active .modal-content {
    transform: translateY(0);
  }

  .modal-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }
}