/* ==========================================================================
   DivBit - Digital Marketing Agency Website
   CSS Custom Properties & Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables / Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand Colors - Dark Charcoal, Red, White */
  --primary: #1a1a1a;           /* Dark Charcoal/Black */
  --primary-light: #2d2d2d;
  --primary-dark: #000000;
  --accent: #d32f2f;             /* Red */
  --accent-light: #e53935;
  --accent-dark: #b71c1c;
  --text: #1E293B;               /* High-contrast slate */
  --text-light: #64748B;
  --text-muted: #94A3B8;
  --background: #FFFFFF;
  --background-alt: #F8FAFC;
  --background-dark: #0F172A;
  
  /* Typography Scale */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Source Sans 3', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  
  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  
  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
  
  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
  
  /* Layout */
  --container-max: 1280px;
  --header-height: 80px;
}

/* --------------------------------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* Focus Styles for Accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background-color: var(--accent);
  color: var(--background);
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text);
}

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

@media (max-width: 768px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }
}

@media (max-width: 480px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
}

p {
  margin-bottom: var(--space-4);
}

.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Layout Components
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-24) 0;
}

.section-alt {
  background-color: var(--background-alt);
}

.section-dark {
  background-color: var(--background-dark);
  color: var(--background);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4,
.section-dark h5,
.section-dark h6 {
  color: var(--background);
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  z-index: var(--z-sticky);
  transition: var(--transition-base);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--primary);
}

.logo-accent {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-link {
  font-weight: 600;
  color: var(--text);
  transition: var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: var(--z-modal);
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  transition: var(--transition-fast);
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
  
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-8);
    background-color: var(--background);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
  }
  
  .nav.active {
    opacity: 1;
    visibility: visible;
  }
  
  .nav-link {
    font-size: var(--text-2xl);
  }
}

/* --------------------------------------------------------------------------
   Buttons & CTAs
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--background);
}

.btn-primary:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-accent {
  background-color: var(--accent);
  color: var(--background);
}

.btn-accent:hover {
  background-color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: var(--background);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(0, 191, 165, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 191, 165, 0.08) 0%, transparent 40%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  color: var(--background);
}

.hero h1 {
  color: var(--background);
  margin-bottom: var(--space-6);
  font-size: var(--text-6xl);
}

.hero-subtitle {
  font-size: var(--text-xl);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-8);
  line-height: var(--leading-relaxed);
}

.hero-cta {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero {
    padding-top: calc(var(--header-height) + var(--space-12));
    padding-bottom: var(--space-16);
  }
  
  .hero h1 {
    font-size: var(--text-4xl);
  }
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background-color: var(--background);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

.card-icon svg {
  width: 32px;
  height: 32px;
  color: var(--background);
}

.card h3 {
  margin-bottom: var(--space-3);
}

.card p {
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Service Card */
.service-card {
  text-align: center;
  padding: var(--space-10);
}

.service-card .card-icon {
  margin-left: auto;
  margin-right: auto;
}

/* Blog Card */
.blog-card {
  overflow: hidden;
}

.blog-card-image {
  height: 200px;
  background-color: var(--background-alt);
  background-size: cover;
  background-position: center;
  margin: calc(var(--space-8) * -1);
  margin-bottom: var(--space-6);
}

.blog-card-meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.blog-card-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.blog-card-excerpt {
  color: var(--text-light);
  margin-bottom: var(--space-4);
}

/* --------------------------------------------------------------------------
   Stats Section
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
}

.stat {
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid #E2E8F0;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  transition: var(--transition-fast);
  background-color: var(--background);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.1);
}

.form-input.error,
.form-textarea.error {
  border-color: #EF4444;
}

.form-error {
  color: #EF4444;
  font-size: var(--text-sm);
  margin-top: var(--space-1);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.form-success {
  padding: var(--space-4);
  background-color: #D1FAE5;
  border: 1px solid #10B981;
  border-radius: var(--radius-md);
  color: #065F46;
  margin-bottom: var(--space-4);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  background-color: var(--background-dark);
  color: var(--background);
  padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer-brand {
  max-width: 300px;
}

.footer-brand .logo {
  color: var(--background);
  margin-bottom: var(--space-4);
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--text-sm);
}

.footer h4 {
  color: var(--background);
  margin-bottom: var(--space-4);
  font-size: var(--text-lg);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--text-sm);
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.5);
}

.social-links {
  display: flex;
  gap: var(--space-4);
}

.social-links a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.1);
  transition: var(--transition-fast);
}

.social-links a:hover {
  background-color: var(--accent);
}

.social-links svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Cookie Banner
   -------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--background);
  border-top: 1px solid #E2E8F0;
  padding: var(--space-6);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-toast);
  transform: translateY(100%);
  transition: var(--transition-base);
}

.cookie-banner.active {
  transform: translateY(0);
}

.cookie-banner-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.cookie-banner p {
  margin-bottom: 0;
  font-size: var(--text-sm);
}

.cookie-banner-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .cookie-banner-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Specialties Section
   -------------------------------------------------------------------------- */
.specialty-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 0;
}

.specialty-card-inner {
  padding: var(--space-8);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--background);
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.specialty-card h3 {
  color: var(--background);
  margin-bottom: var(--space-3);
}

.specialty-card p {
  color: rgba(255, 255, 255, 0.8);
  flex-grow: 1;
}

.specialty-card .card-icon {
  background-color: var(--accent);
  margin-bottom: var(--space-4);
}

/* --------------------------------------------------------------------------
   Testimonial
   -------------------------------------------------------------------------- */
.testimonial {
  background-color: var(--background);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  position: relative;
}

.testimonial::before {
  content: '"';
  position: absolute;
  top: var(--space-4);
  left: var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-6xl);
  color: var(--accent);
  opacity: 0.3;
  line-height: 1;
}

.testimonial-content {
  position: relative;
  z-index: 1;
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--text);
  margin-bottom: var(--space-6);
  padding-left: var(--space-8);
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.testimonial-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background-color: var(--background-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
}

.testimonial-info h4 {
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}

.testimonial-info span {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   404 Page
   -------------------------------------------------------------------------- */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8);
}

.error-code {
  font-family: var(--font-display);
  font-size: 8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--space-4);
}

.error-page h1 {
  margin-bottom: var(--space-4);
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: var(--space-8);
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Staggered animations */
.stagger > *:nth-child(1) { transition-delay: 0ms; }
.stagger > *:nth-child(2) { transition-delay: 100ms; }
.stagger > *:nth-child(3) { transition-delay: 200ms; }
.stagger > *:nth-child(4) { transition-delay: 300ms; }
.stagger > *:nth-child(5) { transition-delay: 400ms; }
.stagger > *:nth-child(6) { transition-delay: 500ms; }

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
  .header, .footer, .cookie-banner {
    display: none;
  }
  
  .section {
    padding: var(--space-4) 0;
  }
}
