/* 
  Krishna Negi – Personal E‑Portfolio
  -----------------------------------
  - Dark, modern, responsive layout
  - Cybersecurity‑inspired accents (grid background, neon accent color)
  - Minimal, clean UI with subtle animations
*/

/* CSS Reset (simplified) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e5e7eb;
  background: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button,
input,
textarea {
  font-family: inherit;
}

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

/* Layout helpers */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  position: relative;
  padding: 5rem 0;
}

.section-inner {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.section-inner-centered {
  align-items: center;
  text-align: center;
}

/* Background cyber grid */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(31, 41, 55, 0.45) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(31, 41, 55, 0.45) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.35;
  mix-blend-mode: soft-light;
  z-index: -1;
}

/* Accent & typography */
.accent {
  color: #22c55e;
}

.section-header {
  max-width: 720px;
}

.section-eyebrow {
  font-size: 30px;
  text-transform: uppercase;
  color: #9ca3af;
  margin: 0 0 0.5rem;
  letter-spacing: 0.03em;
  font-weight: 500;
}

.section-header h2 {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1.9rem, 2.4vw, 2.2rem);
  margin: 0 0 0.5rem;
}

.section-description {
  margin: 0;
  color: #9ca3af;
  line-height: 1.7;
  font-size: 0.98rem;
}

/* Header / Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.8), transparent);
  border-bottom: 1px solid rgba(31, 41, 55, 0.8);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: radial-gradient(circle at top, rgba(15, 118, 110, 0.7), rgba(15, 23, 42, 0.9));
  font-size: 24px;
  color: #e5e7eb;
}

.logo-text {
  font-size: clamp(1rem, 3vw, 1.625rem);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

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

.nav-links a {
  font-size: 0.92rem;
  color: #d1d5db;
  position: relative;
  padding-bottom: 0.15rem;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(to right, #22c55e, #38bdf8);
  transition: width 0.2s ease-out;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  width: 2.4rem;
  height: 2.4rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: rgba(34, 197, 94, 0.2);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(31, 41, 55, 0.95);
  border-color: rgba(55, 65, 81, 1);
}

.nav-toggle-line {
  width: 1.3rem;
  height: 2px;
  border-radius: 999px;
  background: #e5e7eb;
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.nav-open .nav-toggle-line:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.nav-open .nav-toggle-line:nth-child(2) {
  transform: translateY(-4px) rotate(-45deg);
}

/* Hero */
.hero {
  min-height: 78vh;
  padding: 4.5rem 0 1.5rem; /* tighter bottom spacing to reduce gap before About */
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  text-align: left;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  max-width: 680px;
}

.hero-content h1 {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 46px;
  text-align: left;
  max-width: 600px;
  margin: 0 0 0.5rem;
}

/* Hero Image Wrapper & Liquid Interaction */
.hero-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  /* Initialize CSS custom properties for shadow positioning */
  --shadow-x: 0;
  --shadow-y: 0;
}

.hero-image img {
  width: 320px;
  height: 420px;
  object-fit: cover;
  border-radius: 18%;
  border: 1px solid rgba(34, 197, 94, 0.35);
  position: relative;
  z-index: 2;
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  /* Soft ambient shadow */
  box-shadow: 
    0 12px 38px rgba(22, 163, 74, 0.25),
    0 0 60px rgba(34, 197, 94, 0.15),
    inset 0 0 20px rgba(34, 197, 94, 0.05);
}

/* Dynamic shadow that shifts with cursor */
.hero-image::before {
  content: "";
  position: absolute;
  inset: -20px;
  border-radius: 18%;
  background: radial-gradient(
    ellipse at center,
    rgba(34, 197, 94, 0.4) 0%,
    rgba(22, 163, 74, 0.2) 40%,
    transparent 70%
  );
  opacity: 0.6;
  z-index: 1;
  will-change: transform, opacity;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s ease;
  filter: blur(20px);
  pointer-events: none;
  /* Use CSS custom properties for dynamic positioning */
  transform: translate3d(var(--shadow-x, 0), var(--shadow-y, 0), 0);
}

/* Additional directional shadow layer */
.hero-image::after {
  content: "";
  position: absolute;
  inset: -15px;
  border-radius: 18%;
  background: radial-gradient(
    ellipse at 30% 30%,
    rgba(34, 197, 94, 0.3) 0%,
    transparent 60%
  );
  opacity: 0.4;
  z-index: 1;
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  filter: blur(15px);
  pointer-events: none;
  /* Use CSS custom properties for dynamic positioning */
  transform: translate3d(calc(var(--shadow-x, 0) * 0.7), calc(var(--shadow-y, 0) * 0.7), 0);
}

/* Disable interaction on mobile/touch devices */
@media (hover: none) and (pointer: coarse) {
  .hero-image {
    transition: none;
  }
  
  .hero-image img,
  .hero-image::before,
  .hero-image::after {
    transition: none;
    will-change: auto;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .hero-image,
  .hero-image img,
  .hero-image::before,
  .hero-image::after {
    transition: none;
    will-change: auto;
  }
}

.eyebrow {
  font-size: 0.86rem;
  color: #9ca3af;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-role {
  margin: 0.2rem 0 0.8rem;
  color: #a5b4fc;
  font-weight: 500;
}

.hero-tagline {
  margin: 0;
  color: #9ca3af;
  font-size: 0.98rem;
  line-height: 1.8;
  max-width: 34rem;
  text-align: left;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.6rem;
  justify-content: flex-start;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: center;
  text-align: left;
}

.meta-label {
  display: block;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.meta-value {
  font-size: 15px;
  letter-spacing: 0.07em;
  color: #d1d5db;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hero-panel {
  display: flex;
  justify-content: flex-end;
}

.hero-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 1.4rem 1.5rem;
  border-radius: 1.2rem;
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.15), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(55, 65, 81, 0.9);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -60%;
  background: conic-gradient(from 180deg, rgba(34, 197, 94, 0.18), transparent, rgba(56, 189, 248, 0.18), transparent);
  opacity: 0.25;
  filter: blur(42px);
  transform: translate3d(0, 0, 0);
}

.hero-card > * {
  position: relative;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
}

.hero-stat {
  margin-top: 1.2rem;
}

.hero-stat .stat-label {
  font-size: 0.8rem;
  color: #9ca3af;
}

.hero-stat .stat-value {
  font-size: 0.95rem;
}

.hero-divider {
  margin: 1.2rem 0;
  height: 1px;
  background: linear-gradient(to right, rgba(55, 65, 81, 0.1), rgba(148, 163, 184, 0.7), rgba(55, 65, 81, 0.1));
}

.hero-code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  color: #9ca3af;
}

.code-line {
  display: block;
  margin-bottom: 0.2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.55rem 1.35rem;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.btn-primary {
  background: radial-gradient(circle at top left, #22c55e, #16a34a);
  color: #020617;
  border-color: rgba(22, 163, 74, 0.9);
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.25);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: radial-gradient(circle at top left, #22c55e, #15803d);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.35);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(55, 65, 81, 0.9);
  color: #e5e7eb;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: rgba(31, 41, 55, 0.95);
}

.btn-lg {
  padding: 0.7rem 1.8rem;
  font-size: 0.98rem;
}

/* Cards & grids */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.about-card {
  padding: 1.4rem 1.5rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(31, 41, 55, 0.9);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

.about-card h3 {
  margin: 0 0 0.8rem;
  font-size: 1.05rem;
}

.list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.list-title {
  font-size: 15px;
  font-weight: 500;
}

.list-subtitle {
  display: block;
  font-size: 0.88rem;
  color: #9ca3af;
  margin-top: 0.2rem;
}

/* Vertical Skills Section with Progress Bars */
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  width: 100%;
}

.skill-category {
  padding: 1.5rem 1.6rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(31, 41, 55, 0.9);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

.skill-category-title {
  margin: 0 0 1.2rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #e5e7eb;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skill-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #d1d5db;
  min-width: 140px;
}

.skill-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.skill-bar {
  flex: 1;
  height: 8px;
  background: rgba(31, 41, 55, 0.9);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(55, 65, 81, 0.5);
}

.skill-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 999px;
  position: relative;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  /* Subtle glow effect */
  box-shadow: 
    0 0 8px rgba(251, 191, 36, 0.4),
    0 0 16px rgba(245, 158, 11, 0.2);
}

/* Animated shimmer effect on progress bar */
.skill-bar-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.skill-percentage {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fbbf24;
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Animate progress bars on scroll into view */
.skill-bar[data-reveal="in"] .skill-bar-fill {
  width: var(--proficiency, 0%);
}

/* Legacy skill-group styles (kept for compatibility) */
/* (Old .skills-grid / .pill-list styles removed as they are no longer used) */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.6rem;
}

.card {
  padding: 1.6rem 1.6rem 1.4rem;
  border-radius: 1.1rem;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(31, 41, 55, 0.9);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.95);
}

.card-compact {
  padding: 1.4rem 1.5rem 1.3rem;
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.card-header h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  align-self: flex-start;
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ca3af;
  border: 1px solid rgba(55, 65, 81, 0.9);
}

.card-body {
  margin: 0;
  font-size: 0.94rem;
  color: #9ca3af;
  line-height: 1.7;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.card-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.card-meta li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.card-meta .meta-value {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.2rem;
}

.card-actions .link-btn {
  min-height: 44px;
  padding: 0.5rem 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: #22c55e;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: rgba(34, 197, 94, 0.2);
}

.link-btn:hover,
.link-btn:focus-visible {
  color: #16a34a;
  transform: translateX(2px);
}

.link-btn::after {
  content: "↗";
  font-size: 0.8rem;
  transition: transform 0.15s ease;
}

.link-btn:hover::after,
.link-btn:focus-visible::after {
  transform: translateY(-1px);
}

.link-muted {
  color: #9ca3af;
}

.certifications-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Resume */
.resume-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

/* Reduce top spacing specifically for About section so it sits closer to hero */
#about.section {
  padding-top: 3rem;
}

.resume-note {
  margin: 0;
  font-size: 0.9rem;
  color: #9ca3af;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr);
  gap: 2rem;
  align-items: flex-start;
}

.contact-form {
  padding: 1.6rem 1.6rem 1.4rem;
  border-radius: 1.1rem;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(31, 41, 55, 0.9);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.9);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.form-field label {
  font-size: 0.86rem;
  font-weight: bold;
  color: #d1d5db;
}

.form-field input,
.form-field textarea {
  border-radius: 0.85rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  padding: 0.55rem 0.75rem;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.form-field input:focus-visible,
.form-field textarea:focus-visible {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(22, 197, 94, 0.4);
  background: rgba(15, 23, 42, 0.95);
}

.field-error {
  min-height: 0.9rem;
  font-size: 0.78rem;
  color: #f97373;
  margin: 0;
}

.form-note {
  margin: 0.7rem 0 0;
  font-size: 0.86rem;
  color: #6b7280;
}

.form-success {
  margin-top: 0.6rem;
  font-size: 0.86rem;
  color: #4ade80;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-card {
  padding: 1.3rem 1.4rem;
  border-radius: 1.05rem;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.contact-card h3 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.social-links {
  list-style: none; 
  padding: 0; 
  margin: 0;  
}

.social-icons {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.social-icons a {
  font-size: 2.5rem;
  color: #9ca3af;
  transition: transform 0.3s ease, color 0.3s ease;
}

.social-icons a:hover {
  color: #38bdf8;
  transform: scale(1.15);
}

.social-links a:focus-visible {
  background: rgba(15, 23, 42, 0.9);
  transform: translateY(-1px);
}

.social-handle {
  font-size: 0.86rem;
  color: #9ca3af;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  padding: 1.4rem 0 1.8rem;
  background: radial-gradient(circle at bottom, rgba(15, 23, 42, 0.9), #020617);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: #6b7280;
}

.footer-note {
  margin: 0;
}

/* Scroll reveal animation */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal="in"] {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive styles */
@media (max-width: 900px) {
  .hero-inner {
    gap: 2rem;
    grid-template-columns: 1fr;
  }

  .hero-image-wrapper {
    order: -1; /* Image appears above content on mobile */
    margin-bottom: 1rem;
  }

  .hero-image img {
    width: 260px;
    height: 340px;
  }

  .hero-panel {
    justify-content: flex-start;
  }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Skills grid on smaller screens */
  .skills-container {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  /* Projects grid on tablets */
  .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.4rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.2rem;
  }

  .header-inner {
    padding-inline: 1.1rem;
  }

  .logo-mark {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .nav-toggle {
    display: flex;
    width: 2.2rem;
    height: 2.2rem;
  }

  .nav-links {
    position: absolute;
    inset-inline: 1.2rem;
    top: calc(100% + 0.75rem);
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem 1.1rem;
    border-radius: 0.9rem;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(31, 41, 55, 0.9);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
    transform-origin: top;
    transform: scaleY(0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

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

  .nav-links a {
    display: block;
    padding: 0.75rem 0.5rem;
    font-size: 0.95rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: rgba(34, 197, 94, 0.2);
  }

  .nav-links a:hover,
  .nav-links a:focus-visible {
    background: rgba(31, 41, 55, 0.6);
  }

  .nav-open .nav-links {
    opacity: 1;
    transform: scaleY(1);
    pointer-events: auto;
  }

  .section {
    padding: 3.5rem 0;
  }

  .section-inner {
    gap: 2rem;
  }

  .hero {
    padding-top: 3.5rem;
    padding-bottom: 3rem;
    min-height: auto;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-content h1 {
    font-size: clamp(1.8rem, 6vw, 2.4rem);
    line-height: 1.2;
  }

  .hero-tagline {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .hero-image-wrapper {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
  }

  .hero-image img {
    width: 240px;
    height: 320px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1;
    min-width: 140px;
  }

  .hero-meta {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .meta-label {
    font-size: 0.75rem;
    margin-top: 0;
  }

  .meta-value {
    font-size: 0.9rem;
  }

  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Projects on mobile */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .card {
    padding: 1.4rem 1.3rem 1.2rem;
  }

  .card-header h3 {
    font-size: 1rem;
  }

  .card-body {
    font-size: 0.9rem;
  }

  .card-actions {
    flex-direction: column;
    gap: 0.7rem;
  }

  .card-actions .link-btn {
    width: 100%;
    justify-content: space-between;
    padding: 0.6rem 0;
  }

  /* Skills on mobile */
  .skill-category {
    padding: 1.2rem 1.3rem;
  }

  .skill-name {
    font-size: 0.85rem;
    min-width: auto;
  }

  .skill-percentage {
    font-size: 0.8rem;
    min-width: 35px;
  }

  .skill-bar-wrapper {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* About cards on mobile */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .about-card {
    padding: 1.3rem 1.2rem;
  }

  /* Contact form on mobile */
  .contact-grid {
    gap: 1.5rem;
  }

  .contact-form {
    padding: 1.4rem 1.3rem 1.2rem;
  }

  .contact-card {
    padding: 1.2rem 1.3rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .header-inner {
    padding-inline: 1rem;
  }

  .logo-mark {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .section {
    padding: 3rem 0;
  }

  .section-header {
    max-width: 100%;
  }

  .section-header h2 {
    font-size: clamp(1.5rem, 7vw, 1.9rem);
    line-height: 1.3;
  }

  .section-description {
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .hero {
    padding-top: 3rem;
    padding-bottom: 2.5rem;
  }

  .hero-content h1 {
    font-size: clamp(1.6rem, 8vw, 2rem);
    margin-bottom: 0.4rem;
  }

  .hero-role {
    font-size: 0.95rem;
    margin: 0.3rem 0 0.6rem;
  }

  .hero-tagline {
    font-size: 0.9rem;
    line-height: 1.65;
  }

  .hero-meta {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.2rem;
  }

  .hero-image img {
    width: 200px;
    height: 260px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.7rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  /* Cards on small mobile */
  .card,
  .about-card,
  .contact-form,
  .contact-card {
    padding: 1.2rem 1.1rem 1rem;
  }

  .card-header h3 {
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .card-tag {
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
  }

  .card-body {
    font-size: 0.88rem;
    line-height: 1.65;
  }

  .card-meta {
    gap: 0.5rem;
  }

  .card-meta .meta-label {
    font-size: 0.75rem;
  }

  .card-meta .meta-value {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .card-actions {
    gap: 0.6rem;
  }

  .link-btn {
    font-size: 0.88rem;
    min-height: 44px;
  }

  /* Skills on small mobile */
  .skill-category {
    padding: 1rem 1.1rem;
  }

  .skill-category-title {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .skill-list {
    gap: 0.9rem;
  }

  .skill-name {
    font-size: 0.8rem;
  }

  .skill-bar {
    height: 7px;
  }

  .skill-percentage {
    font-size: 0.75rem;
    min-width: 32px;
  }

  .skill-bar-wrapper {
    gap: 0.5rem;
  }

  /* About on small mobile */
  .about-card h3 {
    font-size: 1rem;
    margin-bottom: 0.7rem;
  }

  .list-title {
    font-size: 0.9rem;
  }

  .list-subtitle {
    font-size: 0.85rem;
    margin-top: 0.25rem;
  }

  /* Contact on small mobile */
  .contact-form {
    padding: 1.2rem 1.1rem 1rem;
  }

  .form-field {
    margin-bottom: 0.9rem;
  }

  .form-field label {
    font-size: 0.84rem;
  }

  .form-field input,
  .form-field textarea {
    padding: 0.6rem 0.7rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  .form-field textarea {
    min-height: 120px;
  }

  .contact-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
  }

  .social-links a {
    padding: 0.5rem 0.3rem;
    min-height: 44px;
  }

  /* Footer on small mobile */
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.4rem;
    font-size: 0.8rem;
  }
}



/* Image modal (clicked image preview) */
.image-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.75);
  z-index: 9999;
  padding: 2rem;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.image-modal.open {
  display: flex;
}
.image-modal .image-modal-content {
  max-width: calc(100% - 4rem);
  max-height: calc(100% - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-modal img {
  max-width: 90vmin;
  max-height: 90vmin;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(2,6,23,0.85), 0 8px 24px rgba(0,0,0,0.6);
  transform: scale(0.92);
  transition: transform 260ms cubic-bezier(.22,1,.36,1), opacity 180ms ease;
  opacity: 0.98;
}
.image-modal.open.zoom-in img,
.image-modal.open .image-modal-content img {
  transform: scale(1);
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10000;
  transition: transform 0.12s ease, background 0.12s ease;
}
.modal-close:hover,
.modal-close:focus {
  background: rgba(0,0,0,0.65);
  transform: scale(1.04);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .image-modal img {
    transition: none;
    transform: none;
  }
}



