@import url('shared.css');
@import "https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap";

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --color: #1a1a1a;
  --color-light: #404040;
  --primary: #648796;
  --primary-dark: #4a6b7a;
  --primary-light: #7fa3b3;
  --white: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 29px 38px -15px rgba(0, 0, 0, 0.43);
  --shadow-2xl: 0 35px 60px -12px rgba(0, 0, 0, 0.5);
  --radius-sm: 0.5em;
  --radius-md: 0.75em;
  --radius-lg: 1em;
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===== BASE STYLES ===== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Poppins, sans-serif;
  position: relative;
  background-color: #f5f5f0;
  color: var(--color);
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== BACK LINK ===== */
.back-link {
  position: fixed;
  top: 2rem;
  left: 2rem;
  z-index: 1000;
}

/* ===== PARALLAX SECTIONS ===== */
.parallax {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: var(--color);
  text-align: center;
  position: relative;
}

.parallax::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.3) 100%
  );
  z-index: 1;
}

/* Mobile fallback - disable fixed attachment on smaller screens */
@media (max-width: 768px) {
  .parallax {
    background-attachment: scroll;
  }
}

/* Fallback for iOS Safari which doesn't support background-attachment: fixed */
@supports (-webkit-touch-callout: none) {
  .parallax {
    background-attachment: scroll;
  }
}

/* ===== HEADER SECTION ===== */
.parallax-header {
  background-position: bottom;
  flex-direction: column;
  background-image: url(https://images.unsplash.com/photo-1586114659943-8ff32c5d686d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1789&q=80);
}

.header-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.parallax-header h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1rem 0;
  color: var(--white);
  text-shadow: 
    0 2px 20px rgba(0, 0, 0, 0.5),
    0 4px 40px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.8s var(--transition-base);
}

.parallax-header .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  margin: 0;
  animation: fadeInUp 0.8s 0.2s both;
}

/* ===== CONTENT SECTION ===== */
.parallax-content {
  flex-direction: row;
  flex-wrap: wrap;
  background-position: center;
  padding: 6rem 2rem;
  background-image: url(https://images.unsplash.com/photo-1548126324-8457f62a0a22?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80);
  position: relative;
}

.parallax-content::before {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* ===== CARDS ===== */
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 0;
  border-radius: var(--radius-md);
  background-color: var(--white);
  box-shadow: 
    var(--shadow-xl),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  transition: 
    transform var(--transition-base),
    box-shadow var(--transition-base),
    opacity var(--transition-base);
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
  position: relative;
}

.card.is-visible {
  animation: fadeInUp 0.8s calc(var(--delay, 0) * 0.15s) both;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-md);
  padding: 2px;
  background: linear-gradient(
    135deg,
    rgba(100, 135, 150, 0.1),
    rgba(100, 135, 150, 0.05)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 
    var(--shadow-2xl),
    0 0 0 1px rgba(100, 135, 150, 0.2);
}

.card:hover::before {
  opacity: 1;
}

/* ===== CARD IMAGE ===== */
.card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.card .img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
  will-change: transform;
}

.card:hover .img {
  transform: scale(1.1);
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.3) 100%
  );
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.card:hover .image-overlay {
  opacity: 1;
}

/* ===== CARD CONTENT ===== */
.card h3 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  font-weight: 700;
  color: var(--color);
  padding: 0 1.5rem;
  text-align: center;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  max-width: 35ch;
  padding: 0 1.5rem;
  line-height: 1.7;
  color: var(--color-light);
  font-size: 0.95rem;
  text-align: center;
  flex-grow: 1;
}

/* ===== CARD BUTTON ===== */
.card-button {
  padding: 0.875em 2.5em;
  margin: 0 1.5rem 1.5rem;
  border-radius: 2em;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  text-transform: uppercase;
  transition: 
    background var(--transition-base),
    transform var(--transition-fast),
    box-shadow var(--transition-base);
  box-shadow: 
    0 4px 12px rgba(100, 135, 150, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.card-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.card-button:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 6px 20px rgba(100, 135, 150, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.card-button:hover::before {
  width: 300px;
  height: 300px;
}

.card-button:active {
  transform: translateY(0) scale(1.02);
}

.card-button:focus {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

/* ===== BUFFER SECTION ===== */
.buffer {
  width: 100%;
  min-height: 20vh;
  background-color: var(--primary);
  position: relative;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .back-link {
    top: 1rem;
    left: 1rem;
  }

  .parallax-header {
    padding: 1rem;
  }

  .header-content {
    padding: 1rem;
  }

  .parallax-content {
    padding: 4rem 1.5rem;
  }

  .cards-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .card {
    max-width: 100%;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== CONTAINER QUERIES (for future enhancement) ===== */
/* Container queries can be added here when needed */

/* ===== PRINT STYLES ===== */
@media print {
  .parallax {
    background-attachment: scroll;
    min-height: auto;
  }
  
  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
