/* ===============================
   Design system for portfolio redesign
 ================================= */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
  --color-bg: #0a0c10;
  --color-bg-rgb: 10, 12, 16;
  --color-surface-muted: #161b22;
  --color-surface-strong: #21262d;
  --color-accent: #0c8ce9;
  --color-accent-muted: rgba(12, 140, 233, 0.16);
  --color-accent-soft: rgba(12, 140, 233, 0.08);
  --color-accent-strong: rgba(12, 140, 233, 0.9);
  --color-accent-focus: rgba(12, 140, 233, 0.6);
  --color-secondary: #6366f1;
  --color-text-primary: #e6edf3;
  --color-text-muted: #8b949e;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.16);
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.2);
  --header-bg: rgba(10, 12, 16, 0.94);
  --btn-send-bg: #0c8ce9;
  --btn-send-hover: #0a78c2;
  --btn-send-text: #fff;
  --btn-send-icon-filter: brightness(0) invert(1);
  --color-chip-bg: #cbe2f5;
  --color-chip-border: #d1dce8;
  --color-chip-text: var(--color-accent);  --icon-filter: brightness(0) invert(1);
  --font-family: 'Space Grotesk', sans-serif;
  --font-display: var(--font-family);
  --font-mono: var(--font-family);
  --text-xs: 11px;
  --text-sm: 13px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: 32px;

  --space-1: 1px;
  --space-2: 2px;
  --space-3: 4px;
  --space-4: 5px;
  --space-5: 7px;
  --space-6: 8px;
  --space-7: 12px;
  --space-8: 32px;
  --space-9: 40px;

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 24px;

  --header-h: 80px;
}

html[data-theme='light'] {
  --color-bg: #f8fafc;
  --color-bg-rgb: 248, 250, 252;
  --color-surface-muted: #f1f5f9;
  --color-surface-strong: #e2e8f0;
  --color-accent: #0c8ce9;
  --color-accent-muted: rgba(12, 140, 233, 0.16);
  --color-accent-soft: rgba(12, 140, 233, 0.08);
  --color-accent-strong: rgba(12, 140, 233, 0.9);
  --color-accent-focus: rgba(12, 140, 233, 0.6);
  --color-text-primary: #0f172a;
  --color-text-muted: #475569;
  --color-border: rgba(15, 23, 42, 0.08);
  --color-border-strong: rgba(15, 23, 42, 0.16);
  --header-bg: rgba(255, 255, 255, 0.94);
  --btn-send-bg: #0c8ce9;
  --btn-send-hover: #0a78c2;
  --btn-send-text: #fff;
  --btn-send-icon-filter: brightness(0) invert(1);
  --color-chip-bg: rgba(12, 140, 233, 0.08);
  --color-chip-border: rgba(12, 140, 233, 0.16);
  --color-chip-text: var(--color-accent);
  --icon-filter: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-size: var(--text-md);
  font-weight: 500;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea {
  font: inherit;
}

button,
.nav-toggle {
  border: none;
  background: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-accent-focus);
  outline-offset: 3px;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  opacity: 0.18;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.05) 100%);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 3.8rem);
}

h2 {
  font-size: clamp(1.9rem, 4vw, 2.4rem);
}

h3 {
  font-size: var(--text-lg);
}

p {
  margin: 0 0 1.2rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.eyebrow {
  font-family: var(--font-family);
  color: var(--color-accent);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  color: var(--color-accent);
  font-family: var(--font-family);
  font-size: var(--text-xs);
  margin-bottom: var(--space-5);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.solid {
  background: var(--color-accent);
  color: #000;
  border-color: transparent;
}

.btn.solid:hover {
  background: var(--color-accent-strong);
}

.btn-send {
  background: var(--btn-send-bg) !important;
  color: var(--btn-send-text) !important;
}

.btn-send:hover {
  background: var(--btn-send-hover) !important;
}

.btn-send .icon-img {
  filter: var(--btn-send-icon-filter);
}

.btn.ghost {
  background: transparent;
  border-color: var(--color-border-strong);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0 40px;
  min-height: var(--header-h);
  background: var(--header-bg);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(14px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-weight: 700;
}

.logo-copy {
  display: grid;
  gap: 0.1rem;
  line-height: 1.1;
}

.logo-title {
  font-size: 1rem;
}

.logo-subtitle {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.logo .code-tag {
  font-family: var(--font-family);
  color: var(--color-accent);
}

.header-left {
  justify-self: start;
  display: flex;
}

.nav-center {
  display: flex;
  justify-self: center;
}

.header-right {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 0.75rem;
}

.nav-toggle {
  display: none;
  color: var(--color-text-primary);
  cursor: pointer;
  padding: 0.5rem;
}

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

.nav-links a {
  color: var(--color-text-muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links a i {
  width: 1rem;
  height: 1rem;
}

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

main {
  padding: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 2rem;
  align-items: center;
  padding: 84px 24px 48px;
  max-width: 1180px;
  margin: 0 auto;
}

.hero-panel {
  min-width: 0;
}

.hero h1 {
  margin-bottom: 1.5rem;
}

.hero-copy {
  max-width: 58ch;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-aside {
  display: grid;
  gap: 1.25rem;
}

.profile-card,
.details-card,
.tech-stack-card,
.summary-card,
.highlight-card,
.contact-card,
.project-card {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.profile-card {
  display: grid;
  gap: 1.2rem;
}

.avatar-lg {
  width: 100%;
  min-height: 260px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chip,
.meta-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--text-xs);
  color: var(--color-chip-text);
  background: var(--color-chip-bg);
  border: 1px solid var(--color-chip-border);
  gap: 0.5rem;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.chip img,
.icon-img,
.nav-links a img {
  width: 1rem;
  height: 1rem;
  display: block;
}

.nav-links a img,
.socials a img {
  filter: var(--icon-filter);
}

.icon-img {
  width: 1rem;
  height: 1rem;
}

.section {
  padding: 48px 24px;
}

.section-header {
  max-width: 840px;
  margin: 0 auto 24px;
  text-align: center;
}

.projects-grid,
.highlight-grid,
.summary-grid {
  display: grid;
  gap: 1.5rem;
}

.highlight-grid,
.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.projects-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

.project-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
}

.project-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.project-img:hover {
  opacity: 0.85;
}

/* Handle square images - adjust aspect ratio for square images */
.project-img[data-aspect-ratio="square"] {
  aspect-ratio: 1 / 1;
}

.project-body {
  padding: 1.5rem;
}

.project-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.85rem;
}

.project-card h2 {
  margin: 0 0 0.9rem;
  font-size: 1.35rem;
}

.project-body p {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
}

.project-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  font-family: var(--font-family);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.project-meta li {
  display: grid;
  gap: 0.25rem;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.project-stack .chip {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.project-stack .chip:hover {
  background: var(--color-accent-muted);
}

.project-body strong {
  color: var(--color-accent);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 40px;
  align-items: stretch;
}

.details-card {
  display: grid;
  gap: 0.75rem;
}

.tech-stack-card {
  display: grid;
  gap: 1.5rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 1.5rem 24px;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.feature-list li {
  position: relative;
  padding-left: 1.2rem;
}

.feature-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 0.1rem;
  color: var(--color-accent);
}

.profile-meta {
  display: grid;
  gap: 1rem;
}

.profile-meta div {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  border-top: 1px solid var(--color-border);
  padding-top: 0.9rem;
}

.profile-meta span:last-child {
  color: var(--color-text-muted);
}

.page-hero {
  padding: 40px 24px 0;
  max-width: 1180px;
  margin: 0 auto;
}

.page-hero .section-header {
  text-align: left;
}

.contact-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 1.5rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.form-card {
  grid-column: span 2;
  padding: 2rem;
}

.contact-form {
  display: grid;
  gap: 1.5rem;
}

.input-row {
  display: grid;
  gap: 0.5rem;
}

.input-row label {
  color: var(--color-text-primary);
  font-weight: 600;
}

.input-row input,
.input-row textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-primary);
  padding: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-row input:focus,
.input-row textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-muted);
}

.hint {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.form-status {
  margin: 0;
  color: var(--color-accent);
  font-size: var(--text-sm);
}

/* Unified contact info card: replaces the old three separate,
   sparsely-filled tiles with one card that stretches to match the
   form's height and distributes its rows evenly, so there's no
   leftover empty space at the bottom. */
.info-card {
  grid-column: span 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--color-border);
}

.info-item:first-child {
  border-top: none;
  padding-top: 0;
}

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

.info-item-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  border: 1px solid var(--color-border);
}

.info-item-icon .icon-img {
  width: 1.15rem;
  height: 1.15rem;
  filter: var(--icon-filter);
}

.info-item-body {
  min-width: 0;
}

.info-item-body h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.info-item-body a,
.info-item-body p {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin: 0 0 0.2rem;
  word-break: break-word;
}

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

.info-item-body .info-sub {
  color: var(--color-text-muted);
  opacity: 0.75;
  font-size: var(--text-xs);
  margin-bottom: 0;
}

.site-footer {
  padding: 32px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.footer-note {
  margin: 0;
}

.socials {
  display: flex;
  gap: 1rem;
}

@media (max-width: 960px) {
  .hero,
  .about-grid,
  .contact-layout,
  .projects-grid,
  .highlight-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .form-card,
  .info-card {
    grid-column: span 1;
  }
}

@media (max-width: 760px) {
  .site-header {
    padding: 0 20px;
    grid-template-columns: auto 1fr auto;
  }
  
  .nav-center {
    justify-self: end;
  }

  .nav-toggle {
    display: inline-flex;
    cursor: pointer;
  }

  .nav-links {
    position: absolute;
    top: var(--header-h);
    right: 20px;
    left: 20px;
    display: none;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    z-index: 101;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links a {
    width: 100%;
  }

  .header-right .nav-cta {
    display: none; /* Hide resume button on small screens to save space */
  }

  .site-footer {
    justify-content: center;
    text-align: center;
  }
}

/* ===============================
   Image Modal / Lightbox
================================= */

.image-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.image-modal.active {
  opacity: 1;
  pointer-events: all;
}

.image-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.image-modal-content {
  position: relative;
  z-index: 1001;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.image-modal-image {
  width: 100%;
  height: 100%;
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
}

.image-modal-close {
  position: absolute;
  top: -45px;
  right: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  font-size: 1.5rem;
  line-height: 1;
}

.image-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

@media (max-width: 760px) {
  .image-modal-close {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }

  .image-modal-image {
    max-width: 95vw;
    max-height: 80vh;
  }
}