/* ==========================================================================
   BASE STYLES & RESET - KASRA PORTFOLIO
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  position: relative;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-violet);
}

/* Typography Rules */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.025em;
}

h3 {
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
}

h4 {
  font-size: 1.25rem;
}

p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.25rem;
  }
}

/* Custom Cursor Elements */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--accent-violet-light);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background-color 0.2s;
  mix-blend-mode: difference;
}

.custom-cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(155, 140, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: calc(var(--z-cursor) - 1);
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease-out, width 0.3s var(--ease-out-expo), height 0.3s var(--ease-out-expo), border-color 0.3s;
}

body.cursor-hover .custom-cursor {
  width: 12px;
  height: 12px;
  background-color: var(--accent-blue-light);
}

body.cursor-hover .custom-cursor-follower {
  width: 56px;
  height: 56px;
  border-color: var(--accent-violet);
  background-color: rgba(108, 92, 231, 0.08);
}

@media (max-width: 1024px) {
  .custom-cursor, .custom-cursor-follower {
    display: none !important;
  }
}

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-violet-light) 70%, var(--accent-blue-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-violet {
  color: var(--accent-violet-light);
}

.text-muted {
  color: var(--text-muted);
}

.bg-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
}

/* Section Common Structure */
.section {
  padding: 8rem 0;
  position: relative;
}

@media (max-width: 768px) {
  .section {
    padding: 5rem 0;
  }
}

.section-header {
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-violet-light);
  margin-bottom: 1rem;
  padding: 0.35rem 0.85rem;
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.25);
  border-radius: var(--radius-pill);
}

.section-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  background-color: var(--accent-violet);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-violet);
}

.section-title {
  font-size: clamp(2rem, 3.5vw, 3rem);
}

.section-subtitle {
  max-width: 640px;
  margin-top: 1rem;
  font-size: 1.15rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   MINIMAL PAGE LOADER
   ========================================================================== */

#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary, #080c10);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  user-select: none;
}

/* Monogram */
.loader-mark {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #a78bfa 0%, #818cf8 40%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: loader-pulse 1.6s ease-in-out infinite;
}

@keyframes loader-pulse {
  0%, 100% { opacity: 1;   filter: drop-shadow(0 0 18px rgba(139, 92, 246, 0.55)); }
  50%       { opacity: 0.6; filter: drop-shadow(0 0  8px rgba(139, 92, 246, 0.20)); }
}

/* Progress bar */
.loader-bar-track {
  width: clamp(80px, 16vw, 140px);
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #818cf8, #a78bfa, #60a5fa);
  transition: width 0.1s linear;
}
