/* -------------------------------------------------------------
 * Main CSS Design System - João Marcos Portfolio
 * ------------------------------------------------------------- */

/* Define Global CSS Variables for Themes */
:root {
  /* Colors for default DARK theme */
  --bg: #14011E;
  --bg-gradient: radial-gradient(circle at 50% 50%, #200435 0%, #14011E 100%);
  --bg-section: #1d032b;
  --bg-card: rgba(32, 4, 53, 0.4);
  --bg-card-hover: rgba(51, 8, 82, 0.6);
  --bg-control: rgba(109, 40, 217, 0.15);
  
  --primary: #6D28D9;
  --primary-rgb: 109, 40, 217;
  --secondary: #8B5CF6;
  --secondary-rgb: 139, 92, 246;
  
  --text: #FFFFFF;
  --text-muted: #D1D5DB;
  --text-dark: #9CA3AF;
  
  --border: rgba(139, 92, 246, 0.2);
  --border-hover: rgba(139, 92, 246, 0.5);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-hover: 0 12px 40px 0 rgba(109, 40, 217, 0.3);
  
  --backdrop-blur: blur(12px);
  --transition-speed: 0.3s;
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Light Mode Variables Override */
[data-theme="light"] {
  --bg: #F8FAFC;
  --bg-gradient: radial-gradient(circle at 50% 50%, #F1F5F9 0%, #E2E8F0 100%);
  --bg-section: #FFFFFF;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-control: rgba(109, 40, 217, 0.1);
  
  --text: #0F172A;
  --text-muted: #475569;
  --text-dark: #64748B;
  
  --border: rgba(109, 40, 217, 0.15);
  --border-hover: rgba(109, 40, 217, 0.4);
  --shadow: 0 8px 30px 0 rgba(109, 40, 217, 0.06);
  --shadow-hover: 0 12px 35px 0 rgba(109, 40, 217, 0.15);
}

/* -------------------------------------------------------------
 * Reset & Base Layout
 * ------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-speed), transform var(--transition-speed);
}

ul {
  list-style: none;
}

/* Focus Outline Style for Accessibility */
*:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 4px;
}

/* -------------------------------------------------------------
 * Layout Structure
 * ------------------------------------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
  position: relative;
}

.bg-light-section {
  background-color: var(--bg-section);
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Wrapper constraints inside full-width section */
.bg-light-section > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

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

.section-title {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 30%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.section-divider {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

/* -------------------------------------------------------------
 * Accessibility Skip Link
 * ------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--primary);
  color: white;
  padding: 1rem 1.5rem;
  z-index: 9999;
  border-radius: 8px;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* -------------------------------------------------------------
 * Global Animation Systems
 * ------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(109, 40, 217, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(109, 40, 217, 0); }
  100% { box-shadow: 0 0 0 0 rgba(109, 40, 217, 0); }
}

.animate-fade {
  animation: fadeIn 1s ease forwards;
}

.animate-slide-up {
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* -------------------------------------------------------------
 * Utilities & Helper Classes
 * ------------------------------------------------------------- */
.glass {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 16px;
  transition: border var(--transition-speed) ease, box-shadow var(--transition-speed) ease, background var(--transition-speed) ease;
}

.glass:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
}

.hidden {
  display: none !important;
}

.logo-gradient {
  background: linear-gradient(135deg, #A78BFA 0%, var(--secondary) 50%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* -------------------------------------------------------------
 * Media Queries for Responsiveness
 * ------------------------------------------------------------- */
@media (max-width: 1024px) {
  html {
    font-size: 15px;
  }
  .section {
    padding: 5rem 0;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  .section {
    padding: 4rem 0;
  }
  .section-title {
    font-size: 2.2rem;
  }
  .container {
    padding: 0 1.5rem;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 2rem;
  }
}
