/**
* Ivan Anikin — visual enhancements layer
* Loaded AFTER style.css / polyscape.css so it wins on shared selectors.
* Adds: scroll progress, richer hover transitions, card polish,
* hero motion, staggered scroll reveals. Respects reduced-motion.
*/

:root {
  --accent: #149ddd;
  --accent-light: #37b3ed;
  --accent-dark: #0f7bb0;
  --ink: #173b6c;
  --panel-shadow: 0 6px 22px rgba(16, 58, 105, 0.08);
  --panel-shadow-hover: 0 18px 40px rgba(20, 157, 221, 0.22);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Smooth scrolling fallback (jQuery handles nav clicks; this covers the rest) */
html {
  scroll-behavior: smooth;
}

/*--------------------------------------------------------------
# Scroll progress bar
--------------------------------------------------------------*/
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  z-index: 100000;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(20, 157, 221, 0.6);
}

/*--------------------------------------------------------------
# Hero — animated overlay, entrance, scroll cue
--------------------------------------------------------------*/
#hero:before {
  background: linear-gradient(
    130deg,
    rgba(4, 11, 20, 0.72) 0%,
    rgba(9, 35, 64, 0.55) 45%,
    rgba(20, 157, 221, 0.32) 100%
  );
  background-size: 200% 200%;
  animation: heroGradient 14s ease infinite;
}

@keyframes heroGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#hero .hero-container {
  animation: heroFadeUp 1.1s var(--ease-out) both;
}

#hero h1 {
  letter-spacing: 1px;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Blinking caret on the typed string */
#hero .typed-cursor {
  color: var(--accent-light);
}

/* Scroll-down chevron */
.scroll-down {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  animation: chevronBounce 2s infinite;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.scroll-down:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

@keyframes chevronBounce {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 10px); }
}

/*--------------------------------------------------------------
# Section titles — growing underline
--------------------------------------------------------------*/
.section-title h2::after {
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 0.9s var(--ease-out) 0.15s;
}

.section-title.is-visible h2::after,
body:not(.js-reveal-enabled) .section-title h2::after {
  width: 50px;
}

/*--------------------------------------------------------------
# Cards — unified look + lift + image zoom
--------------------------------------------------------------*/
.portfolio .card,
.skills .card {
  border: 1px solid rgba(20, 157, 221, 0.10);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--panel-shadow);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out),
    border-color 0.4s var(--ease-out);
  height: 100%;
}

.portfolio .card:hover,
.skills .card:hover {
  transform: translateY(-10px);
  box-shadow: var(--panel-shadow-hover);
  border-color: rgba(20, 157, 221, 0.35);
}

/* Uniform portfolio imagery for a clean grid */
.portfolio .card-img-top {
  height: 210px;
  object-fit: cover;
  width: 100%;
  transition: transform 0.6s var(--ease-out), filter 0.4s ease;
}

.portfolio .card:hover .card-img-top {
  transform: scale(1.07);
  filter: saturate(1.1);
}

.portfolio .card-body,
.skills .card-body {
  padding: 20px;
}

.portfolio .card-title,
.skills .card-title {
  color: var(--ink);
  font-weight: 700;
  transition: color 0.3s ease;
}

.portfolio .card:hover .card-title {
  color: var(--accent);
}

/*--------------------------------------------------------------
# Skill badges — pop on hover
--------------------------------------------------------------*/
#skills .badge {
  display: inline-block;
  margin: 4px 4px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 50px;
  letter-spacing: 0.3px;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
  cursor: default;
}

#skills .badge:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

/*--------------------------------------------------------------
# Skills cards — gutters between columns and rows
--------------------------------------------------------------*/
#skills .skills-content {
  margin-left: -12px;
  margin-right: -12px;
}

#skills .skills-content > [class*="col-"] {
  padding-left: 12px;
  padding-right: 12px;
  margin-bottom: 24px;
}

#skills .skills-content .card {
  border-radius: 14px;
}

/*--------------------------------------------------------------
# Focus / services icon boxes
# The card look lives on .icon-box-inner so the column padding
# can act as a real gutter between cards.
--------------------------------------------------------------*/
.services .row {
  margin-left: -12px;
  margin-right: -12px;
}

.services .icon-box {
  padding-left: 12px;
  padding-right: 12px;
  margin-bottom: 24px;
}

.services .icon-box-inner {
  height: 100%;
  padding: 26px 24px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--panel-shadow);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  overflow: hidden;
}

.services .icon-box-inner:hover {
  transform: translateY(-8px);
  box-shadow: var(--panel-shadow-hover);
}

.services .icon {
  transition: transform 0.5s var(--ease-out), background 0.4s ease;
}

/* Hover state follows the card, not the column's gutter area */
.services .icon-box:hover .icon {
  background: #149ddd;
}

.services .icon-box:hover .icon i {
  color: #fff;
}

.services .icon-box-inner:hover .icon {
  background: #fff;
  transform: rotate(-8deg) scale(1.12);
}

.services .icon-box-inner:hover .icon i {
  color: #149ddd;
}

/*--------------------------------------------------------------
# Buttons — lift + glow
--------------------------------------------------------------*/
.btn-primary,
.btn-secondary {
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out),
    filter 0.25s ease;
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(20, 157, 221, 0.35);
  filter: brightness(1.05);
}

.btn-primary:active,
.btn-secondary:active {
  transform: translateY(-1px);
}

/*--------------------------------------------------------------
# Portfolio filter pills
--------------------------------------------------------------*/
.portfolio #portfolio-flters {
  box-shadow: var(--panel-shadow);
  display: inline-block;
}

.portfolio #portfolio-flters li {
  border-radius: 50px;
  transition: color 0.3s ease, background 0.3s ease;
}

.portfolio #portfolio-flters li:hover,
.portfolio #portfolio-flters li.filter-active {
  background: rgba(20, 157, 221, 0.12);
  color: var(--accent);
}

/*--------------------------------------------------------------
# Sidebar: social links + nav polish
--------------------------------------------------------------*/
#header .profile .social-links a {
  transition: transform 0.3s var(--ease-out), background 0.3s ease;
}

#header .profile .social-links a:hover {
  transform: translateY(-4px) scale(1.1);
}

.nav-menu a {
  border-radius: 8px;
  position: relative;
}

.nav-menu a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 3px;
  transition: transform 0.3s var(--ease-out);
}

.nav-menu a:hover,
.nav-menu .active > a {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
  transition: transform 0.3s var(--ease-out), background 0.3s ease;
}

.nav-menu a:hover::before,
.nav-menu .active > a::before {
  transform: translateY(-50%) scaleY(1);
}

/* Sidebar entrance */
#header {
  animation: sidebarIn 0.8s var(--ease-out) both;
}

@keyframes sidebarIn {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1199px) {
  #header { animation: none; }
}

/*--------------------------------------------------------------
# Contact info hover
--------------------------------------------------------------*/
.contact .info .email,
.contact .info .phone {
  border-radius: 10px;
  padding: 6px;
  transition: background 0.3s ease, transform 0.3s var(--ease-out);
}

.contact .info .email:hover,
.contact .info .phone:hover {
  background: #f3faff;
  transform: translateX(4px);
}

/*--------------------------------------------------------------
# Back-to-top
--------------------------------------------------------------*/
.back-to-top {
  transition: transform 0.3s var(--ease-out), background 0.3s ease,
    opacity 0.3s ease;
}

.back-to-top:hover {
  transform: translateY(-4px);
}

/*--------------------------------------------------------------
# Scroll reveal (driven by enhancements.js via IntersectionObserver)
# Only applies once JS flags the body, so content is never hidden
# if JS fails to load.
--------------------------------------------------------------*/
body.js-reveal-enabled .reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}

body.js-reveal-enabled .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/*--------------------------------------------------------------
# Reduced motion — disable the movement, keep the content
--------------------------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  body.js-reveal-enabled .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .scroll-down { animation: none; }
}
