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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-primary);
  color: var(--fg-primary);
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  background: var(--bg-primary);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }

/* ═══ UTILITY ═══ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.accent { color: var(--accent); }
.font-display { font-family: var(--font-display); }
.font-accent { font-family: var(--font-accent); }

/* ═══ GRAIN OVERLAY — Cool neutral grain ═══ */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='6' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 512px 512px;
}

/* ═══ CUSTOM CURSOR GLOW — Premium dual-layer ═══ */
.cursor-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: 
    radial-gradient(circle, rgba(142,153,164,0.08) 0%, transparent 50%),
    radial-gradient(circle, rgba(200,210,220,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: opacity 0.5s var(--ease-out-expo);
  opacity: 0;
  filter: blur(1px);
}

.cursor-glow.active {
  opacity: 1;
}

/* ═══ PREMIUM: Section Dividers — Gradient Wash with gold center ═══ */
.section-divider {
  position: relative;
  height: 1px;
  max-width: var(--container-max);
  margin: 0 auto;
  background: linear-gradient(90deg, transparent 0%, var(--border) 25%, var(--accent-warm-dim) 50%, var(--border) 75%, transparent 100%);
  opacity: 0.35;
}

.section-divider::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 20%;
  right: 20%;
  height: 40px;
  background: radial-gradient(ellipse at center, rgba(168,180,192,0.02) 0%, transparent 70%);
  pointer-events: none;
}

/* ═══ PREMIUM: Global Card Highlight ═══ */
.premium-card {
  position: relative;
  box-shadow: var(--shadow-card);
  transition: 
    box-shadow 0.6s var(--ease-out-expo),
    transform 0.5s var(--ease-out-expo),
    border-color 0.5s var(--ease-out-expo);
}

.premium-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out-expo);
}

.premium-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.premium-card:hover::before {
  opacity: 1;
}

/* ═══ PREMIUM: Subtle page fade-in ═══ */
body {
  animation: pageReveal 1.2s var(--ease-out-expo) both;
}

@keyframes pageReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ═══ PREMIUM: Selection color ═══ */
::selection {
  background: rgba(142,153,164,0.18);
  color: var(--fg-primary);
}

/* ═══ PREMIUM: Smooth scrollbar ═══ */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
  transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dim);
}
html {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg-primary);
}


/* ═══ PREMIUM: Scroll Progress Indicator ═══ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent), var(--accent-light));
  z-index: 9998;
  width: 0%;
  transition: none;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(142,153,164,0.3);
}

/* ═══ PREMIUM: Focus ring for accessibility ═══ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ═══ PREMIUM: Smooth image loading ═══ */
img {
  opacity: 1;
  transition: opacity 0.4s ease;
}

img[loading="lazy"] {
  opacity: 0;
}

img[loading="lazy"].loaded,
img[loading="lazy"]:complete {
  opacity: 1;
}
