:root {
  --bg: #03050d;
  --bg-soft: #0a0f1d;
  --text: #f4f7ff;
  --muted: #9aa6c2;
  --primary: #1f76ff;
  --primary-dark: #0f45a8;
  --line: #1d2740;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Montserrat", sans-serif;
  background:
    radial-gradient(circle at 90% 10%, rgba(31, 118, 255, 0.2), transparent 35%),
    radial-gradient(circle at 0% 100%, rgba(31, 118, 255, 0.16), transparent 40%),
    var(--bg);
  color: var(--text);
  transition: background 0.55s ease, color 0.45s ease;
  position: relative;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.02));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 100;
}

body.theme-switching::after {
  opacity: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 88px;
  padding: 0 5vw;
  background: linear-gradient(145deg, rgba(25, 37, 72, 0.96), rgba(8, 15, 34, 0.96));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.45s ease, border-color 0.45s ease;
}

.brand img {
  width: 64px;
  height: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand span {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.menu {
  display: flex;
  gap: 28px;
  color: #ffffff;
  font-weight: 600;
}

.menu a {
  transition: 0.2s;
}

.menu a:hover {
  color: var(--text);
}

.btn-primary,
.btn-outline {
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: #2f84ff;
}

.btn-outline {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: rgba(31, 118, 255, 0.15);
}

.hero {
  min-height: calc(100vh - 88px);
  padding: 70px 5vw;
  display: grid;
  gap: 40px;
  align-items: center;
  grid-template-columns: 1.1fr 0.9fr;
}

.eyebrow {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.05;
  margin-bottom: 20px;
}

.hero h1 span,
h2 span {
  color: var(--primary);
}

.hero p {
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.6;
}

.hero-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-card {
  min-height: 360px;
  border-radius: 26px;
  border: 1px solid rgba(31, 118, 255, 0.35);
  background:
    linear-gradient(160deg, rgba(19, 32, 68, 0.8), rgba(5, 8, 19, 0.9)),
    var(--bg-soft);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 40px rgba(31, 118, 255, 0.22);
  display: grid;
  place-items: center;
  padding: 30px;
  transition: border-color 0.45s ease, background 0.45s ease, box-shadow 0.45s ease;
}

.hero-card img {
  width: min(75%, 360px);
  filter: drop-shadow(0 0 18px rgba(31, 118, 255, 0.45));
}

.section {
  padding: 85px 5vw;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
  margin-bottom: 34px;
}

.cards {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
}

.card {
  background: rgba(11, 16, 31, 0.85);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  transition: background-color 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
}

.card i {
  color: var(--primary);
  font-size: 30px;
  margin-bottom: 16px;
}

.card h3 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.card p {
  color: var(--muted);
  line-height: 1.55;
}

.about {
  display: grid;
  align-items: center;
  gap: 40px;
  grid-template-columns: 0.9fr 1.1fr;
}

.about-logo {
  background: linear-gradient(160deg, rgba(14, 23, 48, 0.95), rgba(7, 11, 25, 0.95));
  border: 1px solid rgba(108, 176, 255, 0.5);
  border-radius: 26px;
  padding: 12px;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 0 34px rgba(31, 118, 255, 0.16),
    0 0 0 1px rgba(31, 118, 255, 0.18),
    0 0 44px rgba(12, 34, 85, 0.42);
  transition: background 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
}

.about-logo img {
  width: 100%;
  max-width: 360px;
  height: 440px;
  object-fit: cover;
  object-position: center 20%;
  background: rgba(3, 5, 13, 0.85);
  border-radius: 24px;
  border: 1px solid rgba(196, 230, 255, 0.55);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.5),
    0 0 26px rgba(31, 118, 255, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  transition: transform 0.42s ease, box-shadow 0.42s ease, opacity 0.25s ease, filter 0.42s ease;
  cursor: pointer;
}

.about-logo img:hover {
  transform: scale(1.015);
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.55),
    0 0 30px rgba(31, 118, 255, 0.36),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.about-logo img.photo-spin {
  animation: photoSpin 0.58s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes photoSpin {
  from {
    transform: perspective(900px) rotateY(0deg) scale(1);
    opacity: 1;
  }
  50% {
    transform: perspective(900px) rotateY(90deg) scale(0.9);
    opacity: 0.2;
  }
  to {
    transform: perspective(900px) rotateY(180deg) scale(1);
    opacity: 1;
  }
}

body.cat-theme {
  --bg: #eef6ff;
  --bg-soft: #ffffff;
  --text: #18344c;
  --muted: #4d6578;
  --primary: #2ca3a3;
  --primary-dark: #1b7f7f;
  --line: #c8deef;
  background:
    radial-gradient(circle at 8% 12%, rgba(154, 214, 255, 0.42), transparent 34%),
    radial-gradient(circle at 88% 85%, rgba(170, 236, 216, 0.4), transparent 40%),
    linear-gradient(145deg, #f4fbff, #eef6ff 50%, #f8fffe);
}

body.cat-theme .header {
  background: linear-gradient(145deg, rgba(25, 37, 72, 0.96), rgba(8, 15, 34, 0.96));
  border-bottom-color: rgba(120, 171, 214, 0.35);
}

body.cat-theme .footer {
  background: linear-gradient(145deg, rgba(25, 37, 72, 0.96), rgba(8, 15, 34, 0.96));
  border-top-color: rgba(120, 171, 214, 0.35);
}

body.cat-theme .menu a,
body.cat-theme .brand span,
body.cat-theme .hero p,
body.cat-theme .about-content p,
body.cat-theme .project-card p,
body.cat-theme .contact-form input::placeholder,
body.cat-theme .contact-form textarea::placeholder,
body.cat-theme .footer {
  color: #476479;
}

body.cat-theme .brand span,
body.cat-theme .menu a,
body.cat-theme .footer {
  color: #ffffff;
}

body.cat-theme .eyebrow {
  color: #2ca3a3;
}

body.cat-theme .hero h1 span,
body.cat-theme h2 span {
  color: #2ca3a3;
}

body.cat-theme .btn-primary {
  background: linear-gradient(135deg, #2ca3a3, #53bcbc);
  color: #ffffff;
}

body.cat-theme .btn-primary:hover {
  background: linear-gradient(135deg, #37b0b0, #66c8c8);
}

body.cat-theme .btn-outline {
  border-color: #2ca3a3;
  color: #2a8e8e;
}

body.cat-theme .card,
body.cat-theme .project-card,
body.cat-theme .about-logo,
body.cat-theme .hero-card,
body.cat-theme .contact-form input,
body.cat-theme .contact-form textarea {
  border-color: rgba(44, 163, 163, 0.28);
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 22px rgba(44, 124, 163, 0.12);
}

body.cat-theme .project-image {
  background:
    linear-gradient(135deg, rgba(44, 163, 163, 0.5), rgba(98, 165, 235, 0.38)),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.5) 0,
      rgba(255, 255, 255, 0.5) 6px,
      transparent 6px,
      transparent 14px
    );
}

body.cat-theme .portfolio-controls button,
body.cat-theme .socials a {
  border-color: rgba(44, 163, 163, 0.65);
  background: linear-gradient(145deg, rgba(228, 248, 252, 0.98), rgba(209, 239, 246, 0.98));
  color: #257979;
  box-shadow: inset 0 0 10px rgba(44, 163, 163, 0.2), 0 0 12px rgba(95, 185, 214, 0.25);
}

body.cat-theme .portfolio-controls button:hover,
body.cat-theme .socials a:hover {
  box-shadow: inset 0 0 12px rgba(44, 163, 163, 0.26), 0 0 18px rgba(95, 185, 214, 0.35);
}

body.cat-theme .about-logo img {
  border-color: rgba(129, 199, 214, 0.8);
  box-shadow:
    0 14px 30px rgba(37, 104, 136, 0.2),
    0 0 22px rgba(95, 185, 214, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.about-content p {
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.socials {
  margin-top: 26px;
  display: flex;
  gap: 12px;
}

.socials a {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(31, 118, 255, 0.9);
  background: radial-gradient(circle at 30% 30%, #1f76ff, #0f45a8);
  display: grid;
  place-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  box-shadow: 0 0 0 rgba(31, 118, 255, 0.4);
  animation: socialPulse 2.6s ease-in-out infinite;
}

.socials a:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 0 24px rgba(31, 118, 255, 0.72);
  filter: brightness(1.12);
}

.linkedin-icon {
  width: 60%;
  height: 60%;
  object-fit: contain;
  border-radius: 8px;
}

@keyframes socialPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(31, 118, 255, 0.28);
  }
  50% {
    box-shadow: 0 0 18px 3px rgba(31, 118, 255, 0.5);
  }
}

.portfolio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portfolio-controls {
  display: flex;
  gap: 10px;
}

.portfolio-controls button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(67, 145, 255, 0.95);
  background: linear-gradient(145deg, rgba(10, 18, 40, 0.95), rgba(6, 11, 28, 0.95));
  color: #dbe9ff;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  box-shadow: inset 0 0 12px rgba(31, 118, 255, 0.18), 0 0 10px rgba(31, 118, 255, 0.22);
}

.portfolio-controls button:hover {
  transform: translateY(-2px) scale(1.03);
  background: linear-gradient(145deg, rgba(16, 30, 68, 0.96), rgba(8, 16, 39, 0.96));
  border-color: #63adff;
  box-shadow: inset 0 0 14px rgba(31, 118, 255, 0.28), 0 0 18px rgba(31, 118, 255, 0.52);
}

.portfolio-controls button:active {
  transform: translateY(0) scale(0.98);
}

.portfolio-controls .arrow {
  line-height: 1;
  font-size: 1.65rem;
  margin-top: -2px;
}

.portfolio-track {
  margin-top: 20px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 320px;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.portfolio-track::-webkit-scrollbar {
  height: 8px;
}

.portfolio-track::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 999px;
}

.project-card {
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: rgba(11, 16, 31, 0.85);
  transition: border-color 0.45s ease, background-color 0.45s ease, box-shadow 0.45s ease;
}

.project-image {
  width: 100%;
  height: 180px;
  border-radius: 14px;
  margin-bottom: 14px;
  background:
    linear-gradient(135deg, rgba(31, 118, 255, 0.75), rgba(15, 69, 168, 0.35)),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.12) 0,
      rgba(255, 255, 255, 0.12) 4px,
      transparent 4px,
      transparent 12px
    );
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card h3 {
  margin-bottom: 8px;
}

.project-card p {
  color: var(--muted);
  line-height: 1.5;
}

.project-link {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 700;
  transition: 0.2s;
}

.project-link:hover {
  background: var(--primary);
  color: #ffffff;
}

.contact h2 {
  text-align: center;
}

.contact-form {
  width: min(740px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.contact-form input,
.contact-form textarea {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 15px;
  font: inherit;
  transition: border-color 0.45s ease, background-color 0.45s ease, color 0.45s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #8390ac;
}

.contact-form button {
  justify-self: center;
  min-width: 180px;
  cursor: pointer;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 5vw 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #ffffff;
  background: linear-gradient(145deg, rgba(25, 37, 72, 0.96), rgba(8, 15, 34, 0.96));
}

.footer img {
  width: 54px;
}

.footer-brand span {
  font-size: 0.95rem;
}

.footer p {
  text-align: right;
}

@media (max-width: 980px) {
  .menu {
    display: none;
  }

  .hero,
  .about {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .portfolio-track {
    grid-auto-columns: 300px;
  }

  .about-logo img {
    max-width: 340px;
    height: 420px;
  }
}

@media (max-width: 640px) {
  .header {
    height: 80px;
    padding: 0 16px;
  }

  .brand img {
    width: 50px;
  }

  .brand span {
    font-size: 0.85rem;
  }

  .btn-primary,
  .btn-outline {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .section,
  .hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .portfolio-track {
    grid-auto-columns: 85vw;
  }

  .about-logo img {
    max-width: 300px;
    height: 360px;
  }

  .footer {
    flex-direction: column;
    text-align: center;
  }

  .footer p {
    text-align: center;
  }
}
