/* About Section Styles */

.about-section {
  /* Fluid padding: adapts naturally to viewport size */
  padding: clamp(var(--space-10), 8vw, var(--space-16)) clamp(var(--space-4), 5vw, var(--space-24));
  background-color: rgba(7, 17, 41, 0.97);
  position: relative;
  overflow: hidden;
  color: #fff;
  /* Enable container queries for intrinsic responsiveness */
  container-type: inline-size;
  container-name: about-section;
}

.about-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(32, 87, 214, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(21, 56, 138, 0.08) 0%, transparent 50%);
  z-index: 0;
  pointer-events: none;
  animation: subtleGradientShift 25s infinite alternate ease-in-out;
  transform-origin: center;
  will-change: transform, opacity;
}

@keyframes subtleGradientShift {
  0% {
    transform: scale(1) translate(0, 0);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1) translate(-1%, 1%);
    opacity: 1;
  }
  100% {
    transform: scale(1.05) translate(1%, -1%);
    opacity: 0.9;
  }
}

.about-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  z-index: 1;
}

.about-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.about-header {
  text-align: center;
  margin-bottom: clamp(var(--space-8), 5vw, var(--space-12));
}

.about-title {
  color: #fff;
  /* Fluid typography: scales naturally between breakpoints */
  font-size: clamp(1.75rem, 4vw + 0.5rem, var(--font-size-h2));
  font-weight: var(--font-weight-bold);
  margin-bottom: clamp(var(--space-3), 2vw, var(--space-4));
  position: relative;
  display: inline-block;
}

.about-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 60px;
  height: 2px;
  background-color: var(--color-accent-light);
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.about-section:hover .about-title::after {
  width: 100px;
}

.about-subtitle {
  color: rgba(255, 255, 255, 0.85);
  /* Fluid body text for optimal readability */
  font-size: clamp(0.9rem, 1.5vw + 0.5rem, var(--font-size-body));
  line-height: var(--line-height-body);
  max-width: min(768px, 90%);
  margin: 0 auto clamp(var(--space-8), 5vw, var(--space-12));
  font-weight: 300;
  letter-spacing: 0.015em;
  /* Smooth text rendering */
  text-wrap: balance;
}

/* Content grid layout - Flexible box system */
.about-content {
  display: grid;
  /* Intrinsic sizing: adapts to content while maintaining balance */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: clamp(var(--space-6), 4vw, var(--space-8));
  align-items: center;
}

/* Desktop: 2-column layout for image and text */
@media (min-width: 769px) {
  .about-content {
    grid-template-columns: 1fr 1fr;
  }
}

.about-image-container {
  position: relative;
  border-radius: var(--radius-3);
  overflow: hidden;
  box-shadow: 0 var(--space-2) var(--space-4) rgba(7, 17, 41, 0.1);
}

.about-image-container img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.about-image-container:hover img {
  transform: scale(1.02);
}

/* Content area */
.about-text {
  /* Fluid padding that adapts to available space */
  padding: clamp(var(--space-2), 2vw, var(--space-4));
}

.about-story-title {
  color: #fff;
  /* Fluid title sizing */
  font-size: clamp(1.5rem, 3vw + 0.5rem, var(--font-size-h3));
  font-weight: var(--font-weight-bold);
  margin-bottom: clamp(var(--space-4), 3vw, var(--space-6));
  position: relative;
  display: inline-block;
}

.about-story-title::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  width: 36px;
  height: 2px;
  background-color: var(--color-accent-light);
}

.about-story-text {
  color: rgba(255, 255, 255, 0.8);
  /* Fluid text sizing for readability */
  font-size: clamp(0.9rem, 1.5vw + 0.5rem, var(--font-size-body));
  margin-bottom: clamp(var(--space-4), 3vw, var(--space-6));
  line-height: var(--line-height-body);
  transition: color 0.3s ease;
}

.about-text:hover .about-story-text {
  color: rgba(255, 255, 255, 0.9);
}

/* Values section */
.values-section {
  margin-top: var(--space-16);
  padding: var(--space-12) 0;
  position: relative;
  z-index: 2;
}

.values-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 150px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: translateX(-50%);
}

.values-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.value-card {
  background-color: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-2);
  /* Fluid padding that adapts to available space */
  padding: clamp(var(--space-6), 4vw, var(--space-8)) clamp(var(--space-4), 3vw, var(--space-6));
  box-shadow: 
    0 var(--space-2) var(--space-6) rgba(0, 0, 0, 0.15),
    0 1px 1px rgba(255, 255, 255, 0.05) inset;
  text-align: left;
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  /* Initial state for entrance animation */
  opacity: 0;
  transform: translateY(15px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Fallback for when animations don't load - ensure cards are visible */
@media (prefers-reduced-motion: reduce) {
  .value-card {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Ensure cards become visible after a timeout (fallback) */
.value-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.value-card:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 var(--space-3) var(--space-8) rgba(0, 0, 0, 0.25),
    0 1px 2px rgba(255, 255, 255, 0.1) inset;
  background-color: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.1);
}

.value-card:active {
  transform: translateY(-2px);
  transition-duration: 0.15s;
}

.value-icon {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 0 var(--space-6);
}

.value-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: rgba(32, 87, 214, 0.25);
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.2),
    0 6px 16px -6px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transform: scale(1);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform, box-shadow, background-color;
}

.value-card:hover .value-icon::before {
  background-color: rgba(32, 87, 214, 0.35);
  transform: scale(1.05);
  box-shadow: 
    0 4px 14px rgba(32, 87, 214, 0.25),
    0 8px 20px -6px rgba(32, 87, 214, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

/* Special styles for mission icon to ensure visibility */
.value-card[data-value="mission"] .value-icon::before {
  background-color: rgba(21, 56, 138, 0.15);
}

.value-card[data-value="mission"]:hover .value-icon::before {
  background-color: rgba(21, 56, 138, 0.25);
}

.value-icon svg {
  width: var(--space-6);
  height: var(--space-6);
  fill: var(--color-accent-dark);
}

.value-icon i {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.9);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateZ(0); /* Force hardware acceleration */
  z-index: 2;
  backface-visibility: hidden; /* Prevent jagged edges during animation */
  -webkit-font-smoothing: antialiased; /* Smooth font rendering */
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Create a slight appearance delay between each card for visual interest */
.value-card:nth-child(1) {
  animation-delay: 0s;
}

.value-card:nth-child(2) {
  animation-delay: 0.15s;
}

.value-card:nth-child(3) {
  animation-delay: 0.3s;
}

.value-title {
  color: #fff;
  /* Fluid title sizing */
  font-size: clamp(1.25rem, 2vw + 0.5rem, var(--font-size-h4));
  margin-bottom: clamp(var(--space-2), 2vw, var(--space-3));
  font-weight: var(--font-weight-bold);
  position: relative;
  display: inline-block;
}

.value-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.3);
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.value-card:hover .value-title::after {
  width: 100%;
}

.value-text {
  color: rgba(255, 255, 255, 0.75);
  /* Fluid text sizing for readability */
  font-size: clamp(0.9rem, 1.5vw + 0.5rem, var(--font-size-body));
  line-height: var(--line-height-body);
  transition: color 0.3s ease;
}

.value-card:hover .value-text {
  color: rgba(255, 255, 255, 0.85);
}

.values-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.values-list li {
  margin-bottom: var(--space-2);
  position: relative;
  padding-left: var(--space-6);
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.3s ease, transform 0.2s ease;
}

.values-list li:hover {
  color: rgba(255, 255, 255, 0.9);
  transform: translateX(2px);
}

.values-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: var(--space-1);
  height: var(--space-1);
  border-radius: 50%;
  background-color: rgba(32, 87, 214, 0.8);
  box-shadow: 0 0 8px rgba(32, 87, 214, 0.5);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.values-list li:hover::before {
  background-color: rgba(32, 87, 214, 1);
  box-shadow: 0 0 12px rgba(32, 87, 214, 0.8);
  transform: translateY(-50%) scale(1.2);
}

/* ========================================= */
/* RESPONSIVE REARRANGEMENT WITH PURPOSE    */
/* ========================================= */

/* Tablet Landscape (769px - 1024px): Maintain 2-column layout with adjusted spacing */
@media (min-width: 769px) and (max-width: 1024px) {
  .about-section {
    padding: clamp(var(--space-10), 8vw, var(--space-14)) var(--space-8);
  }
  
  .about-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
  
  .about-text {
    padding: var(--space-3);
  }
  
  .values-container {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
  }
  
  .value-card {
    padding: var(--space-6) var(--space-5);
  }
}

/* Tablet Portrait (481px - 768px): Single column with optimized proportions */
@media (min-width: 481px) and (max-width: 768px) {
  .about-section {
    padding: var(--space-10) var(--space-6);
  }
  
  .about-content {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .about-image-container {
    order: -1;
    margin-bottom: var(--space-4);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .about-text {
    padding: var(--space-2);
  }
  
  .about-story-title {
    font-size: clamp(1.5rem, 4vw, 1.75rem);
  }
  
  .about-story-text {
    font-size: 0.95rem;
  }
  
  .values-section {
    margin-top: var(--space-10);
    padding: var(--space-8) 0;
  }
  
  .values-container {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
  }
  
  /* Third value card spans full width for visual balance */
  .value-card:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 400px;
    margin: 0 auto;
  }
}

/* Mobile (320px - 480px): Vertical stacking with priority-based spacing */
@media (max-width: 480px) {
  .about-section {
    padding: var(--space-8) var(--space-4);
  }
  
  .about-header {
    margin-bottom: var(--space-6);
  }
  
  .about-title {
    font-size: clamp(1.5rem, 6vw, 1.875rem);
  }
  
  .about-subtitle {
    font-size: 0.9rem;
    line-height: 1.6;
  }
  
  .about-content {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
  
  .about-image-container {
    order: -1;
    margin-bottom: var(--space-4);
  }
  
  .about-text {
    padding: 0;
  }
  
  .about-story-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-3);
  }
  
  .about-story-text {
    font-size: 0.9rem;
    line-height: 1.65;
    margin-bottom: var(--space-4);
  }
  
  .values-section {
    margin-top: var(--space-8);
    padding: var(--space-6) 0;
  }
  
  .values-container {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  
  .value-card {
    padding: var(--space-5) var(--space-4);
  }
  
  .value-icon {
    width: 50px;
    height: 50px;
    margin-bottom: var(--space-4);
  }
  
  .value-icon i {
    font-size: 20px;
  }
  
  .value-title {
    font-size: 1.25rem;
  }
  
  .value-text {
    font-size: 0.9rem;
  }
  
  /* Reduce hover effects on mobile for better performance */
  .value-card:hover {
    transform: translateY(-2px);
  }
  
  .about-image-container:hover img {
    transform: scale(1.01);
  }
}

/* Extra Small Mobile (< 360px): Compact layout with essential content */
@media (max-width: 359px) {
  .about-section {
    padding: var(--space-6) var(--space-3);
  }
  
  .about-title {
    font-size: 1.5rem;
  }
  
  .about-subtitle {
    font-size: 0.85rem;
  }
  
  .about-story-title {
    font-size: 1.25rem;
  }
  
  .about-story-text {
    font-size: 0.85rem;
  }
  
  .values-section {
    margin-top: var(--space-6);
  }
  
  .value-card {
    padding: var(--space-4) var(--space-3);
  }
  
  .value-icon {
    width: 45px;
    height: 45px;
  }
  
  .value-icon i {
    font-size: 18px;
  }
  
  .value-title {
    font-size: 1.15rem;
  }
  
  .value-text {
    font-size: 0.85rem;
  }
}

/* ========================================= */
/* CONTAINER QUERIES - Intrinsic Design     */
/* Modern browsers: Content adapts to       */
/* container, not just viewport             */
/* ========================================= */

@container about-section (max-width: 480px) {
  .about-content {
    grid-template-columns: 1fr;
  }
  
  .values-container {
    grid-template-columns: 1fr;
  }
}

@container about-section (min-width: 481px) and (max-width: 768px) {
  .about-content {
    grid-template-columns: 1fr;
  }
  
  .values-container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .value-card:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@container about-section (min-width: 769px) {
  .about-content {
    grid-template-columns: 1fr 1fr;
  }
  
  .values-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .about-section::before,
  .value-card,
  .value-card:hover,
  .value-icon::before,
  .value-card:hover .value-icon::before,
  .about-image-container img,
  .about-image-container:hover img {
    transition: none !important;
    transform: none !important;
    animation: none !important;
  }
}
