/* ==========================================================================
   Kaan Karabina — Portfolio
   Hand-written CSS that complements the Tailwind (CDN) utility classes.
   Kept deliberately framework-free so it works with zero build step.
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  scroll-padding-top: 5rem;
}

/* ---- Selection color ---- */
::selection {
  background-color: #2563eb;
  color: #ffffff;
}

/* ---- Scrollbar (WebKit) ---- */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(100, 116, 139, 0.4);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 116, 139, 0.6);
}

/* ---- Sticky navbar states (toggled via JS) ---- */
#navbar {
  background-color: transparent;
}
#navbar.is-scrolled {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}
html.dark #navbar.is-scrolled {
  background-color: rgba(2, 6, 23, 0.75);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---- Active nav link ---- */
[data-nav-link].is-active {
  color: #2563eb;
  font-weight: 600;
}
html.dark [data-nav-link].is-active {
  color: #60a5fa;
}

/* ---- Blueprint grid background for hero ---- */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}
html.dark .bg-grid {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
}

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .animate-float,
  .animate-pulse {
    animation: none !important;
  }
}

/* ---- Hero portrait: precisely crops the circular photo out of its
   original square canvas (which has black padding around the circle),
   so no black background is ever visible. ---- */
.avatar-photo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 131%;
  height: 157%;
  max-width: none;
  object-fit: cover;
  transform: translate(-51%, -54%);
}

/* ---- Back to top button visibility (toggled via JS) ---- */
#back-to-top {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}
