/* ==========================================================
   Nuestra Historia page
   Base, navbar and footer styles come from index.css
   ========================================================== */
:root {
  --color-story-title: #0a306a;
  --color-band: #7bb0ff;
  --color-mission-bg: #c5dcff;
  --color-card-bg: #f2f2f2;
  --color-team-role: #4d4d4d;
  --color-arrow: #7bb0ff;
  --color-ring: #1e4b8f;
  --color-placeholder: #d9d9d9;
}

h1,
h2,
h3 {
  margin: 0;
}

.story-title {
  width: calc(100% - 48px);
  max-width: 1306px;
  margin: 0 auto;
  font-size: clamp(32px, 4.4445vw, 64px);
  font-weight: 600;
  line-height: normal;
  color: var(--color-story-title);
  text-align: center;
}

.story-heading {
  font-size: clamp(32px, 4.4445vw, 64px);
  font-weight: 600;
  line-height: normal;
  color: var(--color-story-title);
}

/* ==========================================================
   Intro video (group photo on phones)
   ========================================================== */
.story-video {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-white);
}

/* Same treatment as the Inicio hero: media at 59% with a 52.5% black layer */
.story-video__media {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.59;
}

.story-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000000;
  opacity: 0.525;
}

.story-video__title {
  position: absolute;
  top: 33.333%; /* 270px of the 810px hero at 1440px wide, scaling with it */
  left: 50%;
  z-index: 1;
  width: calc(100% - 48px);
  max-width: 1054px;
  translate: -50% 0;
  color: var(--color-white);
  font-size: clamp(30px, 4.4445vw, 64px);
  font-weight: 800;
  line-height: normal;
  text-align: center;
}

/* Phones: keep the headline readable over a taller photo */
@media (max-width: 760px) {
  .story-video {
    aspect-ratio: auto;
    min-height: 300px;
  }

  .story-video__title {
    top: 50%;
    translate: -50% -50%;
  }
}

/* ==========================================================
   Nacimiento de CONECTA
   ========================================================== */
.origin {
  display: flex;
  align-items: flex-start;
  max-width: 1440px;
  margin: 129px auto 0;
  padding-left: 70.5px;
}

.origin__image {
  flex: 0 1 624px;
  min-width: 0;
  height: auto;
  margin-top: 19px;
  aspect-ratio: 624 / 468;
  border-radius: 30px;
  object-fit: cover;
}

.origin__text {
  flex: 0 1 600px;
  min-width: 0;
  margin-left: 59.5px;
}

.origin__text .story-heading {
  max-width: 560px;
}

.origin__body {
  margin-top: 37px;
  font-size: 32px;
  line-height: 65px;
}

/* ==========================================================
   La experiencia que dio origen a CONECTA (blue band)
   ========================================================== */
.founder {
  position: relative;
  height: 784px;
  margin-top: 132px;
  overflow: hidden;
  background: var(--color-band);
}

.founder__text {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 87px 0 0 69px;
}

.founder__text .story-heading {
  max-width: 720px;
}

.founder__body {
  max-width: 790px;
  margin-top: 51px;
  font-size: 32px;
  line-height: 65px;
  color: var(--color-white);
}

/* Portrait sits on the right and is cut off by the band */
.founder__image {
  position: absolute;
  top: -122px;
  left: calc(50% + 44px);
  width: 786px;
  max-width: none;
  height: 979px;
  object-fit: contain;
}

/* ==========================================================
   Nuestro Recorrido (timeline)
   ========================================================== */
.journey {
  margin-top: 120px;
}

/* Trunk with a cap on top; items are placed along it with --y */
.journey__list {
  position: relative;
  max-width: 1440px;
  height: 2603px;
  margin: 25px auto 0;
  padding: 0;
  list-style: none;
  background:
    linear-gradient(#000000, #000000) 706px 0 / 35px 5px no-repeat,
    linear-gradient(#000000, #000000) 721.5px 0 / 4px calc(100% - 25px) no-repeat;
}

/* Arrowhead at the bottom of the trunk */
.journey__list::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 709px;
  border-top: 25px solid #000000;
  border-right: 14.5px solid transparent;
  border-left: 14.5px solid transparent;
}

.journey__item {
  --len: 263px;
  position: absolute;
  top: var(--y);
  left: 0;
  right: 0;
}

/* Ring on the trunk */
.journey__item::before {
  content: "";
  position: absolute;
  top: -12.5px;
  left: 711px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-primary) 0 6.5px, var(--color-white) 7px 8.5px, var(--color-ring) 9px);
}

/* Dashed branch ending in a dot */
.journey__item::after {
  content: "";
  position: absolute;
  top: -7.5px;
  width: calc(var(--len) - 5px);
  height: 15px;
  background:
    radial-gradient(circle, var(--color-primary) 7px, transparent 7.5px) var(--dot-x) center / 15px 15px no-repeat,
    repeating-linear-gradient(var(--dash-dir), var(--color-primary) 0 8px, transparent 8px 13px) var(--dash-x) center / calc(100% - 15px) 3px no-repeat;
}

.journey__item--right::after {
  --dot-x: right;
  --dash-x: left;
  --dash-dir: to right;
  left: 736px;
}

.journey__item--left::after {
  --dot-x: left;
  --dash-x: right;
  --dash-dir: to left;
  right: calc(100% - 711px);
}

.journey__label {
  position: absolute;
  top: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 506px;
  height: 66px;
  padding: 0 8px;
  background: var(--color-band);
  color: var(--color-white);
  font-size: 34px;
  font-weight: 600;
  line-height: normal;
  text-align: center;
  text-transform: uppercase;
}

.journey__text {
  position: absolute;
  top: 113px;
  width: 506px;
  font-size: 28px;
  line-height: 34px;
}

.journey__image {
  position: absolute;
  top: -12px;
  width: 506px;
  height: 285px;
  border-radius: 20px;
  object-fit: cover;
}

.journey__image--placeholder {
  border-radius: 0;
  background: var(--color-placeholder);
}

.journey__item--right .journey__label,
.journey__item--right .journey__text,
.journey__item--left .journey__image {
  left: 776px;
}

.journey__item--left .journey__label,
.journey__item--left .journey__text,
.journey__item--right .journey__image {
  left: 161.5px;
}

/* ==========================================================
   De la idea a la acción (4 steps with arrows)
   ========================================================== */
.steps {
  --circle-w: 243px;
  --circle-h: 235px;
  --arrow: 129px;
  margin-top: 179px;
}

.steps__list {
  display: flex;
  justify-content: center;
  margin: 80px 0 0;
  padding: 0 24px;
  list-style: none;
}

.steps__step {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--circle-w);
  height: var(--circle-h);
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 36px;
  font-weight: 600;
  line-height: normal;
  text-align: center;
}

.steps__step + .steps__step {
  margin-left: var(--arrow);
}

/* Light blue arrow pointing to the next step */
.steps__step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  width: var(--arrow);
  height: 24px;
  translate: 0 -50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='24' viewBox='0 0 13 24'%3E%3Cpath d='M1 1l10.5 11L1 23' fill='none' stroke='%237bb0ff' stroke-width='3'/%3E%3C/svg%3E") right 0.5px center / 13px 24px no-repeat,
    linear-gradient(var(--color-arrow), var(--color-arrow)) 1.5px center / calc(100% - 3px) 3px no-repeat;
}

/* ==========================================================
   Misión / Visión (full-width band)
   ========================================================== */
.mission {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 562px;
  margin-top: 178px;
  padding: 113px 24px 64px;
  background: var(--color-mission-bg);
}

.mission__col {
  flex: 0 1 560px;
  min-width: 0;
  text-align: center;
}

.mission__title {
  font-size: 64px;
  font-weight: 600;
  line-height: normal;
  color: var(--color-primary);
}

.mission__text {
  margin-top: 25px;
  font-size: 32px;
  line-height: 39px;
}

.mission__divider {
  flex-shrink: 0;
  width: 2px;
  height: 300px;
  margin: 18px 75.6px 0 73px;
  background: var(--color-primary);
}

/* ==========================================================
   Nuestros Valores
   ========================================================== */
.values {
  margin-top: 90px;
}

.values__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 540px));
  justify-content: center;
  gap: 100px 110px;
  width: calc(100% - 48px);
  margin: 91px auto 0;
}

.values__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 521px;
  padding: 42px 24px 24px;
  border-radius: 16px;
  background: var(--color-card-bg);
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.values__icon {
  width: 200px;
  height: 200px;
  object-fit: contain;
}

.values__name {
  margin-top: 18.5px;
  font-size: 48px;
  font-weight: 700;
  line-height: normal;
}

.values__text {
  max-width: 470px;
  margin-top: 40.5px;
  font-size: 36px;
  line-height: 44px;
}

/* ==========================================================
   El Equipo de CONECTA
   ========================================================== */
.team {
  margin-top: 127px;
}

.team__grid {
  display: grid;
  grid-template-columns: repeat(2, 283px);
  grid-template-rows: repeat(6, 421px);
  justify-content: space-between;
  width: calc(100% - 48px);
  max-width: 1002.5px;
  margin: 0 auto;
  padding: 79px 0 0;
}

.team__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: start;
  width: 283px;
  padding-top: 17px;
  text-align: center;
}

.team__photo {
  width: 233px;
  height: 233px;
  border-radius: 50%;
  object-fit: cover;
}

.team__name {
  margin-top: 17px;
  font-size: 32px;
  font-weight: 700;
  line-height: normal;
  color: var(--color-primary);
}

.team__role {
  margin-top: 7px;
  font-size: 20px;
  line-height: normal;
  color: var(--color-team-role);
}

.team__focus {
  margin-top: 13px;
  font-size: 20px;
  line-height: normal;
}

/* The design places a few blocks off-center at 1440px */
@media (min-width: 1300px) {
  .journey .story-title {
    translate: 4.5px 0;
  }

  .team__grid {
    translate: 1.25px 0;
  }

  .mission > * {
    translate: 1.3px 0;
  }
}

/* ==========================================================
   Responsive
   ========================================================== */

/* Below the design width: vertical timeline, flexible columns */
@media (max-width: 1440px) {
  .founder__image {
    left: auto;
    right: -110px;
  }
}

@media (max-width: 1300px) {
  .origin {
    gap: 40px;
    margin-top: 96px;
    padding: 0 24px;
  }

  .origin__image,
  .origin__text {
    flex: 1 1 0;
    margin-left: 0;
  }

  .origin__image {
    margin-top: 0;
  }

  .origin__body,
  .founder__body {
    font-size: 24px;
    line-height: 1.8;
  }

  .founder {
    height: auto;
    min-height: 560px;
    margin-top: 96px;
  }

  .founder__text {
    max-width: 58%;
    margin: 0;
    padding: 64px 0 64px 32px;
  }

  .founder__image {
    top: auto;
    bottom: 0;
    right: 0;
    width: 42%;
    height: auto;
    max-height: 105%;
    object-fit: contain;
    object-position: bottom right;
  }

  /* Timeline becomes a single line on the left */
  .journey {
    margin-top: 96px;
  }

  .journey__list {
    display: flex;
    flex-direction: column;
    gap: 56px;
    width: calc(100% - 48px);
    max-width: 640px;
    height: auto;
    margin-top: 40px;
    padding: 40px 0 56px 56px;
    background:
      linear-gradient(#000000, #000000) 2px 0 / 30px 5px no-repeat,
      linear-gradient(#000000, #000000) 15px 0 / 4px calc(100% - 25px) no-repeat;
  }

  .journey__list::after {
    left: 2.5px;
  }

  .journey__item {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
  }

  .journey__item::before {
    top: 20px;
    left: -52px;
  }

  .journey__item::after {
    display: none;
  }

  .journey__label,
  .journey__text,
  .journey__image {
    position: static;
    width: 100%;
  }

  .journey__label {
    height: auto;
    min-height: 66px;
    font-size: 28px;
  }

  .journey__text {
    margin-top: 16px;
    font-size: 22px;
    line-height: 1.4;
  }

  .journey__image {
    display: block;
    height: auto;
    margin-top: 20px;
    aspect-ratio: 506 / 285;
  }

  .steps {
    --circle-w: clamp(150px, 16vw, 243px);
    --circle-h: clamp(145px, 15.5vw, 235px);
    --arrow: clamp(40px, 6vw, 129px);
    margin-top: 120px;
  }

  .steps__list {
    margin-top: 64px;
  }

  .steps__step {
    font-size: clamp(22px, 2.5vw, 36px);
  }

  .mission {
    margin-top: 120px;
    padding-top: 80px;
  }

  .mission__title {
    font-size: 48px;
  }

  .mission__text {
    font-size: 24px;
    line-height: 1.4;
  }

  .mission__divider {
    margin: 18px 40px 0;
  }

  .values {
    margin-top: 96px;
  }

  .values__grid {
    gap: 40px;
    margin-top: 56px;
  }

  .values__card {
    min-height: 0;
  }

  .values__icon {
    width: 140px;
    height: 140px;
  }

  .values__name {
    font-size: 36px;
  }

  .values__text {
    margin-top: 20px;
    font-size: 24px;
    line-height: 1.4;
  }

  .team {
    margin-top: 96px;
  }

  .team__grid {
    grid-template-rows: none;
    row-gap: 48px;
    max-width: 760px;
    padding: 56px 0 80px;
  }
}

/* Tablets: Nacimiento photo on top, then heading and text */
@media (max-width: 1100px) {
  .origin {
    flex-direction: column;
    gap: 32px;
  }

  .origin__image,
  .origin__text {
    flex: none;
    width: 100%;
  }

  .origin__text .story-heading {
    max-width: none;
  }
}

/* Phones: keep two columns with smaller photos so 12 people stay compact */
@media (max-width: 700px) {
  .team__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }

  .team__card {
    width: auto;
    padding-top: 0;
  }

  .team__photo {
    width: min(150px, 100%);
    height: auto;
    aspect-ratio: 1;
  }

  .team__name {
    margin-top: 12px;
    font-size: 22px;
  }

  .team__role {
    margin-top: 4px;
    font-size: 16px;
  }
}

/* Phones: everything stacks */
@media (max-width: 760px) {
  .origin {
    flex-direction: column;
    gap: 24px;
    margin-top: 56px;
    padding: 0 16px;
  }

  .origin__image,
  .origin__text {
    flex: none;
    width: 100%;
  }

  .origin__image {
    border-radius: 20px;
  }

  .origin__body,
  .founder__body {
    margin-top: 16px;
    font-size: 19px;
    line-height: 1.7;
  }

  .founder {
    min-height: 0;
    margin-top: 64px;
  }

  .founder__text {
    max-width: none;
    padding: 48px 16px 0;
  }

  .founder__image {
    position: static;
    display: block;
    width: 70%;
    max-height: none;
    margin: 24px 0 0 auto;
  }

  .journey {
    margin-top: 72px;
  }

  .journey__list {
    width: calc(100% - 32px);
    padding-left: 48px;
  }

  .journey__item::before {
    left: -44px;
  }

  .journey__label {
    font-size: 22px;
    min-height: 54px;
  }

  .journey__text {
    font-size: 18px;
  }

  /* Steps stack vertically with downward arrows */
  .steps {
    --circle-w: 200px;
    --circle-h: 194px;
    --arrow: 64px;
    margin-top: 80px;
  }

  .steps__list {
    flex-direction: column;
    align-items: center;
    margin-top: 40px;
  }

  .steps__step {
    font-size: 30px;
  }

  .steps__step + .steps__step {
    margin-top: var(--arrow);
    margin-left: 0;
  }

  .steps__step:not(:last-child)::after {
    top: 100%;
    left: 50%;
    width: 24px;
    height: var(--arrow);
    translate: -50% 0;
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='13' viewBox='0 0 24 13'%3E%3Cpath d='M1 1l11 10.5L23 1' fill='none' stroke='%237bb0ff' stroke-width='3'/%3E%3C/svg%3E") center bottom 0.5px / 24px 13px no-repeat,
      linear-gradient(var(--color-arrow), var(--color-arrow)) center 1.5px / 3px calc(100% - 3px) no-repeat;
  }

  .mission {
    flex-direction: column;
    align-items: center;
    gap: 32px;
    min-height: 0;
    margin-top: 80px;
    padding: 56px 16px;
  }

  .mission__col {
    flex: none;
    width: 100%;
  }

  .mission__title {
    font-size: 40px;
  }

  .mission__text {
    margin-top: 12px;
    font-size: 19px;
  }

  .mission__divider {
    width: 180px;
    height: 2px;
    margin: 0;
  }

  .values {
    margin-top: 72px;
  }

  .values__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    width: calc(100% - 32px);
    margin-top: 40px;
  }

  .values__card {
    padding: 32px 16px 28px;
  }

  .values__icon {
    width: 110px;
    height: 110px;
  }

  .values__name {
    font-size: 30px;
  }

  .values__text {
    margin-top: 12px;
    font-size: 19px;
  }

  .team {
    margin-top: 72px;
  }

  .team__grid {
    row-gap: 32px;
    width: calc(100% - 32px);
    padding: 40px 0 64px;
  }
}
