/* ==========================================================================
   BASE STYLES & RESET
   Gioele Lombardi - Premium Web Development & Design
   ========================================================================== */

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

html {
  font-family: var(--font-body);
  font-size: 16px;
  background-color: var(--bg-main);
  color: var(--text-primary);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1.5rem);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

/* Ambient Background Light Effects (Subtle and high performance) */
.ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: var(--z-bg);
  overflow: hidden;
}

.glow-orb-1 {
  position: absolute;
  top: -10vw;
  right: -5vw;
  width: 55vw;
  height: 55vw;
  max-width: 750px;
  max-height: 750px;
  background: radial-gradient(circle, rgba(118, 103, 232, 0.1) 0%, rgba(118, 103, 232, 0) 70%);
  border-radius: 50%;
  filter: blur(60px);
  will-change: transform;
}

.glow-orb-2 {
  position: absolute;
  top: 45vh;
  left: -15vw;
  width: 50vw;
  height: 50vw;
  max-width: 650px;
  max-height: 650px;
  background: radial-gradient(circle, rgba(8, 112, 141, 0.08) 0%, rgba(8, 112, 141, 0) 70%);
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
}

.glow-orb-3 {
  position: absolute;
  bottom: 5vh;
  right: 10vw;
  width: 45vw;
  height: 45vw;
  max-width: 600px;
  max-height: 600px;
  background: radial-gradient(circle, rgba(8, 122, 85, 0.06) 0%, rgba(8, 122, 85, 0) 70%);
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }

p {
  margin-bottom: 1rem;
  font-size: var(--text-base);
  color: var(--text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

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

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

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

/* Accessibility focus styles */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 4px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 9px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: rgba(44, 54, 78, 0.16);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(44, 54, 78, 0.3);
}

/* Text selection */
::selection {
  background: var(--accent-primary);
  color: #ffffff;
}

/* Utility layout helpers */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1.25rem, 3.5vw, 2.5rem);
  padding-right: clamp(1.25rem, 3.5vw, 2.5rem);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3.5rem auto;
}

.section-header.text-left {
  text-align: left;
  margin-left: 0;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-azure);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-full);
  margin-bottom: 1.15rem;
}

.section-title {
  margin-bottom: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-title .text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Animated reveals */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Accessibility: Respect user motion preferences (WCAG) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .fade-in-up {
    opacity: 1 !important;
    transform: none !important;
  }

  .floating-badge {
    animation: none !important;
  }

  .pulse-dot::before, .floating-whatsapp-btn::after {
    animation: none !important;
  }
}
