/* ================================================================
   base.css — Reset, Body, Scrollbar, Loader, Keyframes
   Hussain Patanwala Portfolio
================================================================ */

/* ── Reset ────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  cursor: none;
  line-height: 1.7;
  transition: background 0.4s ease, color 0.4s ease;
}

img {
  max-width: 100%;
  display: block;
}

/* ── Custom Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--cyan), var(--purple));
  border-radius: 99px;
}

/* ── Custom Cursor ────────────────────────────────────────────── */
#cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
}

#cursor .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  position: absolute;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px var(--cyan);
  transition: width 0.15s, height 0.15s, opacity 0.2s;
}

#cursor .ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 229, 255, 0.5);
  position: absolute;
  transform: translate(-50%, -50%);
  transition:
    width 0.35s cubic-bezier(0.23, 1, 0.32, 1),
    height 0.35s cubic-bezier(0.23, 1, 0.32, 1),
    border-color 0.3s;
}

body.hover-state #cursor .ring {
  width: 56px;
  height: 56px;
  border-color: var(--cyan);
}

/* ── Page Loader ──────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-text {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--cyan);
  letter-spacing: 6px;
  text-transform: uppercase;
  animation: blink 1.2s steps(2) infinite;
}

.loader-bar {
  width: 200px;
  height: 2px;
  background: var(--border);
  margin-top: 24px;
  border-radius: 99px;
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  animation: loadBar 1.8s ease forwards;
}

/* ── Scroll Reveal ────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Keyframes ────────────────────────────────────────────────── */
@keyframes loadBar {
  from { width: 0; }
  to   { width: 100%; }
}

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

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

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(0, 229, 255, 0); }
}

@keyframes scrollAnim {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
