:root {
  --bg: #0b0f12;
  --bg-greenish: #071015;
  --card: #0f1518;
  --muted: #9aa5ad;
  --accent: #5eead4;
  --accent-2: #60a5fa;
  --accent-3: #f97316;
  --text: #e6eef3;
  --glass: rgba(255, 255, 255, 0.03);
  --shadow: rgba(2, 6, 23, 0.6);
  --mb-2: 1rem;
  --mb-4: 2rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}
html,
body {
  min-height: 100%;
  background-color: var(--bg);
}

#cv-link {
  display: inline-flex;
  align-items: center; /* center text & icon vertically */
  gap: 0.35em; /* small spacing between text and icon */
}

#cv-link i {
  display: inline-block; /* makes transform/vertical-align predictable */
  font-size: 1em; /* match icon size to text */
  transform: translateY(0.08em);
}

body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.4;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(11, 15, 18, 0.6);
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  gap: 1rem;
  align-items: center;
  transition:
    background 0.3s ease,
    backdrop-filter 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease;
}
header.scrolled {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(11, 15, 18, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
@media (max-width: 767px) {
  header.nav-hidden {
    transform: translateY(-100%);
  }
}
.brand {
  font-weight: 700;
  color: var(--accent-3);
  letter-spacing: 0.2px;
}
nav {
  margin-left: auto;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition:
    color 0.25s ease,
    background 0.25s ease;
}
nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
nav a.active {
  color: var(--accent);
  background: rgba(94, 234, 212, 0.06);
}

/* Parallax section container */
.parallax {
  position: relative;
  height: 68vh;
  min-height: 360px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-align: center;
  margin-bottom: 0;
}
.parallax .bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 130%;
  background-position: center;
  background-size: cover;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  filter: brightness(0.6) contrast(1.05) saturate(1.05);
}
.parallax .inner {
  position: relative;
  z-index: 10;
  padding: 2rem;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}
.parallax h1 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.6rem, 4.2vw, 3rem);
}
.parallax p {
  margin: 0;
  color: var(--muted);
}

.skills__container {
  row-gap: 2rem;
  text-align: center;
}

/* Content container */
.content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

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

.profile {
  justify-self: center;
}
.profile img {
  width: 250px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.bio {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 8px 30px var(--shadow);
}
.skills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}
.skill {
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent-3);
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.cv-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(11, 20, 30, 0.5);
  border: 0;
  cursor: pointer;
  transition:
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.25s ease,
    filter 0.25s ease;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(11, 20, 30, 0.5),
    0 0 16px rgba(94, 234, 212, 0.15);
  filter: brightness(1.1);
}
.btn:active {
  transform: translateY(0);
}
.btn.secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 600;
}
.btn.secondary:hover {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
  filter: none;
}

/* Gallery */
.gallery-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tile {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.35s ease;
}
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(
    135deg,
    rgba(94, 234, 212, 0.12) 0%,
    transparent 50%,
    rgba(96, 165, 250, 0.08) 100%
  );
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 2;
}
.tile img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition:
    filter 0.4s ease,
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  filter: saturate(20%) brightness(80%);
}
.tile:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 14px 40px rgba(2, 6, 23, 0.6),
    0 0 20px rgba(94, 234, 212, 0.08);
  border-color: rgba(94, 234, 212, 0.15);
}
.tile:hover::after {
  opacity: 1;
}
.tile:hover img {
  filter: saturate(100%) brightness(100%);
  transform: scale(1.05);
}

.tile .meta {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 0.4rem 0.55rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  color: var(--text);
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 3;
  transition:
    background 0.3s ease,
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.tile:hover .meta {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-2px);
}

body.lb-open {
  overflow: hidden;
}
body.lb-open header {
  z-index: 0;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
  background: rgba(2, 6, 23, 0.98);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}
.lightbox .lb-inner {
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}
.lightbox.open .lb-inner {
  transform: scale(1) translateY(0);
}
.lb-inner {
  max-width: 1100px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}
.lb-img {
  flex: 1;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #081216;
}
.lb-img img {
  max-width: 100%;
  max-height: 85vh;
  display: block;
}
.lb-side {
  width: 320px;
  height: 85vh;
  color: var(--muted);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.lb-side #lb-desc {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.lb-controls {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}
.icon-btn {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

/* Contact */
.contact {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}
form {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 8px 30px var(--shadow);
}
label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
input,
textarea {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.01);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.1);
  background: rgba(255, 255, 255, 0.03);
}
textarea {
  min-height: 140px;
  resize: vertical;
}
.form-foot {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.6rem;
  align-items: center;
}
.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.cursor {
  display: inline-block;
  width: 10px;
  height: 24px;
  vertical-align: bottom;
  margin-left: 2px;
  border-radius: 2px;
  background: var(--text);
  animation: blink 1s steps(2, end) infinite;
  transition:
    background 0.2s ease,
    opacity 0.3s ease;
}
.cursor.active {
  background: var(--accent);
  opacity: 1;
}
.cursor.delete {
  background: var(--error);
}
.cursor.idle {
  opacity: 0.4;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.char {
  display: inline-block;
  transition:
    transform 0.1s ease,
    opacity 0.15s ease;
  animation: twitch 0.08s ease;
}
.char.new {
  transform: scale(1.1);
  opacity: 0.7;
}
@keyframes twitch {
  0% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-1px);
  }
  100% {
    transform: translateY(0);
  }
}

.char:last-child {
  text-shadow: 0 0 6px var(--accent);
  animation: glow 0.4s ease;
}
@keyframes glow {
  from {
    text-shadow: 0 0 14px var(--accent);
  }
  to {
    text-shadow: 0 0 0 var(--accent);
  }
}

.thinking {
  display: inline-block;
  margin-left: 4px;
  visibility: hidden;
}
.thinking span {
  opacity: 0;
  animation: blinkDots 1.2s infinite;
}
.thinking span:nth-child(2) {
  animation-delay: 0.2s;
}
.thinking span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes blinkDots {
  0%,
  80%,
  100% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
}

#text {
  white-space: pre-wrap;
}

/* ===== FOOTER =====*/
footer {
  padding: 2.5rem 1rem 2rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
}

.footer__social {
  margin-bottom: var(--mb-4);
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.footer__icon {
  font-size: 1.5rem;
  color: var(--muted);
  padding: 0.5rem;
  border-radius: 10px;
  transition:
    color 0.3s ease,
    background 0.3s ease,
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer__icon:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-3px);
}

/* Per-platform brand colors */
.footer__icon[aria-label*="Facebook"]:hover {
  color: #1877f2;
}
.footer__icon[aria-label*="Instagram"]:hover {
  color: #e4405f;
}
.footer__icon[aria-label*="Medium"]:hover {
  color: var(--text);
}
.footer__icon[aria-label*="LinkedIn"]:hover {
  color: #0a66c2;
}
.footer__icon[aria-label*="GitHub"]:hover {
  color: var(--text);
}

.footer__copy {
  font-size: var(--smaller-font-size);
}

.about__container {
  gap: 2rem;
  text-align: center;
}

/* Experience */
.experience {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.experience-item {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  border-radius: 12px;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 8px 30px var(--shadow);
}
.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.experience-date {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}
.experience-role {
  color: var(--accent);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

/* Credentials */
.credentials {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.credential-item {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 8px 30px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* Responsive */
@media (max-width: 980px) {
  .about {
    grid-template-columns: 1fr;
  }
  .contact {
    grid-template-columns: 1fr;
  }
  .parallax {
    height: 55vh;
  }
  .lb-side {
    display: none;
  }
}
@media (max-width: 640px) {
  nav {
    display: none;
  }
  .parallax {
    height: 48vh;
  }
  .profile img {
    object-fit: cover;
  }
}

@media screen and (min-width: 768px) {
  .about__container {
    padding-top: 0rem;
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    text-align: initial;
  }

  .profile img {
    width: 300px;
  }

  .bd-grid {
    margin-left: auto;
    margin-right: auto;
  }

  .skills__container {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 2rem;
    align-items: center;
    text-align: initial;
    justify-content: center;
    column-gap: 1rem;
  }
}

.bd-grid {
  max-width: 1024px;
  display: grid;
  margin-left: var(--mb-2);
  margin-right: var(--mb-2);
}

.skills__img,
.skills__img2 {
  border-radius: 0.5rem;
  margin-bottom: 5rem;
}

/* Scroll-triggered entrance animations */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children: each .reveal-child inside a .reveal-group */
.reveal-child {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-group.visible .reveal-child {
  opacity: 1;
  transform: translateY(0);
}
.reveal-group.visible .reveal-child:nth-child(1) {
  transition-delay: 0s;
}
.reveal-group.visible .reveal-child:nth-child(2) {
  transition-delay: 0.08s;
}
.reveal-group.visible .reveal-child:nth-child(3) {
  transition-delay: 0.16s;
}
.reveal-group.visible .reveal-child:nth-child(4) {
  transition-delay: 0.24s;
}
.reveal-group.visible .reveal-child:nth-child(5) {
  transition-delay: 0.32s;
}
.reveal-group.visible .reveal-child:nth-child(6) {
  transition-delay: 0.4s;
}
.reveal-group.visible .reveal-child:nth-child(7) {
  transition-delay: 0.48s;
}
.reveal-group.visible .reveal-child:nth-child(8) {
  transition-delay: 0.56s;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-child {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
