/* ============================================
   Modern Minimal + Geo Accents Portfolio Theme
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary: #fafafa;
  --bg-card: #ffffff;
  --bg-accent: #eff6ff;
  --bg-section-alt: #f1f5f9;
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-blue-light: #dbeafe;
  --text-primary: #1a1a2e;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 20px 50px rgba(26,26,46,0.08);
  --shadow-xl: 0 25px 60px rgba(26,26,46,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --transition: all 0.3s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-blue-hover); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  color: var(--text-primary);
  margin: 0 0 0.5em;
  line-height: 1.2;
  font-weight: 700;
}

/* --- Dot Grid Background --- */
.dot-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(26,26,46,0.06) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 0 48px;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(250,250,250,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  z-index: 1000;
  transition: var(--transition);
}

.nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-logo {
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.nav-logo .dot { color: var(--accent-blue); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-blue);
  transition: width 0.3s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}
.nav-links a.active::after,
.nav-links a:hover::after {
  width: 100%;
}

.nav-cta {
  padding: 8px 20px !important;
  background: var(--text-primary) !important;
  color: #fff !important;
  border-radius: var(--radius-sm);
  font-size: 13px !important;
  font-weight: 600 !important;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover {
  background: var(--accent-blue) !important;
  color: #fff !important;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
  border-radius: 1px;
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- Sections --- */
section {
  position: relative;
  z-index: 1;
}

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

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}
.section-header h2 {
  font-size: 32px;
  font-weight: 700;
  margin: 0;
}
.section-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-blue);
  padding: 4px 10px;
  background: var(--bg-accent);
  border-radius: 4px;
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
}

.hero .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
  width: 100%;
}

.hero-content {
  max-width: 620px;
  flex-shrink: 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-accent);
  border: 1px solid var(--accent-blue-light);
  border-radius: 20px;
  font-size: 13px;
  color: var(--accent-blue);
  font-weight: 600;
  margin-bottom: 28px;
}
.hero-badge .pin {
  width: 8px; height: 8px;
  background: var(--accent-blue);
  border-radius: 50%;
  position: relative;
}
.hero-badge .pin::after {
  content: '';
  position: absolute;
  top: -3px; left: -3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-blue);
  opacity: 0.3;
  animation: ping 2s infinite;
}
@keyframes ping {
  0% { transform: scale(1); opacity: 0.3; }
  100% { transform: scale(2); opacity: 0; }
}

.hero h1 {
  font-size: 52px;
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.hero-subtitle {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--text-primary);
  border: none;
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: var(--transition);
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--accent-blue);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37,99,235,0.25);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: var(--transition);
  text-decoration: none;
}
.btn-outline:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 48px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.stat-item .stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}
.stat-item .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Geo visual decoration */
.geo-visual {
  position: relative;
  width: 420px;
  height: 420px;
  flex-shrink: 0;
}
.contour-line {
  position: absolute;
  border: 1px solid rgba(37,99,235,0.08);
  transition: all 2s;
}
.contour-line:nth-child(1) {
  width: 420px; height: 420px; top: 0; left: 0;
  border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
}
.contour-line:nth-child(2) {
  width: 340px; height: 340px; top: 40px; left: 40px;
  border-radius: 55% 45% 42% 58% / 52% 48% 52% 48%;
}
.contour-line:nth-child(3) {
  width: 260px; height: 260px; top: 80px; left: 80px;
  background: rgba(37,99,235,0.02);
  border-radius: 48% 52% 55% 45% / 45% 55% 45% 55%;
}
.contour-line:nth-child(4) {
  width: 180px; height: 180px; top: 120px; left: 120px;
  border-radius: 52% 48% 45% 55% / 55% 45% 55% 45%;
}
.contour-line:nth-child(5) {
  width: 100px; height: 100px; top: 160px; left: 160px;
  background: rgba(37,99,235,0.04);
  border-radius: 45% 55% 52% 48% / 48% 52% 48% 52%;
}
.map-pin-deco {
  position: absolute;
  width: 12px; height: 12px;
  background: var(--accent-blue);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}
.map-pin-deco:nth-of-type(1) { top: 30%; left: 55%; }
.map-pin-deco:nth-of-type(2) { top: 60%; left: 35%; width: 8px; height: 8px; opacity: 0.5; }
.map-pin-deco:nth-of-type(3) { top: 45%; left: 70%; width: 10px; height: 10px; opacity: 0.7; }
.coord-tag {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(37,99,235,0.3);
  padding: 2px 6px;
  background: rgba(37,99,235,0.03);
  border-radius: 3px;
}
.coord-tag:nth-of-type(1) { top: 28%; left: 62%; }
.coord-tag:nth-of-type(2) { bottom: 28%; right: 18%; }

/* --- About --- */
.about {
  padding: 100px 0;
}
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: start;
}
.about-text p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.about-tagline {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-blue);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.skill-pill {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition);
}
.skill-pill:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: var(--bg-accent);
}

/* --- Projects --- */
.projects {
  padding: 100px 0;
  background: var(--bg-section-alt);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}
.project-card-img {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
  background: var(--bg-section-alt);
}
.project-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.project-card:hover .project-card-img img {
  transform: scale(1.05);
}
.project-card-info {
  padding: 20px;
}
.project-card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-blue);
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.project-card-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}
.project-card-info p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-tech {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.project-tech span {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-section-alt);
  color: var(--text-secondary);
  font-weight: 500;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
}
.modal-close:hover {
  background: var(--bg-section-alt);
  color: var(--text-primary);
}

.modal-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-blue);
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.modal-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-right: 40px;
}
.modal-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.modal-tags span {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-accent);
  color: var(--accent-blue);
  font-weight: 500;
}
.modal-description {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 28px;
}
.modal-description p {
  margin-bottom: 12px;
}

.modal-media {
  margin-bottom: 24px;
}

/* Iframe wrapper (16:9) */
.iframe-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-section-alt);
  border: 1px solid var(--border);
}
.iframe-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.gallery-grid.single-col {
  grid-template-columns: 1fr;
}
.gallery-grid img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.gallery-grid img:hover {
  box-shadow: var(--shadow-md);
  transform: scale(1.02);
}

.modal-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.modal-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
}
.modal-link-btn.primary {
  background: var(--accent-blue);
  color: #fff;
}
.modal-link-btn.primary:hover {
  background: var(--accent-blue-hover);
  color: #fff;
}
.modal-link-btn.secondary {
  background: var(--bg-section-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.modal-link-btn.secondary:hover {
  border-color: var(--text-secondary);
}

body.modal-open {
  overflow: hidden;
}

/* --- Contact --- */
.contact {
  padding: 100px 0;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  transition: var(--transition);
  text-decoration: none;
  display: block;
}
.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-blue-light);
}
.contact-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  background: var(--bg-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.contact-card h3 {
  font-size: 16px;
  margin-bottom: 4px;
}
.contact-card p {
  font-size: 13px;
  color: var(--text-muted);
}
.contact-resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  padding: 14px 28px;
  background: var(--accent-blue);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  text-decoration: none;
}
.contact-resume-btn:hover {
  background: var(--accent-blue-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37,99,235,0.25);
}

/* --- Footer --- */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer p {
  font-size: 13px;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 12px;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 13px;
  transition: var(--transition);
}
.footer-links a:hover { color: var(--accent-blue); }

/* --- Resume Page --- */
.resume-page {
  padding-top: 100px;
  padding-bottom: 60px;
}

.resume-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 60px;
  flex-wrap: wrap;
  gap: 20px;
}
.resume-header h1 {
  font-size: 36px;
}

.resume-section {
  margin-bottom: 60px;
}
.resume-section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-blue);
  margin-bottom: 32px;
  display: inline-block;
}

/* Education & Experience cards */
.resume-card {
  display: flex;
  gap: 20px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  transition: var(--transition);
}
.resume-card:hover {
  box-shadow: var(--shadow-sm);
}
.resume-card-logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
}
.resume-card-logo img {
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
}
.resume-card-content {
  flex: 1;
  min-width: 0;
}
.resume-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
  flex-wrap: wrap;
  gap: 8px;
}
.resume-card-header h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}
.resume-card-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.resume-card-role {
  font-size: 14px;
  color: var(--accent-blue);
  font-weight: 500;
  margin-bottom: 4px;
}
.resume-card-location {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.resume-card ul {
  margin: 0;
  padding-left: 18px;
}
.resume-card li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 6px;
}

/* Sub-role within same company */
.resume-sub-role {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

/* Skills section */
.skills-section-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.skill-category h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 12px;
}
.skill-category p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- Scroll Reveal --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .hero .container { flex-direction: column; text-align: center; }
  .hero-content { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .stats-bar { justify-content: center; }
  .geo-visual { display: none; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav { padding: 0 24px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(250,250,250,0.98);
    backdrop-filter: blur(20px);
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .nav-hamburger { display: flex; }

  .container { padding: 0 24px; }

  .hero h1 { font-size: 36px; }
  .hero-subtitle { font-size: 16px; }
  .stats-bar { flex-direction: column; gap: 20px; align-items: center; }

  .project-grid { grid-template-columns: 1fr; }
  .skills-section-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }

  .modal-content { padding: 24px; width: 95%; }
  .modal-title { font-size: 22px; }

  .resume-card { flex-direction: column; }
  .resume-card-header { flex-direction: column; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 28px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn-primary,
  .hero-actions .btn-outline { width: 100%; justify-content: center; }
  .section-header h2 { font-size: 24px; }
}
