﻿/* ==========================================================================
   CORE STYLES & LAYOUT SYSTEM
   Reda Mohamed Salah — Professional Developer Portfolio
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS RESET & BASE DEFAULTS
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  min-height: 100vh;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans-en);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
}

/* Arabic Language Support */
html[lang="ar"] body,
[dir="rtl"] body {
  font-family: var(--font-sans-ar);
  line-height: 1.75;
}

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

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

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

ul, ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
   ACCESSIBILITY & FOCUS STATES
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  inset-inline-start: 1rem;
  background: var(--primary);
  color: var(--text-inverse);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

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

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY SYSTEM
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: clamp(1.1rem, 1.8vw, 1.25rem); }

.lead-text {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.7;
}

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary-accent { color: var(--primary); }
.text-secondary-accent { color: var(--secondary); }
.font-mono { font-family: var(--font-mono); }

/* --------------------------------------------------------------------------
   CONTAINER & GRID LAYOUTS
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.section {
  padding-block: clamp(4rem, 8vw, 6.5rem);
  position: relative;
}

.section-header {
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
  text-align: center;
  max-width: 700px;
  margin-inline: auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background-color: var(--primary-surface);
  color: var(--primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-title {
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Flex & Grid Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* --------------------------------------------------------------------------
   BACKGROUND ACCENTS & GLOWS
   -------------------------------------------------------------------------- */
.bg-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.4;
  z-index: 0;
}

.glow-primary {
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.glow-secondary {
  background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
}
