/* ==========================================================================
   VITALYS — BRAND STORY (IMAGE + CONTENT PROMOTIONAL SECTION)
   Sections: Variables, Section, Container, Image, Content, Typography,
   Button, Animations, Responsive Breakpoints.
   Shares brand tokens (--font-nav, --color-accent, --color-accent-deep,
   --color-navy, --color-description, --ease-out-quart, etc.) already
   defined in navbar.css / hero.css / features.css; only section-specific
   tokens live here.
   ========================================================================== */

/* ==========================================================================
   1. VARIABLES
   ========================================================================== */
:root {
  --story-padding-desktop: 100px;
  --story-padding-tablet: 80px;
  --story-padding-mobile: 60px;

  --story-image-radius: 24px;
  --story-image-min-height: 550px;
  --story-image-height-mobile: 350px;

  --story-content-max-width: 520px;

  --story-heading-desktop: 54px;
  --story-heading-tablet: 44px;
  --story-heading-mobile: 34px;

  --story-shape-color: rgba(24, 88, 162, 0.04);
}

/* ==========================================================================
   2. SECTION
   ========================================================================== */
.brand-story {
  position: relative;
  background: #ffffff;
  padding-top: var(--story-padding-desktop);
  padding-bottom: var(--story-padding-desktop);
  overflow: hidden;
}

/* Subtle abstract background shape — brand blue at well under 5% opacity,
   purely decorative, sits behind the content column. */
.brand-story::before {
  content: "";
  position: absolute;
  top: -10%;
  right: -8%;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: var(--story-shape-color);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   3. CONTAINER
   ========================================================================== */
.brand-story-container {
  position: relative;
  z-index: 1;
}

.brand-story-row {
  align-items: stretch;
}

/* ==========================================================================
   4. IMAGE
   ========================================================================== */
.brand-story-media {
  height: 100%;
}

.brand-story-image-wrap {
  width: 100%;
  height: 100%;
  min-height: var(--story-image-min-height);
  border-radius: var(--story-image-radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(12, 44, 81, 0.16);
}

.brand-story-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.brand-story-image-wrap:hover .brand-story-image,
.brand-story-image-wrap:focus-within .brand-story-image {
  transform: scale(1.05);
}

/* ==========================================================================
   5. CONTENT
   ========================================================================== */
.brand-story-content {
  display: flex;
  align-items: center;
  height: 100%;
}

.brand-story-content-inner {
  max-width: var(--story-content-max-width);
}

/* ==========================================================================
   6. TYPOGRAPHY
   ========================================================================== */
.brand-story-subtitle {
  margin: 0 0 15px;
  font-family: var(--font-nav);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--color-accent);
}

.brand-story-heading {
  margin: 0 0 25px;
  font-family: var(--font-nav);
  font-weight: 700;
  font-size: var(--story-heading-desktop);
  line-height: 1.2;
  color: var(--color-navy);
  text-wrap: balance;
}

.brand-story-description {
  margin: 0 0 20px;
  font-family: var(--font-nav);
  font-size: 18px;
  line-height: 1.9;
  color: var(--color-description);
  text-wrap: pretty;
}

.brand-story-description:last-of-type {
  margin-bottom: 40px;
}

/* ==========================================================================
   7. BUTTON
   ========================================================================== */
.btn-story {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 58px;
  padding: 18px 38px;
  border: none;
  border-radius: 50px;
  background: var(--color-accent);
  color: #ffffff;
  font-family: var(--font-nav);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.btn-story-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.btn-story-icon svg {
  width: 16px;
  height: 16px;
}

.btn-story:hover,
.btn-story:focus-visible {
  background: var(--color-accent-deep);
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(12, 44, 81, 0.28);
}

.btn-story:focus-visible {
  outline: 2px solid var(--color-accent-deep);
  outline-offset: 3px;
}

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

@keyframes storyFadeInZoom {
  from {
    opacity: 0;
    transform: scale(1.08);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Section content is fully visible by default. brand-story.js opts each
   element into a hidden pre-animation state (.will-animate) only after
   confirming IntersectionObserver support and no reduced-motion
   preference — so a JS failure or a headless/no-scroll render never
   ships a blank section. */
.brand-story-image-wrap.will-animate {
  opacity: 0;
}

.brand-story-image-wrap.will-animate.is-visible {
  animation: storyFadeInZoom 0.8s var(--ease-out-quart) both;
}

.brand-story-subtitle.will-animate,
.brand-story-heading.will-animate,
.brand-story-description.will-animate,
.brand-story-cta.will-animate {
  opacity: 0;
  transform: translateY(30px);
}

.brand-story-subtitle.will-animate.is-visible,
.brand-story-heading.will-animate.is-visible,
.brand-story-description.will-animate.is-visible,
.brand-story-cta.will-animate.is-visible {
  animation: storyFadeUp 0.7s var(--ease-out-quart) both;
}

.brand-story-subtitle.is-visible {
  animation-delay: 0ms;
}

.brand-story-heading.is-visible {
  animation-delay: 150ms;
}

.brand-story-description:nth-of-type(1).is-visible {
  animation-delay: 300ms;
}

.brand-story-description:nth-of-type(2).is-visible,
.brand-story-description:nth-of-type(3).is-visible {
  animation-delay: 450ms;
}

.brand-story-cta.is-visible {
  animation-delay: 600ms;
}

@media (prefers-reduced-motion: reduce) {
  .brand-story-image-wrap.will-animate,
  .brand-story-image-wrap.will-animate.is-visible,
  .brand-story-subtitle.will-animate,
  .brand-story-heading.will-animate,
  .brand-story-description.will-animate,
  .brand-story-cta.will-animate,
  .brand-story-subtitle.will-animate.is-visible,
  .brand-story-heading.will-animate.is-visible,
  .brand-story-description.will-animate.is-visible,
  .brand-story-cta.will-animate.is-visible {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .brand-story-image-wrap:hover .brand-story-image,
  .brand-story-image-wrap:focus-within .brand-story-image {
    transform: none;
  }

  .btn-story:hover,
  .btn-story:focus-visible {
    transform: none;
  }
}

/* ==========================================================================
   9. RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet: 768px–991px */
@media (min-width: 768px) and (max-width: 991.98px) {
  .brand-story {
    padding-top: var(--story-padding-tablet);
    padding-bottom: var(--story-padding-tablet);
  }

  .brand-story-image-wrap {
    min-height: 420px;
  }

  .brand-story-heading {
    font-size: var(--story-heading-tablet);
  }

  .brand-story-content {
    padding-left: 1rem;
  }
}

/* Mobile: below 768px */
@media (max-width: 767.98px) {
  .brand-story {
    padding-top: var(--story-padding-mobile);
    padding-bottom: var(--story-padding-mobile);
  }

  .brand-story-row {
    text-align: center;
  }

  .brand-story-media {
    margin-bottom: 40px;
  }

  .brand-story-image-wrap {
    min-height: 0;
    height: var(--story-image-height-mobile);
  }

  .brand-story-content {
    display: block;
  }

  .brand-story-content-inner {
    max-width: 100%;
    margin: 0 auto;
  }

  .brand-story-heading {
    font-size: var(--story-heading-mobile);
  }

  .brand-story-cta {
    display: flex;
    justify-content: center;
  }
}
