/* ============================================
   FuelOdo - Base Styles & 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;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition-base), color var(--transition-base);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); font-weight: 800; }
h2 { font-size: var(--text-3xl); font-weight: 700; }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

a {
  color: var(--primary-500);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--primary-600); }

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

ul, ol { list-style: none; }

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

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-500), var(--cyan-500));
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary-400), var(--cyan-400));
}

/* ── Selection ── */
::selection {
  background: var(--primary-500);
  color: white;
}

/* ── Utilities ── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── Animations ── */
.fade-in {
  animation: fadeIn var(--transition-slow) ease-out;
}

.slide-up {
  animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.slide-in-right {
  animation: slideInRight var(--transition-slow) ease-out;
}

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

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-12px) rotate(1deg); }
  66% { transform: translateY(4px) rotate(-1deg); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
}

/* ── Stagger delays ── */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ── App Layout ── */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  background: var(--bg-primary);
}

/* ── Section (SPA pages) ── */
.app-section {
  display: none;
  animation: fadeIn var(--transition-base) ease-out;
}

.app-section.active {
  display: block;
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.section-header h2 {
  font-size: var(--text-2xl);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.section-header h2 .icon {
  font-size: var(--text-3xl);
}

/* ── Animated Mesh Background (for decorated pages) ── */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.mesh-bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
  will-change: transform;
}

.mesh-bg .orb-1 {
  width: 300px; height: 300px;
  background: rgba(99, 102, 241, 0.15);
  top: -10%; left: -5%;
  animation-duration: 22s;
}

.mesh-bg .orb-2 {
  width: 250px; height: 250px;
  background: rgba(6, 182, 212, 0.12);
  top: 50%; right: -10%;
  animation-duration: 18s;
  animation-delay: -5s;
}

.mesh-bg .orb-3 {
  width: 200px; height: 200px;
  background: rgba(34, 197, 94, 0.10);
  bottom: -5%; left: 30%;
  animation-duration: 25s;
  animation-delay: -10s;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .mesh-bg .orb { animation: none; }
}
