/**
 * Portfolio - Rajat Bajwa
 * Light theme - Warm, energetic, client-friendly
 */

/* ========== Variables ========== */
:root {
  --bg: #fefdfb;
  --bg-warm: #faf8f5;
  --bg-card: #ffffff;
  --accent: #ea580c;
  --accent-light: #f97316;
  --accent-soft: rgba(234, 88, 12, 0.12);
  --accent-glow: rgba(234, 88, 12, 0.25);
  --text: #1c1917;
  --text-muted: #57534e;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 12px 40px rgba(234, 88, 12, 0.15);
  --font: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ========== Reset & Base ========== */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-light);
}

#main {
  margin-left: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========== Top Navigation ========== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  background: rgba(254, 253, 251, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  transition: all 0.3s;
}

.top-nav.scrolled {
  padding: 12px 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text) !important;
  letter-spacing: -0.02em;
}

.nav-logo:hover {
  color: var(--accent) !important;
}

.nav-menu ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 32px;
}

.nav-menu a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--accent);
}

.nav-social {
  display: flex;
  gap: 12px;
}

.nav-social a {
  color: var(--text-muted);
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-social a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* Mobile nav toggle */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: 0.3s;
}

.mobile-nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 1199px) {
  .mobile-nav-toggle {
    display: flex;
  }

  .nav-menu,
  .nav-social {
    display: none;
  }

  .mobile-nav-active .nav-menu {
    display: block;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }

  .mobile-nav-active .nav-menu ul {
    flex-direction: column;
    gap: 0;
  }

  .mobile-nav-active .nav-menu a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }

  .mobile-nav-active .nav-menu a:last-child {
    border-bottom: none;
  }
}

/* ========== Hero ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 100% 80% at 50% 0%, var(--accent-soft), transparent 60%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(249, 115, 22, 0.12), transparent),
    radial-gradient(ellipse 70% 50% at 20% 80%, rgba(234, 88, 12, 0.08), transparent),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-warm) 100%);
  pointer-events: none;
}

/* Floating code decor */
.hero-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-code {
  position: absolute;
  font-family: var(--font-mono);
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 500;
  color: rgba(234, 88, 12, 0.08);
  white-space: nowrap;
  animation: heroFloat 20s ease-in-out infinite;
}

.hero-code:nth-child(1) { top: 15%; right: 10%; animation-delay: 0s; }
.hero-code:nth-child(2) { top: 60%; left: 5%; animation-delay: -7s; }
.hero-code:nth-child(3) { bottom: 20%; right: 20%; animation-delay: -14s; font-size: 1.5rem; }

@keyframes heroFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(10px, -15px) rotate(2deg); }
  66% { transform: translate(-5px, 10px) rotate(-1deg); }
}

.hero-inner {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content {
  position: relative;
  text-align: left;
}

.hero-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding: 6px 12px;
  background: var(--accent-soft);
  border-radius: 6px;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 20px;
}

.hero-typed {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.hero-typed .typed {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

.btn-hero {
  display: inline-block;
  padding: 14px 32px;
  background: var(--accent);
  color: #fff !important;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s;
}

.btn-hero:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

/* Hero image */
.hero-visual {
  position: relative;
}

.hero-image-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(234, 88, 12, 0.2), 0 8px 24px rgba(0, 0, 0, 0.1);
}

.hero-image-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.1) 0%, transparent 50%);
  z-index: 1;
  pointer-events: none;
}

.hero-image-wrap img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
}

.hero-image-badge {
  position: absolute;
  bottom: 24px;
  left: 24px;
  background: var(--bg-card);
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 2;
}

.hero-image-badge span {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.hero-image-badge small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    text-align: center;
  }

  .hero-visual {
    order: -1;
  }

  .hero-image-wrap img {
    height: 280px;
  }

  .hero-code {
    display: none;
  }
}

/* ========== Sections ========== */
.section {
  padding: 100px 0;
}

.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}

.section-intro {
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 40px;
}

/* ========== About ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 60px;
  align-items: start;
}

.about-visual img {
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.about-content h2 {
  margin-bottom: 20px;
}

.about-content p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.about-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 32px;
  margin-top: 32px;
}

.info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-size: 0.95rem;
}

.info-value a {
  color: var(--text);
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-info {
    grid-template-columns: 1fr;
  }
}

/* ========== Certifications ========== */
.facts-section {
  background: var(--bg-warm);
}

.badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 24px;
}

.badge-item {
  transition: transform 0.3s;
}

.badge-item:hover {
  transform: scale(1.02);
}

/* ========== Skills / Tech Stack ========== */
.skills-section {
  background: var(--bg);
}

.tech-stack {
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin-top: 40px;
}

.tech-category {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tech-category-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-soft);
  width: fit-content;
}

.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.tech-badge:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.tech-badge i {
  font-size: 1.75rem;
  line-height: 1;
}

.tech-badge span {
  font-weight: 500;
  font-size: 0.95rem;
}

/* Devicon icons - colored by default, sized in .tech-badge i */

/* ========== Portfolio - Bento Grid ========== */
.portfolio-section {
  background: var(--bg-warm);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 200px;
  gap: 20px;
  margin-top: 40px;
}

.bento-item {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.bento-item:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.bento-normal {
  grid-column: span 1;
  grid-row: span 1;
}

.bento-wide {
  grid-column: span 2;
}

.bento-tall {
  grid-row: span 2;
}

.bento-image {
  position: absolute;
  inset: 0;
}

.bento-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bento-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28, 25, 23, 0.9) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  opacity: 0.85;
  transition: opacity 0.3s;
}

.bento-item:hover .bento-overlay {
  opacity: 1;
  background: linear-gradient(to top, rgba(28, 25, 23, 0.95), rgba(28, 25, 23, 0.5));
}

.bento-overlay .bento-title {
  color: #fff;
}

.bento-overlay .bento-link {
  color: var(--accent-light);
}

.bento-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.bento-link {
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 4px;
}

.portfolio-more {
  text-align: center;
  color: var(--text-muted);
  margin-top: 40px;
}

@media (max-width: 900px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-wide {
    grid-column: span 2;
  }

  .bento-tall {
    grid-row: span 1;
  }
}

@media (max-width: 600px) {
  .bento-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 180px;
  }

  .bento-wide {
    grid-column: span 1;
  }
}

/* ========== Resume ========== */
.resume-section {
  background: var(--bg);
}

.resume-download {
  margin-left: 12px;
  color: var(--accent);
  font-size: 1.25rem;
}

.resume-download:hover {
  color: var(--accent-dim);
}

.resume-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 40px;
}

.resume-col h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 24px;
  font-weight: 600;
}

.resume-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.resume-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.resume-card h4 {
  font-size: 1rem;
  margin: 0 0 8px;
}

.resume-period {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.resume-place {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.resume-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .resume-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Contact ========== */
.contact-section {
  background: var(--bg-warm);
  padding-bottom: 120px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  margin-top: 40px;
}

.contact-item {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.contact-item i {
  font-size: 1.5rem;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-item h4 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 4px;
  font-weight: 500;
}

.contact-item p {
  margin: 0;
}

.contact-item a {
  color: var(--text);
}

.contact-item a:hover {
  color: var(--accent);
}

.contact-info iframe {
  width: 100%;
  height: 220px;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-top: 24px;
  box-shadow: var(--shadow);
}

.contact-form-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.contact-form-wrap .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.contact-form-wrap .row .form-group {
  margin-bottom: 20px;
}

@media (max-width: 576px) {
  .contact-form-wrap .row {
    grid-template-columns: 1fr;
  }
}

.contact-form-wrap .form-group {
  margin-bottom: 20px;
}

.contact-form-wrap label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.contact-form-wrap input,
.contact-form-wrap textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.contact-form-wrap input:focus,
.contact-form-wrap textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.contact-form-wrap textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-form-wrap button[type="submit"] {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.contact-form-wrap button[type="submit"]:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: var(--accent-glow);
}

.contact-form-wrap .loading,
.contact-form-wrap .error-message,
.contact-form-wrap .sent-message {
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 16px;
  display: none;
}

.contact-form-wrap .error-message {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.contact-form-wrap .sent-message {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.contact-form-wrap .loading {
  background: var(--bg-warm);
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Footer ========== */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ========== Back to top ========== */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s;
  z-index: 999;
  box-shadow: var(--shadow);
}

.back-to-top:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.back-to-top.active {
  visibility: visible;
  opacity: 1;
}

/* ========== Scroll behavior for nav ========== */
@media (min-width: 1200px) {
  .top-nav {
    padding: 24px 0;
  }
}
