/*
  Pran Jyoti Pegu — Portfolio Styles
  - Modern, elegant, responsive
  - Subtle glassmorphism, gradients, and motion
*/

:root {
  --bg: #0b1020; /* deep slate */
  --panel: #0f172a; /* elevated panel */
  --panel-2: #111827; /* soft panel */
  --text: #e5e7eb; /* base text */
  --muted: #9ca3af; /* secondary text */
  --accent: #60a5fa; /* primary */
  --accent-2: #a78bfa; /* secondary */
  --card: rgba(17, 24, 39, 0.6);
  --glass: rgba(255, 255, 255, 0.06);
  --ring: rgba(96, 165, 250, 0.35);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 2px 12px rgba(0, 0, 0, 0.25);
  --header-h: 64px; /* mobile header height for offsets */
  --skill-icon-size: 28px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji",
    "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}
.section {
  padding: 88px 0;
}
.section__head {
  margin-bottom: 28px;
}
.section__head h2 {
  margin: 0 0 6px;
  font: 700 28px/1.2 ui-sans-serif;
}
.section__head .muted {
  color: var(--muted);
}

/* Background FX */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.bg__gradient {
  position: absolute;
  inset: -20%;
  background: radial-gradient(
      1200px 600px at 10% 10%,
      rgba(96, 165, 250, 0.2),
      transparent 55%
    ),
    radial-gradient(
      900px 700px at 90% 20%,
      rgba(167, 139, 250, 0.18),
      transparent 60%
    ),
    radial-gradient(
      1000px 800px at 50% 100%,
      rgba(34, 197, 94, 0.14),
      transparent 60%
    ),
    linear-gradient(180deg, #0b1020 0%, #0b1020 100%);
}
.bg__noise {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  mix-blend-mode: soft-light;
  pointer-events: none;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="140" height="140" viewBox="0 0 140 140"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity=".25"/></svg>')
    repeat;
}
.bg__orbs {
  position: absolute;
  inset: 0;
  filter: blur(45px);
  opacity: 0.65;
}
.bg__orbs span {
  position: absolute;
  width: 36vmin;
  height: 36vmin;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--accent), transparent);
  animation: float 18s ease-in-out infinite;
}
.bg__orbs span:nth-child(1) {
  top: 10%;
  left: 12%;
}
.bg__orbs span:nth-child(2) {
  top: 20%;
  right: 8%;
  animation-delay: -6s;
}
.bg__orbs span:nth-child(3) {
  bottom: 12%;
  left: 18%;
  animation-delay: -3s;
}
.bg__orbs span:nth-child(4) {
  bottom: 6%;
  right: 16%;
  animation-delay: -9s;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-18px) translateX(8px);
  }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(1.1) blur(10px);
  z-index: 10;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.brand__logo {
  width: 28px;
  height: 28px;
}
.brand__name {
  font-weight: 700;
}

.nav__menu {
  display: flex;
  gap: 18px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__menu a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.9;
}
.nav__menu a:hover {
  opacity: 1;
}
.nav__toggle {
  display: none;
  background: none;
  border: 0;
  width: 40px;
  height: 40px;
  position: relative;
}
.nav__toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: #e5e7eb;
  transition: 0.3s;
}
.nav__toggle span:nth-child(1) {
  top: 12px;
}
.nav__toggle span:nth-child(2) {
  top: 19px;
}
.nav__toggle span:nth-child(3) {
  top: 26px;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); /* prevent overflow from pushing siblings */
  gap: 40px;
  align-items: center;
  min-height: 68vh;
}
.hero__content,
.hero__visual {
  min-width: 0; /* allow grid items to shrink inside the grid */
}
.hero__title {
  margin: 0 0 12px;
  font: 800 44px/1.05 ui-sans-serif;
  letter-spacing: -0.02em;
}
.hero__title .accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* keep subtitle readable width and allow wrapping */
.hero__subtitle {
  margin: 0 0 22px;
  color: #cbd5e1;
  max-width: 72ch;
}
.hero__cta {
  display: flex;
  gap: 12px;
}
.hero__meta {
  margin-top: 26px;
  display: flex;
  gap: 28px;
}
.metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.metric__num {
  font: 800 28px/1 ui-sans-serif;
}
.metric__label {
  font-size: 12px;
  color: var(--muted);
}

/* Summary typewriter */
.typewriter {
  display: inline; /* participate in text flow */
  white-space: normal; /* allow wrap */
  overflow-wrap: anywhere;
  word-break: break-word;
  /* remove caret border to avoid multi-line artifacts; chip typing keeps caret */
  border-right: 0;
  animation: none;
}

.hero__visual {
  display: flex;
  justify-content: center;
}
.card {
  background: linear-gradient(180deg, var(--glass), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}
.card--glass {
  padding: 28px;
  position: relative;
}
.avatar {
  width: clamp(128px, 18vw, 220px);
  height: auto; /* preserve aspect ratio */
  aspect-ratio: 1 / 1;
  display: block;
  border-radius: 50%; /* circular */
  object-fit: cover;
  object-position: center;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.25),
    0 0 0 3px rgba(96, 165, 250, 0.12);
  transform: translateZ(0); /* promote to its own layer */
  animation: avatarFade 600ms ease-out both,
    floatY 7s ease-in-out infinite 600ms;
  transition: transform 160ms ease;
  backface-visibility: hidden;
}
.card--glass:hover .avatar {
  animation-play-state: paused; /* pause float while hovering */
  transform: translateY(-2px) scale(1.03);
}
@keyframes avatarFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes floatY {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
.chip {
  position: absolute;
  right: 18px;
  bottom: 18px;
  background: rgba(96, 165, 250, 0.14);
  color: #dbeafe;
  border: 1px solid var(--ring);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
}

/* Projects */
.grid {
  display: grid;
  gap: 18px;
}
.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}
.project {
  overflow: hidden;
  position: relative; /* anchor for absolute avatar on desktop */
  --avatar-size: 64px;
}
@media (max-width: 640px) {
  .project {
    --avatar-size: 48px;
  }
}
.project-card__avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  min-width: var(--avatar-size); /* reserve space to prevent shift */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(
    120% 120% at 30% 20%,
    rgba(96, 165, 250, 0.25),
    rgba(167, 139, 250, 0.18) 55%,
    rgba(255, 255, 255, 0.06) 100%
  );
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32), 0 2px 10px rgba(0, 0, 0, 0.2),
    0 0 0 3px rgba(96, 165, 250, 0.12);
  color: #dbeafe; /* icon/text color via currentColor */
  transition: transform 200ms ease-out, box-shadow 200ms ease-out;
  will-change: transform;
}
/* Desktop: top-left badge */
@media (min-width: 641px) {
  .project-card__avatar {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1;
    animation: projFloat 8s ease-in-out infinite;
  }
}
/* Mobile: inline above title */
@media (max-width: 640px) {
  .project__body {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }
  .project__body .project-card__avatar {
    position: static;
    margin: 6px 0 10px;
  }
}
.project-card__avatar:hover,
.project-card__avatar:focus-visible {
  transform: scale(1.04);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.38), 0 4px 14px rgba(0, 0, 0, 0.24),
    0 0 0 4px rgba(96, 165, 250, 0.18);
}
.project-card__avatar--text,
.project-card__avatar--label {
  font-weight: 800;
  letter-spacing: 0.5px;
}
.project-card__avatar svg {
  width: 76%;
  height: 76%;
  display: block;
}
/* Label fallback variant: show project name prominently instead of an icon */
.project-card__avatar--label {
  width: auto;
  height: auto;
  min-height: var(--avatar-size);
  padding: 8px 12px;
  border-radius: 12px;
  white-space: nowrap;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  line-height: 1;
}
@keyframes projFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .project-card__avatar {
    transition: none;
    animation: none !important;
  }
}

/* Optional: add top padding to content if you prefer avoiding visual overlap with the thumb */
@media (min-width: 641px) {
  .project__body {
    padding-top: 20px;
  }
}
.project__thumb {
  height: 140px;
  background: linear-gradient(
    135deg,
    rgba(96, 165, 250, 0.2),
    rgba(167, 139, 250, 0.16)
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.project__body {
  padding: 16px 16px 8px;
}
.project__body h3 {
  margin: 0 0 10px;
  transition: transform 150ms ease;
}
.project:hover .project__body h3 {
  transform: translateY(-1px);
}
.project__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 16px 16px;
}
.project__meta span {
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #d1d5db;
}

/* Timeline */
.timeline {
  display: grid;
  gap: 16px;
  border-left: 2px dashed rgba(255, 255, 255, 0.12);
  padding-left: 18px;
}
.timeline__item {
  position: relative;
}
.timeline__item:before {
  content: "";
  position: absolute;
  left: -28px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}
.timeline__meta h3 {
  margin: 0 0 4px;
}
.timeline__meta .muted {
  font-size: 14px;
}
.timeline__item ul {
  margin: 6px 0 0 18px;
}

/* Skills */
.skills {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, 1fr);
}
.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tags span {
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  border-radius: 999px;
  color: #e2e8f0;
}
.tags--lg span {
  padding: 10px 14px;
}

/* Skills icons */
@media (max-width: 640px) {
  :root {
    --skill-icon-size: 24px;
  }
}
.skill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.skill__icon {
  width: var(--skill-icon-size);
  height: var(--skill-icon-size);
  min-width: var(--skill-icon-size);
  object-fit: contain;
  display: inline-block;
  filter: none; /* use source colors by default */
  transition: transform 180ms ease-out, filter 180ms ease-out,
    opacity 180ms ease-out;
  opacity: 0.95;
}
.skill__label {
  color: inherit;
}
/* Hover/focus tint and glow */
.tags span:hover .skill__icon,
.tags span:focus-within .skill__icon {
  transform: scale(1.05);
  filter: drop-shadow(0 0 0.25rem rgba(96, 165, 250, 0.45));
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .skill__icon {
    transition: none;
  }
}
/* Responsive grid suggestion: keep as-is but allow auto-fit when needed */
/* If desired, uncomment below to auto-fit skills; keeping original layout intact. */
/*
.skills { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
*/

/* Checklist */
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.checklist li {
  position: relative;
  padding-left: 28px;
}
.checklist li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.35);
}
.checklist li:after {
  content: "✓";
  position: absolute;
  left: 4px;
  top: 1px;
  color: #0b1020;
  font-weight: 900;
  font-size: 14px;
}

/* Contact */
.contact {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px;
}
.contact__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.contact__links a {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #e5e7eb;
  text-decoration: none;
}
.contact__links a:hover {
  color: #fff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.08s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn--primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #0b1020;
}
.btn--ghost {
  background: transparent;
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, 0.18);
}
.btn--sm {
  padding: 8px 12px;
  font-size: 14px;
}

/* Utilities */
.muted {
  color: var(--muted);
}
.accent {
  color: var(--accent);
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(14px);
}
.reveal.in {
  animation: reveal 0.8s ease forwards;
}
.reveal.delay-1.in {
  animation-delay: 0.15s;
}
.reveal.delay-2.in {
  animation-delay: 0.3s;
}
.reveal.delay-3.in {
  animation-delay: 0.45s;
}
@keyframes reveal {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Typing chip */
.typing__text {
  display: inline-block;
  min-width: 6ch;
  border-right: 2px solid currentColor;
  white-space: nowrap;
  overflow: hidden;
  animation: caret 0.9s steps(1) infinite;
}
/* Summary typewriter */
.typewriter {
  display: inline; /* participate in text flow */
  white-space: normal; /* allow wrap */
  overflow-wrap: anywhere;
  word-break: break-word;
  /* remove caret border to avoid multi-line artifacts; chip typing keeps caret */
  border-right: 0;
  animation: none;
}
@keyframes caret {
  50% {
    border-color: transparent;
  }
}

/* Tilt hover */
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.15s ease;
}
.tilt:hover {
  transform: perspective(800px) rotateX(3deg) rotateY(-4deg);
}

/* About section card refinements */
#about .card {
  padding: 22px; /* balanced inner spacing for readability */
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), 0 2px 10px rgba(0, 0, 0, 0.18);
  transition: transform 160ms ease, box-shadow 200ms ease, background 200ms ease,
    border-color 200ms ease;
}
#about .card h3 {
  margin: 0 0 8px;
}
#about .card p {
  margin: 0;
}
#about .card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.22);
}
#about .card:focus-within {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px var(--ring), 0 10px 28px rgba(0, 0, 0, 0.32);
}
/* keep grid spacing consistent */
#about .grid.grid--2 {
  gap: 20px;
}

@media (max-width: 640px) {
  #about .card {
    padding: 18px; /* consistent, slightly tighter on small screens */
  }
}

/* Responsive */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 12px;
  }
  .grid--3 {
    grid-template-columns: 1fr 1fr;
  }
  .skills {
    grid-template-columns: 1fr 1fr;
  }
  .contact {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .nav__toggle {
    display: block;
  }
  .nav__menu {
    position: fixed;
    inset: var(--header-h) 0 auto 0; /* start below header */
    background: rgba(11, 16, 32, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    /* closed state: fully non-interactive */
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    transition: transform 0.25s ease, opacity 0.2s ease, visibility 0.2s ease,
      max-height 0.25s ease;
    flex-direction: column;
    align-items: flex-start;
    z-index: 9; /* keep under sticky header */
  }
  .nav__menu.open {
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    max-height: calc(100vh - var(--header-h));
    overflow: auto;
  }
  /* Ensure each item only occupies its own area */
  .nav__menu li {
    width: 100%;
    position: relative;
  }
  .nav__menu li + li {
    margin-top: 8px;
  }
  .nav__menu li a {
    display: block;
    width: 100%;
    padding: 10px 6px;
  }
  /* Resume button behaves like a normal item, not full-width overlay */
  .nav__menu li a.btn {
    display: inline-flex; /* shrink to fit */
    width: auto;
    padding: 10px 14px; /* keep button tone */
  }
  /* prevent brand text from colliding with hamburger */
  .brand__name {
    max-width: 60vw;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }
  .hero__title {
    font-size: 34px;
  }
  /* push hero content below sticky header to avoid overlap with hamburger */
  .hero {
    padding-top: calc(var(--header-h) + 12px);
  }
}

/* Footer */
.site-footer {
  padding: 28px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 24px;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
